diff -Nru qt4-x11-4.8.0/debian/changelog qt4-x11-4.8.0/debian/changelog --- qt4-x11-4.8.0/debian/changelog 2012-02-21 09:26:31.000000000 +0000 +++ qt4-x11-4.8.0/debian/changelog 2012-02-22 10:41:19.000000000 +0000 @@ -1,3 +1,11 @@ +qt4-x11 (4:4.8.0-1ubuntu7) precise; urgency=low + + * Update kubuntu_29_window_shaping_fix.diff + with improved patch now upstream + http://qt.gitorious.org/qt/qt/commit/29ec5ba68a14b8c75876ce129dd7b3204f8ba503/diffs + + -- Jonathan Riddell Wed, 22 Feb 2012 10:39:17 +0000 + qt4-x11 (4:4.8.0-1ubuntu6) precise; urgency=low * Add kubuntu_30_translucent_drag_pixmap.diff diff -Nru qt4-x11-4.8.0/debian/patches/kubuntu_29_window_shaping_fix.diff qt4-x11-4.8.0/debian/patches/kubuntu_29_window_shaping_fix.diff --- qt4-x11-4.8.0/debian/patches/kubuntu_29_window_shaping_fix.diff 2012-02-06 19:41:55.000000000 +0000 +++ qt4-x11-4.8.0/debian/patches/kubuntu_29_window_shaping_fix.diff 2012-02-22 10:33:59.000000000 +0000 @@ -15,34 +15,49 @@ Index: qt4-x11-4.8.0/src/gui/kernel/qapplication_x11.cpp =================================================================== ---- qt4-x11-4.8.0.orig/src/gui/kernel/qapplication_x11.cpp 2012-02-06 19:41:49.638872063 +0000 -+++ qt4-x11-4.8.0/src/gui/kernel/qapplication_x11.cpp 2012-02-06 19:41:50.518872089 +0000 -@@ -2097,6 +2097,9 @@ - X11->ptrXFixesQueryVersion = XFIXES_LOAD_V1(XFixesQueryVersion); - X11->ptrXFixesSetCursorName = XFIXES_LOAD_V2(XFixesSetCursorName); - X11->ptrXFixesSelectSelectionInput = XFIXES_LOAD_V2(XFixesSelectSelectionInput); -+ X11->ptrXFixesCreateRegionFromWindow = XFIXES_LOAD_V2(XFixesCreateRegionFromWindow); -+ X11->ptrXFixesFetchRegion = XFIXES_LOAD_V2(XFixesFetchRegion); -+ X11->ptrXFixesDestroyRegion = XFIXES_LOAD_V2(XFixesDestroyRegion); +--- qt4-x11-4.8.0.orig/src/gui/kernel/qapplication_x11.cpp 2012-02-22 10:08:35.000000000 +0000 ++++ qt4-x11-4.8.0/src/gui/kernel/qapplication_x11.cpp 2012-02-22 10:26:40.145966632 +0000 +@@ -2114,7 +2114,12 @@ + X11->use_xfixes = (major >= 1); + X11->xfixes_major = major; + } +- } ++ } else { ++ X11->ptrXFixesQueryExtension = 0; ++ X11->ptrXFixesQueryVersion = 0; ++ X11->ptrXFixesSetCursorName = 0; ++ X11->ptrXFixesSelectSelectionInput = 0; ++ } + #endif // QT_NO_XFIXES - if(X11->ptrXFixesQueryExtension && X11->ptrXFixesQueryVersion - && X11->ptrXFixesQueryExtension(X11->display, &X11->xfixes_eventbase, + #ifndef QT_NO_XCURSOR Index: qt4-x11-4.8.0/src/gui/kernel/qdnd_x11.cpp =================================================================== ---- qt4-x11-4.8.0.orig/src/gui/kernel/qdnd_x11.cpp 2011-12-08 05:06:02.000000000 +0000 -+++ qt4-x11-4.8.0/src/gui/kernel/qdnd_x11.cpp 2012-02-06 19:41:50.522872089 +0000 -@@ -71,6 +71,10 @@ - #include "qwidget_p.h" - #include "qcursor_p.h" - -+#ifndef QT_NO_XFIXES -+#include -+#endif +--- qt4-x11-4.8.0.orig/src/gui/kernel/qdnd_x11.cpp 2012-02-22 10:08:35.000000000 +0000 ++++ qt4-x11-4.8.0/src/gui/kernel/qdnd_x11.cpp 2012-02-22 10:33:24.745976992 +0000 +@@ -1422,6 +1422,21 @@ + } + + static ++bool windowInteractsWithPosition(const QPoint & pos, Window w, int shapeType) ++{ ++ int nrectanglesRet, dummyOrdering; ++ XRectangle *rectangles = XShapeGetRectangles(QX11Info::display(), w, shapeType, &nrectanglesRet, &dummyOrdering); ++ bool interacts = true; ++ if (rectangles) { ++ interacts = false; ++ for (int i = 0; !interacts && i < nrectanglesRet; ++i) ++ interacts = QRect(rectangles[i].x, rectangles[i].y, rectangles[i].width, rectangles[i].height).contains(pos); ++ XFree(rectangles); ++ } ++ return interacts; ++} + - QT_BEGIN_NAMESPACE - - // #define DND_DEBUG -@@ -1432,6 +1436,7 @@ ++static + Window findRealWindow(const QPoint & pos, Window w, int md) + { + if (xdnd_data.deco && w == xdnd_data.deco->effectiveWinId()) +@@ -1436,6 +1451,7 @@ if (attr.map_state == IsViewable && QRect(attr.x,attr.y,attr.width,attr.height).contains(pos)) { @@ -50,36 +65,23 @@ { Atom type = XNone; int f; -@@ -1441,8 +1446,26 @@ +@@ -1445,8 +1461,13 @@ XGetWindowProperty(X11->display, w, ATOM(XdndAware), 0, 0, False, AnyPropertyType, &type, &f,&n,&a,&data); if (data) XFree(data); - if (type) - return w; + if (type) { -+#ifndef QT_NO_XFIXES -+ if (X11->use_xfixes && X11->ptrXFixesCreateRegionFromWindow && X11->ptrXFixesFetchRegion && X11->ptrXFixesDestroyRegion) { -+ XserverRegion region = X11->ptrXFixesCreateRegionFromWindow(X11->display, w, WindowRegionBounding); -+ int nrectanglesRet; -+ XRectangle *rectangles = X11->ptrXFixesFetchRegion(X11->display, region, &nrectanglesRet); -+ if (rectangles) { -+ windowContainsMouse = false; -+ for (int i = 0; !windowContainsMouse && i < nrectanglesRet; ++i) -+ windowContainsMouse = QRect(rectangles[i].x, rectangles[i].y, rectangles[i].width, rectangles[i].height).contains(pos); -+ XFree(rectangles); -+ } -+ X11->ptrXFixesDestroyRegion(X11->display, region); -+ -+ if (windowContainsMouse) -+ return w; -+ } else -+#endif ++ // When ShapeInput and ShapeBounding are not set they return a single rectangle with the geometry of the window, this is why we ++ // need an && here so that in the case one is set and the other is not we still get the correct result. ++ windowContainsMouse = windowInteractsWithPosition(pos, w, ShapeInput) && windowInteractsWithPosition(pos, w, ShapeBounding); ++ if (windowContainsMouse) + return w; + } } Window r, p; -@@ -1463,7 +1486,10 @@ +@@ -1467,7 +1488,10 @@ } // No children! @@ -91,27 +93,3 @@ } } return 0; -Index: qt4-x11-4.8.0/src/gui/kernel/qt_x11_p.h -=================================================================== ---- qt4-x11-4.8.0.orig/src/gui/kernel/qt_x11_p.h 2012-02-06 19:41:49.642872065 +0000 -+++ qt4-x11-4.8.0/src/gui/kernel/qt_x11_p.h 2012-02-06 19:41:50.918872098 +0000 -@@ -211,6 +211,9 @@ - typedef Status (*PtrXFixesQueryVersion)(Display *, int *, int *); - typedef void (*PtrXFixesSetCursorName)(Display *dpy, Cursor cursor, const char *name); - typedef void (*PtrXFixesSelectSelectionInput)(Display *dpy, Window win, Atom selection, unsigned long eventMask); -+typedef void (*PtrXFixesDestroyRegion)(Display *dpy, /*XserverRegion*/ XID region); -+typedef /*XserverRegion*/ XID (*PtrXFixesCreateRegionFromWindow)(Display *dpy, Window window, int kind); -+typedef XRectangle *(*PtrXFixesFetchRegion)(Display *dpy, /*XserverRegion*/ XID region, int *nrectanglesRet); - #endif // QT_NO_XFIXES - - #ifndef QT_NO_XCURSOR -@@ -421,6 +424,9 @@ - PtrXFixesQueryVersion ptrXFixesQueryVersion; - PtrXFixesSetCursorName ptrXFixesSetCursorName; - PtrXFixesSelectSelectionInput ptrXFixesSelectSelectionInput; -+ PtrXFixesDestroyRegion ptrXFixesDestroyRegion; -+ PtrXFixesCreateRegionFromWindow ptrXFixesCreateRegionFromWindow; -+ PtrXFixesFetchRegion ptrXFixesFetchRegion; - #endif - - #ifndef QT_NO_XINPUT