From 38f740e4de9a313fd33984bd54834c56dc2316c4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Jan 2013 10:05:55 +0100 Subject: Windows tray icon: Fix reinstalling after restart of Explorer. Use a normal instead of a HWND_MESSAGE-window since the latter do not receive the "TaskbarCreated" message. Provide an invokable slot in the native interface to register a window class for that purpose. Task-number: QTBUG-29160 Change-Id: Ic25222d08d21867f7d882a9e19d8aaf50f3f47cf Reviewed-by: Joerg Bornemann --- src/widgets/util/qsystemtrayicon_win.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/widgets/util') diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp index 8d8d731795..209fb206e1 100644 --- a/src/widgets/util/qsystemtrayicon_win.cpp +++ b/src/widgets/util/qsystemtrayicon_win.cpp @@ -166,21 +166,29 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsTrayconWndProc(HWND hwnd, UINT messag } // Invoke a service of the native Windows interface to create -// a non-visible message window. +// a non-visible toplevel window to receive tray messages. +// Note: Message windows (HWND_MESSAGE) are not sufficient, they +// will not receive the "TaskbarCreated" message. static inline HWND createTrayIconMessageWindow() { - if (QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface()) { - void *hwnd = 0; - void *wndProc = reinterpret_cast(qWindowsTrayconWndProc); - if (QMetaObject::invokeMethod(ni, "createMessageWindow", Qt::DirectConnection, - Q_RETURN_ARG(void *, hwnd), - Q_ARG(QString, QStringLiteral("QTrayIconMessageWindowClass")), - Q_ARG(QString, QStringLiteral("QTrayIconMessageWindow")), - Q_ARG(void *, wndProc)) && hwnd) { - return reinterpret_cast(hwnd); - } + QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface(); + if (!ni) + return 0; + // Register window class in the platform plugin. + QString className; + void *wndProc = reinterpret_cast(qWindowsTrayconWndProc); + if (!QMetaObject::invokeMethod(ni, "registerWindowClass", Qt::DirectConnection, + Q_RETURN_ARG(QString, className), + Q_ARG(QString, QStringLiteral("QTrayIconMessageWindowClass")), + Q_ARG(void *, wndProc))) { + return 0; } - return 0; + const wchar_t windowName[] = L"QTrayIconMessageWindow"; + return CreateWindowEx(0, (wchar_t*)className.utf16(), + windowName, WS_OVERLAPPED, + CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, + NULL, NULL, (HINSTANCE)GetModuleHandle(0), NULL); } QSystemTrayIconSys::QSystemTrayIconSys(HWND hwnd, QSystemTrayIcon *object) -- cgit v1.2.3 From 1de63171eec5ae634968cbe1e2343b1c6918226d Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 2 Feb 2013 02:35:08 +0000 Subject: QScroller was introduced in Qt 5.0, not 4.8 Task-number: QTBUG-29365 Change-Id: I11804bf51f1537dcd7f40d7ec02022d8fb76c1e8 Reviewed-by: Jerome Pasion --- src/widgets/util/qscroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/util') diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index baa1ab2e9a..1670d0ab57 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -234,7 +234,7 @@ private: /*! \class QScroller \brief The QScroller class enables kinetic scrolling for any scrolling widget or graphics item. - \since 4.8 + \since 5.0 \inmodule QtWidgets -- cgit v1.2.3