Fix Minecraft window focus
This commit is contained in:
parent
74e54a016c
commit
ea15c978ba
2 changed files with 13 additions and 4 deletions
|
|
@ -218,6 +218,11 @@ impl ManagedProcess {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Java AWT/Swing applications (like Minecraft) need this to work properly
|
||||||
|
// on non-reparenting window managers like Sway. Without this, Java apps may
|
||||||
|
// have focus issues or render incorrectly.
|
||||||
|
cmd.env("_JAVA_AWT_WM_NONREPARENTING", "1");
|
||||||
|
|
||||||
// Special handling for WAYLAND_DISPLAY:
|
// Special handling for WAYLAND_DISPLAY:
|
||||||
// If SHEPHERD_WAYLAND_DISPLAY is set, use that instead of the inherited value.
|
// If SHEPHERD_WAYLAND_DISPLAY is set, use that instead of the inherited value.
|
||||||
// This allows apps to be launched on a nested compositor while the daemon
|
// This allows apps to be launched on a nested compositor while the daemon
|
||||||
|
|
|
||||||
12
sway.conf
12
sway.conf
|
|
@ -58,10 +58,14 @@ for_window [app_id="shepherd-launcher"] fullscreen enable
|
||||||
for_window [class=".*"] fullscreen enable, border none, title_format ""
|
for_window [class=".*"] fullscreen enable, border none, title_format ""
|
||||||
for_window [app_id=".*"] fullscreen enable, border none, title_format ""
|
for_window [app_id=".*"] fullscreen enable, border none, title_format ""
|
||||||
|
|
||||||
# Minecraft-specific rules (XWayland Electron app)
|
# Minecraft Launcher (Electron app) and Minecraft Java Edition (game)
|
||||||
for_window [class="Minecraft.*"] fullscreen enable, border none
|
# Launcher: class="Minecraft Launcher" instance="minecraft-launcher"
|
||||||
for_window [class="minecraft-launcher"] fullscreen enable, border none
|
# Game: class="Minecraft 1.21.11" instance="Minecraft 1.21.11" (version varies)
|
||||||
for_window [title="Minecraft.*"] fullscreen enable, border none
|
# We add "focus" to ensure the window gets focus when it appears
|
||||||
|
for_window [class="^Minecraft [0-9]"] fullscreen enable, border none, focus
|
||||||
|
for_window [instance="^Minecraft [0-9]"] fullscreen enable, border none, focus
|
||||||
|
for_window [class="^Minecraft Launcher$"] fullscreen enable, border none
|
||||||
|
for_window [instance="^minecraft-launcher$"] fullscreen enable, border none
|
||||||
|
|
||||||
# Disable window decorations (no title bars) - for all windows
|
# Disable window decorations (no title bars) - for all windows
|
||||||
default_border none
|
default_border none
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue