Results 1 to 5 of 5

Thread: setting EWM (extended window manager) hints via Qt4 (X11)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2006
    Posts
    172
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Red face Re: setting EWM (extended window manager) hints via Qt4 (X11)

    hey chicken blood machine (CBM)!!,

    THANKS A MILLION FOR THE HELP!!!


    Well I just want to know a few things in your code.

    1.
    XSetWMHints(QX11Info::display(), static_cast<Window>(this->winId()), hints);

    Please elaborate on the use of QX11Info::display(), and static_cast...
    w.r.t. the given function XSetWMHints();

    2.
    #define QT_XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS"
    #define QT_MWM_HINTS_FUNCTIONS 0x01
    #define QT_MWM_HINTS_DECORATIONS 0x10
    #define QT_MWM_ALL_FUNCS_WITHOUT_RESIZE 0x3C
    #define QT_MWM_ALL_DECOR_WITHOUT_RESIZE_HANDLE 0x7A

    These are all user defined Macros, right? and why the specific Hex values, where did you get these from?

    Do reply,

    Thanks once again

    Nupul

  2. #2
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanked 42 Times in 37 Posts

    Default Re: setting EWM (extended window manager) hints via Qt4 (X11)

    Quote Originally Posted by nupul
    1.
    XSetWMHints(QX11Info::display(), static_cast<Window>(this->winId()), hints);

    Please elaborate on the use of QX11Info::display(), and static_cast...
    w.r.t. the given function XSetWMHints();
    The first arg is the X11 display id being used by your application. This can be accessed with QX11Info::display().

    The second arg to XSetWMHints expects an X11 window id. QWidget::winId() returns the correct value to use here, but out of laziness, I added the cast, because I wasn't sure how the Qt WId type had been defined. Actually, I've just checked and it's defined as an int. A X11 'Window' is defined as an integral type on most implementations, but the cast is just there for thoroughness.

    #define QT_XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS"
    #define QT_MWM_HINTS_FUNCTIONS 0x01
    #define QT_MWM_HINTS_DECORATIONS 0x10
    #define QT_MWM_ALL_FUNCS_WITHOUT_RESIZE 0x3C
    #define QT_MWM_ALL_DECOR_WITHOUT_RESIZE_HANDLE 0x7A

    These are all user defined Macros, right? and why the specific Hex values, where did you get these from?
    I actually copied these values from a Motif header. I wanted to know the values of the MWM (Motif Window manager) hints that I needed, but I did not want my program to rely on Motif in any way. You can ignore these defines and just replace them with the NETWM values that you need to define.

    Let me know how you get on.
    Last edited by Chicken Blood Machine; 29th March 2006 at 23:48.
    Save yourself some pain. Learn C++ before learning Qt.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.