Implement some window properties for x11 shell#1785
Implement some window properties for x11 shell#1785maan2003 merged 6 commits intolinebender:masterfrom
Conversation
|
Also, dropdown example from nursery is now functional on x11 backend. |
psychon
left a comment
There was a problem hiding this comment.
I just received a notification due to jneem's comments and apparently I have an old, unsubmitted review laying around... huh?
| if let WindowLevel::DropDown = level { | ||
| log_x11!(conn.change_window_attributes( | ||
| self.id, | ||
| &ChangeWindowAttributesAux::new().override_redirect(1), |
There was a problem hiding this comment.
Uhm. Making a window override-redirect after it is already shown sounds like a bad idea.
Can you somehow make this only work before the window is mapped? However, no idea how to do easily do so...
There was a problem hiding this comment.
Could we remove the window-level-changing methods from WindowHandle and only allow them on WindowBuilder? Is there a use case on any platform for changing a WindowLevel after the window was created?
There was a problem hiding this comment.
Looks like gtk backend is also doing this
There was a problem hiding this comment.
Hm, you are right. Gtk really does this: https://github.com/GNOME/gtk/blob/77f32a69c0a35ffd3a1a542a6057c1c6d13c793d/gdk/x11/gdkwindow-x11.c#L3534-L3553
Still seems like a really bad idea to me. If the WM already reparented the window, the resulting state will not work properly. You can move and resize your window insides of the WM's container window, but the container itself is not affected / does not follow...
|
Thanks! I was actually wondering if we need |
|
either |
|
Well, since you are not assigning a window gravity (and IMO you should not), the functions might not really do exactly what you expect. The ConfigureRequest generated by Both positions are correct, they just do not "do the same thing". Which one is correct depends on the exact definition of these method (and I guess is not really defined). Edit: Never mind, I am now confused by Edit: My new guess is that the positions returns is off by two times the size of the window decoration. One of these comes from my comment in |
| let geom = conn.get_geometry(window.id)?.reply()?; | ||
| let cord = conn | ||
| .translate_coordinates(window.id, geom.root, geom.x, geom.y)? | ||
| .reply()?; |
There was a problem hiding this comment.
Shouldn't the above be translate_coordinates(window.id, geom.root, 0, 0)? You want to know which coordinates the point (0,0) in your window has in the root window. As written, this function figures out the position of the window inside of its parent window (which will be the size of the top/left window decorations in a reparenting WM) and then translates this to the root window.
|
|
|
No idea if it is possible with xmonad for a window to request to be floating, but I would expect that a floating window requesting position (0,0) will end up with its window decorations off-screen. :-( |





Implements: