Changeset 26699 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 23, 2010 11:24:40 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57934
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
r22813 r26699 148 148 return 0; 149 149 #endif /* QT_MAC_USE_COCOA */ 150 } 151 152 bool darwinSetFrontMostProcess() 153 { 154 ProcessSerialNumber psn = { 0, kCurrentProcess }; 155 return ::SetFrontProcess(&psn) == 0; 156 } 157 158 uint64_t darwinGetCurrentProcessId() 159 { 160 uint64_t processId = 0; 161 ProcessSerialNumber psn = { 0, kCurrentProcess }; 162 if (::GetCurrentProcess(&psn) == 0) 163 processId = RT_MAKE_U64(psn.lowLongOfPSN, psn.highLongOfPSN); 164 return processId; 150 165 } 151 166 -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.h
r25171 r26699 94 94 int darwinWindowToolBarHeight (NativeWindowRef aWindow); 95 95 float darwinSmallFontSize(); 96 bool darwinSetFrontMostProcess(); 97 uint64_t darwinGetCurrentProcessId(); 96 98 97 99 RT_C_DECLS_END -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r26637 r26699 430 430 #endif 431 431 432 #endif 432 433 #if defined (Q_WS_MAC) && defined (VBOX_GUI_USE_QUARTZ2D) 433 434 #include <Carbon/Carbon.h> … … 496 497 }; 497 498 #endif /* Q_WS_MAC && VBOX_GUI_USE_QUARTZ2D */ 498 #endif499 499 500 500 #endif // !___UIFrameBuffer_h___ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r26691 r26699 741 741 #ifdef Q_WS_MAC 742 742 /* Update Dock Overlay: */ 743 if (machineWindowWrapper()) 744 machineWindowWrapper()->updateDockOverlay(); 745 #endif 743 if ( machineWindowWrapper() 744 && machineWindowWrapper()->machineView()) 745 machineWindowWrapper()->machineView()->updateDockOverlay(); 746 #endif /* Q_WS_MAC */ 746 747 } 747 748 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r26691 r26699 291 291 //mVirtualBoxLogo = ::darwinToCGImageRef("VirtualBox_cube_42px.png"); 292 292 QString osTypeId = m_console.GetGuest().GetOSTypeId(); 293 mDockIconPreview = new VBoxDockIconPreview(machineWindowWrapper(), vboxGlobal().vmGuestOSTypeIcon (osTypeId)); 293 294 // TODO_NEW_CORE 295 // mDockIconPreview = new VBoxDockIconPreview(machineWindowWrapper(), vboxGlobal().vmGuestOSTypeIcon (osTypeId)); 294 296 295 297 # ifdef QT_MAC_USE_COCOA … … 419 421 * drawing stuff ourself */ 420 422 pViewport->setAttribute(Qt::WA_PaintOnScreen); 421 mFrameBuf =423 // mFrameBuf = 422 424 #ifdef VBOX_WITH_VIDEOHWACCEL 423 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQuartz2DFrameBuffer>(this, &machineWindowWrapper()->session()) : 424 #endif 425 new VBoxQuartz2DFrameBuffer(this); 425 // TODO_NEW_CORE 426 // mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQuartz2DFrameBuffer>(this, &machineWindowWrapper()->session()) : 427 #endif 428 // new UIFrameBufferQuartz2D(this); 426 429 break; 427 430 #endif … … 582 585 583 586 #ifdef Q_WS_MAC 584 void UIMachine Logic::sltChangeDockIconUpdate(const VBoxChangeDockIconUpdateEvent &event)587 void UIMachineView::sltChangeDockIconUpdate(const VBoxChangeDockIconUpdateEvent &event) 585 588 { 586 589 setDockIconEnabled(event.mChanged); … … 589 592 590 593 # ifdef QT_MAC_USE_COCOA 591 void UIMachineLogic::sltChangePresentationMode(const VBoxChangePresentationModeEvent &event) 592 { 594 void UIMachineView::sltChangePresentationMode(const VBoxChangePresentationModeEvent &event) 595 { 596 // TODO_NEW_CORE 597 // this is full screen related 598 #if 0 593 599 if (mIsFullscreen) 594 600 { … … 607 613 else 608 614 SetSystemUIMode(kUIModeNormal, 0); 615 #endif 609 616 } 610 617 # endif /* QT_MAC_USE_COCOA */ … … 2041 2048 } 2042 2049 #elif defined (Q_WS_MAC) 2043 if (aUniKey && aUniKey [0] && !aUniKey [1]) 2044 processed = processHotKey (QKeySequence (Qt::UNICODE_ACCEL + 2045 QChar (aUniKey [0]).toUpper().unicode()), 2046 machineWindowWrapper()->menuBar()->actions()); 2050 // TODO_NEW_CORE 2051 // if (aUniKey && aUniKey [0] && !aUniKey [1]) 2052 // processed = processHotKey (QKeySequence (Qt::UNICODE_ACCEL + 2053 // QChar (aUniKey [0]).toUpper().unicode()), 2054 // machineWindowWrapper()->menuBar()->actions()); 2047 2055 2048 2056 /* Don't consider the hot key as pressed since the guest never saw … … 2543 2551 { 2544 2552 # if defined (VBOX_GUI_USE_QUARTZ2D) 2545 if (mode == VBoxDefs::Quartz2DMode) 2546 { 2553 // TODO_NEW_CORE 2554 // if (mode == VBoxDefs::Quartz2DMode) 2555 // { 2547 2556 /* If the render mode is Quartz2D we could use the CGImageRef 2548 2557 * of the framebuffer for the dock icon creation. This saves 2549 2558 * some conversion time. */ 2550 mDockIconPreview->updateDockPreview (static_cast <VBoxQuartz2DFrameBuffer *> (mFrameBuf)->imageRef());2551 }2552 else2559 // mDockIconPreview->updateDockPreview (static_cast <VBoxQuartz2DFrameBuffer *> (mFrameBuf)->imageRef()); 2560 // } 2561 // else 2553 2562 # endif 2554 2563 /* In image mode we have to create the image ref out of the 2555 2564 * framebuffer */ 2556 mDockIconPreview->updateDockPreview (mFrameBuf); 2565 // TODO_NEW_CORE 2566 // mDockIconPreview->updateDockPreview (mFrameBuf); 2557 2567 } 2558 2568 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r26691 r26699 36 36 #include "UIMachineDefs.h" 37 37 38 #ifdef Q_WS_MAC 39 # include <CoreFoundation/CFBase.h> 40 #endif /* Q_WS_MAC */ 41 42 /* Local forward declarations */ 43 class VBoxChangeDockIconUpdateEvent; 44 class VBoxChangePresentationModeEvent; 45 class VBoxDockIconPreview; 46 38 47 class UIMachineView : public QAbstractScrollArea 39 48 { … … 66 75 void setIgnoreGuestResize(bool bIgnore); 67 76 void setMouseIntegrationEnabled(bool bEnabled); 77 78 #if defined(Q_WS_MAC) 79 void updateDockIcon(); 80 void updateDockOverlay(); 81 void setDockIconEnabled(bool aOn) { mDockIconEnabled = aOn; }; 82 void setMouseCoalescingEnabled(bool aOn); 83 #endif 68 84 69 85 signals: … … 133 149 #if defined(Q_WS_WIN32) 134 150 bool winLowKeyboardEvent(UINT msg, const KBDLLHOOKSTRUCT &event); 135 bool winEvent 151 bool winEvent(MSG *aMsg, long *aResult); 136 152 #elif defined(Q_WS_PM) 137 bool pmEvent 153 bool pmEvent(QMSG *aMsg); 138 154 #elif defined(Q_WS_X11) 139 bool x11Event 155 bool x11Event(XEvent *event); 140 156 #elif defined(Q_WS_MAC) 141 bool darwinKeyboardEvent 142 void darwinGrabKeyboardEvents 157 bool darwinKeyboardEvent(const void *pvCocoaEvent, EventRef inEvent); 158 void darwinGrabKeyboardEvents(bool fGrab); 143 159 #endif 144 160 #if defined (Q_WS_WIN32) … … 184 200 #ifdef VBOX_WITH_VIDEOHWACCEL 185 201 void scrollContentsBy(int dx, int dy); 186 #endif187 #if defined(Q_WS_MAC)188 void updateDockIcon();189 void updateDockOverlay();190 void setDockIconEnabled(bool aOn) { mDockIconEnabled = aOn; };191 void setMouseCoalescingEnabled(bool aOn);192 202 #endif 193 203 void onStateChange(KMachineState state); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r26691 r26699 32 32 #include "UIMachineWindow.h" 33 33 34 #include "VBoxUtils.h" 35 34 36 /* Guest mouse pointer shape change event: */ 35 37 class UIMousePointerShapeChangeEvent : public QEvent … … 475 477 return S_OK; 476 478 477 ProcessSerialNumber psn = { 0, kCurrentProcess }; 478 OSErr rc = ::SetFrontProcess(&psn); 479 if (!rc) 479 if (::darwinSetFrontMostProcess()) 480 480 QApplication::postEvent(m_pEventHandler, new UIShowWindowEvent); 481 481 else … … 484 484 * (This is just a precaution should Mac OS X start imposing the same sensible 485 485 * focus stealing restrictions that other window managers implement). */ 486 AssertMsgFailed(("SetFrontProcess -> %#x\n", rc)); 487 if (::GetCurrentProcess(&psn)) 488 *puWinId = RT_MAKE_U64(psn.lowLongOfPSN, psn.highLongOfPSN); 486 *puWinId = ::darwinGetCurrentProcessId(); 489 487 } 490 488 #else … … 779 777 * what. So, I'll just always show & activate the stupid window to 780 778 * make it get out of the dock when the user wishes to show a VM. */ 779 #if 0 780 // TODO_NEW_CORE 781 781 window()->show(); 782 782 window()->activateWindow(); 783 #endif 783 784 return true; 784 785 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r26691 r26699 37 37 #include "UIMachineView.h" 38 38 39 #include "VBoxUtils.h" 40 39 41 UIMachineLogicNormal::UIMachineLogicNormal(QObject *pParent, UISession *pSession, UIActionsPool *pActionsPool) 40 42 : UIMachineLogic(pParent, pSession, pActionsPool, UIVisualStateType_Normal) … … 115 117 /* We have to make sure that we are getting the front most process. 116 118 * This is necessary for Qt versions > 4.3.3: */ 117 ProcessSerialNumber psn = { 0, kCurrentProcess }; 118 ::SetFrontProcess(&psn); 119 ::darwinSetFrontMostProcess(); 119 120 #endif /* Q_WS_MAC */ 120 121
Note:
See TracChangeset
for help on using the changeset viewer.