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-22 10:41:19.000000000 +0000 +++ qt4-x11-4.8.0/debian/changelog 2012-02-23 16:24:25.000000000 +0000 @@ -1,3 +1,10 @@ +qt4-x11 (4:4.8.0-1ubuntu8) precise; urgency=low + + * Add kubuntu_31_unity_workarea_atom.diff from Unity team + LP: #939629 + + -- Jonathan Riddell Thu, 23 Feb 2012 16:23:22 +0000 + qt4-x11 (4:4.8.0-1ubuntu7) precise; urgency=low * Update kubuntu_29_window_shaping_fix.diff diff -Nru qt4-x11-4.8.0/debian/patches/kubuntu_31_unity_workarea_atom.diff qt4-x11-4.8.0/debian/patches/kubuntu_31_unity_workarea_atom.diff --- qt4-x11-4.8.0/debian/patches/kubuntu_31_unity_workarea_atom.diff 1970-01-01 00:00:00.000000000 +0000 +++ qt4-x11-4.8.0/debian/patches/kubuntu_31_unity_workarea_atom.diff 2012-02-23 16:26:20.000000000 +0000 @@ -0,0 +1,101 @@ +Patch from Unity team, non standard so can not go upstream. + +Author Albert Astals Cid albert.astals@ canonical.com + +In Unity-2d in MultiMonitor we need to set Struts (for the left panel) in the middle of the working area. This means that the specced _NET_WORKAREA is not enough since it can only report one rectangle and we end up with two disconnected working areas once we add a vertical strut in the left of the secondary monitor. For that we have the propietary _UNITY_NET_WORKAREA_REGION atom that returns multiple rectangle. + +This patch adds support for this atom to QDesktopWidget::availableGeometry so the correct geometry is reported when using Unity-2d + + +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-23 16:19:00.000000000 +0000 ++++ qt4-x11-4.8.0/src/gui/kernel/qapplication_x11.cpp 2012-02-23 16:20:01.519131386 +0000 +@@ -218,6 +218,7 @@ + "_NET_SUPPORTED\0" + "_NET_VIRTUAL_ROOTS\0" + "_NET_WORKAREA\0" ++ "_UNITY_NET_WORKAREA_REGION\0" + + "_NET_MOVERESIZE_WINDOW\0" + "_NET_WM_MOVERESIZE\0" +Index: qt4-x11-4.8.0/src/gui/kernel/qdesktopwidget_x11.cpp +=================================================================== +--- qt4-x11-4.8.0.orig/src/gui/kernel/qdesktopwidget_x11.cpp 2011-12-08 05:06:02.000000000 +0000 ++++ qt4-x11-4.8.0/src/gui/kernel/qdesktopwidget_x11.cpp 2012-02-23 16:20:01.523131386 +0000 +@@ -269,6 +269,11 @@ + return d->screens[screen]; + } + ++bool sortRectanglesByAreaLessThan(const QRect &r1, const QRect &r2) ++{ ++ return r1.width() * r1.height() < r2.width() * r2.height() ; ++} ++ + const QRect QDesktopWidget::availableGeometry(int screen) const + { + Q_D(const QDesktopWidget); +@@ -285,7 +290,50 @@ + if (d->workareas[screen].isValid()) + return d->workareas[screen]; + +- if (X11->isSupportedByWM(ATOM(_NET_WORKAREA))) { ++ if (X11->isSupportedByWM(ATOM(_UNITY_NET_WORKAREA_REGION))) { ++ int x11Screen = isVirtualDesktop() ? DefaultScreen(X11->display) : screen; ++ ++ Atom ret; ++ int format, e; ++ unsigned char *data = 0; ++ unsigned long nitems, after; ++ ++ e = XGetWindowProperty(X11->display, ++ QX11Info::appRootWindow(x11Screen), ++ ATOM(_UNITY_NET_WORKAREA_REGION), 0, 1024, False, XA_CARDINAL, ++ &ret, &format, &nitems, &after, &data); ++ ++ QRegion workArea; ++ if (e == Success && ret == XA_CARDINAL && ++ format == 32 && ((nitems % 4) == 0)) { ++ long *regionsRectangles = (long *) data; ++ for (unsigned long i = 0; i < nitems / 4; ++i) { ++ workArea += QRect(regionsRectangles[i * 4 + 0], regionsRectangles[i * 4 + 1], regionsRectangles[i * 4 + 2], regionsRectangles[i * 4 + 3]); ++ } ++ } else { ++ workArea = screenGeometry(screen); ++ } ++ ++ if (isVirtualDesktop()) { ++ // intersect the workarea (which spawns all Xinerama screens) with the rect for the ++ // requested screen ++ workArea &= screenGeometry(screen); ++ } ++ ++ QVector rectangles = workArea.rects(); ++ if (rectangles.isEmpty()) { ++ d->workareas[screen] = QRect(); ++ } else { ++ // Since we can only return one rectangle, return the biggest ++ // Ideally there's only one rectangle anyway since people don't put struts in the middle of the screen ++ qSort(rectangles.begin(), rectangles.end(), sortRectanglesByAreaLessThan); ++ ++ d->workareas[screen] = rectangles.last(); ++ } ++ ++ if (data) ++ XFree(data); ++ } else if (X11->isSupportedByWM(ATOM(_NET_WORKAREA))) { + int x11Screen = isVirtualDesktop() ? DefaultScreen(X11->display) : screen; + + Atom ret; +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-23 16:19:00.000000000 +0000 ++++ qt4-x11-4.8.0/src/gui/kernel/qt_x11_p.h 2012-02-23 16:20:01.591131388 +0000 +@@ -588,6 +588,7 @@ + _NET_SUPPORTED, + _NET_VIRTUAL_ROOTS, + _NET_WORKAREA, ++ _UNITY_NET_WORKAREA_REGION, + + _NET_MOVERESIZE_WINDOW, + _NET_WM_MOVERESIZE, diff -Nru qt4-x11-4.8.0/debian/patches/series qt4-x11-4.8.0/debian/patches/series --- qt4-x11-4.8.0/debian/patches/series 2012-02-21 09:23:50.000000000 +0000 +++ qt4-x11-4.8.0/debian/patches/series 2012-02-23 16:19:37.000000000 +0000 @@ -55,3 +55,4 @@ kubuntu_94_xinput_valuators_fix.diff kubuntu_95_qt_disable_bounce.diff kubuntu_97_a11y_qt_and_qml_backport.diff +kubuntu_31_unity_workarea_atom.diff