diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/commands.h | 1 | ||||
-rw-r--r-- | include/sway/config.h | 32 | ||||
-rw-r--r-- | include/sway/criteria.h | 6 | ||||
-rw-r--r-- | include/sway/desktop/launcher.h | 4 | ||||
-rw-r--r-- | include/sway/desktop/transaction.h | 3 | ||||
-rw-r--r-- | include/sway/input/cursor.h | 2 | ||||
-rw-r--r-- | include/sway/input/input-manager.h | 6 | ||||
-rw-r--r-- | include/sway/input/seat.h | 7 | ||||
-rw-r--r-- | include/sway/input/text_input.h | 3 | ||||
-rw-r--r-- | include/sway/input/text_input_popup.h | 20 | ||||
-rw-r--r-- | include/sway/layers.h | 5 | ||||
-rw-r--r-- | include/sway/output.h | 4 | ||||
-rw-r--r-- | include/sway/server.h | 27 | ||||
-rw-r--r-- | include/sway/tree/root.h | 4 | ||||
-rw-r--r-- | include/sway/tree/view.h | 30 |
15 files changed, 110 insertions, 44 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h index 27058587..0a9fdc70 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h | |||
@@ -283,6 +283,7 @@ sway_cmd input_cmd_xkb_variant; | |||
283 | 283 | ||
284 | sway_cmd output_cmd_adaptive_sync; | 284 | sway_cmd output_cmd_adaptive_sync; |
285 | sway_cmd output_cmd_background; | 285 | sway_cmd output_cmd_background; |
286 | sway_cmd output_cmd_color_profile; | ||
286 | sway_cmd output_cmd_disable; | 287 | sway_cmd output_cmd_disable; |
287 | sway_cmd output_cmd_dpms; | 288 | sway_cmd output_cmd_dpms; |
288 | sway_cmd output_cmd_enable; | 289 | sway_cmd output_cmd_enable; |
diff --git a/include/sway/config.h b/include/sway/config.h index f9da1967..3e3a104e 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <wlr/interfaces/wlr_switch.h> | 7 | #include <wlr/interfaces/wlr_switch.h> |
8 | #include <wlr/types/wlr_tablet_tool.h> | 8 | #include <wlr/types/wlr_tablet_tool.h> |
9 | #include <wlr/util/box.h> | 9 | #include <wlr/util/box.h> |
10 | #include <wlr/render/color.h> | ||
10 | #include <xkbcommon/xkbcommon.h> | 11 | #include <xkbcommon/xkbcommon.h> |
11 | #include <xf86drmMode.h> | 12 | #include <xf86drmMode.h> |
12 | #include "../include/config.h" | 13 | #include "../include/config.h" |
@@ -285,6 +286,8 @@ struct output_config { | |||
285 | int max_render_time; // In milliseconds | 286 | int max_render_time; // In milliseconds |
286 | int adaptive_sync; | 287 | int adaptive_sync; |
287 | enum render_bit_depth render_bit_depth; | 288 | enum render_bit_depth render_bit_depth; |
289 | bool set_color_transform; | ||
290 | struct wlr_color_transform *color_transform; | ||
288 | 291 | ||
289 | char *background; | 292 | char *background; |
290 | char *background_option; | 293 | char *background_option; |
@@ -292,6 +295,14 @@ struct output_config { | |||
292 | }; | 295 | }; |
293 | 296 | ||
294 | /** | 297 | /** |
298 | * An output config pre-matched to an output | ||
299 | */ | ||
300 | struct matched_output_config { | ||
301 | struct sway_output *output; | ||
302 | struct output_config *config; | ||
303 | }; | ||
304 | |||
305 | /** | ||
295 | * Stores size of gaps for each side | 306 | * Stores size of gaps for each side |
296 | */ | 307 | */ |
297 | struct side_gaps { | 308 | struct side_gaps { |
@@ -680,20 +691,25 @@ const char *sway_output_scale_filter_to_string(enum scale_filter_mode scale_filt | |||
680 | 691 | ||
681 | struct output_config *new_output_config(const char *name); | 692 | struct output_config *new_output_config(const char *name); |
682 | 693 | ||
683 | void merge_output_config(struct output_config *dst, struct output_config *src); | 694 | bool apply_output_configs(struct matched_output_config *configs, |
695 | size_t configs_len, bool test_only, bool degrade_to_off); | ||
684 | 696 | ||
685 | bool apply_output_config(struct output_config *oc, struct sway_output *output); | 697 | void apply_all_output_configs(void); |
686 | 698 | ||
687 | bool test_output_config(struct output_config *oc, struct sway_output *output); | 699 | void sort_output_configs_by_priority(struct matched_output_config *configs, |
700 | size_t configs_len); | ||
688 | 701 | ||
689 | struct output_config *store_output_config(struct output_config *oc); | 702 | /** |
703 | * store_output_config stores a new output config. An output may be matched by | ||
704 | * three different config types, in order of precedence: Identifier, name and | ||
705 | * wildcard. When storing a config type of lower precedence, assume that the | ||
706 | * user wants the config to take immediate effect by superseding (clearing) the | ||
707 | * same values from higher presedence configuration. | ||
708 | */ | ||
709 | void store_output_config(struct output_config *oc); | ||
690 | 710 | ||
691 | struct output_config *find_output_config(struct sway_output *output); | 711 | struct output_config *find_output_config(struct sway_output *output); |
692 | 712 | ||
693 | void apply_output_config_to_outputs(struct output_config *oc); | ||
694 | |||
695 | void reset_outputs(void); | ||
696 | |||
697 | void free_output_config(struct output_config *oc); | 713 | void free_output_config(struct output_config *oc); |
698 | 714 | ||
699 | bool spawn_swaybg(void); | 715 | bool spawn_swaybg(void); |
diff --git a/include/sway/criteria.h b/include/sway/criteria.h index 8da345ea..ae546821 100644 --- a/include/sway/criteria.h +++ b/include/sway/criteria.h | |||
@@ -7,6 +7,10 @@ | |||
7 | #include "list.h" | 7 | #include "list.h" |
8 | #include "tree/view.h" | 8 | #include "tree/view.h" |
9 | 9 | ||
10 | #if WLR_HAS_XWAYLAND | ||
11 | #include "sway/xwayland.h" | ||
12 | #endif | ||
13 | |||
10 | enum criteria_type { | 14 | enum criteria_type { |
11 | CT_COMMAND = 1 << 0, | 15 | CT_COMMAND = 1 << 0, |
12 | CT_ASSIGN_OUTPUT = 1 << 1, | 16 | CT_ASSIGN_OUTPUT = 1 << 1, |
@@ -36,7 +40,7 @@ struct criteria { | |||
36 | struct pattern *app_id; | 40 | struct pattern *app_id; |
37 | struct pattern *con_mark; | 41 | struct pattern *con_mark; |
38 | uint32_t con_id; // internal ID | 42 | uint32_t con_id; // internal ID |
39 | #if HAVE_XWAYLAND | 43 | #if WLR_HAS_XWAYLAND |
40 | struct pattern *class; | 44 | struct pattern *class; |
41 | uint32_t id; // X11 window ID | 45 | uint32_t id; // X11 window ID |
42 | struct pattern *instance; | 46 | struct pattern *instance; |
diff --git a/include/sway/desktop/launcher.h b/include/sway/desktop/launcher.h index b7716e82..412068a9 100644 --- a/include/sway/desktop/launcher.h +++ b/include/sway/desktop/launcher.h | |||
@@ -3,14 +3,18 @@ | |||
3 | 3 | ||
4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
5 | #include <wayland-server-core.h> | 5 | #include <wayland-server-core.h> |
6 | #include "sway/input/seat.h" | ||
6 | 7 | ||
7 | struct launcher_ctx { | 8 | struct launcher_ctx { |
8 | pid_t pid; | 9 | pid_t pid; |
9 | char *fallback_name; | 10 | char *fallback_name; |
10 | struct wlr_xdg_activation_token_v1 *token; | 11 | struct wlr_xdg_activation_token_v1 *token; |
11 | struct wl_listener token_destroy; | 12 | struct wl_listener token_destroy; |
13 | struct sway_seat *seat; | ||
14 | struct wl_listener seat_destroy; | ||
12 | 15 | ||
13 | bool activated; | 16 | bool activated; |
17 | bool had_focused_surface; | ||
14 | 18 | ||
15 | struct sway_node *node; | 19 | struct sway_node *node; |
16 | struct wl_listener node_destroy; | 20 | struct wl_listener node_destroy; |
diff --git a/include/sway/desktop/transaction.h b/include/sway/desktop/transaction.h index 17d41fa3..dd7edb7a 100644 --- a/include/sway/desktop/transaction.h +++ b/include/sway/desktop/transaction.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _SWAY_TRANSACTION_H | 2 | #define _SWAY_TRANSACTION_H |
3 | #include <stdint.h> | 3 | #include <stdint.h> |
4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
5 | #include <wlr/types/wlr_scene.h> | ||
5 | 6 | ||
6 | /** | 7 | /** |
7 | * Transactions enable us to perform atomic layout updates. | 8 | * Transactions enable us to perform atomic layout updates. |
@@ -58,4 +59,6 @@ bool transaction_notify_view_ready_by_serial(struct sway_view *view, | |||
58 | bool transaction_notify_view_ready_by_geometry(struct sway_view *view, | 59 | bool transaction_notify_view_ready_by_geometry(struct sway_view *view, |
59 | double x, double y, int width, int height); | 60 | double x, double y, int width, int height); |
60 | 61 | ||
62 | void arrange_popups(struct wlr_scene_tree *popups); | ||
63 | |||
61 | #endif | 64 | #endif |
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index 1e21c66f..527d0350 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h | |||
@@ -114,7 +114,7 @@ void pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, | |||
114 | 114 | ||
115 | void dispatch_cursor_button(struct sway_cursor *cursor, | 115 | void dispatch_cursor_button(struct sway_cursor *cursor, |
116 | struct wlr_input_device *device, uint32_t time_msec, uint32_t button, | 116 | struct wlr_input_device *device, uint32_t time_msec, uint32_t button, |
117 | enum wlr_button_state state); | 117 | enum wl_pointer_button_state state); |
118 | 118 | ||
119 | void dispatch_cursor_axis(struct sway_cursor *cursor, | 119 | void dispatch_cursor_axis(struct sway_cursor *cursor, |
120 | struct wlr_pointer_axis_event *event); | 120 | struct wlr_pointer_axis_event *event); |
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index 145edd4b..b014e18f 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h | |||
@@ -4,10 +4,12 @@ | |||
4 | #include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> | 4 | #include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> |
5 | #include <wlr/types/wlr_virtual_keyboard_v1.h> | 5 | #include <wlr/types/wlr_virtual_keyboard_v1.h> |
6 | #include <wlr/types/wlr_virtual_pointer_v1.h> | 6 | #include <wlr/types/wlr_virtual_pointer_v1.h> |
7 | #include "sway/server.h" | 7 | #include <wlr/types/wlr_transient_seat_v1.h> |
8 | #include "sway/config.h" | 8 | #include "sway/config.h" |
9 | #include "list.h" | 9 | #include "list.h" |
10 | 10 | ||
11 | struct sway_server; | ||
12 | |||
11 | struct sway_input_device { | 13 | struct sway_input_device { |
12 | char *identifier; | 14 | char *identifier; |
13 | struct wlr_input_device *wlr_device; | 15 | struct wlr_input_device *wlr_device; |
@@ -24,6 +26,7 @@ struct sway_input_manager { | |||
24 | struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; | 26 | struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; |
25 | struct wlr_virtual_pointer_manager_v1 *virtual_pointer; | 27 | struct wlr_virtual_pointer_manager_v1 *virtual_pointer; |
26 | struct wlr_pointer_gestures_v1 *pointer_gestures; | 28 | struct wlr_pointer_gestures_v1 *pointer_gestures; |
29 | struct wlr_transient_seat_manager_v1 *transient_seat_manager; | ||
27 | 30 | ||
28 | struct wl_listener new_input; | 31 | struct wl_listener new_input; |
29 | struct wl_listener inhibit_activate; | 32 | struct wl_listener inhibit_activate; |
@@ -31,6 +34,7 @@ struct sway_input_manager { | |||
31 | struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor; | 34 | struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor; |
32 | struct wl_listener virtual_keyboard_new; | 35 | struct wl_listener virtual_keyboard_new; |
33 | struct wl_listener virtual_pointer_new; | 36 | struct wl_listener virtual_pointer_new; |
37 | struct wl_listener transient_seat_create; | ||
34 | }; | 38 | }; |
35 | 39 | ||
36 | struct sway_input_manager *input_manager_create(struct sway_server *server); | 40 | struct sway_input_manager *input_manager_create(struct sway_server *server); |
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index e5aa8478..428f9679 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -17,7 +17,7 @@ struct sway_seat; | |||
17 | struct sway_seatop_impl { | 17 | struct sway_seatop_impl { |
18 | void (*button)(struct sway_seat *seat, uint32_t time_msec, | 18 | void (*button)(struct sway_seat *seat, uint32_t time_msec, |
19 | struct wlr_input_device *device, uint32_t button, | 19 | struct wlr_input_device *device, uint32_t button, |
20 | enum wlr_button_state state); | 20 | enum wl_pointer_button_state state); |
21 | void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec); | 21 | void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec); |
22 | void (*pointer_axis)(struct sway_seat *seat, | 22 | void (*pointer_axis)(struct sway_seat *seat, |
23 | struct wlr_pointer_axis_event *event); | 23 | struct wlr_pointer_axis_event *event); |
@@ -124,6 +124,7 @@ struct sway_seat { | |||
124 | struct wl_listener start_drag; | 124 | struct wl_listener start_drag; |
125 | struct wl_listener request_set_selection; | 125 | struct wl_listener request_set_selection; |
126 | struct wl_listener request_set_primary_selection; | 126 | struct wl_listener request_set_primary_selection; |
127 | struct wl_listener destroy; | ||
127 | 128 | ||
128 | struct wl_list devices; // sway_seat_device::link | 129 | struct wl_list devices; // sway_seat_device::link |
129 | struct wl_list keyboard_groups; // sway_keyboard_group::link | 130 | struct wl_list keyboard_groups; // sway_keyboard_group::link |
@@ -286,13 +287,13 @@ struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat, | |||
286 | struct sway_workspace *workspace); | 287 | struct sway_workspace *workspace); |
287 | 288 | ||
288 | void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, | 289 | void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, |
289 | uint32_t button, enum wlr_button_state state); | 290 | uint32_t button, enum wl_pointer_button_state state); |
290 | 291 | ||
291 | void seat_consider_warp_to_focus(struct sway_seat *seat); | 292 | void seat_consider_warp_to_focus(struct sway_seat *seat); |
292 | 293 | ||
293 | void seatop_button(struct sway_seat *seat, uint32_t time_msec, | 294 | void seatop_button(struct sway_seat *seat, uint32_t time_msec, |
294 | struct wlr_input_device *device, uint32_t button, | 295 | struct wlr_input_device *device, uint32_t button, |
295 | enum wlr_button_state state); | 296 | enum wl_pointer_button_state state); |
296 | 297 | ||
297 | void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec); | 298 | void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec); |
298 | 299 | ||
diff --git a/include/sway/input/text_input.h b/include/sway/input/text_input.h index 214e61d1..1993f928 100644 --- a/include/sway/input/text_input.h +++ b/include/sway/input/text_input.h | |||
@@ -21,18 +21,21 @@ struct sway_input_method_relay { | |||
21 | struct sway_seat *seat; | 21 | struct sway_seat *seat; |
22 | 22 | ||
23 | struct wl_list text_inputs; // sway_text_input::link | 23 | struct wl_list text_inputs; // sway_text_input::link |
24 | struct wl_list input_popups; // sway_input_popup::link | ||
24 | struct wlr_input_method_v2 *input_method; // doesn't have to be present | 25 | struct wlr_input_method_v2 *input_method; // doesn't have to be present |
25 | 26 | ||
26 | struct wl_listener text_input_new; | 27 | struct wl_listener text_input_new; |
27 | 28 | ||
28 | struct wl_listener input_method_new; | 29 | struct wl_listener input_method_new; |
29 | struct wl_listener input_method_commit; | 30 | struct wl_listener input_method_commit; |
31 | struct wl_listener input_method_new_popup_surface; | ||
30 | struct wl_listener input_method_grab_keyboard; | 32 | struct wl_listener input_method_grab_keyboard; |
31 | struct wl_listener input_method_destroy; | 33 | struct wl_listener input_method_destroy; |
32 | 34 | ||
33 | struct wl_listener input_method_keyboard_grab_destroy; | 35 | struct wl_listener input_method_keyboard_grab_destroy; |
34 | }; | 36 | }; |
35 | 37 | ||
38 | |||
36 | struct sway_text_input { | 39 | struct sway_text_input { |
37 | struct sway_input_method_relay *relay; | 40 | struct sway_input_method_relay *relay; |
38 | 41 | ||
diff --git a/include/sway/input/text_input_popup.h b/include/sway/input/text_input_popup.h new file mode 100644 index 00000000..e5f6ab8b --- /dev/null +++ b/include/sway/input/text_input_popup.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _SWAY_INPUT_TEXT_INPUT_POPUP_H | ||
2 | #define _SWAY_INPUT_TEXT_INPUT_POPUP_H | ||
3 | |||
4 | #include "sway/tree/view.h" | ||
5 | |||
6 | struct sway_input_popup { | ||
7 | struct sway_input_method_relay *relay; | ||
8 | |||
9 | struct wlr_scene_tree *scene_tree; | ||
10 | struct sway_popup_desc desc; | ||
11 | struct wlr_input_popup_surface_v2 *popup_surface; | ||
12 | |||
13 | struct wl_list link; | ||
14 | |||
15 | struct wl_listener popup_destroy; | ||
16 | struct wl_listener popup_surface_commit; | ||
17 | |||
18 | struct wl_listener focused_surface_unmap; | ||
19 | }; | ||
20 | #endif | ||
diff --git a/include/sway/layers.h b/include/sway/layers.h index a7afb900..fd6384e0 100644 --- a/include/sway/layers.h +++ b/include/sway/layers.h | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <stdbool.h> | 3 | #include <stdbool.h> |
4 | #include <wlr/types/wlr_compositor.h> | 4 | #include <wlr/types/wlr_compositor.h> |
5 | #include <wlr/types/wlr_layer_shell_v1.h> | 5 | #include <wlr/types/wlr_layer_shell_v1.h> |
6 | #include "sway/tree/view.h" | ||
6 | 7 | ||
7 | struct sway_layer_surface { | 8 | struct sway_layer_surface { |
8 | struct wl_listener map; | 9 | struct wl_listener map; |
@@ -14,10 +15,12 @@ struct sway_layer_surface { | |||
14 | 15 | ||
15 | bool mapped; | 16 | bool mapped; |
16 | 17 | ||
18 | struct wlr_scene_tree *popups; | ||
19 | struct sway_popup_desc desc; | ||
20 | |||
17 | struct sway_output *output; | 21 | struct sway_output *output; |
18 | struct wlr_scene_layer_surface_v1 *scene; | 22 | struct wlr_scene_layer_surface_v1 *scene; |
19 | struct wlr_scene_tree *tree; | 23 | struct wlr_scene_tree *tree; |
20 | struct wlr_scene_tree *popups; | ||
21 | struct wlr_layer_surface_v1 *layer_surface; | 24 | struct wlr_layer_surface_v1 *layer_surface; |
22 | }; | 25 | }; |
23 | 26 | ||
diff --git a/include/sway/output.h b/include/sway/output.h index 30595f54..2189c6e8 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -50,7 +50,7 @@ struct sway_output { | |||
50 | enum wl_output_subpixel detected_subpixel; | 50 | enum wl_output_subpixel detected_subpixel; |
51 | enum scale_filter_mode scale_filter; | 51 | enum scale_filter_mode scale_filter; |
52 | 52 | ||
53 | bool enabling, enabled; | 53 | bool enabled; |
54 | list_t *workspaces; | 54 | list_t *workspaces; |
55 | 55 | ||
56 | struct sway_output_state current; | 56 | struct sway_output_state current; |
@@ -66,6 +66,8 @@ struct sway_output { | |||
66 | struct wl_signal disable; | 66 | struct wl_signal disable; |
67 | } events; | 67 | } events; |
68 | 68 | ||
69 | struct wlr_color_transform *color_transform; | ||
70 | |||
69 | struct timespec last_presentation; | 71 | struct timespec last_presentation; |
70 | uint32_t refresh_nsec; | 72 | uint32_t refresh_nsec; |
71 | int max_render_time; // In milliseconds | 73 | int max_render_time; // In milliseconds |
diff --git a/include/sway/server.h b/include/sway/server.h index adb62cda..3a63df34 100644 --- a/include/sway/server.h +++ b/include/sway/server.h | |||
@@ -2,27 +2,10 @@ | |||
2 | #define _SWAY_SERVER_H | 2 | #define _SWAY_SERVER_H |
3 | #include <stdbool.h> | 3 | #include <stdbool.h> |
4 | #include <wayland-server-core.h> | 4 | #include <wayland-server-core.h> |
5 | #include <wlr/backend.h> | ||
6 | #include <wlr/render/allocator.h> | ||
7 | #include <wlr/render/wlr_renderer.h> | ||
8 | #include <wlr/types/wlr_compositor.h> | ||
9 | #include <wlr/types/wlr_data_device.h> | ||
10 | #include <wlr/types/wlr_input_method_v2.h> | ||
11 | #include <wlr/types/wlr_foreign_toplevel_management_v1.h> | ||
12 | #include <wlr/types/wlr_drm_lease_v1.h> | ||
13 | #include <wlr/types/wlr_layer_shell_v1.h> | ||
14 | #include <wlr/types/wlr_output_management_v1.h> | ||
15 | #include <wlr/types/wlr_output_power_management_v1.h> | ||
16 | #include <wlr/types/wlr_presentation_time.h> | ||
17 | #include <wlr/types/wlr_relative_pointer_v1.h> | ||
18 | #include <wlr/types/wlr_session_lock_v1.h> | ||
19 | #include <wlr/types/wlr_server_decoration.h> | ||
20 | #include <wlr/types/wlr_text_input_v3.h> | ||
21 | #include <wlr/types/wlr_xdg_shell.h> | ||
22 | #include "config.h" | 5 | #include "config.h" |
23 | #include "list.h" | 6 | #include "list.h" |
24 | #include "sway/desktop/idle_inhibit_v1.h" | 7 | #include "sway/desktop/idle_inhibit_v1.h" |
25 | #if HAVE_XWAYLAND | 8 | #if WLR_HAS_XWAYLAND |
26 | #include "sway/xwayland.h" | 9 | #include "sway/xwayland.h" |
27 | #endif | 10 | #endif |
28 | 11 | ||
@@ -63,6 +46,7 @@ struct sway_server { | |||
63 | 46 | ||
64 | struct wl_listener new_output; | 47 | struct wl_listener new_output; |
65 | struct wl_listener output_layout_change; | 48 | struct wl_listener output_layout_change; |
49 | struct wl_listener renderer_lost; | ||
66 | 50 | ||
67 | struct wlr_idle_notifier_v1 *idle_notifier_v1; | 51 | struct wlr_idle_notifier_v1 *idle_notifier_v1; |
68 | struct sway_idle_inhibit_manager_v1 idle_inhibit_manager_v1; | 52 | struct sway_idle_inhibit_manager_v1 idle_inhibit_manager_v1; |
@@ -75,7 +59,7 @@ struct sway_server { | |||
75 | 59 | ||
76 | struct wlr_tablet_manager_v2 *tablet_v2; | 60 | struct wlr_tablet_manager_v2 *tablet_v2; |
77 | 61 | ||
78 | #if HAVE_XWAYLAND | 62 | #if WLR_HAS_XWAYLAND |
79 | struct sway_xwayland xwayland; | 63 | struct sway_xwayland xwayland; |
80 | struct wl_listener xwayland_surface; | 64 | struct wl_listener xwayland_surface; |
81 | struct wl_listener xwayland_ready; | 65 | struct wl_listener xwayland_ready; |
@@ -97,6 +81,8 @@ struct sway_server { | |||
97 | struct wlr_pointer_constraints_v1 *pointer_constraints; | 81 | struct wlr_pointer_constraints_v1 *pointer_constraints; |
98 | struct wl_listener pointer_constraint; | 82 | struct wl_listener pointer_constraint; |
99 | 83 | ||
84 | struct wlr_xdg_output_manager_v1 *xdg_output_manager_v1; | ||
85 | |||
100 | struct wlr_output_manager_v1 *output_manager_v1; | 86 | struct wlr_output_manager_v1 *output_manager_v1; |
101 | struct wl_listener output_manager_apply; | 87 | struct wl_listener output_manager_apply; |
102 | struct wl_listener output_manager_test; | 88 | struct wl_listener output_manager_test; |
@@ -116,6 +102,7 @@ struct sway_server { | |||
116 | struct wl_listener output_power_manager_set_mode; | 102 | struct wl_listener output_power_manager_set_mode; |
117 | struct wlr_input_method_manager_v2 *input_method; | 103 | struct wlr_input_method_manager_v2 *input_method; |
118 | struct wlr_text_input_manager_v3 *text_input; | 104 | struct wlr_text_input_manager_v3 *text_input; |
105 | struct wlr_ext_foreign_toplevel_list_v1 *foreign_toplevel_list; | ||
119 | struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager; | 106 | struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager; |
120 | struct wlr_content_type_manager_v1 *content_type_manager_v1; | 107 | struct wlr_content_type_manager_v1 *content_type_manager_v1; |
121 | struct wlr_data_control_manager_v1 *data_control_manager_v1; | 108 | struct wlr_data_control_manager_v1 *data_control_manager_v1; |
@@ -180,7 +167,7 @@ void sway_session_lock_add_output(struct sway_session_lock *lock, | |||
180 | bool sway_session_lock_has_surface(struct sway_session_lock *lock, | 167 | bool sway_session_lock_has_surface(struct sway_session_lock *lock, |
181 | struct wlr_surface *surface); | 168 | struct wlr_surface *surface); |
182 | void handle_xdg_shell_toplevel(struct wl_listener *listener, void *data); | 169 | void handle_xdg_shell_toplevel(struct wl_listener *listener, void *data); |
183 | #if HAVE_XWAYLAND | 170 | #if WLR_HAS_XWAYLAND |
184 | void handle_xwayland_surface(struct wl_listener *listener, void *data); | 171 | void handle_xwayland_surface(struct wl_listener *listener, void *data); |
185 | #endif | 172 | #endif |
186 | void handle_server_decoration(struct wl_listener *listener, void *data); | 173 | void handle_server_decoration(struct wl_listener *listener, void *data); |
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h index 15df0f55..7de0abcd 100644 --- a/include/sway/tree/root.h +++ b/include/sway/tree/root.h | |||
@@ -2,12 +2,12 @@ | |||
2 | #define _SWAY_ROOT_H | 2 | #define _SWAY_ROOT_H |
3 | #include <wayland-server-core.h> | 3 | #include <wayland-server-core.h> |
4 | #include <wayland-util.h> | 4 | #include <wayland-util.h> |
5 | #include <wlr/config.h> | ||
5 | #include <wlr/types/wlr_output_layout.h> | 6 | #include <wlr/types/wlr_output_layout.h> |
6 | #include <wlr/types/wlr_scene.h> | 7 | #include <wlr/types/wlr_scene.h> |
7 | #include <wlr/render/wlr_texture.h> | 8 | #include <wlr/render/wlr_texture.h> |
8 | #include "sway/tree/container.h" | 9 | #include "sway/tree/container.h" |
9 | #include "sway/tree/node.h" | 10 | #include "sway/tree/node.h" |
10 | #include "config.h" | ||
11 | #include "list.h" | 11 | #include "list.h" |
12 | 12 | ||
13 | extern struct sway_root *root; | 13 | extern struct sway_root *root; |
@@ -47,7 +47,7 @@ struct sway_root { | |||
47 | struct wlr_scene_tree *shell_top; | 47 | struct wlr_scene_tree *shell_top; |
48 | struct wlr_scene_tree *fullscreen; | 48 | struct wlr_scene_tree *fullscreen; |
49 | struct wlr_scene_tree *fullscreen_global; | 49 | struct wlr_scene_tree *fullscreen_global; |
50 | #if HAVE_XWAYLAND | 50 | #if WLR_HAS_XWAYLAND |
51 | struct wlr_scene_tree *unmanaged; | 51 | struct wlr_scene_tree *unmanaged; |
52 | #endif | 52 | #endif |
53 | struct wlr_scene_tree *shell_overlay; | 53 | struct wlr_scene_tree *shell_overlay; |
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 3e5a9bfe..3ae8cf22 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #ifndef _SWAY_VIEW_H | 1 | #ifndef _SWAY_VIEW_H |
2 | #define _SWAY_VIEW_H | 2 | #define _SWAY_VIEW_H |
3 | #include <wayland-server-core.h> | 3 | #include <wayland-server-core.h> |
4 | #include <wlr/config.h> | ||
4 | #include <wlr/types/wlr_compositor.h> | 5 | #include <wlr/types/wlr_compositor.h> |
5 | #include <wlr/types/wlr_scene.h> | 6 | #include <wlr/types/wlr_scene.h> |
6 | #include "sway/config.h" | 7 | #include "sway/config.h" |
7 | #if HAVE_XWAYLAND | 8 | #if WLR_HAS_XWAYLAND |
8 | #include <wlr/xwayland.h> | 9 | #include <wlr/xwayland.h> |
9 | #endif | 10 | #endif |
10 | #include "sway/input/input-manager.h" | 11 | #include "sway/input/input-manager.h" |
@@ -15,7 +16,7 @@ struct sway_xdg_decoration; | |||
15 | 16 | ||
16 | enum sway_view_type { | 17 | enum sway_view_type { |
17 | SWAY_VIEW_XDG_SHELL, | 18 | SWAY_VIEW_XDG_SHELL, |
18 | #if HAVE_XWAYLAND | 19 | #if WLR_HAS_XWAYLAND |
19 | SWAY_VIEW_XWAYLAND, | 20 | SWAY_VIEW_XWAYLAND, |
20 | #endif | 21 | #endif |
21 | }; | 22 | }; |
@@ -27,7 +28,7 @@ enum sway_view_prop { | |||
27 | VIEW_PROP_INSTANCE, | 28 | VIEW_PROP_INSTANCE, |
28 | VIEW_PROP_WINDOW_TYPE, | 29 | VIEW_PROP_WINDOW_TYPE, |
29 | VIEW_PROP_WINDOW_ROLE, | 30 | VIEW_PROP_WINDOW_ROLE, |
30 | #if HAVE_XWAYLAND | 31 | #if WLR_HAS_XWAYLAND |
31 | VIEW_PROP_X11_WINDOW_ID, | 32 | VIEW_PROP_X11_WINDOW_ID, |
32 | VIEW_PROP_X11_PARENT_ID, | 33 | VIEW_PROP_X11_PARENT_ID, |
33 | #endif | 34 | #endif |
@@ -84,6 +85,8 @@ struct sway_view { | |||
84 | // transaction state. Updated on every commit. | 85 | // transaction state. Updated on every commit. |
85 | struct wlr_box geometry; | 86 | struct wlr_box geometry; |
86 | 87 | ||
88 | struct wlr_ext_foreign_toplevel_handle_v1 *ext_foreign_toplevel; | ||
89 | |||
87 | struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel; | 90 | struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel; |
88 | struct wl_listener foreign_activate_request; | 91 | struct wl_listener foreign_activate_request; |
89 | struct wl_listener foreign_fullscreen_request; | 92 | struct wl_listener foreign_fullscreen_request; |
@@ -96,7 +99,7 @@ struct sway_view { | |||
96 | 99 | ||
97 | union { | 100 | union { |
98 | struct wlr_xdg_toplevel *wlr_xdg_toplevel; | 101 | struct wlr_xdg_toplevel *wlr_xdg_toplevel; |
99 | #if HAVE_XWAYLAND | 102 | #if WLR_HAS_XWAYLAND |
100 | struct wlr_xwayland_surface *wlr_xwayland_surface; | 103 | struct wlr_xwayland_surface *wlr_xwayland_surface; |
101 | #endif | 104 | #endif |
102 | }; | 105 | }; |
@@ -125,7 +128,7 @@ struct sway_xdg_shell_view { | |||
125 | struct wl_listener unmap; | 128 | struct wl_listener unmap; |
126 | struct wl_listener destroy; | 129 | struct wl_listener destroy; |
127 | }; | 130 | }; |
128 | #if HAVE_XWAYLAND | 131 | #if WLR_HAS_XWAYLAND |
129 | struct sway_xwayland_view { | 132 | struct sway_xwayland_view { |
130 | struct sway_view view; | 133 | struct sway_view view; |
131 | 134 | ||
@@ -174,6 +177,11 @@ struct sway_xwayland_unmanaged { | |||
174 | }; | 177 | }; |
175 | #endif | 178 | #endif |
176 | 179 | ||
180 | struct sway_popup_desc { | ||
181 | struct wlr_scene_node *relative; | ||
182 | struct sway_view *view; | ||
183 | }; | ||
184 | |||
177 | struct sway_xdg_popup { | 185 | struct sway_xdg_popup { |
178 | struct sway_view *view; | 186 | struct sway_view *view; |
179 | 187 | ||
@@ -181,8 +189,11 @@ struct sway_xdg_popup { | |||
181 | struct wlr_scene_tree *xdg_surface_tree; | 189 | struct wlr_scene_tree *xdg_surface_tree; |
182 | struct wlr_xdg_popup *wlr_xdg_popup; | 190 | struct wlr_xdg_popup *wlr_xdg_popup; |
183 | 191 | ||
192 | struct sway_popup_desc desc; | ||
193 | |||
184 | struct wl_listener surface_commit; | 194 | struct wl_listener surface_commit; |
185 | struct wl_listener new_popup; | 195 | struct wl_listener new_popup; |
196 | struct wl_listener reposition; | ||
186 | struct wl_listener destroy; | 197 | struct wl_listener destroy; |
187 | }; | 198 | }; |
188 | 199 | ||
@@ -233,6 +244,11 @@ void view_set_activated(struct sway_view *view, bool activated); | |||
233 | */ | 244 | */ |
234 | void view_request_activate(struct sway_view *view, struct sway_seat *seat); | 245 | void view_request_activate(struct sway_view *view, struct sway_seat *seat); |
235 | 246 | ||
247 | /* | ||
248 | * Called when the view requests urgent state | ||
249 | */ | ||
250 | void view_request_urgent(struct sway_view *view); | ||
251 | |||
236 | /** | 252 | /** |
237 | * If possible, instructs the client to change their decoration mode. | 253 | * If possible, instructs the client to change their decoration mode. |
238 | */ | 254 | */ |
@@ -278,12 +294,14 @@ void view_center_and_clip_surface(struct sway_view *view); | |||
278 | 294 | ||
279 | struct sway_view *view_from_wlr_xdg_surface( | 295 | struct sway_view *view_from_wlr_xdg_surface( |
280 | struct wlr_xdg_surface *xdg_surface); | 296 | struct wlr_xdg_surface *xdg_surface); |
281 | #if HAVE_XWAYLAND | 297 | #if WLR_HAS_XWAYLAND |
282 | struct sway_view *view_from_wlr_xwayland_surface( | 298 | struct sway_view *view_from_wlr_xwayland_surface( |
283 | struct wlr_xwayland_surface *xsurface); | 299 | struct wlr_xwayland_surface *xsurface); |
284 | #endif | 300 | #endif |
285 | struct sway_view *view_from_wlr_surface(struct wlr_surface *surface); | 301 | struct sway_view *view_from_wlr_surface(struct wlr_surface *surface); |
286 | 302 | ||
303 | void view_update_app_id(struct sway_view *view); | ||
304 | |||
287 | /** | 305 | /** |
288 | * Re-read the view's title property and update any relevant title bars. | 306 | * Re-read the view's title property and update any relevant title bars. |
289 | * The force argument makes it recreate the title bars even if the title hasn't | 307 | * The force argument makes it recreate the title bars even if the title hasn't |