diff options
| -rw-r--r-- | default_sxwmrc | 3 | ||||
| -rw-r--r-- | src/defs.h | 1 | ||||
| -rw-r--r-- | src/parser.c | 3 | ||||
| -rw-r--r-- | src/sxwm.c | 13 |
4 files changed, 18 insertions, 2 deletions
diff --git a/default_sxwmrc b/default_sxwmrc index 264f8da..5cfc524 100644 --- a/default_sxwmrc +++ b/default_sxwmrc @@ -16,9 +16,10 @@ motion_throttle : 60 # Set to screen refresh rate for smoothest motions should_float : "pcmanfm", "obs" new_win_focus : true warp_cursor : true +floating_on_top : true +new_win_master : false can_swallow : "st" can_be_swallowed : "mpv", "sxiv" -new_win_master : false start_fullscreen : "mpv", "vlc" # Keybinds: @@ -105,6 +105,7 @@ typedef struct { int resize_window_amt; Bool new_win_focus; Bool warp_cursor; + Bool floating_on_top; Bool new_win_master; Binding binds[MAX_ITEMS]; char **should_float[MAX_ITEMS]; diff --git a/src/parser.c b/src/parser.c index a479705..f1dd7c0 100644 --- a/src/parser.c +++ b/src/parser.c @@ -272,6 +272,9 @@ found: else if (!strcmp(key, "resize_master_amount")) { cfg->resize_master_amt = atoi(rest); } + else if (!strcmp(key, "floating_on_top")) { + cfg->floating_on_top = !strcmp(rest, "true") ? True : False; + } else if (!strcmp(key, "resize_stack_amount")) { cfg->resize_stack_amt = atoi(rest); } @@ -1574,6 +1574,7 @@ void init_defaults(void) default_config.new_win_focus = True; default_config.warp_cursor = True; default_config.new_win_master = False; + default_config.floating_on_top = True; user_config = default_config; } @@ -2363,7 +2364,7 @@ void set_input_focus(Client *c, Bool raise_win, Bool warp) XSetInputFocus(dpy, w, RevertToPointerRoot, CurrentTime); send_wm_take_focus(w); - if (raise_win) { + if (raise_win && c->floating) { XRaiseWindow(dpy, w); } @@ -2816,6 +2817,16 @@ void tile(void) } update_borders(); } + + if (user_config.floating_on_top) { + for (Client *c = workspaces[current_ws]; c; c = c->next) { + if (c->mapped && c->floating && !c->fullscreen) { + XRaiseWindow(dpy, c->win); + } + } + } + + update_borders(); } void toggle_floating(void) |
