- Timestamp:
- Jul 14, 2015 2:18:11 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r56341 r56929 176 176 177 177 # define BOOL PRBool 178 # include "VBoxX11Helper.h"179 178 #endif /* Q_WS_X11 */ 180 179 … … 232 231 , m_fSeparateProcess(false) 233 232 , m_pMediumEnumerator(0) 234 , mIsKWinManaged (false) 233 #ifdef Q_WS_X11 234 , m_enmWindowManagerType(X11WMType_Unknown) 235 #endif /* Q_WS_X11 */ 235 236 #if defined(DEBUG_bird) 236 237 , mAgressiveCaching(false) … … 3948 3949 3949 3950 #ifdef Q_WS_X11 3950 mIsKWinManaged = X11IsWindowManagerKWin(); 3951 #endif 3951 /* Acquire current Window Manager type: */ 3952 m_enmWindowManagerType = X11WindowManagerType(); 3953 #endif /* Q_WS_X11 */ 3952 3954 3953 3955 #ifdef VBOX_WITH_DEBUGGER_GUI -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r55678 r56929 35 35 #include "UIMediumDefs.h" 36 36 #include "VBoxGlobalSettings.h" 37 #ifdef Q_WS_X11 38 # include "VBoxX11Helper.h" 39 #endif /* Q_WS_X11 */ 37 40 38 41 /* COM includes: */ … … 149 152 QList<QUrl> &argUrlList() { return m_ArgUrlList; } 150 153 151 bool isKWinManaged() const { return mIsKWinManaged; } 154 #ifdef Q_WS_X11 155 /** X11: Returns the type of the Window Manager we are running under. */ 156 X11WMType typeOfWindowManager() const { return m_enmWindowManagerType; } 157 #endif /* Q_WS_X11 */ 152 158 153 159 /** Returns whether we should restore current snapshot before VM started. */ … … 480 486 mutable QReadWriteLock m_mediumEnumeratorDtorRwLock; 481 487 482 bool mIsKWinManaged; 488 #ifdef Q_WS_X11 489 /** X11: Holds the type of the Window Manager we are running under. */ 490 X11WMType m_enmWindowManagerType; 491 #endif /* Q_WS_X11 */ 483 492 484 493 /** The --aggressive-caching / --no-aggressive-caching option. */ -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.cpp
r56928 r56929 16 16 */ 17 17 18 /* Qt includes: */ 19 #include <QX11Info> 20 #include <QString> 21 22 /* GUI includes: */ 18 23 #include "VBoxX11Helper.h" 19 24 25 /* Other VBox includes: */ 20 26 #include <iprt/cdefs.h> 21 #include <iprt/string.h>22 #include <QX11Info>23 27 24 28 /* rhel3 build hack */ … … 73 77 } 74 78 75 bool X11IsWindowManagerKWin()79 X11WMType X11WindowManagerType() 76 80 { 77 81 /* Get display: */ … … 84 88 unsigned long ulDummy; 85 89 unsigned char *pcData = 0; 86 bool fIsKWinManaged = false;90 X11WMType wmType = X11WMType_Unknown; 87 91 88 92 /* Ask if root-window supports check for WM name: */ … … 106 110 &iReturnedFormat, &ulReturnedItemCount, &ulDummy, &pcData) == Success) 107 111 { 108 fIsKWinManaged = RTStrCmp((const char*)pcData, "KWin") == 0; 112 if (QString((const char*)pcData).contains("KWin", Qt::CaseInsensitive)) 113 wmType = X11WMType_KWin; 114 else 115 if (QString((const char*)pcData).contains("Mutter", Qt::CaseInsensitive)) 116 wmType = X11WMType_Mutter; 109 117 if (pcData) 110 118 XFree(pcData); … … 112 120 } 113 121 } 114 return fIsKWinManaged;122 return wmType; 115 123 } 116 124 -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.h
r56927 r56929 19 19 #define ___VBoxX11Helpers_h___ 20 20 21 /** X11: Known Window Manager types. */ 22 enum X11WMType 23 { 24 X11WMType_Unknown, 25 X11WMType_KWin, 26 X11WMType_Mutter, 27 }; 28 21 29 /** X11: Inits the screen saver save/restore mechanism. */ 22 30 void X11ScreenSaverSettingsInit(); … … 26 34 void X11ScreenSaverSettingsRestore(); 27 35 28 /** X11: Determines whether current Window Manager is KWin. */29 bool X11IsWindowManagerKWin();36 /** X11: Determines and returns current Window Manager type. */ 37 X11WMType X11WindowManagerType(); 30 38 31 39 #endif /* !___VBoxX11Helpers_h___ */
Note:
See TracChangeset
for help on using the changeset viewer.