Changeset 52870 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
- Timestamp:
- Sep 26, 2014 2:31:02 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 96292
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r52819 r52870 74 74 m_pMachineView->setFocus(); 75 75 } 76 77 #ifdef VBOX_WITH_MASKED_SEAMLESS 78 # ifdef Q_WS_X11 79 void UIMachineWindowSeamless::sltUpdateMiniToolbarMask(const QRect &geo) 80 { 81 /* Make sure mini-toolbar exists: */ 82 AssertPtrReturnVoid(m_pMiniToolBar); 83 84 /* Remember mini-toolbar mask: */ 85 m_maskMiniToolbar = geo; 86 87 /* Re-assign guest mask. */ 88 setMask(m_maskGuest); 89 } 90 # endif /* Q_WS_X11 */ 91 #endif /* VBOX_WITH_MASKED_SEAMLESS */ 76 92 77 93 void UIMachineWindowSeamless::prepareVisualState() … … 103 119 /* Make sure we have no background 104 120 * until the first one set-region-event: */ 105 setMask(m_mask Region);121 setMask(m_maskGuest); 106 122 #endif /* VBOX_WITH_MASKED_SEAMLESS */ 107 123 … … 132 148 actionPool()->action(UIActionIndexRT_M_Machine_S_Close), SLOT(trigger())); 133 149 connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()), this, SLOT(sltRevokeFocus())); 150 #ifdef VBOX_WITH_MASKED_SEAMLESS 151 # ifdef Q_WS_X11 152 connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutGeometryChange(const QRect&)), 153 this, SLOT(sltUpdateMiniToolbarMask(const QRect&))); 154 # endif /* Q_WS_X11 */ 155 #endif /* VBOX_WITH_MASKED_SEAMLESS */ 134 156 } 135 157 #endif /* !Q_WS_MAC */ … … 280 302 281 303 #ifdef VBOX_WITH_MASKED_SEAMLESS 282 void UIMachineWindowSeamless::setMask(const QRegion ®ion) 283 { 284 /* Prepare mask-region: */ 285 QRegion maskRegion(region); 286 287 /* Shift region if left spacer width is NOT zero or top spacer height is NOT zero: */ 304 void UIMachineWindowSeamless::setMask(const QRegion &maskGuest) 305 { 306 /* Remember new guest mask: */ 307 m_maskGuest = maskGuest; 308 309 /* Prepare full mask: */ 310 QRegion maskFull(m_maskGuest); 311 312 /* Shift full mask if left or top spacer width is NOT zero: */ 288 313 if (m_pLeftSpacer->geometry().width() || m_pTopSpacer->geometry().height()) 289 maskRegion.translate(m_pLeftSpacer->geometry().width(), m_pTopSpacer->geometry().height()); 290 291 /* Seamless-window for empty region should be empty too, 314 maskFull.translate(m_pLeftSpacer->geometry().width(), m_pTopSpacer->geometry().height()); 315 316 # ifdef Q_WS_X11 317 /* Take into account mini-toolbar mask if necessary: */ 318 if (m_pMiniToolBar) 319 maskFull += m_maskMiniToolbar; 320 # endif /* Q_WS_X11 */ 321 322 /* Seamless-window for empty full mask should be empty too, 292 323 * but the QWidget::setMask() wrapper doesn't allow this. 293 * Instead, we have a full painted screen of seamless-geometry size visible. 294 * Moreover, we can't just hide the empty seamless-window as 'hiding' 295 * 1. will collide with the multi-screen layout behavior and 296 * 2. will cause a task-bar flicker on moving window from one screen to another. 297 * As a *temporary* though quite a dirty workaround we have to make sure 298 * region have at least one pixel. */ 299 if (maskRegion.isEmpty()) 300 maskRegion += QRect(0, 0, 1, 1); 301 /* Make sure mask-region had changed: */ 302 if (m_maskRegion != maskRegion) 324 * Instead, we see a full guest-screen of available-geometry size. 325 * So we have to make sure full mask have at least one pixel. */ 326 if (maskFull.isEmpty()) 327 maskFull += QRect(0, 0, 1, 1); 328 329 /* Make sure full mask had changed: */ 330 if (m_maskFull != maskFull) 303 331 { 304 332 /* Compose viewport region to update: */ 305 QRegion toUpdate = m_mask Region + maskRegion;306 /* Remember new mask-region: */307 m_mask Region = maskRegion;308 /* Assign new mask-region: */309 UIMachineWindow::setMask(m_mask Region);333 QRegion toUpdate = m_maskFull + maskFull; 334 /* Remember new full mask: */ 335 m_maskFull = maskFull; 336 /* Assign new full mask: */ 337 UIMachineWindow::setMask(m_maskFull); 310 338 /* Update viewport region finally: */ 311 339 m_pMachineView->viewport()->update(toUpdate);
Note:
See TracChangeset
for help on using the changeset viewer.