Improve full-screen toggling behaviour - #1190
Conversation
| set_float_above_fullscreen(!get_float_above_fullscreen()) | ||
| } | ||
|
|
||
| /// Sets whether a temporarily unfullscreened window is restored to fullscreen when it is reselected. |
There was a problem hiding this comment.
"selected" is not a concept that exists in Jay. I don't know what it means.
There was a problem hiding this comment.
I didn't want to fullscreen the window again whenever it was focused, because just mousing over it and having it fullscreen could be frustrating. I wanted it to be on a mouse-click or selecting it in a window switcher. I'm not sure what to call it in this case
| let state = self.state.clone(); | ||
| let eng = state.eng.clone(); | ||
| let yield_eng = eng.clone(); | ||
| let future = eng.spawn("refullscreen", async move { |
There was a problem hiding this comment.
I don't usually spawn new futures so liberally.
| let eng = state.eng.clone(); | ||
| let yield_eng = eng.clone(); | ||
| let future = eng.spawn("refullscreen", async move { | ||
| yield_eng.yield_now().await; |
There was a problem hiding this comment.
This is highly suspicious. Why is this here?
| if let Some(fs) = self.node_state[LiveTL].fullscreen.get() { | ||
| fs.clone().tl_set_fullscreen(false, None); |
There was a problem hiding this comment.
This would be wrong if _child is the fullscreen toplevel.
I find this highly surprising. I don't know of any other compositor that behaves like this. KDE doesn't unfullscreen a window and then refullscreen it automatically. |
I suppose I should have specified that it's mostly games that do this. If I'm in a fullscreen game in KDE or Niri for example, alt-tabbing to another window and then alt-tabbing back will return the game to a fullscreen state. Which doesn't happen currently on Jay. Though maybe I took the wrong approach here |
I don't know about Niri, but on KDE a window does not exit fullscreen when switching to another window. |
I suppose KDE isn't actually toggling fullscreen and it's just allowing any window to appear over a fullscreen window if you alt-tab. Maybe I'm just at odds with how a tiling window manager handles these things |
|
I've looked at niri and it seems it also doesn't unfullscreen windows when switching to a different window using the default alt-tab switcher. |
|
But niri allows you to escape that fullscreen window by alt-tabbing (on the same workspace) and then return to that fullscreened window by alt-tabbing back to it. That was my goal really. |
|
I see a potential design here. Mind you I have not thought too much about it, so even if you implement it I might ultimately reject it.
What do you think? |
I like the idea of right-clicking to dismiss. I just think the overlay could be a bit distracting or intrusive in some cases. If you were in a fullscreen browser for example, then you may still want to be able to see your browser window clearly when you exit fullscreen. Maybe the overlay could be a setting you could toggle |
|
Maybe the overlay could only appear when the mouse is over the window. |
This pull request adds 2 main things:
restore-fullscreen-on-reselect, which defaults tofalse. The window that was taken out of full-screen is tracked, and when it is selected again — either by clicking on it or using a window switcher — it is automatically restored to its previous full-screen state. If full-screen is manually exited (by using a keybind) this does not apply.The main aim of this is to make jay behave more like other compositors when dealing with full-screened windows. Please let me know if this can be improved in any way.