mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-22 16:48:33 +02:00
feat(wm): add native window maximization toggle
Windows that have been maximized do not retain their maximized state across workspaces as workspaces are built on top of sending SW_HIDE and SW_SHOW events which at various points of the event loop end up overriding SW_SHOWMAXIMIZED and SW_SHOWMAXIMIZE. To handle this use case, I have added a new 'komorebic toggle-maximize' command which sends SW_MAXIMIZE for a window and keeps a record of the window in the focused workspace in the same way that monocle windows are tracked. In this way, komorebi can know when switching to a workspace if it has to restore a window to a native maximized state. Some additional edge cases are caught in this commit in showing and hiding workspaces, to also account for floating windows and monocle containers. resolve #12
This commit is contained in:
@@ -250,6 +250,8 @@ enum SubCommand {
|
||||
ToggleFloat,
|
||||
/// Toggle monocle mode for the focused container
|
||||
ToggleMonocle,
|
||||
/// Toggle native maximization for the focused window
|
||||
ToggleMaximize,
|
||||
/// Restore all hidden windows (debugging command)
|
||||
RestoreWindows,
|
||||
/// Reload ~/komorebi.ahk (if it exists)
|
||||
@@ -341,6 +343,9 @@ fn main() -> Result<()> {
|
||||
SubCommand::ToggleMonocle => {
|
||||
send_message(&*SocketMessage::ToggleMonocle.as_bytes()?)?;
|
||||
}
|
||||
SubCommand::ToggleMaximize => {
|
||||
send_message(&*SocketMessage::ToggleMaximize.as_bytes()?)?;
|
||||
}
|
||||
SubCommand::WorkspaceLayout(arg) => {
|
||||
send_message(
|
||||
&*SocketMessage::WorkspaceLayout(arg.monitor, arg.workspace, arg.value)
|
||||
|
||||
Reference in New Issue
Block a user