diff --git a/src/config/parse_config.h b/src/config/parse_config.h index daed654..099e19e 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -219,6 +219,7 @@ typedef struct { unsigned int cursor_size; int single_scratchpad; + int xwayland_persistence; } Config; @@ -780,6 +781,8 @@ void parse_config_line(Config *config, const char *line) { config->focus_cross_tag = atoi(value); } else if (strcmp(key, "single_scratchpad") == 0) { config->single_scratchpad = atoi(value); + } else if (strcmp(key, "xwayland_persistence") == 0) { + config->xwayland_persistence = atoi(value); } else if (strcmp(key, "no_border_when_single") == 0) { config->no_border_when_single = atoi(value); } else if (strcmp(key, "snap_distance") == 0) { @@ -1807,6 +1810,7 @@ void override_config(void) { focus_cross_monitor = config.focus_cross_monitor; focus_cross_tag = config.focus_cross_tag; single_scratchpad = config.single_scratchpad; + xwayland_persistence = config.xwayland_persistence; no_border_when_single = config.no_border_when_single; snap_distance = config.snap_distance; drag_tile_to_tile = config.drag_tile_to_tile; @@ -1911,6 +1915,7 @@ void set_value_default() { config.focus_cross_monitor = focus_cross_monitor; config.focus_cross_tag = focus_cross_tag; config.single_scratchpad = single_scratchpad; + config.xwayland_persistence = xwayland_persistence; config.no_border_when_single = no_border_when_single; config.snap_distance = snap_distance; config.drag_tile_to_tile = drag_tile_to_tile; diff --git a/src/config/preset_config.h b/src/config/preset_config.h index 81c5a93..9aca7a1 100644 --- a/src/config/preset_config.h +++ b/src/config/preset_config.h @@ -85,6 +85,7 @@ int overviewgappo = 30; /* overview时 窗口与窗口 缝隙大小 */ float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; int warpcursor = 1; /* Warp cursor to focused client */ +int xwayland_persistence = 1; /* xwayland persistence */ /* layout(s) */ Layout overviewlayout = {"󰃇", overview, "overview"}; diff --git a/src/maomao.c b/src/maomao.c index 7be2377..e4096a8 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -6179,7 +6179,7 @@ void setup(void) { * Initialise the XWayland X server. * It will be started when the first X client is started. */ - xwayland = wlr_xwayland_create(dpy, compositor, 1); + xwayland = wlr_xwayland_create(dpy, compositor, !xwayland_persistence); if (xwayland) { wl_signal_add(&xwayland->events.ready, &xwayland_ready); wl_signal_add(&xwayland->events.new_surface, &new_xwayland_surface);