Changeset 1007


Ignore:
Timestamp:
Aug 19, 2011, 12:33:16 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: Do not attempt to natively hide widgets with no handle.

This would just always fail due to an invalid window handle being
passed to the PM APIs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r986 r1007  
    18041804}
    18051805
     1806/*
     1807    \internal
     1808    Platform-specific part of QWidget::hide().
     1809*/
    18061810void QWidgetPrivate::hide_sys()
    18071811{
     
    18101814    Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
    18111815    if (q->windowFlags() != Qt::Desktop) {
    1812         ULONG fl = SWP_HIDE;
    1813         if (q->isWindow() && frameWinId() != NULLHANDLE) {
    1814             if ((q->windowFlags() & Qt::Popup) != Qt::Popup)
    1815                 fl |= SWP_DEACTIVATE;
    1816         }
    1817         qt_WinSetWindowPos(frameWinId(), 0, 0, 0, 0, 0, fl);
    1818         HSWITCH swEntry = maybeTopData() ? maybeTopData()->swEntry : NULLHANDLE;
    1819         if (swEntry != NULLHANDLE) {
    1820             SWCNTRL swc;
    1821             WinQuerySwitchEntry(swEntry, &swc);
    1822             swc.uchVisibility = SWL_INVISIBLE;
    1823             WinChangeSwitchEntry(swEntry, &swc);
     1816        HWND wid = frameWinId();
     1817        if (wid != NULLHANDLE) {
     1818            ULONG fl = SWP_HIDE;
     1819            if (q->isWindow()) {
     1820                if ((q->windowFlags() & Qt::Popup) != Qt::Popup)
     1821                    fl |= SWP_DEACTIVATE;
     1822            }
     1823            qt_WinSetWindowPos(wid, 0, 0, 0, 0, 0, fl);
     1824            HSWITCH swEntry = maybeTopData() ? maybeTopData()->swEntry : NULLHANDLE;
     1825            if (swEntry != NULLHANDLE) {
     1826                SWCNTRL swc;
     1827                WinQuerySwitchEntry(swEntry, &swc);
     1828                swc.uchVisibility = SWL_INVISIBLE;
     1829                WinChangeSwitchEntry(swEntry, &swc);
     1830            }
    18241831        }
    18251832    }
     
    18331840}
    18341841
     1842/*
     1843    \internal
     1844    Platform-specific part of QWidget::show().
     1845*/
    18351846void QWidgetPrivate::show_sys()
    18361847{
     
    18461857    }
    18471858
    1848     if (frameWinId() != NULLHANDLE) {
     1859    HWND wid = frameWinId();
     1860    if (wid != NULLHANDLE) {
    18491861        ULONG fl = SWP_SHOW;
    18501862        if (q->isWindow()) {
     
    18651877        }
    18661878
    1867         qt_WinSetWindowPos(frameWinId(), 0, 0, 0, 0, 0, fl);
     1879        qt_WinSetWindowPos(wid, 0, 0, 0, 0, 0, fl);
    18681880
    18691881        if (q->isWindow()) {
     
    18781890                if (!swEntry) {
    18791891                    // lazily create a new window list entry
    1880                     HWND id = frameWinId();
    18811892                    PID pid;
    1882                     WinQueryWindowProcess(id, &pid, NULL);
     1893                    WinQueryWindowProcess(wid, &pid, NULL);
    18831894                    SWCNTRL swc;
    18841895                    memset(&swc, 0, sizeof(SWCNTRL));
    1885                     swc.hwnd = id;
     1896                    swc.hwnd = wid;
    18861897                    swc.idProcess = pid;
    18871898                    swc.uchVisibility = SWL_VISIBLE;
    18881899                    swc.fbJump = SWL_JUMPABLE;
    1889                     WinQueryWindowText(id, sizeof(swc.szSwtitle), swc.szSwtitle);
     1900                    WinQueryWindowText(wid, sizeof(swc.szSwtitle), swc.szSwtitle);
    18901901                    swEntry = WinAddSwitchEntry(&swc);
    18911902                } else {
     
    18971908            }
    18981909
    1899             ULONG wstyle = WinQueryWindowULong(frameWinId(), QWL_STYLE);
     1910            ULONG wstyle = WinQueryWindowULong(wid, QWL_STYLE);
    19001911            if (wstyle & WS_MINIMIZED)
    19011912                data.window_state |= Qt::WindowMinimized;
Note: See TracChangeset for help on using the changeset viewer.