Ignore:
Timestamp:
Apr 2, 2006, 12:41:47 AM (19 years ago)
Author:
dmik
Message:

Implemented the OS/2 version of the QSessionManager class (see ticket:15 for more details); QT_NO_SESSIONMANAGER is no more defined by default.

File:
1 edited

Legend:

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

    r75 r77  
    6464// defined in qapplication_pm.cpp
    6565extern void qt_sendBlocked( QObject *obj, QWidget *modal, QEvent *e, bool override );
     66#if !defined (QT_NO_SESSIONMANAGER)
     67extern bool qt_about_to_destroy_wnd;
     68#endif
    6669
    6770static QWidget *mouseGrb    = 0;
     
    598601#endif
    599602
     603/*!
     604 * \internal
     605 * For some unknown reason, PM sends WM_SAVEAPPLICATION to every window
     606 * being destroyed, which makes it indistinguishable from WM_SAVEAPPLICATION
     607 * sent to top level windows during system shutdown. We use our own version of
     608 * WinDestroyWindow() and a special flag (qt_about_to_destroy_wnd) to
     609 * distinguish it in qapplication_pm.cpp.
     610 */
     611static BOOL qt_WinDestroyWindow( HWND hwnd )
     612{
     613#if !defined (QT_NO_SESSIONMANAGER)
     614    qt_about_to_destroy_wnd = TRUE;
     615#endif
     616    BOOL rc = WinDestroyWindow( hwnd );
     617#if !defined (QT_NO_SESSIONMANAGER)
     618    qt_about_to_destroy_wnd = FALSE;
     619#endif
     620    return rc;
     621}
     622
    600623static void removeSysMenuAccels( HWND frame )
    601624{
     
    808831            fcData.idResources = 0;
    809832#if !defined(QT_NO_DEBUG) && defined(QT_DEBUGWINCREATEDESTROY)
    810             qDebug(
    811                 "|Creating top level window [%s] (frame):\n"
    812                 "|  owner = %08lX\n"
    813                 "|  title = '%s'\n"
    814                 "|  style = %08lX\n"
    815                 "|  fcFlags = %08lX",
    816                 name(), ownerw, title, fStyle, fcFlags
    817             );
     833            qDebug ( "|Creating top level window [%s/%s] (frame):\n"
     834                     "|  owner = %08lX\n"
     835                     "|  title = '%s'\n"
     836                     "|  style = %08lX\n"
     837                     "|  fcFlags = %08lX",
     838                     name(), this->className(), ownerw, title, fStyle, fcFlags );
    818839#endif
    819840            fId = WinCreateWindow(
     
    838859            // create client
    839860#if !defined(QT_NO_DEBUG) && defined(QT_DEBUGWINCREATEDESTROY)
    840             qDebug(
    841                 "|Creating top level window [%s] (client):\n"
    842                 "|  owner & parent = %08lX\n"
    843                 "|  class = '%s'\n"
    844                 "|  title = '%s'\n"
    845                 "|  style = %08lX",
    846                 name(), fId, pszClassName, title, style
    847             );
     861            qDebug( "|Creating top level window [%s/%s] (client):\n"
     862                    "|  owner & parent = %08lX\n"
     863                    "|  class = '%s'\n"
     864                    "|  title = '%s'\n"
     865                    "|  style = %08lX",
     866                    name(), this->className(), fId, pszClassName, title, style );
    848867#endif
    849868            // note that we place the client on top (HWND_TOP) to exclude other
     
    855874        } else {
    856875#if !defined(QT_NO_DEBUG) && defined(QT_DEBUGWINCREATEDESTROY)
    857             qDebug(
    858                 "|Creating top level window [%s]:\n"
    859                 "|  owner = %08lX\n"
    860                 "|  class = '%s'\n"
    861                 "|  title = '%s'\n"
    862                 "|  style = %08lX",
    863                 name(), ownerw, pszClassName, title, style
    864             );
     876            qDebug( "|Creating top level window [%s/%s]:\n"
     877                    "|  owner = %08lX\n"
     878                    "|  class = '%s'\n"
     879                    "|  title = '%s'\n"
     880                    "|  style = %08lX",
     881                    name(), this->className(), ownerw, pszClassName, title, style );
    865882#endif
    866883            id = WinCreateWindow(
     
    894911        HWND parentw = parentWidget()->winId();
    895912#if !defined(QT_NO_DEBUG) && defined(QT_DEBUGWINCREATEDESTROY)
    896         qDebug(
    897             "|Creating child window [%s]:\n"
    898             "|  owner & parent = %08lX\n"
    899             "|  class = '%s'\n"
    900             "|  title = '%s'\n"
    901             "|  style = %08lX",
    902             name(), parentw, pszClassName, title, style
    903         );
     913        qDebug( "|Creating child window [%s/%s]:\n"
     914                "|  owner & parent = %08lX\n"
     915                "|  class = '%s'\n"
     916                "|  title = '%s'\n"
     917                "|  style = %08lX",
     918                name(), this->className(), parentw, pszClassName, title, style );
    904919#endif
    905920        id = WinCreateWindow(
     
    9981013            }
    9991014#if !defined(QT_NO_DEBUG) && defined(QT_DEBUGWINCREATEDESTROY)
    1000             qDebug(
    1001                 "|Destroying window:\n"
    1002                 "|  hwnd = %08lX",
    1003                 id
    1004             );
    1005 #endif
    1006             WinDestroyWindow( id );
     1015            qDebug( "|Destroying window [%s/%s]:\n"
     1016                    "|  hwnd = %08lX",
     1017                    name(), className(), id );
     1018#endif
     1019            qt_WinDestroyWindow( id );
    10071020        }
    10081021        setWinId( 0 );
     
    11281141        show();
    11291142    if ( old_winfid )
    1130         WinDestroyWindow( old_winfid );
     1143        qt_WinDestroyWindow( old_winfid );
    11311144
    11321145    reparentFocusWidgets( oldtlw );             // fix focus chains
Note: See TracChangeset for help on using the changeset viewer.