summaryrefslogtreecommitdiff
path: root/debian/patches/00_0182-argb-visuals-default.dpatch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/00_0182-argb-visuals-default.dpatch')
-rw-r--r--debian/patches/00_0182-argb-visuals-default.dpatch135
1 files changed, 135 insertions, 0 deletions
diff --git a/debian/patches/00_0182-argb-visuals-default.dpatch b/debian/patches/00_0182-argb-visuals-default.dpatch
new file mode 100644
index 0000000..22cb0bf
--- /dev/null
+++ b/debian/patches/00_0182-argb-visuals-default.dpatch
@@ -0,0 +1,135 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 00_0182-argb-visuals-default.diff.dpatch by Zack Rusin <zrusin@trolltech.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Trolltech task ID : 120338
+## DP: Qt handling argb visuals on X11. in Qt 4.4 already.
+
+@DPATCH@
+diff -urNad qt4-x11-4.3.0~/src/gui/kernel/qapplication_x11.cpp qt4-x11-4.3.0/src/gui/kernel/qapplication_x11.cpp
+--- qt4-x11-4.3.0~/src/gui/kernel/qapplication_x11.cpp 2007-05-25 15:24:19.000000000 +0200
++++ qt4-x11-4.3.0/src/gui/kernel/qapplication_x11.cpp 2007-06-26 20:05:47.000000000 +0200
+@@ -1547,6 +1547,30 @@
+ / (DisplayHeightMM(X11->display, s)*10);
+ }
+
++
++#ifndef QT_NO_XRENDER
++ int xrender_eventbase, xrender_errorbase;
++ // See if XRender is supported on the connected display
++ if (XQueryExtension(X11->display, "RENDER", &X11->xrender_major,
++ &xrender_eventbase, &xrender_errorbase)
++ && XRenderQueryExtension(X11->display, &xrender_eventbase,
++ &xrender_errorbase)) {
++ // Check the version as well - we need v0.4 or higher
++ int major = 0;
++ int minor = 0;
++ XRenderQueryVersion(X11->display, &major, &minor);
++ if (qgetenv("QT_X11_NO_XRENDER").isNull()) {
++ X11->use_xrender = (major >= 0 && minor >= 5);
++ X11->xrender_version = major*100+minor;
++ // workaround for broken XServer on Ubuntu Breezy (6.8 compiled with 7.0
++ // protocol headers)
++ if (X11->xrender_version == 10
++ && VendorRelease(X11->display) < 60900000
++ && QByteArray(ServerVendor(X11->display)).contains("X.Org"))
++ X11->xrender_version = 9;
++ }
++ }
++#endif // QT_NO_XRENDER
+ QColormap::initialize();
+
+ // Support protocols
+@@ -1570,30 +1594,15 @@
+ #endif // QT_NO_XRANDR
+
+ #ifndef QT_NO_XRENDER
+- int xrender_eventbase, xrender_errorbase;
+- // See if XRender is supported on the connected display
+- if (XQueryExtension(X11->display, "RENDER", &X11->xrender_major,
+- &xrender_eventbase, &xrender_errorbase)
+- && XRenderQueryExtension(X11->display, &xrender_eventbase,
+- &xrender_errorbase)) {
++ if (X11->use_xrender) {
+ // XRender is supported, let's see if we have a PictFormat for the
+ // default visual
+ XRenderPictFormat *format =
+ XRenderFindVisualFormat(X11->display,
+ (Visual *) QX11Info::appVisual(X11->defaultScreen));
+- // Check the version as well - we need v0.4 or higher
+- int major = 0;
+- int minor = 0;
+- XRenderQueryVersion(X11->display, &major, &minor);
+- if (qgetenv("QT_X11_NO_XRENDER").isNull() && format != 0) {
+- X11->use_xrender = (major >= 0 && minor >= 5);
+- X11->xrender_version = major*100+minor;
+- // workaround for broken XServer on Ubuntu Breezy (6.8 compiled with 7.0
+- // protocol headers)
+- if (X11->xrender_version == 10
+- && VendorRelease(X11->display) < 60900000
+- && QByteArray(ServerVendor(X11->display)).contains("X.Org"))
+- X11->xrender_version = 9;
++
++ if (!format) {
++ X11->use_xrender = false;
+ }
+ }
+ #endif // QT_NO_XRENDER
+diff -urNad qt4-x11-4.3.0~/src/gui/kernel/qwidget_x11.cpp qt4-x11-4.3.0/src/gui/kernel/qwidget_x11.cpp
+--- qt4-x11-4.3.0~/src/gui/kernel/qwidget_x11.cpp 2007-05-25 15:24:19.000000000 +0200
++++ qt4-x11-4.3.0/src/gui/kernel/qwidget_x11.cpp 2007-06-26 20:05:47.000000000 +0200
+@@ -503,7 +503,7 @@
+ picture = 0;
+ }
+
+- if (X11->use_xrender) {
++ if (X11->use_xrender && !desktop) {
+ XRenderPictFormat *format = XRenderFindVisualFormat(dpy, (Visual *) xinfo.visual());
+ if (format)
+ picture = XRenderCreatePicture(dpy, id, format, 0, 0);
+diff -urNad qt4-x11-4.3.0~/src/gui/painting/qcolormap_x11.cpp qt4-x11-4.3.0/src/gui/painting/qcolormap_x11.cpp
+--- qt4-x11-4.3.0~/src/gui/painting/qcolormap_x11.cpp 2007-05-25 15:24:12.000000000 +0200
++++ qt4-x11-4.3.0/src/gui/painting/qcolormap_x11.cpp 2007-06-26 20:05:47.000000000 +0200
+@@ -386,7 +386,33 @@
+ } else if (!X11->custom_cmap) {
+ XStandardColormap *stdcmap = 0;
+ int ncmaps = 0;
+- if (XGetRGBColormaps(display, RootWindow(display, i),
++
++ bool foundArgbVisual = false;
++#ifndef QT_NO_XRENDER
++ if (X11->use_xrender) {
++ int nvi;
++ XVisualInfo templ;
++ templ.screen = i;
++ templ.depth = 32;
++ templ.c_class = TrueColor;
++ XVisualInfo *xvi = XGetVisualInfo(X11->display, VisualScreenMask |
++ VisualDepthMask |
++ VisualClassMask, &templ, &nvi);
++ for (int idx = 0; idx < nvi; ++idx) {
++ XRenderPictFormat *format = XRenderFindVisualFormat(X11->display,
++ xvi[idx].visual);
++ if (format->type == PictTypeDirect && format->direct.alphaMask) {
++ d->visual = xvi[idx].visual;
++ d->depth = 32;
++ d->defaultVisual = false;
++ foundArgbVisual = true;
++ break;
++ }
++ }
++ }
++#endif
++ if (!foundArgbVisual &&
++ XGetRGBColormaps(display, RootWindow(display, i),
+ &stdcmap, &ncmaps, XA_RGB_DEFAULT_MAP)) {
+ if (stdcmap) {
+ for (int c = 0; c < ncmaps; ++c) {
+@@ -444,7 +470,6 @@
+ }
+ }
+ }
+-
+ if (!use_stdcmap) {
+ switch (d->visual->c_class) {
+ case StaticGray: