diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2019-01-25 08:29:21 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2019-01-25 08:29:21 +1000 |
commit | 20aa8ee67dc528299dbc8735220a1c081c7ff9f6 (patch) | |
tree | 685de48be3db51fc01510ccf051e2b63a4655fba /sway/desktop | |
parent | Update for swaywm/wlroots#1402 (diff) | |
download | sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.tar.gz sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.tar.zst sway-20aa8ee67dc528299dbc8735220a1c081c7ff9f6.zip |
Implement fullscreen global
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 30 | ||||
-rw-r--r-- | sway/desktop/render.c | 10 | ||||
-rw-r--r-- | sway/desktop/transaction.c | 2 | ||||
-rw-r--r-- | sway/desktop/xdg_shell.c | 2 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 2 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 2 |
6 files changed, 33 insertions, 15 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index f18a118f..b5f164cb 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -251,17 +251,27 @@ static void output_for_each_surface(struct sway_output *output, | |||
251 | }; | 251 | }; |
252 | 252 | ||
253 | struct sway_workspace *workspace = output_get_active_workspace(output); | 253 | struct sway_workspace *workspace = output_get_active_workspace(output); |
254 | if (workspace->current.fullscreen) { | 254 | struct sway_container *fullscreen_con = root->fullscreen_global; |
255 | for_each_surface_container_iterator( | 255 | if (fullscreen_con && fullscreen_con->scratchpad && |
256 | workspace->current.fullscreen, &data); | 256 | !fullscreen_con->workspace) { |
257 | container_for_each_child(workspace->current.fullscreen, | 257 | fullscreen_con = NULL; |
258 | } | ||
259 | if (!fullscreen_con) { | ||
260 | fullscreen_con = workspace->current.fullscreen; | ||
261 | } | ||
262 | if (fullscreen_con) { | ||
263 | for_each_surface_container_iterator(fullscreen_con, &data); | ||
264 | container_for_each_child(fullscreen_con, | ||
258 | for_each_surface_container_iterator, &data); | 265 | for_each_surface_container_iterator, &data); |
259 | for (int i = 0; i < workspace->current.floating->length; ++i) { | 266 | |
260 | struct sway_container *floater = | 267 | // TODO: Show transient containers for fullscreen global |
261 | workspace->current.floating->items[i]; | 268 | if (fullscreen_con == workspace->current.fullscreen) { |
262 | if (container_is_transient_for(floater, | 269 | for (int i = 0; i < workspace->current.floating->length; ++i) { |
263 | workspace->current.fullscreen)) { | 270 | struct sway_container *floater = |
264 | for_each_surface_container_iterator(floater, &data); | 271 | workspace->current.floating->items[i]; |
272 | if (container_is_transient_for(floater, fullscreen_con)) { | ||
273 | for_each_surface_container_iterator(floater, &data); | ||
274 | } | ||
265 | } | 275 | } |
266 | } | 276 | } |
267 | #if HAVE_XWAYLAND | 277 | #if HAVE_XWAYLAND |
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index a38c6a07..fa27500e 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -985,7 +985,15 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
985 | goto render_overlay; | 985 | goto render_overlay; |
986 | } | 986 | } |
987 | 987 | ||
988 | struct sway_container *fullscreen_con = workspace->current.fullscreen; | 988 | struct sway_container *fullscreen_con = root->fullscreen_global; |
989 | if (fullscreen_con && fullscreen_con->scratchpad && | ||
990 | !fullscreen_con->workspace) { | ||
991 | fullscreen_con = NULL; | ||
992 | } | ||
993 | if (!fullscreen_con) { | ||
994 | fullscreen_con = workspace->current.fullscreen; | ||
995 | } | ||
996 | |||
989 | if (fullscreen_con) { | 997 | if (fullscreen_con) { |
990 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; | 998 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; |
991 | 999 | ||
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 55cf1c5e..b06ac9cc 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -134,7 +134,7 @@ static void copy_container_state(struct sway_container *container, | |||
134 | state->y = container->y; | 134 | state->y = container->y; |
135 | state->width = container->width; | 135 | state->width = container->width; |
136 | state->height = container->height; | 136 | state->height = container->height; |
137 | state->is_fullscreen = container->is_fullscreen; | 137 | state->fullscreen_mode = container->fullscreen_mode; |
138 | state->parent = container->parent; | 138 | state->parent = container->parent; |
139 | state->workspace = container->workspace; | 139 | state->workspace = container->workspace; |
140 | state->border = container->border; | 140 | state->border = container->border; |
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index e2c614b3..007b0a94 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -349,7 +349,7 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
349 | 349 | ||
350 | container_set_fullscreen(view->container, e->fullscreen); | 350 | container_set_fullscreen(view->container, e->fullscreen); |
351 | 351 | ||
352 | arrange_workspace(view->container->workspace); | 352 | arrange_root(); |
353 | transaction_commit_dirty(); | 353 | transaction_commit_dirty(); |
354 | } | 354 | } |
355 | 355 | ||
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index f11c00b1..386e350e 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -342,7 +342,7 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
342 | 342 | ||
343 | container_set_fullscreen(view->container, e->fullscreen); | 343 | container_set_fullscreen(view->container, e->fullscreen); |
344 | 344 | ||
345 | arrange_workspace(view->container->workspace); | 345 | arrange_root(); |
346 | transaction_commit_dirty(); | 346 | transaction_commit_dirty(); |
347 | } | 347 | } |
348 | 348 | ||
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 4ea661f8..d9e1b0a9 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -453,7 +453,7 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
453 | } | 453 | } |
454 | container_set_fullscreen(view->container, xsurface->fullscreen); | 454 | container_set_fullscreen(view->container, xsurface->fullscreen); |
455 | 455 | ||
456 | arrange_workspace(view->container->workspace); | 456 | arrange_root(); |
457 | transaction_commit_dirty(); | 457 | transaction_commit_dirty(); |
458 | } | 458 | } |
459 | 459 | ||