Skip to content

Improve full-screen toggling behaviour - #1190

Draft
hamburg3rz wants to merge 1 commit into
mahkoh:masterfrom
hamburg3rz:main
Draft

Improve full-screen toggling behaviour#1190
hamburg3rz wants to merge 1 commit into
mahkoh:masterfrom
hamburg3rz:main

Conversation

@hamburg3rz

Copy link
Copy Markdown
Contributor

This pull request adds 2 main things:

  1. Allows switching to another window on the same workspace while a window is full-screen by temporarily exiting full-screen. For example, using a window switcher to switch to another window while full-screen will now allow that new window to be focused properly. Previously, this only worked when switching to a window on a different workspace.
  2. Adds a new setting, restore-fullscreen-on-reselect, which defaults to false. 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.

Comment thread jay-config/src/_private/ipc.rs
Comment thread jay-config/src/lib.rs
set_float_above_fullscreen(!get_float_above_fullscreen())
}

/// Sets whether a temporarily unfullscreened window is restored to fullscreen when it is reselected.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"selected" is not a concept that exists in Jay. I don't know what it means.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is highly suspicious. Why is this here?

Comment thread src/tree/workspace.rs
Comment on lines +663 to +664
if let Some(fs) = self.node_state[LiveTL].fullscreen.get() {
fs.clone().tl_set_fullscreen(false, None);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be wrong if _child is the fullscreen toplevel.

@mahkoh

mahkoh commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Adds a new setting, restore-fullscreen-on-reselect, which defaults to false. 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.

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.

@hamburg3rz

hamburg3rz commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

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

@mahkoh

mahkoh commented Aug 17, 2026

Copy link
Copy Markdown
Owner

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.

I don't know about Niri, but on KDE a window does not exit fullscreen when switching to another window.

@hamburg3rz

Copy link
Copy Markdown
Contributor Author

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

@mahkoh

mahkoh commented Aug 17, 2026

Copy link
Copy Markdown
Owner

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.

@hamburg3rz

Copy link
Copy Markdown
Contributor Author

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.

@mahkoh mahkoh closed this Aug 19, 2026
@mahkoh mahkoh reopened this Aug 19, 2026
@mahkoh

mahkoh commented Aug 23, 2026

Copy link
Copy Markdown
Owner

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.

  • Create a new toplevel node type, say PendingFullscreen.
  • PendingFullscreen has as a child another ToplevelNode.
  • PendingFullscreen is rendered by rendering the underlying ToplevelNode and on top an overlay that says something to the effect of "left click to re-fullscreen this node / right click to dismiss".
  • When performing any click, the PendingFullscreen node is first replaced by the ToplevelNode. Then, if the click was a left click, the ToplevelNode is fullscreened.

What do you think?

@hamburg3rz

Copy link
Copy Markdown
Contributor Author
* PendingFullscreen is rendered by rendering the underlying ToplevelNode and on top an overlay that says something to the effect of "left click to re-fullscreen this node / right click to dismiss".

* When performing any click, the PendingFullscreen node is first replaced by the ToplevelNode. Then, if the click was a left click, the ToplevelNode is fullscreened.

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

@mahkoh

mahkoh commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Maybe the overlay could only appear when the mouse is over the window.

@hamburg3rz
hamburg3rz marked this pull request as draft August 25, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants