From 9fd1486736cc9d98b61212580806d84b092208ba Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Tue, 21 Apr 2026 17:10:23 +0200 Subject: [PATCH 1/3] [tpad] Fix - paint highlight border if color positive Prevent border painting when highlight specially deactivated --- graf2d/gpad/src/TPad.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graf2d/gpad/src/TPad.cxx b/graf2d/gpad/src/TPad.cxx index 3a0ff72783443..66cb2d9370da6 100644 --- a/graf2d/gpad/src/TPad.cxx +++ b/graf2d/gpad/src/TPad.cxx @@ -3626,8 +3626,10 @@ void TPad::Paint(Option_t * /*option*/) lnk = lnk->Next(); } - if (fCanvas && (fCanvas->fHilightPadBorder == this)) - PaintBorder(-GetHighLightColor(), kTRUE); + if (fCanvas && (fCanvas->fHilightPadBorder == this)) { + auto col = GetHighLightColor(); + if (col > 0) PaintBorder(-col, kTRUE); + } } fPadPaint = 0; From 49ab76e2d2ad1049f8766bd6a6a349da5bead052 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Tue, 21 Apr 2026 17:19:42 +0200 Subject: [PATCH 2/3] [tasimage] fix - create two ASVisual objects Prevent situation when ASVisual recreated many times without real need --- graf2d/asimage/src/TASImage.cxx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/graf2d/asimage/src/TASImage.cxx b/graf2d/asimage/src/TASImage.cxx index dedeff20eb1f7..01a937db61104 100644 --- a/graf2d/asimage/src/TASImage.cxx +++ b/graf2d/asimage/src/TASImage.cxx @@ -2231,8 +2231,6 @@ Bool_t TASImage::InitVisual() if (fgVisual && (noX == fgBatch)) return kTRUE; - if (fgVisual) - destroy_asvisual(fgVisual, kFALSE); fgVisual = nullptr; fgBatch = false; @@ -2244,16 +2242,27 @@ Bool_t TASImage::InitVisual() Visual *vis = (Visual*) gVirtualX->GetVisual(); Colormap cmap = (Colormap) gVirtualX->GetColormap(); - if (vis && cmap) - fgVisual = create_asvisual_for_id(disp, screen, depth, + static ASVisual *vis_x = nullptr; + + if (vis && cmap && !noX) { + if (!vis_x) + vis_x = create_asvisual_for_id(disp, screen, depth, XVisualIDFromVisual(vis), cmap, nullptr); + fgVisual = vis_x; + } #endif #endif + static ASVisual *vis_batch = nullptr; + if (!fgVisual) { - // create dummy fgVisual for batch mode - fgVisual = create_asvisual(nullptr, 0, 0, nullptr); - fgVisual->dpy = nullptr; // fake (not used) + if (!vis_batch) { + // create dummy visual for batch mode + vis_batch = create_asvisual(nullptr, 0, 0, nullptr); + vis_batch->dpy = nullptr; // fake (not used) + } + + fgVisual = vis_batch; fgBatch = true; } From 683aae454e1892d083e993b8bb58b0e2d4f05aa4 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Wed, 22 Apr 2026 15:37:41 +0200 Subject: [PATCH 3/3] [asimage] fix seg fault when negative coordinate specified Index was checked on max value, but not on negative value --- graf2d/asimage/src/TASImage.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graf2d/asimage/src/TASImage.cxx b/graf2d/asimage/src/TASImage.cxx index 01a937db61104..3784e05a23554 100644 --- a/graf2d/asimage/src/TASImage.cxx +++ b/graf2d/asimage/src/TASImage.cxx @@ -6749,5 +6749,5 @@ Bool_t TASImage::SetJpegDpi(const char *name, UInt_t set) Int_t TASImage::Idx(Int_t idx) { // The size of arrays like fImage->alt.argb32 is fImage->width*fImage->height - return TMath::Min(idx,(Int_t)(fImage->width*fImage->height)); + return TMath::Max(0, TMath::Min(idx,(Int_t)(fImage->width*fImage->height))); }