diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/layer_shell.c | 5 | ||||
-rw-r--r-- | sway/desktop/output.c | 4 | ||||
-rw-r--r-- | sway/desktop/xdg_shell.c | 7 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 7 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 7 |
5 files changed, 30 insertions, 0 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index ff37bbf1..de1fe349 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -307,6 +307,11 @@ static void handle_unmap(struct wl_listener *listener, void *data) { | |||
307 | unmap(sway_layer); | 307 | unmap(sway_layer); |
308 | } | 308 | } |
309 | 309 | ||
310 | struct sway_layer_surface *layer_from_wlr_layer_surface( | ||
311 | struct wlr_layer_surface *layer_surface) { | ||
312 | return layer_surface->data; | ||
313 | } | ||
314 | |||
310 | void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | 315 | void handle_layer_shell_surface(struct wl_listener *listener, void *data) { |
311 | struct wlr_layer_surface *layer_surface = data; | 316 | struct wlr_layer_surface *layer_surface = data; |
312 | struct sway_server *server = | 317 | struct sway_server *server = |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 541d765d..1e7494b3 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -1302,6 +1302,10 @@ static void handle_scale(struct wl_listener *listener, void *data) { | |||
1302 | arrange_and_commit(output->swayc); | 1302 | arrange_and_commit(output->swayc); |
1303 | } | 1303 | } |
1304 | 1304 | ||
1305 | struct sway_output *output_from_wlr_output(struct wlr_output *wlr_output) { | ||
1306 | return wlr_output->data; | ||
1307 | } | ||
1308 | |||
1305 | void handle_new_output(struct wl_listener *listener, void *data) { | 1309 | void handle_new_output(struct wl_listener *listener, void *data) { |
1306 | struct sway_server *server = wl_container_of(listener, server, new_output); | 1310 | struct sway_server *server = wl_container_of(listener, server, new_output); |
1307 | struct wlr_output *wlr_output = data; | 1311 | struct wlr_output *wlr_output = data; |
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index da3a1cdd..5b40d903 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -289,6 +289,11 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
289 | arrange_and_commit(ws); | 289 | arrange_and_commit(ws); |
290 | } | 290 | } |
291 | 291 | ||
292 | struct sway_view *view_from_wlr_xdg_surface( | ||
293 | struct wlr_xdg_surface *xdg_surface) { | ||
294 | return xdg_surface->data; | ||
295 | } | ||
296 | |||
292 | void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { | 297 | void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { |
293 | struct sway_server *server = wl_container_of(listener, server, | 298 | struct sway_server *server = wl_container_of(listener, server, |
294 | xdg_shell_surface); | 299 | xdg_shell_surface); |
@@ -327,4 +332,6 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { | |||
327 | xdg_shell_view->request_fullscreen.notify = handle_request_fullscreen; | 332 | xdg_shell_view->request_fullscreen.notify = handle_request_fullscreen; |
328 | wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, | 333 | wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, |
329 | &xdg_shell_view->request_fullscreen); | 334 | &xdg_shell_view->request_fullscreen); |
335 | |||
336 | xdg_surface->data = xdg_shell_view; | ||
330 | } | 337 | } |
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 69819280..c794e23a 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -280,6 +280,11 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
280 | arrange_and_commit(ws); | 280 | arrange_and_commit(ws); |
281 | } | 281 | } |
282 | 282 | ||
283 | struct sway_view *view_from_wlr_xdg_surface_v6( | ||
284 | struct wlr_xdg_surface_v6 *xdg_surface_v6) { | ||
285 | return xdg_surface_v6->data; | ||
286 | } | ||
287 | |||
283 | void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { | 288 | void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { |
284 | struct sway_server *server = wl_container_of(listener, server, | 289 | struct sway_server *server = wl_container_of(listener, server, |
285 | xdg_shell_v6_surface); | 290 | xdg_shell_v6_surface); |
@@ -318,4 +323,6 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { | |||
318 | xdg_shell_v6_view->request_fullscreen.notify = handle_request_fullscreen; | 323 | xdg_shell_v6_view->request_fullscreen.notify = handle_request_fullscreen; |
319 | wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, | 324 | wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, |
320 | &xdg_shell_v6_view->request_fullscreen); | 325 | &xdg_shell_v6_view->request_fullscreen); |
326 | |||
327 | xdg_surface->data = xdg_shell_v6_view; | ||
321 | } | 328 | } |
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 6e63c505..4bb35f60 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -417,6 +417,11 @@ static void handle_set_window_type(struct wl_listener *listener, void *data) { | |||
417 | view_execute_criteria(view); | 417 | view_execute_criteria(view); |
418 | } | 418 | } |
419 | 419 | ||
420 | struct sway_view *view_from_wlr_xwayland_surface( | ||
421 | struct wlr_xwayland_surface *xsurface) { | ||
422 | return xsurface->data; | ||
423 | } | ||
424 | |||
420 | void handle_xwayland_surface(struct wl_listener *listener, void *data) { | 425 | void handle_xwayland_surface(struct wl_listener *listener, void *data) { |
421 | struct sway_server *server = wl_container_of(listener, server, | 426 | struct sway_server *server = wl_container_of(listener, server, |
422 | xwayland_surface); | 427 | xwayland_surface); |
@@ -470,6 +475,8 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { | |||
470 | 475 | ||
471 | wl_signal_add(&xsurface->events.map, &xwayland_view->map); | 476 | wl_signal_add(&xsurface->events.map, &xwayland_view->map); |
472 | xwayland_view->map.notify = handle_map; | 477 | xwayland_view->map.notify = handle_map; |
478 | |||
479 | xsurface->data = xwayland_view; | ||
473 | } | 480 | } |
474 | 481 | ||
475 | void handle_xwayland_ready(struct wl_listener *listener, void *data) { | 482 | void handle_xwayland_ready(struct wl_listener *listener, void *data) { |