Determine if GTK window in xlib is a subwindow or a top level window

ktb92677

Does anyone know how to determine which windows in a GTK application are "top level windows". What I mean by this is windows that would normally come along with a border (which includes a title and a minimize/maximize button as well as a red 'x'/close button) in any common window manager e.g. text tool tips would not be a top level window because those never get borders, never the less they are still considered windows in x11 (or at least in GTK they are). I have a GTK application running on top of xvfb without any window managers and I noticed that every window is a direct child of the root window for some reason making finding the "top level windows" difficult to find.

Thanks a bunch!

JvO

A popup like you describe is a top-level window precisely because it floats above the window that generated the popup. It can't be a child since then it would be clipped.

What you should check are the hints given to the window manager, more specifically the _NET_WM_WINDOW_TYPE atom(s). (see this link at freedesktop.org or this one at gnome.org). What every application these days does (or should do) is tell the window manager "Hey, I'm a window of type X, please make sure I get decorated properly." A 'normal' window for an application should set the property to _NET_WM_WINDOW_TYPE_NORMAL, while a menu would have _NET_WM_TYPE_POPUP_MENU, a tooltip _NET_WM_TYPE_TOOLTIP, et cetera.

Even though you are not running a window manager the application will still set the property and you can still query it.

Note that a window can have multiple types though in practice this is rarely done; the intent was to have a preferred window type followed by fallback type(s) in case the window manager doesn't support your type of window. So if you get the list of types you must check them all. I'm not sure there's a way to determine which type the window manager eventually uses. At least your 'normal' window should have a supported type.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Determine url of top level window from a multilevel cross domain iframe

From Dev

Top level window in WinForms

From Dev

Top-level window size

From Dev

Top-level window size

From Dev

Closing application window with Xlib

From Dev

How to restore a window with Xlib?

From Dev

Xlib - window is not rendering

From Dev

No maximize button on XLib window

From Dev

Closing application window with Xlib

From Dev

Xlib - window is not rendering

From Dev

Capture global window object of subwindow accounting for refresh

From Dev

C# Finding top-level window

From Dev

Change the title for the default top level window

From Dev

Popup window unable to receive focus when top level window is minimized

From Dev

XLIB C - get window by PID

From Dev

cairo / xlib not updating window content

From Dev

Window on top of another window?

From Dev

What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

From Dev

What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

From Dev

three.js - Trying to include a subwindow into main window

From Dev

Tkinter grid manager can't manage 'top level window' menu

From Dev

How to create a draggable (borderless and titleless) top level window in QT

From Dev

TideSDK bring window to top level on click of system notification

From Dev

Firebreath NPAPI plugin rendering video to top level browser window (HWND)

From Dev

Tkinter grid manager can't manage 'top level window' menu

From Dev

Javascript: Call top-level window function from inside object

From Dev

Writing a compositing window manager with python and xlib

From Dev

How to set Xlib window background transparent?

From Dev

sending fake keypress event to a window using xlib

Related Related

  1. 1

    Determine url of top level window from a multilevel cross domain iframe

  2. 2

    Top level window in WinForms

  3. 3

    Top-level window size

  4. 4

    Top-level window size

  5. 5

    Closing application window with Xlib

  6. 6

    How to restore a window with Xlib?

  7. 7

    Xlib - window is not rendering

  8. 8

    No maximize button on XLib window

  9. 9

    Closing application window with Xlib

  10. 10

    Xlib - window is not rendering

  11. 11

    Capture global window object of subwindow accounting for refresh

  12. 12

    C# Finding top-level window

  13. 13

    Change the title for the default top level window

  14. 14

    Popup window unable to receive focus when top level window is minimized

  15. 15

    XLIB C - get window by PID

  16. 16

    cairo / xlib not updating window content

  17. 17

    Window on top of another window?

  18. 18

    What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

  19. 19

    What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

  20. 20

    three.js - Trying to include a subwindow into main window

  21. 21

    Tkinter grid manager can't manage 'top level window' menu

  22. 22

    How to create a draggable (borderless and titleless) top level window in QT

  23. 23

    TideSDK bring window to top level on click of system notification

  24. 24

    Firebreath NPAPI plugin rendering video to top level browser window (HWND)

  25. 25

    Tkinter grid manager can't manage 'top level window' menu

  26. 26

    Javascript: Call top-level window function from inside object

  27. 27

    Writing a compositing window manager with python and xlib

  28. 28

    How to set Xlib window background transparent?

  29. 29

    sending fake keypress event to a window using xlib

HotTag

Archive