summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qsystemtrayicon_win.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-19 13:31:25 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-19 13:31:25 (GMT)
commit78dcac759d500c1744751955623b1d0babcd37a4 (patch)
tree59d7a2540c2fcffe0b274afbf85db9a1f53242f4 /src/gui/util/qsystemtrayicon_win.cpp
parentf1c79b3c90c1e14d8bee0228e3e416fa5337cf6e (diff)
parentde0858687898f6e0e54cce3f986779c7aa1a350e (diff)
downloadQt-78dcac759d500c1744751955623b1d0babcd37a4.zip
Qt-78dcac759d500c1744751955623b1d0babcd37a4.tar.gz
Qt-78dcac759d500c1744751955623b1d0babcd37a4.tar.bz2
Merge remote branch 'origin/4.7' into HEAD
Conflicts: src/corelib/tools/qlocale_symbian.cpp
Diffstat (limited to 'src/gui/util/qsystemtrayicon_win.cpp')
-rw-r--r--src/gui/util/qsystemtrayicon_win.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp
index 8e482e0..c89fbae 100644
--- a/src/gui/util/qsystemtrayicon_win.cpp
+++ b/src/gui/util/qsystemtrayicon_win.cpp
@@ -60,17 +60,9 @@
#include <QDesktopWidget>
#include <QSettings>
-#if defined(Q_WS_WINCE) && !defined(STANDARDSHELL_UI_MODEL)
-# include <streams.h>
-#endif
-
QT_BEGIN_NAMESPACE
-#if defined(Q_WS_WINCE)
-static const UINT q_uNOTIFYICONID = 13; // IDs from 0 to 12 are reserved on WinCE.
-#else
static const UINT q_uNOTIFYICONID = 0;
-#endif
static uint MYWM_TASKBARCREATED = 0;
#define MYWM_NOTIFYICON (WM_APP+101)
@@ -124,23 +116,15 @@ bool QSystemTrayIconSys::allowsMessages()
bool QSystemTrayIconSys::supportsMessages()
{
-#ifndef Q_OS_WINCE
return allowsMessages();
-#endif
- return false;
}
QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *object)
: hIcon(0), q(object), ignoreNextMouseRelease(false)
{
-#ifndef Q_OS_WINCE
notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, guidItem); // NOTIFYICONDATAW_V2_SIZE;
maxTipLength = 128;
-#else
- notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, szTip[64]); // NOTIFYICONDATAW_V1_SIZE;
- maxTipLength = 64;
-#endif
// For restoring the tray icon after explorer crashes
if (!MYWM_TASKBARCREATED) {
@@ -316,24 +300,13 @@ bool QSystemTrayIconSys::winEvent( MSG *m, long *result )
case WM_RBUTTONUP:
if (q->contextMenu()) {
q->contextMenu()->popup(gpos);
-#if defined(Q_WS_WINCE)
- // We must ensure that the popup menu doesn't show up behind the task bar.
- QRect desktopRect = qApp->desktop()->availableGeometry();
- int maxY = desktopRect.y() + desktopRect.height() - q->contextMenu()->height();
- if (gpos.y() > maxY) {
- gpos.ry() = maxY;
- q->contextMenu()->move(gpos);
- }
-#endif
}
emit q->activated(QSystemTrayIcon::Context);
break;
-#if !defined(Q_WS_WINCE)
case NIN_BALLOONUSERCLICK:
emit q->messageClicked();
break;
-#endif
case WM_MBUTTONUP:
emit q->activated(QSystemTrayIcon::MiddleClick);
@@ -400,23 +373,11 @@ QRect QSystemTrayIconSys::findIconGeometry(const int iconId)
//find the toolbar used in the notification area
if (trayHandle) {
-#if defined(Q_OS_WINCE)
- trayHandle = FindWindow(L"TrayNotifyWnd", NULL);
-#else
trayHandle = FindWindowEx(trayHandle, NULL, L"TrayNotifyWnd", NULL);
-#endif
if (trayHandle) {
-#if defined(Q_OS_WINCE)
- HWND hwnd = FindWindow(L"SysPager", NULL);
-#else
HWND hwnd = FindWindowEx(trayHandle, NULL, L"SysPager", NULL);
-#endif
if (hwnd) {
-#if defined(Q_OS_WINCE)
- hwnd = FindWindow(L"ToolbarWindow32", NULL);
-#else
hwnd = FindWindowEx(hwnd, NULL, L"ToolbarWindow32", NULL);
-#endif
if (hwnd)
trayHandle = hwnd;
}
@@ -435,11 +396,7 @@ QRect QSystemTrayIconSys::findIconGeometry(const int iconId)
return ret;
int buttonCount = SendMessage(trayHandle, TB_BUTTONCOUNT, 0, 0);
-#if defined(Q_OS_WINCE)
- LPVOID data = VirtualAlloc(NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE);
-#else
LPVOID data = VirtualAllocEx(trayProcess, NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE);
-#endif
if ( buttonCount < 1 || !data ) {
CloseHandle(trayProcess);
@@ -477,11 +434,7 @@ QRect QSystemTrayIconSys::findIconGeometry(const int iconId)
}
}
}
-#if defined(Q_OS_WINCE)
- VirtualFree(data, 0, MEM_RELEASE);
-#else
VirtualFreeEx(trayProcess, data, 0, MEM_RELEASE);
-#endif
CloseHandle(trayProcess);
return ret;
}
@@ -555,16 +508,10 @@ void QSystemTrayIconPrivate::updateMenu_sys()
void QSystemTrayIconPrivate::updateToolTip_sys()
{
-#ifdef Q_WS_WINCE
- // Calling sys->trayMessage(NIM_MODIFY) on an existing icon is broken on Windows CE.
- // So we need to call updateIcon_sys() which creates a new icon handle.
- updateIcon_sys();
-#else
if (!sys)
return;
sys->trayMessage(NIM_MODIFY);
-#endif
}
bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()