Changeset 561 for trunk/src/gui/kernel/qdesktopwidget_x11.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/kernel/qdesktopwidget_x11.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 198 198 if (screens) { 199 199 // leaks QWidget* pointers on purpose, can't delete them as pointer escapes 200 screens = (QWidget**) realloc(screens, j * sizeof(QWidget*));200 screens = q_check_ptr((QWidget**) realloc(screens, j * sizeof(QWidget*))); 201 201 if (j > screenCount) 202 202 memset(&screens[screenCount], 0, (j-screenCount) * sizeof(QWidget*)); … … 286 286 return d->workareas[screen]; 287 287 288 if ((d->screenCount == 1 || !isVirtualDesktop()) 289 && X11->isSupportedByWM(ATOM(_NET_WORKAREA))) { 288 if (X11->isSupportedByWM(ATOM(_NET_WORKAREA))) { 289 int x11Screen = isVirtualDesktop() ? DefaultScreen(X11->display) : screen; 290 290 291 Atom ret; 291 292 int format, e; … … 294 295 295 296 e = XGetWindowProperty(X11->display, 296 QX11Info::appRootWindow(screen), 297 ATOM(_NET_WORKAREA), 0, 4, False, XA_CARDINAL, 298 &ret, &format, &nitems, &after, &data); 299 297 QX11Info::appRootWindow(x11Screen), 298 ATOM(_NET_WORKAREA), 0, 4, False, XA_CARDINAL, 299 &ret, &format, &nitems, &after, &data); 300 301 QRect workArea; 300 302 if (e == Success && ret == XA_CARDINAL && 301 303 format == 32 && nitems == 4) { 302 304 long *workarea = (long *) data; 303 d->workareas[screen].setRect(workarea[0], workarea[1], 304 workarea[2], workarea[3]); 305 workArea = QRect(workarea[0], workarea[1], workarea[2], workarea[3]); 305 306 } else { 306 d->workareas[screen] = screenGeometry(screen); 307 } 307 workArea = screenGeometry(screen); 308 } 309 310 if (isVirtualDesktop()) { 311 // intersect the workarea (which spawns all Xinerama screens) with the rect for the 312 // requested screen 313 workArea &= screenGeometry(screen); 314 } 315 316 d->workareas[screen] = workArea; 317 308 318 if (data) 309 319 XFree(data); … … 373 383 { 374 384 Q_D(QDesktopWidget); 385 int oldScreenCount = d->screenCount; 386 QVector<QRect> oldRects(oldScreenCount); 387 for (int i = 0; i < oldScreenCount; ++i) { 388 oldRects[i] = d->rects[i]; 389 } 390 375 391 d->init(); 392 393 for (int i = 0; i < qMin(oldScreenCount, d->screenCount); ++i) { 394 if (oldRects.at(i) != d->rects[i]) 395 emit resized(i); 396 } 397 398 if (oldScreenCount != d->screenCount) { 399 emit screenCountChanged(d->screenCount); 400 } 401 376 402 qt_desktopwidget_workarea_dirty = true; 377 403 QWidget::resizeEvent(event);
Note:
See TracChangeset
for help on using the changeset viewer.