Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/util/qsystemtrayicon_win.cpp

    r651 r769  
    6262#include <QSettings>
    6363
    64 #if defined(Q_WS_WINCE) && !defined(STANDARDSHELL_UI_MODEL)
    65 #   include <streams.h>
    66 #endif
    67 
    6864QT_BEGIN_NAMESPACE
    6965
    70 #if defined(Q_WS_WINCE)
    71 static const UINT q_uNOTIFYICONID = 13;     // IDs from 0 to 12 are reserved on WinCE.
    72 #else
    7366static const UINT q_uNOTIFYICONID = 0;
    74 #endif
    7567
    7668static uint MYWM_TASKBARCREATED = 0;
     
    126118bool QSystemTrayIconSys::supportsMessages()
    127119{
    128 #ifndef Q_OS_WINCE
    129120    return allowsMessages();
    130 #endif
    131     return false;
    132121}
    133122
     
    136125
    137126{
    138 #ifndef Q_OS_WINCE
    139127    notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, guidItem); // NOTIFYICONDATAW_V2_SIZE;
    140128    maxTipLength = 128;
    141 #else
    142     notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, szTip[64]); // NOTIFYICONDATAW_V1_SIZE;
    143     maxTipLength = 64;
    144 #endif
    145129
    146130    // For restoring the tray icon after explorer crashes
     
    318302                if (q->contextMenu()) {
    319303                    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 #endif
    329304                    q->contextMenu()->activateWindow();
    330305                    //Must be activated for proper keyboardfocus and menu closing on windows:
     
    333308                break;
    334309
    335 #if !defined(Q_WS_WINCE)
    336310            case NIN_BALLOONUSERCLICK:
    337311                emit q->messageClicked();
    338312                break;
    339 #endif
    340313
    341314            case WM_MBUTTONUP:
     
    404377    //find the toolbar used in the notification area
    405378    if (trayHandle) {
    406 #if defined(Q_OS_WINCE)
    407         trayHandle = FindWindow(L"TrayNotifyWnd", NULL);
    408 #else
    409379        trayHandle = FindWindowEx(trayHandle, NULL, L"TrayNotifyWnd", NULL);
    410 #endif
    411380        if (trayHandle) {
    412 #if defined(Q_OS_WINCE)
    413             HWND hwnd = FindWindow(L"SysPager", NULL);
    414 #else
    415381            HWND hwnd = FindWindowEx(trayHandle, NULL, L"SysPager", NULL);
    416 #endif
    417382            if (hwnd) {
    418 #if defined(Q_OS_WINCE)
    419                 hwnd = FindWindow(L"ToolbarWindow32", NULL);
    420 #else
    421383                hwnd = FindWindowEx(hwnd, NULL, L"ToolbarWindow32", NULL);
    422 #endif
    423384                if (hwnd)
    424385                    trayHandle = hwnd;
     
    439400
    440401    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 #else
    444402    LPVOID data = VirtualAllocEx(trayProcess, NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE);
    445 #endif
    446403
    447404    if ( buttonCount < 1 || !data ) {
     
    481438        }
    482439    }
    483 #if defined(Q_OS_WINCE)
    484     VirtualFree(data, 0, MEM_RELEASE);
    485 #else
    486440    VirtualFreeEx(trayProcess, data, 0, MEM_RELEASE);
    487 #endif
    488441    CloseHandle(trayProcess);
    489442    return ret;
     
    559512void QSystemTrayIconPrivate::updateToolTip_sys()
    560513{
    561 #ifdef Q_WS_WINCE
    562     // 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 #else
    566514    if (!sys)
    567515        return;
    568516
    569517    sys->trayMessage(NIM_MODIFY);
    570 #endif
    571518}
    572519
Note: See TracChangeset for help on using the changeset viewer.