Changeset 769 for trunk/src/gui/util/qsystemtrayicon_win.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/util/qsystemtrayicon_win.cpp
r651 r769 62 62 #include <QSettings> 63 63 64 #if defined(Q_WS_WINCE) && !defined(STANDARDSHELL_UI_MODEL)65 # include <streams.h>66 #endif67 68 64 QT_BEGIN_NAMESPACE 69 65 70 #if defined(Q_WS_WINCE)71 static const UINT q_uNOTIFYICONID = 13; // IDs from 0 to 12 are reserved on WinCE.72 #else73 66 static const UINT q_uNOTIFYICONID = 0; 74 #endif75 67 76 68 static uint MYWM_TASKBARCREATED = 0; … … 126 118 bool QSystemTrayIconSys::supportsMessages() 127 119 { 128 #ifndef Q_OS_WINCE129 120 return allowsMessages(); 130 #endif131 return false;132 121 } 133 122 … … 136 125 137 126 { 138 #ifndef Q_OS_WINCE139 127 notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, guidItem); // NOTIFYICONDATAW_V2_SIZE; 140 128 maxTipLength = 128; 141 #else142 notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, szTip[64]); // NOTIFYICONDATAW_V1_SIZE;143 maxTipLength = 64;144 #endif145 129 146 130 // For restoring the tray icon after explorer crashes … … 318 302 if (q->contextMenu()) { 319 303 q->contextMenu()->popup(gpos); 320 #if defined(Q_WS_WINCE)321 // We must ensure that the popup menu doesn't show up behind the task bar.322 QRect desktopRect = qApp->desktop()->availableGeometry();323 int maxY = desktopRect.y() + desktopRect.height() - q->contextMenu()->height();324 if (gpos.y() > maxY) {325 gpos.ry() = maxY;326 q->contextMenu()->move(gpos);327 }328 #endif329 304 q->contextMenu()->activateWindow(); 330 305 //Must be activated for proper keyboardfocus and menu closing on windows: … … 333 308 break; 334 309 335 #if !defined(Q_WS_WINCE)336 310 case NIN_BALLOONUSERCLICK: 337 311 emit q->messageClicked(); 338 312 break; 339 #endif340 313 341 314 case WM_MBUTTONUP: … … 404 377 //find the toolbar used in the notification area 405 378 if (trayHandle) { 406 #if defined(Q_OS_WINCE)407 trayHandle = FindWindow(L"TrayNotifyWnd", NULL);408 #else409 379 trayHandle = FindWindowEx(trayHandle, NULL, L"TrayNotifyWnd", NULL); 410 #endif411 380 if (trayHandle) { 412 #if defined(Q_OS_WINCE)413 HWND hwnd = FindWindow(L"SysPager", NULL);414 #else415 381 HWND hwnd = FindWindowEx(trayHandle, NULL, L"SysPager", NULL); 416 #endif417 382 if (hwnd) { 418 #if defined(Q_OS_WINCE)419 hwnd = FindWindow(L"ToolbarWindow32", NULL);420 #else421 383 hwnd = FindWindowEx(hwnd, NULL, L"ToolbarWindow32", NULL); 422 #endif423 384 if (hwnd) 424 385 trayHandle = hwnd; … … 439 400 440 401 int buttonCount = SendMessage(trayHandle, TB_BUTTONCOUNT, 0, 0); 441 #if defined(Q_OS_WINCE)442 LPVOID data = VirtualAlloc(NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE);443 #else444 402 LPVOID data = VirtualAllocEx(trayProcess, NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE); 445 #endif446 403 447 404 if ( buttonCount < 1 || !data ) { … … 481 438 } 482 439 } 483 #if defined(Q_OS_WINCE)484 VirtualFree(data, 0, MEM_RELEASE);485 #else486 440 VirtualFreeEx(trayProcess, data, 0, MEM_RELEASE); 487 #endif488 441 CloseHandle(trayProcess); 489 442 return ret; … … 559 512 void QSystemTrayIconPrivate::updateToolTip_sys() 560 513 { 561 #ifdef Q_WS_WINCE562 // Calling sys->trayMessage(NIM_MODIFY) on an existing icon is broken on Windows CE.563 // So we need to call updateIcon_sys() which creates a new icon handle.564 updateIcon_sys();565 #else566 514 if (!sys) 567 515 return; 568 516 569 517 sys->trayMessage(NIM_MODIFY); 570 #endif571 518 } 572 519
Note:
See TracChangeset
for help on using the changeset viewer.