aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorBrian Ashworth <RedSoxFan@users.noreply.github.com>2018-07-25 21:30:56 -0400
committerGitHub <noreply@github.com>2018-07-25 21:30:56 -0400
commit75ebeb4a167ca218af37fa9041223a6450dc20f4 (patch)
tree47456198945ceea9f105dc9122ebbdf2013872ce /sway/desktop
parentc8dc9b3b3094c9b2778309855114b9495518c2d4 (diff)
parent868dcde14ef2116fcbd5c2c66badf2bcc514bba3 (diff)
Merge pull request #2356 from RyanDwyer/fullscreen-containers
Allow containers to be fullscreen
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c14
-rw-r--r--sway/desktop/render.c23
-rw-r--r--sway/desktop/transaction.c2
-rw-r--r--sway/desktop/xdg_shell.c4
-rw-r--r--sway/desktop/xdg_shell_v6.c4
-rw-r--r--sway/desktop/xwayland.c4
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) {
struct sway_container *workspace = output_get_active_workspace(output);
if (workspace->current.ws_fullscreen) {
- send_frame_done_container_iterator(
- workspace->current.ws_fullscreen->swayc, &data);
-#ifdef HAVE_XWAYLAND
- if (workspace->current.ws_fullscreen->type == SWAY_VIEW_XWAYLAND) {
- send_frame_done_unmanaged(&data,
- &root_container.sway_root->xwayland_unmanaged);
+ if (workspace->current.ws_fullscreen->type == C_VIEW) {
+ send_frame_done_container_iterator(
+ workspace->current.ws_fullscreen, &data);
+ } else {
+ send_frame_done_container(&data, workspace->current.ws_fullscreen);
}
+#ifdef HAVE_XWAYLAND
+ send_frame_done_unmanaged(&data,
+ &root_container.sway_root->xwayland_unmanaged);
#endif
} else {
send_frame_done_layer(&data,
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 15c5b94c..d2f1c9f2 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,
}
struct sway_container *workspace = output_get_active_workspace(output);
- struct sway_view *fullscreen_view = workspace->current.ws_fullscreen;
+ struct sway_container *fullscreen_con = workspace->current.ws_fullscreen;
if (output_has_opaque_overlay_layer_surface(output)) {
goto render_overlay;
}
- if (fullscreen_view) {
+ if (fullscreen_con) {
float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f};
int nrects;
@@ -853,16 +853,21 @@ void output_render(struct sway_output *output, struct timespec *when,
}
// TODO: handle views smaller than the output
- if (fullscreen_view->swayc->instructions->length) {
- render_saved_view(fullscreen_view, output, damage, 1.0f);
+ if (fullscreen_con->type == C_VIEW) {
+ if (fullscreen_con->instructions->length) {
+ render_saved_view(fullscreen_con->sway_view,
+ output, damage, 1.0f);
+ } else {
+ render_view_surfaces(fullscreen_con->sway_view,
+ output, damage, 1.0f);
+ }
} else {
- render_view_surfaces(fullscreen_view, output, damage, 1.0f);
+ render_container(output, damage, fullscreen_con,
+ fullscreen_con->current.focused);
}
#ifdef HAVE_XWAYLAND
- if (fullscreen_view->type == SWAY_VIEW_XWAYLAND) {
- render_unmanaged(output, damage,
- &root_container.sway_root->xwayland_unmanaged);
- }
+ render_unmanaged(output, damage,
+ &root_container.sway_root->xwayland_unmanaged);
#endif
} else {
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,
state->swayc_y = container->y;
state->swayc_width = container->width;
state->swayc_height = container->height;
+ state->is_fullscreen = container->is_fullscreen;
state->has_gaps = container->has_gaps;
state->current_gaps = container->current_gaps;
state->gaps_inner = container->gaps_inner;
@@ -122,7 +123,6 @@ static void copy_pending_state(struct sway_container *container,
state->view_y = view->y;
state->view_width = view->width;
state->view_height = view->height;
- state->is_fullscreen = view->is_fullscreen;
state->border = view->border;
state->border_thickness = view->border_thickness;
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)
return;
}
- view_set_fullscreen(view, e->fullscreen);
+ container_set_fullscreen(view->swayc, e->fullscreen);
struct sway_container *output = container_parent(view->swayc, C_OUTPUT);
arrange_windows(output);
@@ -338,7 +338,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
view_map(view, view->wlr_xdg_surface->surface);
if (xdg_surface->toplevel->client_pending.fullscreen) {
- view_set_fullscreen(view, true);
+ container_set_fullscreen(view->swayc, true);
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
arrange_windows(ws);
} 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)
return;
}
- view_set_fullscreen(view, e->fullscreen);
+ container_set_fullscreen(view->swayc, e->fullscreen);
struct sway_container *output = container_parent(view->swayc, C_OUTPUT);
arrange_windows(output);
@@ -333,7 +333,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
view_map(view, view->wlr_xdg_surface_v6->surface);
if (xdg_surface->toplevel->client_pending.fullscreen) {
- view_set_fullscreen(view, true);
+ container_set_fullscreen(view->swayc, true);
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
arrange_windows(ws);
} 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) {
view_map(view, xsurface->surface);
if (xsurface->fullscreen) {
- view_set_fullscreen(view, true);
+ container_set_fullscreen(view->swayc, true);
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
arrange_windows(ws);
} else {
@@ -395,7 +395,7 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
if (!xsurface->mapped) {
return;
}
- view_set_fullscreen(view, xsurface->fullscreen);
+ container_set_fullscreen(view->swayc, xsurface->fullscreen);
struct sway_container *output = container_parent(view->swayc, C_OUTPUT);
arrange_windows(output);