Changeset 50816 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 19, 2014 7:47:53 AM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r50681 r50816 164 164 } 165 165 #endif /* Q_WS_MAC */ 166 167 void UIMachineWindowFullscreen::sltRevokeFocus() 168 { 169 /* Revoke stolen focus: */ 170 m_pMachineView->setFocus(); 171 } 166 172 167 173 void UIMachineWindowFullscreen::prepareMenu() … … 248 254 connect(m_pMiniToolBar, SIGNAL(sigCloseAction()), 249 255 gActionPool->action(UIActionIndexRuntime_Simple_Close), SLOT(trigger())); 256 connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()), this, SLOT(sltRevokeFocus())); 250 257 } 251 258 … … 345 352 placeOnScreen(); 346 353 347 #ifdef Q_WS_WIN348 /* On Windows we should activate main window first,349 * because entering fullscreen there doesn't means window will be auto-activated,350 * so no window-activation event will be received and no keyboard-hook created otherwise... */351 if (m_uScreenId == 0)352 setWindowState(windowState() | Qt::WindowActive);353 #endif /* Q_WS_WIN */354 355 354 #ifdef Q_WS_MAC 356 355 /* ML and next using native stuff, so we can call for simple show(): */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r50681 r50816 70 70 #endif /* RT_OS_DARWIN */ 71 71 72 /** Revokes keyboard-focus. */ 73 void sltRevokeFocus(); 74 72 75 private: 73 76 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r50631 r50816 69 69 QTimer::singleShot(0, m_pMainMenu, SLOT(sltHighlightFirstAction())); 70 70 } 71 } 72 73 void UIMachineWindowSeamless::sltRevokeFocus() 74 { 75 /* Revoke stolen focus: */ 76 m_pMachineView->setFocus(); 71 77 } 72 78 … … 152 158 connect(m_pMiniToolBar, SIGNAL(sigCloseAction()), 153 159 gActionPool->action(UIActionIndexRuntime_Simple_Close), SLOT(trigger())); 160 connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()), this, SLOT(sltRevokeFocus())); 154 161 } 155 162 #endif /* !Q_WS_MAC */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h
r50535 r50816 45 45 /* Popup main menu: */ 46 46 void sltPopupMainMenu(); 47 48 /** Revokes keyboard-focus. */ 49 void sltRevokeFocus(); 47 50 48 51 private: -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
r49758 r50816 193 193 /* Simulate toolbar auto-hiding: */ 194 194 simulateToolbarAutoHiding(); 195 196 /* Due to [probably] Qt bug QMdiSubWindow still197 * can receive focus even if focus policy is Qt::NoFocus,198 * We should return the focus to our parent: */199 parentWidget()->setFocus();200 195 } 201 196 … … 260 255 m_pToolbar = new UIMiniToolBar; 261 256 { 257 /* Make sure we have no focus: */ 258 m_pToolbar->setFocusPolicy(Qt::NoFocus); 262 259 /* Propagate known options to child: */ 263 260 m_pToolbar->setAutoHide(m_fAutoHide); … … 279 276 m_pEmbeddedToolbar = m_pMdiArea->addSubWindow(m_pToolbar, Qt::Window | Qt::FramelessWindowHint); 280 277 /* Make sure we have no focus: */ 281 m_pToolbar->setFocusPolicy(Qt::NoFocus);282 278 m_pEmbeddedToolbar->setFocusPolicy(Qt::NoFocus); 279 m_pEmbeddedToolbar->installEventFilter(this); 283 280 } 284 281 … … 340 337 if (m_fAutoHide) 341 338 m_pHoverLeaveTimer->start(); 339 } 340 341 bool UIRuntimeMiniToolBar::eventFilter(QObject *pWatched, QEvent *pEvent) 342 { 343 /* Due to Qt bug QMdiArea can 344 * 1. steal focus from current application focus-widget 345 * 3. and even request focus stealing if QMdiArea hidden yet. 346 * We have to notify listeners about such facts.. */ 347 if (pWatched && m_pEmbeddedToolbar && pWatched == m_pEmbeddedToolbar && 348 pEvent->type() == QEvent::FocusIn) 349 emit sigNotifyAboutFocusStolen(); 350 /* Call to base-class: */ 351 return QWidget::eventFilter(pWatched, pEvent); 342 352 } 343 353 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h
r49758 r50816 64 64 void sigHoverLeave(); 65 65 66 /** Notifies listeners about we stole focus. */ 67 void sigNotifyAboutFocusStolen(); 68 66 69 public: 67 70 … … 109 112 void enterEvent(QEvent *pEvent); 110 113 void leaveEvent(QEvent *pEvent); 114 115 /** Filters @a pEvent if <i>this</i> object has been 116 * installed as an event-filter for the @a pWatched. */ 117 bool eventFilter(QObject *pWatched, QEvent *pEvent); 111 118 112 119 /* Helper: Hover stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.