Changeset 52870 in vbox
- Timestamp:
- Sep 26, 2014 2:31:02 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 96292
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 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); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h
r52819 r52870 44 44 void sltRevokeFocus(); 45 45 46 #ifdef VBOX_WITH_MASKED_SEAMLESS 47 # ifdef Q_WS_X11 48 /** Assigns mini-toolbar seamless mask. */ 49 void sltUpdateMiniToolbarMask(const QRect &geo); 50 # endif /* Q_WS_X11 */ 51 #endif /* VBOX_WITH_MASKED_SEAMLESS */ 52 46 53 private: 47 54 … … 76 83 77 84 #ifdef VBOX_WITH_MASKED_SEAMLESS 78 /* Helper: Masking stuff:*/79 void setMask(const QRegion & region);85 /** Assigns guest seamless mask. */ 86 void setMask(const QRegion &maskGuest); 80 87 #endif /* VBOX_WITH_MASKED_SEAMLESS */ 81 88 … … 86 93 87 94 #ifdef VBOX_WITH_MASKED_SEAMLESS 88 /* Variable: Masking stuff: */ 89 QRegion m_maskRegion; 95 /** Holds the full seamless mask. */ 96 QRegion m_maskFull; 97 /** Holds the guest seamless mask. */ 98 QRegion m_maskGuest; 99 # ifdef Q_WS_X11 100 /** Holds the mini-toolbar seamless mask. */ 101 QRect m_maskMiniToolbar; 102 # endif /* Q_WS_X11 */ 90 103 #endif /* VBOX_WITH_MASKED_SEAMLESS */ 91 104 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
r52868 r52870 416 416 * Win host allows to enable it through Qt::WA_TranslucentBackground: */ 417 417 setMask(m_pEmbeddedToolbar->geometry()); 418 419 # ifdef VBOX_WITH_MASKED_SEAMLESS 420 /* Notify listeners as well: */ 421 const QRect windowGeo = geometry(); 422 emit sigNotifyAboutGeometryChange(windowGeo.intersected(m_pEmbeddedToolbar->geometry().translated(windowGeo.topLeft()))); 423 # endif /* VBOX_WITH_MASKED_SEAMLESS */ 418 424 #endif /* Q_WS_X11 */ 419 425 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h
r52732 r52870 64 64 void sigNotifyAboutFocusStolen(); 65 65 66 #ifdef VBOX_WITH_MASKED_SEAMLESS 67 # ifdef Q_WS_X11 68 /** Notifies about geometry change. */ 69 void sigNotifyAboutGeometryChange(const QRect &geo); 70 # endif /* Q_WS_X11 */ 71 #endif /* VBOX_WITH_MASKED_SEAMLESS */ 72 66 73 public: 67 74
Note:
See TracChangeset
for help on using the changeset viewer.