diff options
author | rjb330 <[email protected]> | 2024-10-30 19:56:55 -0700 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2024-10-31 12:48:04 +0900 |
commit | 8e7c77521c335af0a878853eef0b0ecf52ca2da4 (patch) | |
tree | f6e35fe00c3c2bdd9803d59e2ea401decbd64081 | |
parent | e632e7f23e91810ae096fcd623f4c5f437875e01 (diff) | |
download | gtk-qt-engine-8e7c77521c335af0a878853eef0b0ecf52ca2da4.tar.gz gtk-qt-engine-8e7c77521c335af0a878853eef0b0ecf52ca2da4.zip |
Unref imggc and add separate CDE checks
Signed-off-by: rjb330 <[email protected]>
(cherry picked from commit ff0467588335c91ec6c2dac3b417c9b1665d6c22)
-rw-r--r-- | src/qt_qt_wrapper.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/qt_qt_wrapper.cpp b/src/qt_qt_wrapper.cpp index 618e6f5..26ec275 100644 --- a/src/qt_qt_wrapper.cpp +++ b/src/qt_qt_wrapper.cpp @@ -70,6 +70,7 @@ TQWidget* meepWidget = 0; TQWidget* meepWidgetP = 0; TQSlider* meepSlider = 0; TQTabBar* meepTabBar = 0; +GdkGC* windowGC = 0; GdkGC* altBackGC = 0; TQWidget* smw = 0; @@ -98,6 +99,7 @@ int isAlloy; int isDomino; int isPolyester; int isMotif; +int isCDE; int eclipseFix; int openOfficeFix; int mozillaFix; @@ -445,8 +447,8 @@ void createTQApp() isAlloy = (TQString(tqApp->style().name()).lower() == "alloy"); isDomino = (TQString(tqApp->style().name()).lower() == "domino"); isPolyester = (TQString(tqApp->style().name()).lower() == "polyester"); - isMotif = (TQString(tqApp->style().name()).lower() == "motif" || - TQString(tqApp->style().name()).lower() == "cde"); + isMotif = (TQString(tqApp->style().name()).lower() == "motif"); + isCDE = (TQString(tqApp->style().name()).lower() == "cde"); if (isDomino) { @@ -508,6 +510,8 @@ void destroyTQApp() delete tqApp; tqApp = 0; } + if (windowGC != 0) + gtk_gc_release(windowGC); if (altBackGC != 0) gtk_gc_release(altBackGC); @@ -657,7 +661,6 @@ TQColor gdkColorToTQColor(GdkColor* c) 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. @@ -665,7 +668,7 @@ void drawTQPixmapToWindow(GdkWindow* window, GdkGC* gc, TQPixmap* pixmap, int x, int width, height; gdk_drawable_get_size(window, &width, &height); if (!pixmap->hasAlpha() || isDomino || isBaghira || - (width < x + w) || (height < y + h)) { + (width < x + w) || (height < y + h) || (0 > x) || (0 > y)) { pix = gdk_pixmap_foreign_new(pixmap->handle()); gdk_draw_drawable(window, gc, pix, 0, 0, x, y, w, h); g_object_unref(pix); @@ -674,10 +677,12 @@ void drawTQPixmapToWindow(GdkWindow* window, GdkGC* gc, TQPixmap* pixmap, int x, // Gdk isn't aware of the TQPixmap mask, // so instead we create a new pixmap from the window region and bitBlt over it. + if (windowGC == 0) + windowGC = gdk_gc_new(window); 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, imggc, img, 0, 0, 0, 0, w, h); + gdk_draw_image(pix, windowGC, 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); @@ -794,7 +799,7 @@ void drawButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int defa tqApp->style().subRect(TQStyle::SR_PushButtonContents, &button), button.colorGroup(), sflags); - if (!isBaghira && !isMotif) { + if (!isBaghira && !isMotif && !isCDE) { TQBitmap bitmap(w, h, TRUE); TQPainter bpainter(&bitmap); bpainter.setBrush(TQt::color1); @@ -824,7 +829,7 @@ void drawButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int defa tqApp->style().drawControl(TQStyle::CE_PushButton, &painter, &button, TQRect(0,0,w,h), button.palette().active(), sflags); - if (!isBaghira && !isMotif) { + if (!isBaghira && !isMotif && !isCDE) { TQBitmap bitmap(w, h, TRUE); TQPainter bpainter(&bitmap); bpainter.setBrush(TQt::color1); |