diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2023-04-13 20:45:02 +0200 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2024-01-18 18:36:54 +0300 |
commit | 1b092386455eeb16fed05cea672c4c88d733f8f2 (patch) | |
tree | 7957005c4ff17c8660f12b97421ad71cc994136b | |
parent | scene_graph: Maintain `wlr_scene_node`s for the sway tree. (diff) | |
download | sway-1b092386455eeb16fed05cea672c4c88d733f8f2.tar.gz sway-1b092386455eeb16fed05cea672c4c88d733f8f2.tar.zst sway-1b092386455eeb16fed05cea672c4c88d733f8f2.zip |
scene_graph: Use built-in linux dmabuf feedback handling
-rw-r--r-- | sway/main.c | 4 | ||||
-rw-r--r-- | sway/tree/container.c | 27 |
2 files changed, 4 insertions, 27 deletions
diff --git a/sway/main.c b/sway/main.c index 98aba7f2..65c85d31 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -340,6 +340,10 @@ int main(int argc, char **argv) { | |||
340 | return 1; | 340 | return 1; |
341 | } | 341 | } |
342 | 342 | ||
343 | if (server.linux_dmabuf_v1) { | ||
344 | wlr_scene_set_linux_dmabuf_v1(root->root_scene, server.linux_dmabuf_v1); | ||
345 | } | ||
346 | |||
343 | if (validate) { | 347 | if (validate) { |
344 | bool valid = load_main_config(config_path, false, true); | 348 | bool valid = load_main_config(config_path, false, true); |
345 | free(config_path); | 349 | free(config_path); |
diff --git a/sway/tree/container.c b/sway/tree/container.c index 9ed08929..307bf963 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -1157,33 +1157,6 @@ static void set_fullscreen(struct sway_container *con, bool enable) { | |||
1157 | con->view->foreign_toplevel, enable); | 1157 | con->view->foreign_toplevel, enable); |
1158 | } | 1158 | } |
1159 | } | 1159 | } |
1160 | |||
1161 | if (!server.linux_dmabuf_v1 || !con->view->surface) { | ||
1162 | return; | ||
1163 | } | ||
1164 | if (!enable) { | ||
1165 | wlr_linux_dmabuf_v1_set_surface_feedback(server.linux_dmabuf_v1, | ||
1166 | con->view->surface, NULL); | ||
1167 | return; | ||
1168 | } | ||
1169 | |||
1170 | if (!con->pending.workspace || !con->pending.workspace->output) { | ||
1171 | return; | ||
1172 | } | ||
1173 | |||
1174 | struct sway_output *output = con->pending.workspace->output; | ||
1175 | |||
1176 | const struct wlr_linux_dmabuf_feedback_v1_init_options options = { | ||
1177 | .main_renderer = server.renderer, | ||
1178 | .scanout_primary_output = output->wlr_output, | ||
1179 | }; | ||
1180 | struct wlr_linux_dmabuf_feedback_v1 feedback = {0}; | ||
1181 | if (!wlr_linux_dmabuf_feedback_v1_init_with_options(&feedback, &options)) { | ||
1182 | return; | ||
1183 | } | ||
1184 | wlr_linux_dmabuf_v1_set_surface_feedback(server.linux_dmabuf_v1, | ||
1185 | con->view->surface, &feedback); | ||
1186 | wlr_linux_dmabuf_feedback_v1_finish(&feedback); | ||
1187 | } | 1160 | } |
1188 | 1161 | ||
1189 | static void container_fullscreen_workspace(struct sway_container *con) { | 1162 | static void container_fullscreen_workspace(struct sway_container *con) { |