aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sway/commands.h2
-rw-r--r--include/sway/config.h1
-rw-r--r--include/sway/output.h1
-rw-r--r--include/sway/server.h6
-rw-r--r--include/sway/tree/view.h12
5 files changed, 22 insertions, 0 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h
index 15cd8698..5210d3ba 100644
--- a/include/sway/commands.h
+++ b/include/sway/commands.h
@@ -104,6 +104,7 @@ struct sway_container *container_find_resize_parent(struct sway_container *con,
104sway_cmd cmd_exec_validate; 104sway_cmd cmd_exec_validate;
105sway_cmd cmd_exec_process; 105sway_cmd cmd_exec_process;
106 106
107sway_cmd cmd_allow_tearing;
107sway_cmd cmd_assign; 108sway_cmd cmd_assign;
108sway_cmd cmd_bar; 109sway_cmd cmd_bar;
109sway_cmd cmd_bindcode; 110sway_cmd cmd_bindcode;
@@ -283,6 +284,7 @@ sway_cmd input_cmd_xkb_switch_layout;
283sway_cmd input_cmd_xkb_variant; 284sway_cmd input_cmd_xkb_variant;
284 285
285sway_cmd output_cmd_adaptive_sync; 286sway_cmd output_cmd_adaptive_sync;
287sway_cmd output_cmd_allow_tearing;
286sway_cmd output_cmd_background; 288sway_cmd output_cmd_background;
287sway_cmd output_cmd_color_profile; 289sway_cmd output_cmd_color_profile;
288sway_cmd output_cmd_disable; 290sway_cmd output_cmd_disable;
diff --git a/include/sway/config.h b/include/sway/config.h
index dfa3c1b7..d9f56157 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -289,6 +289,7 @@ struct output_config {
289 enum render_bit_depth render_bit_depth; 289 enum render_bit_depth render_bit_depth;
290 bool set_color_transform; 290 bool set_color_transform;
291 struct wlr_color_transform *color_transform; 291 struct wlr_color_transform *color_transform;
292 int allow_tearing;
292 293
293 char *background; 294 char *background;
294 char *background_option; 295 char *background_option;
diff --git a/include/sway/output.h b/include/sway/output.h
index 2189c6e8..7e2d5892 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -73,6 +73,7 @@ struct sway_output {
73 int max_render_time; // In milliseconds 73 int max_render_time; // In milliseconds
74 struct wl_event_source *repaint_timer; 74 struct wl_event_source *repaint_timer;
75 bool gamma_lut_changed; 75 bool gamma_lut_changed;
76 bool allow_tearing;
76}; 77};
77 78
78struct sway_output_non_desktop { 79struct sway_output_non_desktop {
diff --git a/include/sway/server.h b/include/sway/server.h
index abf1b6b4..460f9e17 100644
--- a/include/sway/server.h
+++ b/include/sway/server.h
@@ -115,6 +115,10 @@ struct sway_server {
115 struct wl_listener xdg_activation_v1_new_token; 115 struct wl_listener xdg_activation_v1_new_token;
116 116
117 struct wl_listener request_set_cursor_shape; 117 struct wl_listener request_set_cursor_shape;
118
119 struct wlr_tearing_control_manager_v1 *tearing_control_v1;
120 struct wl_listener tearing_control_new_object;
121 struct wl_list tearing_controllers; // sway_tearing_controller::link
118 122
119 struct wl_list pending_launcher_ctxs; // launcher_ctx::link 123 struct wl_list pending_launcher_ctxs; // launcher_ctx::link
120 124
@@ -182,4 +186,6 @@ void xdg_activation_v1_handle_new_token(struct wl_listener *listener,
182 186
183void set_rr_scheduling(void); 187void set_rr_scheduling(void);
184 188
189void handle_new_tearing_hint(struct wl_listener *listener, void *data);
190
185#endif 191#endif
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 3ae8cf22..14aad1a1 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -4,6 +4,7 @@
4#include <wlr/config.h> 4#include <wlr/config.h>
5#include <wlr/types/wlr_compositor.h> 5#include <wlr/types/wlr_compositor.h>
6#include <wlr/types/wlr_scene.h> 6#include <wlr/types/wlr_scene.h>
7#include <wlr/types/wlr_tearing_control_v1.h>
7#include "sway/config.h" 8#include "sway/config.h"
8#if WLR_HAS_XWAYLAND 9#if WLR_HAS_XWAYLAND
9#include <wlr/xwayland.h> 10#include <wlr/xwayland.h>
@@ -34,6 +35,12 @@ enum sway_view_prop {
34#endif 35#endif
35}; 36};
36 37
38enum sway_view_tearing_mode {
39 TEARING_OVERRIDE_FALSE,
40 TEARING_OVERRIDE_TRUE,
41 TEARING_WINDOW_HINT,
42};
43
37struct sway_view_impl { 44struct sway_view_impl {
38 void (*get_constraints)(struct sway_view *view, double *min_width, 45 void (*get_constraints)(struct sway_view *view, double *min_width,
39 double *max_width, double *min_height, double *max_height); 46 double *max_width, double *min_height, double *max_height);
@@ -111,6 +118,9 @@ struct sway_view {
111 int max_render_time; // In milliseconds 118 int max_render_time; // In milliseconds
112 119
113 enum seat_config_shortcuts_inhibit shortcuts_inhibit; 120 enum seat_config_shortcuts_inhibit shortcuts_inhibit;
121
122 enum sway_view_tearing_mode tearing_mode;
123 enum wp_tearing_control_v1_presentation_hint tearing_hint;
114}; 124};
115 125
116struct sway_xdg_shell_view { 126struct sway_xdg_shell_view {
@@ -335,4 +345,6 @@ void view_assign_ctx(struct sway_view *view, struct launcher_ctx *ctx);
335 345
336void view_send_frame_done(struct sway_view *view); 346void view_send_frame_done(struct sway_view *view);
337 347
348bool view_can_tear(struct sway_view *view);
349
338#endif 350#endif