- Timestamp:
- Aug 29, 2011, 2:08:51 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/painting/qwindowsurface_pm.cpp
r1034 r1035 338 338 ULONG bufNum; 339 339 bool posDirty; 340 bool vrnDisabled;341 340 bool inDrag; 342 341 SETUP_BLITTER setup; … … 353 352 { 354 353 int widgetHeight; 355 bool vrnDirty; 354 bool vrnDirty : 1; 355 bool vrnDisabled : 1; 356 356 size_t rclCount; 357 357 QVector<RECTL> rcls; … … 393 393 wd->rclCount = 0; 394 394 395 if (widget == that->window()) { 396 // receive visible region change messages (note that we don't do this 397 // for sub-widgets as it causes some strange PM freezes if these widgets 398 // are embedded windows manipulated by other processes). We also want 399 // to handle other PM messages 400 widget->addPmEventFilter(this); 401 WinSetVisibleRegionNotify(widget->internalWinId(), TRUE); 402 } else { 403 // receive various PM messages 404 widget->addPmEventFilter(this); 395 // receive visible region change messages and other PM messages 396 widget->addPmEventFilter(this); 397 WinSetVisibleRegionNotify(widget->internalWinId(), TRUE); 398 399 if (widget != that->window()) { 405 400 // receive reparent messages from children to cleanup the map 406 401 widget->installEventFilter(this); … … 410 405 void QPMDiveWindowSurfacePrivate::removeWidget(QWidget *widget) 411 406 { 412 if (widget == that->window()) { 413 WinSetVisibleRegionNotify(widget->internalWinId(), FALSE); 414 widget->removePmEventFilter(this); 415 } else { 407 if (widget != that->window()) { 416 408 widget->removeEventFilter(this); 417 widget->removePmEventFilter(this);418 409 subWidgets->remove(widget); 419 410 } 411 412 413 420 414 } 421 415 … … 435 429 switch (msg->msg) { 436 430 case WM_VRNDISABLED: { 437 if (!useFB) 438 DiveSetupBlitter(hDive, NULL); 439 vrnDisabled = true; 431 if (msg->hwnd == that->window()->internalWinId()) { 432 if (!useFB) 433 DiveSetupBlitter(hDive, NULL); 434 data.vrnDisabled = true; 435 } else { 436 WidgetData *wd = widgetData(QWidget::find(msg->hwnd)); 437 Q_ASSERT(wd); 438 if (wd) 439 wd->vrnDisabled = true; 440 } 440 441 *result = 0; 441 442 return true; … … 451 452 } 452 453 case WM_VRNENABLED: { 453 vrnDisabled = false; 454 QWidget *widget = msg->hwnd == that->window()->internalWinId() ? 455 that->window() : QWidget::find(msg->hwnd); 456 WidgetData *wd = widgetData(widget); 457 Q_ASSERT(wd); 458 wd->vrnDisabled = false; 454 459 // Note that when an overlapping window of *other* process is moved 455 460 // over this window, PM still sends WM_VRNENABLED to it but with … … 461 466 if (LONGFROMMP(msg->mp1)) // window's visible region changed 462 467 #endif 463 { 464 // mark all widgets' visible regions as dirty 465 data.vrnDirty = true; 466 if (subWidgets) { 467 foreach(QWidget *w, subWidgets->keys()) 468 (*subWidgets)[w].vrnDirty = true; 468 wd->vrnDirty = true; 469 470 if (widget == that->window()) 471 posDirty = true; 472 473 // process pending flush events for this widget 474 for (QList<QPMDiveWindowSurfacePrivate::FlushArgs>::iterator 475 it = pending.begin(); it != pending.end();) { 476 if (it->widget == widget) { 477 that->doFlush(it->widget, it->from, it->to); 478 it = pending.erase(it); 479 } else { 480 ++it; 469 481 } 470 482 } 471 posDirty = true;472 473 // process pending flush events474 foreach(const QPMDiveWindowSurfacePrivate::FlushArgs &args, pending)475 that->doFlush(args.widget, args.from, args.to);476 pending.clear();477 483 478 484 *result = 0; 479 485 return true; 480 }481 case WM_SIZE: {482 if (msg->hwnd != that->window()->internalWinId()) {483 // sometimes PM doesn't send WM_VRNENABLED to the main widget484 // when the sub-widget (its descendant) gets resized within it;485 // fix it here by invalidating all visible regions486 data.vrnDirty = true;487 if (subWidgets) {488 foreach(QWidget *w, subWidgets->keys())489 (*subWidgets)[w].vrnDirty = true;490 }491 }492 break;493 486 } 494 487 default: … … 508 501 d->bufNum = 0; 509 502 d->posDirty = true; 510 d->vrnDisabled = false;511 503 d->inDrag = false; 512 504 d->subWidgets = 0; … … 651 643 QRect wbr = br.translated(-wOffset); 652 644 653 if (d->vrnDisabled) { 645 QPMDiveWindowSurfacePrivate::WidgetData *wd = d->widgetData(widget); 646 Q_ASSERT(wd); 647 648 if (wd->vrnDisabled) { 654 649 // defer the flush 655 650 QPMDiveWindowSurfacePrivate::FlushArgs args = { widget,
Note:
See TracChangeset
for help on using the changeset viewer.