feat: add option to disable syncobj for nvidia

This commit is contained in:
DreamMaoMao 2025-06-17 15:45:17 +08:00
parent eeed7939aa
commit f202a16abe
3 changed files with 7 additions and 1 deletions

View file

@ -241,6 +241,7 @@ typedef struct {
int single_scratchpad; int single_scratchpad;
int xwayland_persistence; int xwayland_persistence;
int syncobj_enable;
struct xkb_rule_names xkb_rules; struct xkb_rule_names xkb_rules;
} Config; } Config;
@ -876,6 +877,8 @@ void parse_config_line(Config *config, const char *line) {
config->single_scratchpad = atoi(value); config->single_scratchpad = atoi(value);
} else if (strcmp(key, "xwayland_persistence") == 0) { } else if (strcmp(key, "xwayland_persistence") == 0) {
config->xwayland_persistence = atoi(value); config->xwayland_persistence = atoi(value);
} else if (strcmp(key, "syncobj_enable") == 0) {
config->syncobj_enable = atoi(value);
} else if (strcmp(key, "no_border_when_single") == 0) { } else if (strcmp(key, "no_border_when_single") == 0) {
config->no_border_when_single = atoi(value); config->no_border_when_single = atoi(value);
} else if (strcmp(key, "snap_distance") == 0) { } else if (strcmp(key, "snap_distance") == 0) {
@ -1969,6 +1972,7 @@ void override_config(void) {
// 杂项设置 // 杂项设置
xwayland_persistence = CLAMP_INT(config.xwayland_persistence, 0, 1); xwayland_persistence = CLAMP_INT(config.xwayland_persistence, 0, 1);
syncobj_enable = CLAMP_INT(config.syncobj_enable, 0, 1);
axis_bind_apply_timeout = axis_bind_apply_timeout =
CLAMP_INT(config.axis_bind_apply_timeout, 0, 1000); CLAMP_INT(config.axis_bind_apply_timeout, 0, 1000);
focus_on_activate = CLAMP_INT(config.focus_on_activate, 0, 1); focus_on_activate = CLAMP_INT(config.focus_on_activate, 0, 1);
@ -2091,6 +2095,7 @@ void set_value_default() {
config.focus_cross_tag = focus_cross_tag; config.focus_cross_tag = focus_cross_tag;
config.single_scratchpad = single_scratchpad; config.single_scratchpad = single_scratchpad;
config.xwayland_persistence = xwayland_persistence; config.xwayland_persistence = xwayland_persistence;
config.syncobj_enable = syncobj_enable;
config.no_border_when_single = no_border_when_single; config.no_border_when_single = no_border_when_single;
config.snap_distance = snap_distance; config.snap_distance = snap_distance;
config.drag_tile_to_tile = drag_tile_to_tile; config.drag_tile_to_tile = drag_tile_to_tile;

View file

@ -87,6 +87,7 @@ float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};
int warpcursor = 1; /* Warp cursor to focused client */ int warpcursor = 1; /* Warp cursor to focused client */
int xwayland_persistence = 1; /* xwayland persistence */ int xwayland_persistence = 1; /* xwayland persistence */
int syncobj_enable = 0;
/* layout(s) */ /* layout(s) */
Layout overviewlayout = {"󰃇", overview, "overview"}; Layout overviewlayout = {"󰃇", overview, "overview"};

View file

@ -6430,7 +6430,7 @@ void setup(void) {
scene, wlr_linux_dmabuf_v1_create_with_renderer(dpy, 5, drw)); scene, wlr_linux_dmabuf_v1_create_with_renderer(dpy, 5, drw));
} }
if ((drm_fd = wlr_renderer_get_drm_fd(drw)) >= 0 && if (syncobj_enable && (drm_fd = wlr_renderer_get_drm_fd(drw)) >= 0 &&
drw->features.timeline && backend->features.timeline) drw->features.timeline && backend->features.timeline)
wlr_linux_drm_syncobj_manager_v1_create(dpy, 1, drm_fd); wlr_linux_drm_syncobj_manager_v1_create(dpy, 1, drm_fd);