diff options
author | Pascal Pascher <aur@clouddrop.de> | 2018-07-24 23:37:41 +0200 |
---|---|---|
committer | Pascal Pascher <aur@clouddrop.de> | 2018-07-24 23:37:41 +0200 |
commit | 2bf893248a94c7f70a9557aad4a8228731041eeb (patch) | |
tree | ec86137e1b5881151b20917f311ecce3d24fba8f | |
parent | Added meson option "enable_xwayland" (default: true) to enable/disable xwayla... (diff) | |
download | sway-2bf893248a94c7f70a9557aad4a8228731041eeb.tar.gz sway-2bf893248a94c7f70a9557aad4a8228731041eeb.tar.zst sway-2bf893248a94c7f70a9557aad4a8228731041eeb.zip |
style fixes, exclude sway/desctop/xwayland.c when enable_xwayland: false
-rw-r--r-- | include/sway/criteria.h | 4 | ||||
-rw-r--r-- | include/sway/server.h | 4 | ||||
-rw-r--r-- | include/sway/tree/layout.h | 4 | ||||
-rw-r--r-- | include/sway/tree/view.h | 12 | ||||
-rw-r--r-- | meson.build | 4 | ||||
-rw-r--r-- | meson_options.txt | 2 | ||||
-rw-r--r-- | sway/commands/swap.c | 12 | ||||
-rw-r--r-- | sway/desktop/output.c | 10 | ||||
-rw-r--r-- | sway/desktop/render.c | 8 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 2 | ||||
-rw-r--r-- | sway/input/cursor.c | 4 | ||||
-rw-r--r-- | sway/input/seat.c | 4 | ||||
-rw-r--r-- | sway/meson.build | 5 | ||||
-rw-r--r-- | sway/server.c | 4 | ||||
-rw-r--r-- | sway/tree/container.c | 4 | ||||
-rw-r--r-- | sway/tree/layout.c | 4 | ||||
-rw-r--r-- | sway/tree/view.c | 14 |
17 files changed, 51 insertions, 50 deletions
diff --git a/include/sway/criteria.h b/include/sway/criteria.h index 5b5c0f58..23efe9d4 100644 --- a/include/sway/criteria.h +++ b/include/sway/criteria.h | |||
@@ -25,9 +25,9 @@ struct criteria { | |||
25 | pcre *instance; | 25 | pcre *instance; |
26 | pcre *con_mark; | 26 | pcre *con_mark; |
27 | uint32_t con_id; // internal ID | 27 | uint32_t con_id; // internal ID |
28 | #ifdef HAVE_XWAYLAND | 28 | #ifdef HAVE_XWAYLAND |
29 | uint32_t id; // X11 window ID | 29 | uint32_t id; // X11 window ID |
30 | #endif | 30 | #endif |
31 | pcre *window_role; | 31 | pcre *window_role; |
32 | uint32_t window_type; | 32 | uint32_t window_type; |
33 | bool floating; | 33 | bool floating; |
diff --git a/include/sway/server.h b/include/sway/server.h index fb22125f..b6a6bde3 100644 --- a/include/sway/server.h +++ b/include/sway/server.h | |||
@@ -41,11 +41,11 @@ struct sway_server { | |||
41 | 41 | ||
42 | struct wlr_xdg_shell *xdg_shell; | 42 | struct wlr_xdg_shell *xdg_shell; |
43 | struct wl_listener xdg_shell_surface; | 43 | struct wl_listener xdg_shell_surface; |
44 | #ifdef HAVE_XWAYLAND | 44 | #ifdef HAVE_XWAYLAND |
45 | struct sway_xwayland xwayland; | 45 | struct sway_xwayland xwayland; |
46 | struct wl_listener xwayland_surface; | 46 | struct wl_listener xwayland_surface; |
47 | struct wl_listener xwayland_ready; | 47 | struct wl_listener xwayland_ready; |
48 | #endif | 48 | #endif |
49 | bool debug_txn_timings; | 49 | bool debug_txn_timings; |
50 | 50 | ||
51 | list_t *transactions; | 51 | list_t *transactions; |
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h index da74e205..580acd16 100644 --- a/include/sway/tree/layout.h +++ b/include/sway/tree/layout.h | |||
@@ -27,9 +27,9 @@ struct sway_root { | |||
27 | struct wlr_output_layout *output_layout; | 27 | struct wlr_output_layout *output_layout; |
28 | 28 | ||
29 | struct wl_listener output_layout_change; | 29 | struct wl_listener output_layout_change; |
30 | #ifdef HAVE_XWAYLAND | 30 | #ifdef HAVE_XWAYLAND |
31 | struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link | 31 | struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link |
32 | #endif | 32 | #endif |
33 | struct wl_list drag_icons; // sway_drag_icon::link | 33 | struct wl_list drag_icons; // sway_drag_icon::link |
34 | 34 | ||
35 | struct wlr_texture *debug_tree; | 35 | struct wlr_texture *debug_tree; |
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index af12cf88..d4416dd3 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -14,9 +14,9 @@ struct sway_container; | |||
14 | enum sway_view_type { | 14 | enum sway_view_type { |
15 | SWAY_VIEW_XDG_SHELL_V6, | 15 | SWAY_VIEW_XDG_SHELL_V6, |
16 | SWAY_VIEW_XDG_SHELL, | 16 | SWAY_VIEW_XDG_SHELL, |
17 | #ifdef HAVE_XWAYLAND | 17 | #ifdef HAVE_XWAYLAND |
18 | SWAY_VIEW_XWAYLAND, | 18 | SWAY_VIEW_XWAYLAND, |
19 | #endif | 19 | #endif |
20 | }; | 20 | }; |
21 | 21 | ||
22 | enum sway_view_prop { | 22 | enum sway_view_prop { |
@@ -26,9 +26,9 @@ enum sway_view_prop { | |||
26 | VIEW_PROP_INSTANCE, | 26 | VIEW_PROP_INSTANCE, |
27 | VIEW_PROP_WINDOW_TYPE, | 27 | VIEW_PROP_WINDOW_TYPE, |
28 | VIEW_PROP_WINDOW_ROLE, | 28 | VIEW_PROP_WINDOW_ROLE, |
29 | #ifdef HAVE_XWAYLAND | 29 | #ifdef HAVE_XWAYLAND |
30 | VIEW_PROP_X11_WINDOW_ID, | 30 | VIEW_PROP_X11_WINDOW_ID, |
31 | #endif | 31 | #endif |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct sway_view_impl { | 34 | struct sway_view_impl { |
@@ -96,9 +96,9 @@ struct sway_view { | |||
96 | union { | 96 | union { |
97 | struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; | 97 | struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; |
98 | struct wlr_xdg_surface *wlr_xdg_surface; | 98 | struct wlr_xdg_surface *wlr_xdg_surface; |
99 | #ifdef HAVE_XWAYLAND | 99 | #ifdef HAVE_XWAYLAND |
100 | struct wlr_xwayland_surface *wlr_xwayland_surface; | 100 | struct wlr_xwayland_surface *wlr_xwayland_surface; |
101 | #endif | 101 | #endif |
102 | struct wlr_wl_shell_surface *wlr_wl_shell_surface; | 102 | struct wlr_wl_shell_surface *wlr_wl_shell_surface; |
103 | }; | 103 | }; |
104 | 104 | ||
diff --git a/meson.build b/meson.build index a2def755..06299618 100644 --- a/meson.build +++ b/meson.build | |||
@@ -49,9 +49,9 @@ git = find_program('git', required: false) | |||
49 | conf_data = configuration_data() | 49 | conf_data = configuration_data() |
50 | 50 | ||
51 | if get_option('enable-xwayland') | 51 | if get_option('enable-xwayland') |
52 | conf_data.set('HAVE_XWAYLAND', true) | 52 | conf_data.set('HAVE_XWAYLAND', true) |
53 | else | 53 | else |
54 | conf_data.set('HAVE_XWAYLAND', false) | 54 | conf_data.set('HAVE_XWAYLAND', false) |
55 | endif | 55 | endif |
56 | 56 | ||
57 | if gdk_pixbuf.found() | 57 | if gdk_pixbuf.found() |
diff --git a/meson_options.txt b/meson_options.txt index 1897cba6..6c7f241d 100644 --- a/meson_options.txt +++ b/meson_options.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | option('sway_version', type : 'string', description: 'The version string reported in `sway --version`.') | 1 | option('sway_version', type : 'string', description: 'The version string reported in `sway --version`.') |
2 | option('default_wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.') | 2 | option('default_wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.') |
3 | option('zsh_completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') | 3 | option('zsh_completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') |
4 | option('enable-xwayland', type: 'boolean', value: false, description: 'Enable support X11 applications') | 4 | option('enable-xwayland', type: 'boolean', value: true, description: 'Enable support for X11 applications') |
diff --git a/sway/commands/swap.c b/sway/commands/swap.c index 3563cdd9..325adc38 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c | |||
@@ -14,14 +14,14 @@ static bool test_con_id(struct sway_container *container, void *con_id) { | |||
14 | } | 14 | } |
15 | 15 | ||
16 | static bool test_id(struct sway_container *container, void *id) { | 16 | static bool test_id(struct sway_container *container, void *id) { |
17 | #ifdef HAVE_XWAYLAND | 17 | #ifdef HAVE_XWAYLAND |
18 | xcb_window_t *wid = id; | 18 | xcb_window_t *wid = id; |
19 | return (container->type == C_VIEW | 19 | return (container->type == C_VIEW |
20 | && container->sway_view->type == SWAY_VIEW_XWAYLAND | 20 | && container->sway_view->type == SWAY_VIEW_XWAYLAND |
21 | && container->sway_view->wlr_xwayland_surface->window_id == *wid); | 21 | && container->sway_view->wlr_xwayland_surface->window_id == *wid); |
22 | #else | 22 | #else |
23 | return false; | 23 | return false; |
24 | #endif | 24 | #endif |
25 | } | 25 | } |
26 | 26 | ||
27 | static bool test_mark(struct sway_container *container, void *mark) { | 27 | static bool test_mark(struct sway_container *container, void *mark) { |
@@ -47,10 +47,10 @@ struct cmd_results *cmd_swap(int argc, char **argv) { | |||
47 | 47 | ||
48 | char *value = join_args(argv + 3, argc - 3); | 48 | char *value = join_args(argv + 3, argc - 3); |
49 | if (strcasecmp(argv[2], "id") == 0) { | 49 | if (strcasecmp(argv[2], "id") == 0) { |
50 | #ifdef HAVE_XWAYLAND | 50 | #ifdef HAVE_XWAYLAND |
51 | xcb_window_t id = strtol(value, NULL, 0); | 51 | xcb_window_t id = strtol(value, NULL, 0); |
52 | other = container_find(&root_container, test_id, (void *)&id); | 52 | other = container_find(&root_container, test_id, (void *)&id); |
53 | #endif | 53 | #endif |
54 | } else if (strcasecmp(argv[2], "con_id") == 0) { | 54 | } else if (strcasecmp(argv[2], "con_id") == 0) { |
55 | size_t con_id = atoi(value); | 55 | size_t con_id = atoi(value); |
56 | other = container_find(&root_container, test_con_id, (void *)con_id); | 56 | other = container_find(&root_container, test_con_id, (void *)con_id); |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 7cca23bd..05daad7b 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -291,12 +291,12 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) { | |||
291 | if (workspace->current.ws_fullscreen) { | 291 | if (workspace->current.ws_fullscreen) { |
292 | send_frame_done_container_iterator( | 292 | send_frame_done_container_iterator( |
293 | workspace->current.ws_fullscreen->swayc, &data); | 293 | workspace->current.ws_fullscreen->swayc, &data); |
294 | #ifdef HAVE_XWAYLAND | 294 | #ifdef HAVE_XWAYLAND |
295 | if (workspace->current.ws_fullscreen->type == SWAY_VIEW_XWAYLAND) { | 295 | if (workspace->current.ws_fullscreen->type == SWAY_VIEW_XWAYLAND) { |
296 | send_frame_done_unmanaged(&data, | 296 | send_frame_done_unmanaged(&data, |
297 | &root_container.sway_root->xwayland_unmanaged); | 297 | &root_container.sway_root->xwayland_unmanaged); |
298 | } | 298 | } |
299 | #endif | 299 | #endif |
300 | } else { | 300 | } else { |
301 | send_frame_done_layer(&data, | 301 | send_frame_done_layer(&data, |
302 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); | 302 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); |
@@ -305,11 +305,11 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) { | |||
305 | 305 | ||
306 | send_frame_done_container(&data, workspace); | 306 | send_frame_done_container(&data, workspace); |
307 | send_frame_done_container(&data, workspace->sway_workspace->floating); | 307 | send_frame_done_container(&data, workspace->sway_workspace->floating); |
308 | 308 | ||
309 | #ifdef HAVE_XWAYLAND | 309 | #ifdef HAVE_XWAYLAND |
310 | send_frame_done_unmanaged(&data, | 310 | send_frame_done_unmanaged(&data, |
311 | &root_container.sway_root->xwayland_unmanaged); | 311 | &root_container.sway_root->xwayland_unmanaged); |
312 | #endif | 312 | #endif |
313 | send_frame_done_layer(&data, | 313 | send_frame_done_layer(&data, |
314 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); | 314 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); |
315 | } | 315 | } |
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 46bfec6b..2e6b6649 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -866,12 +866,12 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
866 | } else { | 866 | } else { |
867 | render_view_surfaces(fullscreen_view, output, damage, 1.0f); | 867 | render_view_surfaces(fullscreen_view, output, damage, 1.0f); |
868 | } | 868 | } |
869 | #ifdef HAVE_XWAYLAND | 869 | #ifdef HAVE_XWAYLAND |
870 | if (fullscreen_view->type == SWAY_VIEW_XWAYLAND) { | 870 | if (fullscreen_view->type == SWAY_VIEW_XWAYLAND) { |
871 | render_unmanaged(output, damage, | 871 | render_unmanaged(output, damage, |
872 | &root_container.sway_root->xwayland_unmanaged); | 872 | &root_container.sway_root->xwayland_unmanaged); |
873 | } | 873 | } |
874 | #endif | 874 | #endif |
875 | } else { | 875 | } else { |
876 | float clear_color[] = {0.25f, 0.25f, 0.25f, 1.0f}; | 876 | float clear_color[] = {0.25f, 0.25f, 0.25f, 1.0f}; |
877 | 877 | ||
@@ -889,10 +889,10 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
889 | 889 | ||
890 | render_container(output, damage, workspace, workspace->current.focused); | 890 | render_container(output, damage, workspace, workspace->current.focused); |
891 | render_floating(output, damage); | 891 | render_floating(output, damage); |
892 | #ifdef HAVE_XWAYLAND | 892 | #ifdef HAVE_XWAYLAND |
893 | render_unmanaged(output, damage, | 893 | render_unmanaged(output, damage, |
894 | &root_container.sway_root->xwayland_unmanaged); | 894 | &root_container.sway_root->xwayland_unmanaged); |
895 | #endif | 895 | #endif |
896 | render_layer(output, damage, | 896 | render_layer(output, damage, |
897 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); | 897 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); |
898 | } | 898 | } |
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index d940d47b..65d4fcd4 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -1,5 +1,4 @@ | |||
1 | #define _POSIX_C_SOURCE 199309L | 1 | #define _POSIX_C_SOURCE 199309L |
2 | #ifdef HAVE_XWAYLAND | ||
3 | #include <stdbool.h> | 2 | #include <stdbool.h> |
4 | #include <stdlib.h> | 3 | #include <stdlib.h> |
5 | #include <wayland-server.h> | 4 | #include <wayland-server.h> |
@@ -592,4 +591,3 @@ void handle_xwayland_ready(struct wl_listener *listener, void *data) { | |||
592 | 591 | ||
593 | xcb_disconnect(xcb_conn); | 592 | xcb_disconnect(xcb_conn); |
594 | } | 593 | } |
595 | #endif | ||
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index c873a20e..33eebf97 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -54,7 +54,7 @@ static struct sway_container *container_at_coords( | |||
54 | struct sway_seat *seat, double lx, double ly, | 54 | struct sway_seat *seat, double lx, double ly, |
55 | struct wlr_surface **surface, double *sx, double *sy) { | 55 | struct wlr_surface **surface, double *sx, double *sy) { |
56 | // check for unmanaged views first | 56 | // check for unmanaged views first |
57 | #ifdef HAVE_XWAYLAND | 57 | #ifdef HAVE_XWAYLAND |
58 | struct wl_list *unmanaged = &root_container.sway_root->xwayland_unmanaged; | 58 | struct wl_list *unmanaged = &root_container.sway_root->xwayland_unmanaged; |
59 | struct sway_xwayland_unmanaged *unmanaged_surface; | 59 | struct sway_xwayland_unmanaged *unmanaged_surface; |
60 | wl_list_for_each_reverse(unmanaged_surface, unmanaged, link) { | 60 | wl_list_for_each_reverse(unmanaged_surface, unmanaged, link) { |
@@ -70,7 +70,7 @@ static struct sway_container *container_at_coords( | |||
70 | return NULL; | 70 | return NULL; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | #endif | 73 | #endif |
74 | // find the output the cursor is on | 74 | // find the output the cursor is on |
75 | struct wlr_output_layout *output_layout = | 75 | struct wlr_output_layout *output_layout = |
76 | root_container.sway_root->output_layout; | 76 | root_container.sway_root->output_layout; |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 66d11eea..6b4e5f2e 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -103,13 +103,13 @@ static void seat_send_focus(struct sway_container *con, | |||
103 | 103 | ||
104 | if (con->type == C_VIEW | 104 | if (con->type == C_VIEW |
105 | && seat_is_input_allowed(seat, con->sway_view->surface)) { | 105 | && seat_is_input_allowed(seat, con->sway_view->surface)) { |
106 | #ifdef HAVE_XWAYLAND | 106 | #ifdef HAVE_XWAYLAND |
107 | if (con->sway_view->type == SWAY_VIEW_XWAYLAND) { | 107 | if (con->sway_view->type == SWAY_VIEW_XWAYLAND) { |
108 | struct wlr_xwayland *xwayland = | 108 | struct wlr_xwayland *xwayland = |
109 | seat->input->server->xwayland.wlr_xwayland; | 109 | seat->input->server->xwayland.wlr_xwayland; |
110 | wlr_xwayland_set_seat(xwayland, seat->wlr_seat); | 110 | wlr_xwayland_set_seat(xwayland, seat->wlr_seat); |
111 | } | 111 | } |
112 | #endif | 112 | #endif |
113 | struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat); | 113 | struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->wlr_seat); |
114 | if (keyboard) { | 114 | if (keyboard) { |
115 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, | 115 | wlr_seat_keyboard_notify_enter(seat->wlr_seat, |
diff --git a/sway/meson.build b/sway/meson.build index 30c848e2..649a3ac2 100644 --- a/sway/meson.build +++ b/sway/meson.build | |||
@@ -18,7 +18,6 @@ sway_sources = files( | |||
18 | 'desktop/transaction.c', | 18 | 'desktop/transaction.c', |
19 | 'desktop/xdg_shell_v6.c', | 19 | 'desktop/xdg_shell_v6.c', |
20 | 'desktop/xdg_shell.c', | 20 | 'desktop/xdg_shell.c', |
21 | 'desktop/xwayland.c', | ||
22 | 21 | ||
23 | 'input/input-manager.c', | 22 | 'input/input-manager.c', |
24 | 'input/seat.c', | 23 | 'input/seat.c', |
@@ -152,6 +151,10 @@ sway_sources = files( | |||
152 | 'tree/output.c', | 151 | 'tree/output.c', |
153 | ) | 152 | ) |
154 | 153 | ||
154 | if get_option('enable-xwayland') | ||
155 | sway_sources += 'desktop/xwayland.c' | ||
156 | endif | ||
157 | |||
155 | sway_deps = [ | 158 | sway_deps = [ |
156 | cairo, | 159 | cairo, |
157 | gdk_pixbuf, | 160 | gdk_pixbuf, |
diff --git a/sway/server.c b/sway/server.c index 90f25dbc..1521597f 100644 --- a/sway/server.c +++ b/sway/server.c | |||
@@ -83,7 +83,7 @@ bool server_init(struct sway_server *server) { | |||
83 | server->xdg_shell_surface.notify = handle_xdg_shell_surface; | 83 | server->xdg_shell_surface.notify = handle_xdg_shell_surface; |
84 | 84 | ||
85 | // TODO make xwayland optional | 85 | // TODO make xwayland optional |
86 | #ifdef HAVE_XWAYLAND | 86 | #ifdef HAVE_XWAYLAND |
87 | server->xwayland.wlr_xwayland = | 87 | server->xwayland.wlr_xwayland = |
88 | wlr_xwayland_create(server->wl_display, server->compositor, true); | 88 | wlr_xwayland_create(server->wl_display, server->compositor, true); |
89 | wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface, | 89 | wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface, |
@@ -104,7 +104,7 @@ bool server_init(struct sway_server *server) { | |||
104 | image->width * 4, image->width, image->height, image->hotspot_x, | 104 | image->width * 4, image->width, image->height, image->hotspot_x, |
105 | image->hotspot_y); | 105 | image->hotspot_y); |
106 | } | 106 | } |
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | // TODO: Integration with sway borders | 109 | // TODO: Integration with sway borders |
110 | struct wlr_server_decoration_manager *deco_manager = | 110 | struct wlr_server_decoration_manager *deco_manager = |
diff --git a/sway/tree/container.c b/sway/tree/container.c index 0a655db5..b56b4e87 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -527,12 +527,12 @@ static struct sway_container *container_at_view(struct sway_container *swayc, | |||
527 | double _sx, _sy; | 527 | double _sx, _sy; |
528 | struct wlr_surface *_surface = NULL; | 528 | struct wlr_surface *_surface = NULL; |
529 | switch (sview->type) { | 529 | switch (sview->type) { |
530 | #ifdef HAVE_XWAYLAND | 530 | #ifdef HAVE_XWAYLAND |
531 | case SWAY_VIEW_XWAYLAND: | 531 | case SWAY_VIEW_XWAYLAND: |
532 | _surface = wlr_surface_surface_at(sview->surface, | 532 | _surface = wlr_surface_surface_at(sview->surface, |
533 | view_sx, view_sy, &_sx, &_sy); | 533 | view_sx, view_sy, &_sx, &_sy); |
534 | break; | 534 | break; |
535 | #endif | 535 | #endif |
536 | case SWAY_VIEW_XDG_SHELL_V6: | 536 | case SWAY_VIEW_XDG_SHELL_V6: |
537 | _surface = wlr_xdg_surface_v6_surface_at( | 537 | _surface = wlr_xdg_surface_v6_surface_at( |
538 | sview->wlr_xdg_surface_v6, | 538 | sview->wlr_xdg_surface_v6, |
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 91350c3f..3d361ea5 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -39,9 +39,9 @@ void layout_init(void) { | |||
39 | root_container.sway_root = calloc(1, sizeof(*root_container.sway_root)); | 39 | root_container.sway_root = calloc(1, sizeof(*root_container.sway_root)); |
40 | root_container.sway_root->output_layout = wlr_output_layout_create(); | 40 | root_container.sway_root->output_layout = wlr_output_layout_create(); |
41 | wl_list_init(&root_container.sway_root->outputs); | 41 | wl_list_init(&root_container.sway_root->outputs); |
42 | #ifdef HAVE_XWAYLAND | 42 | #ifdef HAVE_XWAYLAND |
43 | wl_list_init(&root_container.sway_root->xwayland_unmanaged); | 43 | wl_list_init(&root_container.sway_root->xwayland_unmanaged); |
44 | #endif | 44 | #endif |
45 | wl_list_init(&root_container.sway_root->drag_icons); | 45 | wl_list_init(&root_container.sway_root->drag_icons); |
46 | wl_signal_init(&root_container.sway_root->events.new_container); | 46 | wl_signal_init(&root_container.sway_root->events.new_container); |
47 | root_container.sway_root->scratchpad = create_list(); | 47 | root_container.sway_root->scratchpad = create_list(); |
diff --git a/sway/tree/view.c b/sway/tree/view.c index e99b938e..2eff80a8 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -138,10 +138,10 @@ const char *view_get_shell(struct sway_view *view) { | |||
138 | return "xdg_shell_v6"; | 138 | return "xdg_shell_v6"; |
139 | case SWAY_VIEW_XDG_SHELL: | 139 | case SWAY_VIEW_XDG_SHELL: |
140 | return "xdg_shell"; | 140 | return "xdg_shell"; |
141 | #ifdef HAVE_XWAYLAND | 141 | #ifdef HAVE_XWAYLAND |
142 | case SWAY_VIEW_XWAYLAND: | 142 | case SWAY_VIEW_XWAYLAND: |
143 | return "xwayland"; | 143 | return "xwayland"; |
144 | #endif | 144 | #endif |
145 | } | 145 | } |
146 | return "unknown"; | 146 | return "unknown"; |
147 | } | 147 | } |
@@ -567,7 +567,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) { | |||
567 | } | 567 | } |
568 | 568 | ||
569 | pid_t pid; | 569 | pid_t pid; |
570 | #ifdef HAVE_XWAYLAND | 570 | #ifdef HAVE_XWAYLAND |
571 | if (view->type == SWAY_VIEW_XWAYLAND) { | 571 | if (view->type == SWAY_VIEW_XWAYLAND) { |
572 | struct wlr_xwayland_surface *surf = | 572 | struct wlr_xwayland_surface *surf = |
573 | wlr_xwayland_surface_from_wlr_surface(wlr_surface); | 573 | wlr_xwayland_surface_from_wlr_surface(wlr_surface); |
@@ -577,11 +577,11 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) { | |||
577 | wl_resource_get_client(wlr_surface->resource); | 577 | wl_resource_get_client(wlr_surface->resource); |
578 | wl_client_get_credentials(client, &pid, NULL, NULL); | 578 | wl_client_get_credentials(client, &pid, NULL, NULL); |
579 | } | 579 | } |
580 | #else | 580 | #else |
581 | struct wl_client *client = | 581 | struct wl_client *client = |
582 | wl_resource_get_client(wlr_surface->resource); | 582 | wl_resource_get_client(wlr_surface->resource); |
583 | wl_client_get_credentials(client, &pid, NULL, NULL); | 583 | wl_client_get_credentials(client, &pid, NULL, NULL); |
584 | #endif | 584 | #endif |
585 | 585 | ||
586 | struct sway_seat *seat = input_manager_current_seat(input_manager); | 586 | struct sway_seat *seat = input_manager_current_seat(input_manager); |
587 | struct sway_container *target_sibling = | 587 | struct sway_container *target_sibling = |
@@ -835,13 +835,13 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) { | |||
835 | wlr_xdg_surface_v6_from_wlr_surface(wlr_surface); | 835 | wlr_xdg_surface_v6_from_wlr_surface(wlr_surface); |
836 | return view_from_wlr_xdg_surface_v6(xdg_surface_v6); | 836 | return view_from_wlr_xdg_surface_v6(xdg_surface_v6); |
837 | } | 837 | } |
838 | #ifdef HAVE_XWAYLAND | 838 | #ifdef HAVE_XWAYLAND |
839 | if (wlr_surface_is_xwayland_surface(wlr_surface)) { | 839 | if (wlr_surface_is_xwayland_surface(wlr_surface)) { |
840 | struct wlr_xwayland_surface *xsurface = | 840 | struct wlr_xwayland_surface *xsurface = |
841 | wlr_xwayland_surface_from_wlr_surface(wlr_surface); | 841 | wlr_xwayland_surface_from_wlr_surface(wlr_surface); |
842 | return view_from_wlr_xwayland_surface(xsurface); | 842 | return view_from_wlr_xwayland_surface(xsurface); |
843 | } | 843 | } |
844 | #endif | 844 | #endif |
845 | if (wlr_surface_is_subsurface(wlr_surface)) { | 845 | if (wlr_surface_is_subsurface(wlr_surface)) { |
846 | struct wlr_subsurface *subsurface = | 846 | struct wlr_subsurface *subsurface = |
847 | wlr_subsurface_from_wlr_surface(wlr_surface); | 847 | wlr_subsurface_from_wlr_surface(wlr_surface); |