diff options
author | Robert Xu <robxu9@gmail.com> | 2011-11-12 18:13:39 -0500 |
---|---|---|
committer | Robert Xu <robxu9@gmail.com> | 2011-11-12 18:13:39 -0500 |
commit | cd1f97695be1245ab19058d4fbc34e5697cc5383 (patch) | |
tree | b265d96856632dc78e566d337f7eff254b6695f7 /opensuse/core/qt3/use-xrandr-1.2.diff | |
parent | 21fcfa3348213aa87f0e3aef62ca4720c6d31cb7 (diff) | |
download | tde-packaging-cd1f97695be1245ab19058d4fbc34e5697cc5383.tar.gz tde-packaging-cd1f97695be1245ab19058d4fbc34e5697cc5383.zip |
fix up tdebase and add qt3
Diffstat (limited to 'opensuse/core/qt3/use-xrandr-1.2.diff')
-rw-r--r-- | opensuse/core/qt3/use-xrandr-1.2.diff | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/opensuse/core/qt3/use-xrandr-1.2.diff b/opensuse/core/qt3/use-xrandr-1.2.diff new file mode 100644 index 000000000..4ec4174e7 --- /dev/null +++ b/opensuse/core/qt3/use-xrandr-1.2.diff @@ -0,0 +1,106 @@ +qt-bugs@ issue : +bugs.kde.org number : +applied: no +author: Dirk Mueller <mueller@kde.org> + +support xrandr 1.2 configurations. same patch like for trunk qt-copy, +please see there for details. + + +--- src/kernel/qdesktopwidget_x11.cpp ++++ src/kernel/qdesktopwidget_x11.cpp +@@ -107,7 +107,7 @@ QDesktopWidgetPrivate::~QDesktopWidgetPr + screens[i] = 0; + } + +- delete [] screens; ++ free(screens); + } + + if ( rects ) delete [] rects; +@@ -119,30 +119,33 @@ void QDesktopWidgetPrivate::init() + // get the screen count + #ifndef QT_NO_XINERAMA + XineramaScreenInfo *xinerama_screeninfo = 0; +- int unused; ++ int unused, newScreenCount; + use_xinerama = (XineramaQueryExtension(QPaintDevice::x11AppDisplay(), + &unused, &unused) && + XineramaIsActive(QPaintDevice::x11AppDisplay())); + + if (use_xinerama) { + xinerama_screeninfo = +- XineramaQueryScreens(QPaintDevice::x11AppDisplay(), &screenCount); ++ XineramaQueryScreens(QPaintDevice::x11AppDisplay(), &newScreenCount); ++ ++ if (xinerama_screeninfo) + defaultScreen = 0; + } else + #endif // QT_NO_XINERAMA + { + defaultScreen = DefaultScreen(QPaintDevice::x11AppDisplay()); +- screenCount = ScreenCount(QPaintDevice::x11AppDisplay()); ++ newScreenCount = ScreenCount(QPaintDevice::x11AppDisplay()); ++ use_xinerama = false; + } + + delete [] rects; +- rects = new QRect[ screenCount ]; ++ rects = new QRect[ newScreenCount ]; + delete [] workareas; +- workareas = new QRect[ screenCount ]; ++ workareas = new QRect[ newScreenCount ]; + + // get the geometry of each screen +- int i, x, y, w, h; +- for ( i = 0; i < screenCount; i++ ) { ++ int i, j, x, y, w, h; ++ for ( i = 0, j = 0; i < newScreenCount; i++ ) { + + #ifndef QT_NO_XINERAMA + if (use_xinerama) { +@@ -159,11 +162,33 @@ void QDesktopWidgetPrivate::init() + h = HeightOfScreen(ScreenOfDisplay(QPaintDevice::x11AppDisplay(), i)); + } + +- rects[i].setRect(x, y, w, h); + workareas[i] = QRect(); ++ rects[j].setRect(x, y, w, h); ++ ++ // overlapping? ++ if (j > 0 && rects[j-1].intersects(rects[j])) { ++ // pick the bigger one, ignore the other ++ if ((rects[j].width()*rects[j].height()) > ++ (rects[j-1].width()*rects[j-1].height())) ++ rects[j-1] = rects[j]; ++ } ++ else ++ j++; + } + ++ if (screens) { ++ // leaks QWidget* pointers on purpose, can't delete them as pointer escapes ++ screens = (QWidget**) realloc(screens, j * sizeof(QWidget*)); ++ if (j > screenCount) ++ memset(&screens[screenCount], 0, (j-screenCount) * sizeof(QWidget*)); ++ } ++ ++ screenCount = j; ++ + #ifndef QT_NO_XINERAMA ++ if (use_xinerama && screenCount == 1) ++ use_xinerama = false; ++ + if (xinerama_screeninfo) + XFree(xinerama_screeninfo); + #endif // QT_NO_XINERAMA +@@ -216,8 +241,7 @@ QWidget *QDesktopWidget::screen( int scr + screen = d->defaultScreen; + + if ( ! d->screens ) { +- d->screens = new QWidget*[ d->screenCount ]; +- memset( d->screens, 0, d->screenCount * sizeof( QWidget * ) ); ++ d->screens = (QWidget**) calloc( d->screenCount, sizeof(QWidget*)); + d->screens[ d->defaultScreen ] = this; + } + |