mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: Windows in native fullscreen minimise when switching workspaces #545
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @flipfloppy1 on GitHub (Dec 19, 2024).
Summary
Windows in native fullscreen mode minimise when switching between workspaces. The behaviour I would expect is that the workspace maintains the state it was left in (as is the case in i3/sway), hence ensuring the window is maximised when the user returns to the workspace that had the maximised window.
This has happened with apps using many different graphics frameworks for window handling (SDL, GLFW, Unity, etc.) which is why I assume it's an issue with komorebi.
I run komorebi with administrator privileges so it can manage almost all windows, but the issue happens whether it's run in administrator mode or not. I've tried changing the
window_hiding_behaviourto hide and minimize but both of them exhibit the same behaviour.This is tangentially related to #805 and the workaround I mentioned there
Version Information
OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.22631 N/A Build 22631
komorebic 0.1.31
tag:v0.1.31
commit_hash:40c55dec
build_time:2024-12-14 00:54:06 +00:00
build_env:rustc 1.83.0 (90b35a623 2024-11-26),stable-x86_64-pc-windows-msvc
Komorebi Configuration
Hotkey Configuration
#Requires AutoHotkey v2.0.2
#SingleInstance Force
Komorebic(cmd) {
RunWait(format("komorebic.exe {}", cmd), , "Hide")
}
#+q::Komorebic("close")
#m::Komorebic("minimize")
; Focus windows
#h::Komorebic("focus left")
#j::Komorebic("focus down")
#k::Komorebic("focus up")
#l::Komorebic("focus right")
#+[::Komorebic("cycle-focus previous")
#+]::Komorebic("cycle-focus next")
; Move windows
#+h::Komorebic("move left")
#+j::Komorebic("move down")
#+k::Komorebic("move up")
#+l::Komorebic("move right")
; Stack windows
#Left::Komorebic("stack left")
#Down::Komorebic("stack down")
#Up::Komorebic("stack up")
#Right::Komorebic("stack right")
#;::Komorebic("unstack")
#[::Komorebic("cycle-stack previous")
#]::Komorebic("cycle-stack next")
; Resize
#=::Komorebic("resize-axis horizontal increase")
#-::Komorebic("resize-axis horizontal decrease")
#+=::Komorebic("resize-axis vertical increase")
#+_::Komorebic("resize-axis vertical decrease")
; Manipulate windows
#+Space::Komorebic("toggle-float")
#Space::
#f::
{
Komorebic("toggle-maximize")
}
; Window manager options
#+r::Komorebic("retile")
#p::Komorebic("toggle-pause")
; Create windows
#Enter::Run "wt"
#c::Run "chrome"
#e::Run "devenv"
#d::!Space
; Layouts
#x::Komorebic("flip-layout horizontal")
#y::Komorebic("flip-layout vertical")
; Workspaces
#1::Komorebic("focus-workspace 0")
#2::Komorebic("focus-workspace 1")
#3::Komorebic("focus-workspace 2")
#4::Komorebic("focus-workspace 3")
#5::Komorebic("focus-workspace 4")
#6::Komorebic("focus-workspace 5")
#7::Komorebic("focus-workspace 6")
#8::Komorebic("focus-workspace 7")
; Move windows across workspaces
#+1::Komorebic("move-to-workspace 0")
#+2::Komorebic("move-to-workspace 1")
#+3::Komorebic("move-to-workspace 2")
#+4::Komorebic("move-to-workspace 3")
#+5::Komorebic("move-to-workspace 4")
#+6::Komorebic("move-to-workspace 5")
#+7::Komorebic("move-to-workspace 6")
#+8::Komorebic("move-to-workspace 7")
Output of komorebic check
No KOMOREBI_CONFIG_HOME detected, defaulting to %USERPROFILE%
Looking for configuration files in %USERPROFILE%
Found komorebi.json; this file can be passed to the start command with the --config flag
No ~/.config/whkdrc found; you may not be able to control komorebi with your keyboard
@alex-ds13 commented on GitHub (Dec 19, 2024):
If you set a window to maximize by using the command
komorebic toggle-maximizethen komorebi will know about it and will keep the window maximized when you move back to that workspace. If you however maximize the window by any other means (like pressing the maximize button) then komorebi won't know the window is actually maximized and will tile it again when you move back to the workspace.Also is that really your komorebi configuration? Because you don't have any
"monitors":with any"workspaces":set and you are talking about moving between workspaces...Another thing, this part from your AHK config seems weird, I don't know anything about AHK so it might be ok though:
#Space::doesn't have anything to run apparently and#fhas the command between{}, I don't know if that is normal or not...EDIT: Ok apparently that is for having multiple hotkeys do the same action, so both
#Spaceand#fwill do the same... TIL 😄@flipfloppy1 commented on GitHub (Dec 20, 2024):
I understand using komorebi's
toggle-maximiseis a workaround for this, but the title bar of the window still shows when maximising the window that way. Sorry I didn’t make this clear in the bug report 😅I only have one monitor, so I’m not sure if the monitor configuration is required. Either way, switching workspaces works as I would expect.
@LGUG2Z commented on GitHub (Dec 20, 2024):
Windows does not emit an event when an application goes into or leaves fullscreen mode (usually with F11) - if this is important to you, you should open a ticket with Microsoft if you are a paying customer of Windows.
The lack of events means that there is nothing for komorebi (or any other window manager) to respond to.
The same is true when maximizing and restoring a window, however in that case we manually track the state if the user triggers maximization via
komorebic. I believe we could follow a similar approach and implement atoggle-full-screencommand which will manually track this window state.I don't think this is something that I'll personally work on but I'm happy to consider and provide guidance/feedback on PRs.
On a high level:
Do whatever gets done with maximized windows in the Workspace state:
c64a42bca5/komorebi/src/workspace.rs (L63)Figure out the win32 API calls to toggle this window mode in the same way that F11 does
Write safe wrappers for those calls in
windows_api.rsand call themAdd a
ToggleFullScreenSocketMessage, handle it inprocess_command.rsAdd a
komorebiccommand to allow emitting the new message via the terminal and a keybind@flipfloppy1 commented on GitHub (Dec 20, 2024):
If Windows doesn’t provide any events for this it may be easier to have removing the title bar configurable via applications.json or komorebi.json as per #805, since removing the title bar and running
komorebic toggle-maximizeis graphically identical to F11 in most cases.@LGUG2Z commented on GitHub (Dec 20, 2024):
For now there is an imperative way to add identifiers for this use case; I don't know off the top of my head if this allowlist can take the full range of matchers that would be required to add it to the JSON config, but we can probably get that in for the next release.
@flipfloppy1 commented on GitHub (Dec 20, 2024):
That would be great! And thank you for the work that you do on this amazing WM. It's very nice to have a reliable tiling window manager in Windows.
IIRC, only the
exeidentifier works inkomorebic remove-title-bar@LGUG2Z commented on GitHub (Dec 27, 2024):
79eda30f48@LGUG2Z commented on GitHub (Jan 23, 2025):
With a recent version of whkd you can now also have this bind which will keep a window maximized when switching between workspaces: