feat: add option xwayland_persistence

This commit is contained in:
DreamMaoMao 2025-06-06 17:25:46 +08:00
parent 42115b531c
commit 71e336fecc
3 changed files with 7 additions and 1 deletions

View file

@ -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;

View file

@ -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"};

View file

@ -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);