-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some fullscreen applications iconify when switching workspaces #584
Comments
This is because these games iconify themselves when losing focus if the window was fullscreen ('exclusive fullscreen' or some variation). There is no general workaround, but 'borderless fullscreen window' may prevent that, or turning off fullscreen in the game settings and then manually toggling fullscreen (e.g |
In that case, I think spectrwm would benefit from either making iconification optional - on xmonad, you have to import the Layout.Minimize module, for example - or add the ability to focus on iconified windows via the regular M-j/k bindings. |
For the time being I'm using this patch I wrote: diff --git a/spectrwm.c b/spectrwm.c
index 0737202..e0f6858 100644
--- a/spectrwm.c
+++ b/spectrwm.c
@@ -518,6 +518,7 @@ int maximized_unfocus = SWM_UNFOCUS_RESTORE;
bool maximize_hide_bar = false;
bool maximize_hide_other = false;
bool max_layout_maximize = true;
+bool minimize_windows = true;
bool urgent_enabled = false;
bool urgent_collapse = false;
char *clock_format = NULL;
@@ -2673,7 +2674,9 @@ ewmh_apply_flags(struct ws_win *win, uint32_t pending)
win->ewmh_flags = pending;
if (changed & EWMH_F_HIDDEN) {
- if (HIDDEN(win)) {
+ if (!minimize_windows)
+ return (changed);
+ else if (HIDDEN(win)) {
unmap_window(win);
} else {
/* Reload floating geometry in case region changed. */
@@ -8924,6 +8927,9 @@ raise_toggle(struct swm_screen *s, struct binding *bp, union arg *args)
static void
iconify(struct swm_screen *s, struct binding *bp, union arg *args)
{
+ if (!minimize_windows)
+ return;
+
struct swm_region *r;
struct ws_win *win, *nfw;
bool follow;
@@ -9000,6 +9006,9 @@ get_win_name(xcb_window_t win)
static void
uniconify(struct swm_screen *s, struct binding *bp, union arg *args)
{
+ if (!minimize_windows)
+ return;
+
struct swm_region *r;
struct ws_win *win;
FILE *lfile;
@@ -13304,6 +13313,7 @@ enum {
SWM_S_MAXIMIZE_HIDE_BAR,
SWM_S_MAXIMIZE_HIDE_OTHER,
SWM_S_MAXIMIZED_UNFOCUS,
+ SWM_S_MINIMIZE_WINDOWS,
SWM_S_REGION_PADDING,
SWM_S_SNAP_RANGE,
SWM_S_SPAWN_ORDER,
@@ -13548,6 +13558,9 @@ setconfvalue(uint8_t asop, const char *selector, const char *value, int flags,
return (1);
}
break;
+ case SWM_S_MINIMIZE_WINDOWS:
+ minimize_windows = (atoi(value) != 0);
+ break;
case SWM_S_REGION_PADDING:
region_padding = atoi(value);
if (region_padding < 0)
@@ -14215,6 +14228,7 @@ struct config_option configopt[] = {
{ "maximize_hide_bar", setconfvalue, SWM_S_MAXIMIZE_HIDE_BAR },
{ "maximize_hide_other", setconfvalue, SWM_S_MAXIMIZE_HIDE_OTHER },
{ "maximized_unfocus", setconfvalue, SWM_S_MAXIMIZED_UNFOCUS },
+ { "minimize_windows", setconfvalue, SWM_S_MINIMIZE_WINDOWS },
{ "modkey", setconfmodkey, 0 },
{ "program", setconfspawn, 0 },
{ "quirk", setconfquirk, 0 },
@@ -16637,7 +16651,7 @@ clientmessage(xcb_client_message_event_t *e)
} else if (e->type == a_change_state) {
DNPRINTF(SWM_D_EVENT, "WM_CHANGE_STATE state: %s\n",
get_wm_state_label(e->data.data32[0]));
- if (e->data.data32[0] != XCB_ICCCM_WM_STATE_ICONIC)
+ if (!minimize_windows || e->data.data32[0] != XCB_ICCCM_WM_STATE_ICONIC)
return;
/* Iconify. */
follow = follow_mode(SWM_FOCUS_TYPE_ICONIFY); I'm not opening a pull request for this because I realize this is a niche issue, but it would be nice to have a workaround like this. |
While in a fullscreen application, like a game, switching to a different workspace will cause the application window to be iconified. It doesn't happen for every game - every Steam game I tried doesn't get iconified, but most non-Steam games I have like Minecraft, Vintage Story and The Witness do.
Neither
fullscreen_unfocus
nor any quirks have any effect.The text was updated successfully, but these errors were encountered: