-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement some window properties for x11 shell #1785
Conversation
Also, dropdown example from nursery is now functional on x11 backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like gtk backend is also doing this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
|
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: