diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-25 20:56:23 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-26 08:27:07 +1000 |
commit | 27a20a488465468511de9b2307941ac1bc4db8bf (patch) | |
tree | c5c1aff483cb089870ffebec00869347eec29f4c /sway/desktop | |
parent | Merge pull request #2330 from progandy/set-modifier-locks (diff) | |
download | sway-27a20a488465468511de9b2307941ac1bc4db8bf.tar.gz sway-27a20a488465468511de9b2307941ac1bc4db8bf.tar.zst sway-27a20a488465468511de9b2307941ac1bc4db8bf.zip |
Allow containers to be fullscreen
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 14 | ||||
-rw-r--r-- | sway/desktop/render.c | 23 | ||||
-rw-r--r-- | sway/desktop/transaction.c | 2 | ||||
-rw-r--r-- | sway/desktop/xdg_shell.c | 4 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 4 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 4 |
6 files changed, 29 insertions, 22 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 1764b4e3..cecd300a 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -279,13 +279,15 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) { | |||
279 | 279 | ||
280 | struct sway_container *workspace = output_get_active_workspace(output); | 280 | struct sway_container *workspace = output_get_active_workspace(output); |
281 | if (workspace->current.ws_fullscreen) { | 281 | if (workspace->current.ws_fullscreen) { |
282 | send_frame_done_container_iterator( | 282 | if (workspace->current.ws_fullscreen->type == C_VIEW) { |
283 | workspace->current.ws_fullscreen->swayc, &data); | 283 | send_frame_done_container_iterator( |
284 | #ifdef HAVE_XWAYLAND | 284 | workspace->current.ws_fullscreen, &data); |
285 | if (workspace->current.ws_fullscreen->type == SWAY_VIEW_XWAYLAND) { | 285 | } else { |
286 | send_frame_done_unmanaged(&data, | 286 | send_frame_done_container(&data, workspace->current.ws_fullscreen); |
287 | &root_container.sway_root->xwayland_unmanaged); | ||
288 | } | 287 | } |
288 | #ifdef HAVE_XWAYLAND | ||
289 | send_frame_done_unmanaged(&data, | ||
290 | &root_container.sway_root->xwayland_unmanaged); | ||
289 | #endif | 291 | #endif |
290 | } else { | 292 | } else { |
291 | send_frame_done_layer(&data, | 293 | send_frame_done_layer(&data, |
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 15c5b94c..3e7b1a62 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -836,13 +836,13 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
836 | } | 836 | } |
837 | 837 | ||
838 | struct sway_container *workspace = output_get_active_workspace(output); | 838 | struct sway_container *workspace = output_get_active_workspace(output); |
839 | struct sway_view *fullscreen_view = workspace->current.ws_fullscreen; | 839 | struct sway_container *fullscreen_con = workspace->current.ws_fullscreen; |
840 | 840 | ||
841 | if (output_has_opaque_overlay_layer_surface(output)) { | 841 | if (output_has_opaque_overlay_layer_surface(output)) { |
842 | goto render_overlay; | 842 | goto render_overlay; |
843 | } | 843 | } |
844 | 844 | ||
845 | if (fullscreen_view) { | 845 | if (fullscreen_con) { |
846 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; | 846 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; |
847 | 847 | ||
848 | int nrects; | 848 | int nrects; |
@@ -853,16 +853,21 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
853 | } | 853 | } |
854 | 854 | ||
855 | // TODO: handle views smaller than the output | 855 | // TODO: handle views smaller than the output |
856 | if (fullscreen_view->swayc->instructions->length) { | 856 | if (fullscreen_con->type == C_VIEW) { |
857 | render_saved_view(fullscreen_view, output, damage, 1.0f); | 857 | if (fullscreen_con->instructions->length) { |
858 | render_saved_view(fullscreen_con->sway_view, | ||
859 | output, damage, 1.0f); | ||
858 | } else { | 860 | } else { |
859 | render_view_surfaces(fullscreen_view, output, damage, 1.0f); | 861 | render_view_surfaces(fullscreen_con->sway_view, |
862 | output, damage, 1.0f); | ||
863 | } | ||
864 | } else { | ||
865 | render_container(output, damage, fullscreen_con, | ||
866 | fullscreen_con->current.focused); | ||
860 | } | 867 | } |
861 | #ifdef HAVE_XWAYLAND | 868 | #ifdef HAVE_XWAYLAND |
862 | if (fullscreen_view->type == SWAY_VIEW_XWAYLAND) { | 869 | render_unmanaged(output, damage, |
863 | render_unmanaged(output, damage, | 870 | &root_container.sway_root->xwayland_unmanaged); |
864 | &root_container.sway_root->xwayland_unmanaged); | ||
865 | } | ||
866 | #endif | 871 | #endif |
867 | } else { | 872 | } else { |
868 | float clear_color[] = {0.25f, 0.25f, 0.25f, 1.0f}; | 873 | float clear_color[] = {0.25f, 0.25f, 0.25f, 1.0f}; |
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 2a89880a..ee7a0704 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -110,6 +110,7 @@ static void copy_pending_state(struct sway_container *container, | |||
110 | state->swayc_y = container->y; | 110 | state->swayc_y = container->y; |
111 | state->swayc_width = container->width; | 111 | state->swayc_width = container->width; |
112 | state->swayc_height = container->height; | 112 | state->swayc_height = container->height; |
113 | state->is_fullscreen = container->is_fullscreen; | ||
113 | state->has_gaps = container->has_gaps; | 114 | state->has_gaps = container->has_gaps; |
114 | state->current_gaps = container->current_gaps; | 115 | state->current_gaps = container->current_gaps; |
115 | state->gaps_inner = container->gaps_inner; | 116 | state->gaps_inner = container->gaps_inner; |
@@ -122,7 +123,6 @@ static void copy_pending_state(struct sway_container *container, | |||
122 | state->view_y = view->y; | 123 | state->view_y = view->y; |
123 | state->view_width = view->width; | 124 | state->view_width = view->width; |
124 | state->view_height = view->height; | 125 | state->view_height = view->height; |
125 | state->is_fullscreen = view->is_fullscreen; | ||
126 | state->border = view->border; | 126 | state->border = view->border; |
127 | state->border_thickness = view->border_thickness; | 127 | state->border_thickness = view->border_thickness; |
128 | state->border_top = view->border_top; | 128 | state->border_top = view->border_top; |
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index f3e4fef8..e6e1527e 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -267,7 +267,7 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
267 | return; | 267 | return; |
268 | } | 268 | } |
269 | 269 | ||
270 | view_set_fullscreen(view, e->fullscreen); | 270 | container_set_fullscreen(view->swayc, e->fullscreen); |
271 | 271 | ||
272 | struct sway_container *output = container_parent(view->swayc, C_OUTPUT); | 272 | struct sway_container *output = container_parent(view->swayc, C_OUTPUT); |
273 | arrange_windows(output); | 273 | arrange_windows(output); |
@@ -338,7 +338,7 @@ static void handle_map(struct wl_listener *listener, void *data) { | |||
338 | view_map(view, view->wlr_xdg_surface->surface); | 338 | view_map(view, view->wlr_xdg_surface->surface); |
339 | 339 | ||
340 | if (xdg_surface->toplevel->client_pending.fullscreen) { | 340 | if (xdg_surface->toplevel->client_pending.fullscreen) { |
341 | view_set_fullscreen(view, true); | 341 | container_set_fullscreen(view->swayc, true); |
342 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); | 342 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); |
343 | arrange_windows(ws); | 343 | arrange_windows(ws); |
344 | } else { | 344 | } else { |
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 46fd4769..5feee3e4 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -262,7 +262,7 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
262 | return; | 262 | return; |
263 | } | 263 | } |
264 | 264 | ||
265 | view_set_fullscreen(view, e->fullscreen); | 265 | container_set_fullscreen(view->swayc, e->fullscreen); |
266 | 266 | ||
267 | struct sway_container *output = container_parent(view->swayc, C_OUTPUT); | 267 | struct sway_container *output = container_parent(view->swayc, C_OUTPUT); |
268 | arrange_windows(output); | 268 | arrange_windows(output); |
@@ -333,7 +333,7 @@ static void handle_map(struct wl_listener *listener, void *data) { | |||
333 | view_map(view, view->wlr_xdg_surface_v6->surface); | 333 | view_map(view, view->wlr_xdg_surface_v6->surface); |
334 | 334 | ||
335 | if (xdg_surface->toplevel->client_pending.fullscreen) { | 335 | if (xdg_surface->toplevel->client_pending.fullscreen) { |
336 | view_set_fullscreen(view, true); | 336 | container_set_fullscreen(view->swayc, true); |
337 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); | 337 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); |
338 | arrange_windows(ws); | 338 | arrange_windows(ws); |
339 | } else { | 339 | } else { |
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 65d4fcd4..390ca580 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -357,7 +357,7 @@ static void handle_map(struct wl_listener *listener, void *data) { | |||
357 | view_map(view, xsurface->surface); | 357 | view_map(view, xsurface->surface); |
358 | 358 | ||
359 | if (xsurface->fullscreen) { | 359 | if (xsurface->fullscreen) { |
360 | view_set_fullscreen(view, true); | 360 | container_set_fullscreen(view->swayc, true); |
361 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); | 361 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); |
362 | arrange_windows(ws); | 362 | arrange_windows(ws); |
363 | } else { | 363 | } else { |
@@ -395,7 +395,7 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
395 | if (!xsurface->mapped) { | 395 | if (!xsurface->mapped) { |
396 | return; | 396 | return; |
397 | } | 397 | } |
398 | view_set_fullscreen(view, xsurface->fullscreen); | 398 | container_set_fullscreen(view->swayc, xsurface->fullscreen); |
399 | 399 | ||
400 | struct sway_container *output = container_parent(view->swayc, C_OUTPUT); | 400 | struct sway_container *output = container_parent(view->swayc, C_OUTPUT); |
401 | arrange_windows(output); | 401 | arrange_windows(output); |