Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qwidget_win.cpp

    r807 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4848#include "qimage.h"
    4949#include "qlayout.h"
    50 #include "qlibrary.h"
    5150#include "qpainter.h"
    5251#include "qstack.h"
     
    6665#include <private/qwininputcontext_p.h>
    6766#include <private/qpaintengine_raster_p.h>
     67#include <private/qsystemlibrary_p.h>
    6868
    6969#if defined(Q_WS_WINCE)
     
    7171QT_USE_NAMESPACE
    7272extern void qt_wince_maximize(QWidget *widget);                          //defined in qguifunctions_wince.cpp
     73extern void qt_wince_unmaximize(QWidget *widget);                        //defined in qguifunctions_wince.cpp
    7374extern void qt_wince_minimize(HWND hwnd);                                //defined in qguifunctions_wince.cpp
    7475extern void qt_wince_full_screen(HWND hwnd, bool fullScreen, UINT swpf); //defined in qguifunctions_wince.cpp
     
    124125static PtrWTQueueSizeGet ptrWTQueueSizeGet = 0;
    125126static PtrWTQueueSizeSet ptrWTQueueSizeSet = 0;
     127#ifndef QT_NO_TABLETEVENT
    126128static void init_wintab_functions();
    127129static void qt_tablet_init();
    128130static void qt_tablet_cleanup();
     131#endif // QT_NO_TABLETEVENT
    129132extern HCTX qt_tablet_context;
    130133extern bool qt_tablet_tilt_support;
     
    137140
    138141extern bool qt_is_gui_used;
     142
     143#ifndef QT_NO_TABLETEVENT
    139144static void init_wintab_functions()
    140145{
     
    144149    if (!qt_is_gui_used)
    145150        return;
    146     QLibrary library(QLatin1String("wintab32"));
     151    QSystemLibrary library(QLatin1String("wintab32"));
    147152    ptrWTOpen = (PtrWTOpen)library.resolve("WTOpenW");
    148153    ptrWTInfo = (PtrWTInfo)library.resolve("WTInfoW");
     
    162167    qt_tablet_widget->createWinId();
    163168    qt_tablet_widget->setObjectName(QLatin1String("Qt internal tablet widget"));
    164     // We dont need this internal widget to appear in QApplication::topLevelWidgets()
     169    // We don't need this internal widget to appear in QApplication::topLevelWidgets()
    165170    if (QWidgetPrivate::allWidgets)
    166171        QWidgetPrivate::allWidgets->remove(qt_tablet_widget);
     
    228233    qt_tablet_widget = 0;
    229234}
     235#endif // QT_NO_TABLETEVENT
    230236
    231237const QString qt_reg_winclass(QWidget *w);                // defined in qapplication_win.cpp
     
    244250static HHOOK   journalRec  = 0;
    245251
    246 extern "C" LRESULT CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
     252extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
    247253
    248254#define XCOORD_MAX 16383
     
    513519    }
    514520
     521#ifndef QT_NO_TABLETEVENT
    515522    if (q != qt_tablet_widget && QWidgetPrivate::mapper)
    516523        qt_tablet_init();
     524#endif // QT_NO_TABLETEVENT
    517525
    518526    if (q->testAttribute(Qt::WA_DropSiteRegistered))
     
    538546{
    539547    Q_D(QWidget);
     548    d->aboutToDestroy();
    540549    if (!isWindow() && parentWidget())
    541550        parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
     
    826835// The procedure does nothing, but is required for mousegrabbing to work
    827836#ifndef Q_WS_WINCE
    828 LRESULT CALLBACK qJournalRecordProc(int nCode, WPARAM wParam, LPARAM lParam)
     837LRESULT QT_WIN_CALLBACK qJournalRecordProc(int nCode, WPARAM wParam, LPARAM lParam)
    829838{
    830839    return CallNextHookEx(journalRec, nCode, wParam, lParam);
     
    10931102        invalidateBuffer(q->rect());
    10941103        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        }
    10951119    }
    10961120
     
    11421166        if (IsZoomed(q->internalWinId()))
    11431167            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();
    11441173    }
    11451174
     
    15191548    if (data.window_flags & Qt::MSWindowsFixedSizeDialogHint)
    15201549        return false;
    1521     // if the user explicitely asked for the maximize button, we try to add
     1550    // if the user explicitly asked for the maximize button, we try to add
    15221551    // it even if the window has fixed size.
    15231552    if (data.window_flags & Qt::CustomizeWindowHint &&
     
    16881717void QWidgetPrivate::createTLSysExtra()
    16891718{
     1719    extra->topextra->hotkeyRegistered = 0;
    16901720    extra->topextra->savedFlags = 0;
    16911721    extra->topextra->winIconBig = 0;
     
    18611891    if (!function_resolved) {
    18621892        ptrSetLayeredWindowAttributes =
    1863             (PtrSetLayeredWindowAttributes) QLibrary::resolve(QLatin1String("user32"),
     1893            (PtrSetLayeredWindowAttributes) QSystemLibrary::resolve(QLatin1String("user32"),
    18641894                                                              "SetLayeredWindowAttributes");
    18651895        function_resolved = true;
     
    20482078void QWidgetPrivate::winSetupGestures()
    20492079{
    2050 #if !defined(QT_NO_NATIVE_GESTURES)
     2080#if !defined(QT_NO_GESTURES) && !defined(QT_NO_NATIVE_GESTURES)
    20512081    Q_Q(QWidget);
    20522082    if (!q || !q->isVisible() || !nativeGesturePanEnabled)
Note: See TracChangeset for help on using the changeset viewer.