-
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
Do we need WindowHandle::set_level
?
#1824
Comments
|
Sounds like "always on top should not be a window level", but rather another property that can be controlled separately. And in window builder it has three states, "on", "off", "default", where "default" depends on the window level and implements the current behaviour. |
That sounds reasonable. But in addition, I think that always-on-top is a property that potentially makes sense to change after a window is displayed. Whereas (at least on windows and gtk/x11) the tooltip/dialog/whatever hints are things that can only be set once when the window is created. |
In order to work well with GTK4/wayland the window level needs to be known at creation time. I dont see a use of changing it after the fact anyways, why would you repurpose a window instead of creating a new one? |
Yes but that is diferent from always on top. Any window can be always on top in GTK(3/4), and this can be changed at any time using |
Uhm. Correct me if I am wrong, but neither of these functions is "always on top". The first one is for "window From the docs of
This does not even talk about "always on top", at least not in the way I understood it. I'd recommend
|
Yes, but you cannot ever force a window manager to do anything. Not all follow the exact spec, and some provide more than the exact spec.
It does:
That sounds like always on top to me, assuming the WM allows for that.
I would do the opposite, going this path would probably work with GTK3/X11 but as documented in GDK3 (https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/gdkwindow.c#L11001) this only works under X11, not Wayland. |
I just scrolled through the source code for the platforms. There are 2 platforms for which this is actually implemented: GTK and macos. This does seem to work on macos, going off reading online people discussing However, how much is it worth keeping this just for macos? |
If something is only used for a single platform, I think it's probably best to put it behind some platform-specific trait. |
Maybe we could remove this for now, then use this as an example for platform specific extensions and put that on the pile of things to think about with dynamic platform switching. I feel like they are very much related. EDIT: |
I could imagine eventually wanting to have the ability to move a window to the front or to the back, or to move one of an application's windows behind another one of that application's windows. Is |
On x11 (and this is reflected in the gtk3 API, not sure about gtk4), there is a concept of "window type hint" that's independent of the stacking order. I think you're expected to set the window type hint -- which includes things like "tooltip", "menu", "splash", "dialog", "popup menu" -- before showing the window, but you can change the stacking order at any time. |
IIRC i've never seen success in bringing a window behind another on X11 (as opposed to moving a window in front of another). Anyhow i've definitely had issues with this sort of thing on (plain old x11). |
in GTK4 you can set the window to be transient to another window or modal at any time, but you cannot change something from a popup to a window without rebuilding the entire window. Maybe something similar like |
No idea how well this is implemented in WMs, but at least ICCCM specifies how to stack a window relative to a sibling:
|
I think its clear for linux platforms already. We can use specify things like modal and transient bring windows in front of another window (which is what we want from the API). The internals of this may differ on X11/GTK/wayland, but it seems to be possible on all of them. On mac all things are possible, so thats not an issue either. How does the windows platform handle changing the order after window creation? If it is not possible on windows than this will have to be a platform specific API anyways. |
Yeah, I've never seen one which does implement it (or at the very least none of the common ones at the time), IIRC the GNUstep code (implementing the Mac OS model on X11) which implements this uses an O(n) operation of placing a window, then placing the windows above it with heigher level above, rather than an O(1) operation of placing a window below relative-to a window with higher level. Which as you would expect caused all kinds of window flickering as it went through the window list. I guess all I'm saying is trying to mirror the Mac model with its full generality on X11 leads to a pretty sub-par experience. |
Closed by #1919 |
* Removing `WindowHandle::set_level` as per issue linebender#1824
Support subwindow positioning in windows. Removes `WindowHandle::set_level` as per issue #1824
Is it ever necessary to change the window level after it's already created? For windows that aren't yet created, we have
WindowBuilder::set_level
. There was some concern in #1785 whetherWindowHandle::set_level
will work on x11, but I don't know about any other platforms...The text was updated successfully, but these errors were encountered: