Changeset 775
- Timestamp:
- Aug 4, 2010, 1:28:23 PM (15 years ago)
- Location:
- trunk/src/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/gui/kernel/qwidget_pm.cpp ¶
r749 r775 1389 1389 qApp->d_func()->closePopup(this); 1390 1390 if (destroyWindow && !(windowType() == Qt::Desktop) && 1391 internalWinId() != NULLHANDLE) { 1392 HWND id = internalWinId(); 1393 if (isWindow() && !(windowType() == Qt::Popup)) { 1394 // extra data including extra->topextra has been already 1395 // deleted at this point by deleteExtra() and therefore 1396 // calling frameWinId() is useless -- it will return the 1397 // client window handle. Use WinQueryWindow() instead. 1398 id = WinQueryWindow(id, QW_PARENT); 1399 Q_ASSERT(id != NULLHANDLE); 1400 } 1391 d->frameWinId() != NULLHANDLE) { 1392 // make sure the backing store is deleted before destroying HWND -- 1393 // QPMDiveWindowSurface depends on that 1394 delete d->topData()->backingStore; 1395 d->topData()->backingStore = 0; 1396 // now destroy HWND 1397 HWND id = d->frameWinId(); 1401 1398 #if defined(QT_DEBUGWINCREATEDESTROY) 1402 1399 qDebug() << "|Destroying window" << this … … 1472 1469 } 1473 1470 1474 if ((q->windowType() == Qt::Desktop)) 1475 old_fid = NULLHANDLE; 1471 if (old_fid != NULLHANDLE && q->windowType() != Qt::Desktop) { 1472 // make sure the backing store is deleted before destroying HWND -- 1473 // QPMDiveWindowSurface depends on that 1474 if (extra && extra->topextra) { 1475 delete extra->topextra->backingStore; 1476 extra->topextra->backingStore = 0; 1477 // zero the to-be-destroyed frame HWND just in case 1478 extra->topextra->fId = NULLHANDLE; 1479 } 1480 // now destroy HWND 1481 qt_WinDestroyWindow(old_fid); 1482 } 1483 1476 1484 setWinId(0); 1477 1485 … … 1506 1514 setWindowTitle_helper(extra->topextra->caption); 1507 1515 } 1508 if (old_fid != NULLHANDLE)1509 qt_WinDestroyWindow(old_fid);1510 1516 1511 1517 if (q->testAttribute(Qt::WA_AcceptDrops) || dropSiteWasRegistered -
TabularUnified trunk/src/gui/painting/qwindowsurface_pm.cpp ¶
r758 r775 368 368 if (widget == that->window()) 369 369 return &data; 370 if (!subWidgets || !subWidgets->contains(widget-> winId()))370 if (!subWidgets || !subWidgets->contains(widget->internalWinId())) 371 371 return 0; 372 return &(*subWidgets)[widget-> winId()];372 return &(*subWidgets)[widget->internalWinId()]; 373 373 } 374 374 … … 379 379 void QPMDiveWindowSurfacePrivate::addWidget(QWidget *widget) 380 380 { 381 Q_ASSERT(widget->internalWinId()); 382 381 383 WidgetData *wd = &data; 382 384 if (widget != that->window()) { … … 384 386 if (!subWidgets) 385 387 subWidgets = new QMap<HWND, WidgetData>(); 386 wd = &(*subWidgets)[widget-> winId()];388 wd = &(*subWidgets)[widget->internalWinId()]; 387 389 } 388 390 … … 398 400 // to handle other PM messages 399 401 widget->addPmEventFilter(this); 400 WinSetVisibleRegionNotify(widget-> winId(), TRUE);402 WinSetVisibleRegionNotify(widget->internalWinId(), TRUE); 401 403 } else { 402 404 // receive various PM messages 403 405 widget->addPmEventFilter(this); 404 // receive reparent/destruction messages from children 405 // to cleanup the map 406 // receive reparent messages from children to cleanup the map 406 407 widget->installEventFilter(this); 407 408 } … … 411 412 { 412 413 if (widget == that->window()) { 413 WinSetVisibleRegionNotify(widget-> winId(), FALSE);414 WinSetVisibleRegionNotify(widget->internalWinId(), FALSE); 414 415 widget->removePmEventFilter(this); 415 416 } else { 416 417 widget->removeEventFilter(this); 417 418 widget->removePmEventFilter(this); 418 } 419 420 if (widget != that->window()) 421 subWidgets->remove(widget->winId()); 419 subWidgets->remove(widget->internalWinId()); 420 } 422 421 } 423 422 … … 425 424 { 426 425 QWidget *widget = qobject_cast<QWidget *>(obj); 427 if (event->type() == QEvent::ParentAboutToChange || 428 event->type() == QEvent::Destroy) { 426 if (event->type() == QEvent::ParentAboutToChange) { 429 427 removeWidget(widget); 430 428 } … … 482 480 } 483 481 case WM_SIZE: { 484 if (msg->hwnd != that->window()-> winId()) {482 if (msg->hwnd != that->window()->internalWinId()) { 485 483 // sometimes PM doesn't send WM_VRNENABLED to the main widget 486 484 // when the sub-widget (its descendant) gets resized within it; … … 611 609 // produce a clip region that excludes all descending obstacles 612 610 // (like child widgets with real HWNDs which are not excluded by Qt) 613 HWND wwnd = widget-> winId();611 HWND wwnd = widget->internalWinId(); 614 612 RECTL wrcl = { wbr.left(), wh - wbr.bottom() - 1, 615 613 wbr.right() + 1, wh - wbr.top() }; … … 659 657 bool QPMDiveWindowSurface::adjustSetup(QWidget *widget) 660 658 { 661 HWND hwnd = window()-> winId();659 HWND hwnd = window()->internalWinId(); 662 660 663 661 // don't include lScreenPosX and the rest by default … … 693 691 ULONG rc = WinQueryVisibleRegion(hwnd, hrgn); 694 692 if (rc != RGN_ERROR) { 695 HWND hwndWidget = widget-> winId();693 HWND hwndWidget = widget->internalWinId(); 696 694 POINTL ptlOffset = { 0, 0 }; 697 695 if (hwnd != hwndWidget) {
Note:
See TracChangeset
for help on using the changeset viewer.