1

In case I want to have an undecorated window (for example, I may paint the decorations myself), is there a way to tell the current X11 window manager that a region of window should be draggable and managed by the window manager? I'm interested in low-level solutions (Xlib, XCB or similar). I'm also looking for as standard solution as possible.

In addition, can I mark an area of window as representing the close button?

I'm asking about this because it'd be great if I could attach additional content on window's decoration. This is inspired by Apple's OS X, where all decorations are plain old NSViews and some (close buttons, etc) can even be accessed in a documented way. Adding additional content is also inspired by OS X, where one can right click on the name of the document associated with the window (on the title bar) and get the path to the document. At the same time, window remains movable even if the application is unresponsive, so the draggable area must have somehow been communicated to the window manager (that is, the WindowServer, right?).

So, if there is a standard way (or a widespread FreeDesktop.org extension, or something else) to do this under X11, I'd love to know about it. :-)

Ivan Vučica
  • 9,529
  • 9
  • 60
  • 111
  • GUI frameworks often do this kind of thing by creating subwindows. Any given "widget" is usually several windows working in concert with each other. Another (simpler) approach is 1) handle the mouse event, but 2) don't do anything unless the mouse x/y is within the desired region. That's pretty much it, as far as "Xlib" :) – paulsm4 Jul 19 '12 at 18:30
  • @paulsm4 Doesn't the window remain unmovable if the app hosting the GUI framework freezes? This is the reason why I asked. – Ivan Vučica Jul 20 '12 at 22:19

1 Answers1

1

No way whatsoever.

X11 doesn't even knows what a window manager is. ICCCM and Freedesktop standards are not much different. They know about window managers but do not mandate any particular way of closing and dragging windows, or indeed the very ability to do such things. So there are no official notions of close buttons or drag corners or title bars, and no API for custom definition of such things.

n. m. could be an AI
  • 112,515
  • 14
  • 128
  • 243
  • Technically, X11 does know what a window manager is. However, X11 also has to account for tiling window managers, where the windows are not free, and should not be movable by dragging anywhere in the window. Therefore, the window manager is free to make the window behave in any way that it sees fit. Basically, X11 says that the window manager gets final say in just about everything. – Matthew May 01 '18 at 13:41
  • OK, but many programs can do this, so I feel like there’s more to say here. Is there some unofficial but widely supported way? Does the application itself handle it? – Heath Mitchell Mar 24 '23 at 15:48