Changeset 62998 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 4, 2016 3:29:10 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
r62990 r62998 109 109 : QObject(pParent) 110 110 , m_pDesktopWidget(QApplication::desktop()) 111 , m_cHostScreenCount(-1)112 111 { 113 112 /* Prepare: */ … … 121 120 } 122 121 122 int UIDesktopWidgetWatchdog::screenCount() const 123 { 124 /* Redirect call to desktop-widget: */ 125 return QApplication::desktop()->screenCount(); 126 } 127 123 128 const QRect UIDesktopWidgetWatchdog::screenGeometry(int iHostScreenIndex /* = -1 */) const 124 129 { 125 130 /* Make sure index is valid: */ 126 if (iHostScreenIndex < 0 || iHostScreenIndex >= m_cHostScreenCount)131 if (iHostScreenIndex < 0 || iHostScreenIndex >= screenCount()) 127 132 iHostScreenIndex = m_pDesktopWidget->primaryScreen(); 128 AssertReturn(iHostScreenIndex >= 0 && iHostScreenIndex < m_cHostScreenCount, QRect());133 AssertReturn(iHostScreenIndex >= 0 && iHostScreenIndex < screenCount(), QRect()); 129 134 130 135 /* Redirect call to desktop-widget: */ … … 135 140 { 136 141 /* Make sure index is valid: */ 137 if (iHostScreenIndex < 0 || iHostScreenIndex >= m_cHostScreenCount)142 if (iHostScreenIndex < 0 || iHostScreenIndex >= screenCount()) 138 143 iHostScreenIndex = m_pDesktopWidget->primaryScreen(); 139 AssertReturn(iHostScreenIndex >= 0 && iHostScreenIndex < m_cHostScreenCount, QRect());144 AssertReturn(iHostScreenIndex >= 0 && iHostScreenIndex < screenCount(), QRect()); 140 145 141 146 /* Return cached available-geometry: */ … … 157 162 void UIDesktopWidgetWatchdog::sltHostScreenAdded(QScreen *pHostScreen) 158 163 { 159 // printf("UIDesktopWidgetWatchdog::sltHostScreenAdded(%d)\n", m_pDesktopWidget->screenCount());164 // printf("UIDesktopWidgetWatchdog::sltHostScreenAdded(%d)\n", screenCount()); 160 165 161 166 /* Update host-screen configuration: */ … … 165 170 void UIDesktopWidgetWatchdog::sltHostScreenRemoved(QScreen *pHostScreen) 166 171 { 167 // printf("UIDesktopWidgetWatchdog::sltHostScreenRemoved(%d)\n", m_pDesktopWidget->screenCount());172 // printf("UIDesktopWidgetWatchdog::sltHostScreenRemoved(%d)\n", screenCount()); 168 173 169 174 /* Update host-screen configuration: */ … … 228 233 { 229 234 /* Acquire new host-screen count: */ 230 m_cHostScreenCount = cHostScreenCount != -1 ? cHostScreenCount : m_pDesktopWidget->screenCount(); 235 if (cHostScreenCount == -1) 236 cHostScreenCount = screenCount(); 231 237 232 238 /* Cleanup existing workers first: */ … … 234 240 235 241 /* Resize workers vectors to new host-screen count: */ 236 m_availableGeometryWorkers.resize( m_cHostScreenCount);237 m_availableGeometryData.resize( m_cHostScreenCount);242 m_availableGeometryWorkers.resize(cHostScreenCount); 243 m_availableGeometryData.resize(cHostScreenCount); 238 244 239 245 /* Update host-screen available-geometry for each particular host-screen: */ 240 for (int iHostScreenIndex = 0; iHostScreenIndex < m_cHostScreenCount; ++iHostScreenIndex)246 for (int iHostScreenIndex = 0; iHostScreenIndex < cHostScreenCount; ++iHostScreenIndex) 241 247 updateHostScreenAvailableGeometry(iHostScreenIndex); 242 248 } … … 245 251 { 246 252 /* Make sure index is valid: */ 247 if (iHostScreenIndex < 0 || iHostScreenIndex >= m_cHostScreenCount)253 if (iHostScreenIndex < 0 || iHostScreenIndex >= screenCount()) 248 254 iHostScreenIndex = m_pDesktopWidget->primaryScreen(); 249 AssertReturnVoid(iHostScreenIndex >= 0 && iHostScreenIndex < m_cHostScreenCount);255 AssertReturnVoid(iHostScreenIndex >= 0 && iHostScreenIndex < screenCount()); 250 256 251 257 /* Create invisible frame-less window worker: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h
r62990 r62998 43 43 /** Destructs watchdog. */ 44 44 ~UIDesktopWidgetWatchdog(); 45 46 /** Returns the host-screen count. */ 47 int screenCount() const; 45 48 46 49 /** Returns the geometry of the host-screen with @a iHostScreenIndex. … … 89 92 QDesktopWidget *m_pDesktopWidget; 90 93 91 /** Holds current host-screen count. */92 int m_cHostScreenCount;93 94 /** Holds current host-screen available-geometries. */ 94 95 QVector<QRect> m_availableGeometryData;
Note:
See TracChangeset
for help on using the changeset viewer.