summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrjb330 <[email protected]>2024-10-28 13:49:16 -0700
committerMichele Calgaro <[email protected]>2024-10-31 12:48:04 +0900
commite632e7f23e91810ae096fcd623f4c5f437875e01 (patch)
tree2920d9cd7a61f2513e822570aecd2d5ea60b6d07
parent1030a83acc023601e2f38a273170e55f641dc9eb (diff)
downloadgtk-qt-engine-e632e7f23e91810ae096fcd623f4c5f437875e01.tar.gz
gtk-qt-engine-e632e7f23e91810ae096fcd623f4c5f437875e01.zip
Add some comments in drawTQPixmapToWindow()
Signed-off-by: rjb330 <[email protected]> (cherry picked from commit d055f3b3ad49e11f2b2666623de1f7a13e05f122)
-rw-r--r--src/qt_qt_wrapper.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qt_qt_wrapper.cpp b/src/qt_qt_wrapper.cpp
index a909463..618e6f5 100644
--- a/src/qt_qt_wrapper.cpp
+++ b/src/qt_qt_wrapper.cpp
@@ -655,10 +655,13 @@ TQColor gdkColorToTQColor(GdkColor* c)
return TQColor(c->red / 256, c->green / 256, c->blue / 256);
}
-void drawTQPixmapToWindow(GdkWindow* window, GdkGC* gc, TQPixmap* pixmap, int x, int y, int w, int h) {
- static GdkGC* igc = gdk_gc_new(window);
+void drawTQPixmapToWindow(GdkWindow* window, GdkGC* gc, TQPixmap* pixmap, int x, int y, int w, int h)
+{
+ static GdkGC* imggc = gdk_gc_new(window);
GdkPixmap* pix;
+ // gdk_drawable_get_image crashes if requested region is outside of the window.
+ // Bitmap masks cause artifacts with Domino and Baghira.
int width, height;
gdk_drawable_get_size(window, &width, &height);
if (!pixmap->hasAlpha() || isDomino || isBaghira ||
@@ -669,10 +672,12 @@ void drawTQPixmapToWindow(GdkWindow* window, GdkGC* gc, TQPixmap* pixmap, int x,
return;
}
+ // Gdk isn't aware of the TQPixmap mask,
+ // so instead we create a new pixmap from the window region and bitBlt over it.
TQPixmap gpixmap(w, h);
pix = gdk_pixmap_foreign_new(gpixmap.handle());
GdkImage* img = gdk_drawable_get_image(window, x, y, w, h);
- gdk_draw_image(pix, igc, img, 0, 0, 0, 0, w, h);
+ gdk_draw_image(pix, imggc, img, 0, 0, 0, 0, w, h);
bitBlt(&gpixmap, 0, 0, pixmap, 0, 0, w, h, TQt::CopyROP);
gdk_draw_drawable(window, gc, pix, 0, 0, x, y, w, h);