Changeset 846 for trunk/src/gui/kernel/qwidget_win.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qwidget_win.cpp
r807 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 48 48 #include "qimage.h" 49 49 #include "qlayout.h" 50 #include "qlibrary.h"51 50 #include "qpainter.h" 52 51 #include "qstack.h" … … 66 65 #include <private/qwininputcontext_p.h> 67 66 #include <private/qpaintengine_raster_p.h> 67 #include <private/qsystemlibrary_p.h> 68 68 69 69 #if defined(Q_WS_WINCE) … … 71 71 QT_USE_NAMESPACE 72 72 extern void qt_wince_maximize(QWidget *widget); //defined in qguifunctions_wince.cpp 73 extern void qt_wince_unmaximize(QWidget *widget); //defined in qguifunctions_wince.cpp 73 74 extern void qt_wince_minimize(HWND hwnd); //defined in qguifunctions_wince.cpp 74 75 extern void qt_wince_full_screen(HWND hwnd, bool fullScreen, UINT swpf); //defined in qguifunctions_wince.cpp … … 124 125 static PtrWTQueueSizeGet ptrWTQueueSizeGet = 0; 125 126 static PtrWTQueueSizeSet ptrWTQueueSizeSet = 0; 127 #ifndef QT_NO_TABLETEVENT 126 128 static void init_wintab_functions(); 127 129 static void qt_tablet_init(); 128 130 static void qt_tablet_cleanup(); 131 #endif // QT_NO_TABLETEVENT 129 132 extern HCTX qt_tablet_context; 130 133 extern bool qt_tablet_tilt_support; … … 137 140 138 141 extern bool qt_is_gui_used; 142 143 #ifndef QT_NO_TABLETEVENT 139 144 static void init_wintab_functions() 140 145 { … … 144 149 if (!qt_is_gui_used) 145 150 return; 146 Q Library library(QLatin1String("wintab32"));151 QSystemLibrary library(QLatin1String("wintab32")); 147 152 ptrWTOpen = (PtrWTOpen)library.resolve("WTOpenW"); 148 153 ptrWTInfo = (PtrWTInfo)library.resolve("WTInfoW"); … … 162 167 qt_tablet_widget->createWinId(); 163 168 qt_tablet_widget->setObjectName(QLatin1String("Qt internal tablet widget")); 164 // We don t need this internal widget to appear in QApplication::topLevelWidgets()169 // We don't need this internal widget to appear in QApplication::topLevelWidgets() 165 170 if (QWidgetPrivate::allWidgets) 166 171 QWidgetPrivate::allWidgets->remove(qt_tablet_widget); … … 228 233 qt_tablet_widget = 0; 229 234 } 235 #endif // QT_NO_TABLETEVENT 230 236 231 237 const QString qt_reg_winclass(QWidget *w); // defined in qapplication_win.cpp … … 244 250 static HHOOK journalRec = 0; 245 251 246 extern "C" LRESULT CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);252 extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM); 247 253 248 254 #define XCOORD_MAX 16383 … … 513 519 } 514 520 521 #ifndef QT_NO_TABLETEVENT 515 522 if (q != qt_tablet_widget && QWidgetPrivate::mapper) 516 523 qt_tablet_init(); 524 #endif // QT_NO_TABLETEVENT 517 525 518 526 if (q->testAttribute(Qt::WA_DropSiteRegistered)) … … 538 546 { 539 547 Q_D(QWidget); 548 d->aboutToDestroy(); 540 549 if (!isWindow() && parentWidget()) 541 550 parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry())); … … 826 835 // The procedure does nothing, but is required for mousegrabbing to work 827 836 #ifndef Q_WS_WINCE 828 LRESULT CALLBACK qJournalRecordProc(int nCode, WPARAM wParam, LPARAM lParam)837 LRESULT QT_WIN_CALLBACK qJournalRecordProc(int nCode, WPARAM wParam, LPARAM lParam) 829 838 { 830 839 return CallNextHookEx(journalRec, nCode, wParam, lParam); … … 1093 1102 invalidateBuffer(q->rect()); 1094 1103 return; 1104 } 1105 1106 if (data.window_flags & Qt::Window) { 1107 QTLWExtra *extra = topData(); 1108 if (!extra->hotkeyRegistered) { 1109 // Try to set the hotkey using information from STARTUPINFO 1110 STARTUPINFO startupInfo; 1111 GetStartupInfo(&startupInfo); 1112 // If STARTF_USEHOTKEY is set, hStdInput is the virtual keycode 1113 if (startupInfo.dwFlags & 0x00000200) { 1114 WPARAM hotKey = (WPARAM)startupInfo.hStdInput; 1115 SendMessage(data.winid, WM_SETHOTKEY, hotKey, 0); 1116 } 1117 extra->hotkeyRegistered = 1; 1118 } 1095 1119 } 1096 1120 … … 1142 1166 if (IsZoomed(q->internalWinId())) 1143 1167 data.window_state |= Qt::WindowMaximized; 1168 // This is to resolve the problem where popups are opened from the 1169 // system tray and not being implicitly activated 1170 if (q->windowType() == Qt::Popup && 1171 !q->parentWidget() && !qApp->activeWindow()) 1172 q->activateWindow(); 1144 1173 } 1145 1174 … … 1519 1548 if (data.window_flags & Qt::MSWindowsFixedSizeDialogHint) 1520 1549 return false; 1521 // if the user explicit ely asked for the maximize button, we try to add1550 // if the user explicitly asked for the maximize button, we try to add 1522 1551 // it even if the window has fixed size. 1523 1552 if (data.window_flags & Qt::CustomizeWindowHint && … … 1688 1717 void QWidgetPrivate::createTLSysExtra() 1689 1718 { 1719 extra->topextra->hotkeyRegistered = 0; 1690 1720 extra->topextra->savedFlags = 0; 1691 1721 extra->topextra->winIconBig = 0; … … 1861 1891 if (!function_resolved) { 1862 1892 ptrSetLayeredWindowAttributes = 1863 (PtrSetLayeredWindowAttributes) Q Library::resolve(QLatin1String("user32"),1893 (PtrSetLayeredWindowAttributes) QSystemLibrary::resolve(QLatin1String("user32"), 1864 1894 "SetLayeredWindowAttributes"); 1865 1895 function_resolved = true; … … 2048 2078 void QWidgetPrivate::winSetupGestures() 2049 2079 { 2050 #if !defined(QT_NO_ NATIVE_GESTURES)2080 #if !defined(QT_NO_GESTURES) && !defined(QT_NO_NATIVE_GESTURES) 2051 2081 Q_Q(QWidget); 2052 2082 if (!q || !q->isVisible() || !nativeGesturePanEnabled)
Note:
See TracChangeset
for help on using the changeset viewer.