aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-06-26 14:24:15 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-06-26 14:24:15 +1000
commite8001e6fbe827f6ae6842cf9f221edb322bb570e (patch)
tree806530a903cfb330a1a54b9c9366f21a01133a38 /sway/desktop
parent50190bc7609d981c45d26cd0b7d6d0fbf66feb05 (diff)
Damage output when views toggle fullscreen
Also add workspace to the transaction when a view maps in fullscreen mode.
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/xdg_shell.c10
-rw-r--r--sway/desktop/xdg_shell_v6.c10
-rw-r--r--sway/desktop/xwayland.c12
3 files changed, 26 insertions, 6 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 105e77ae..484afd0c 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -221,8 +221,11 @@ static void handle_map(struct wl_listener *listener, void *data) {
if (xdg_surface->toplevel->client_pending.fullscreen) {
view_set_fullscreen(view, true);
+ struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
+ arrange_and_commit(ws);
+ } else {
+ arrange_and_commit(view->swayc->parent);
}
- arrange_and_commit(view->swayc->parent);
xdg_shell_view->commit.notify = handle_commit;
wl_signal_add(&xdg_surface->surface->events.commit,
@@ -269,7 +272,10 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
view_set_fullscreen(view, e->fullscreen);
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
- arrange_and_commit(ws);
+ struct sway_transaction *transaction = transaction_create();
+ arrange_windows(ws, transaction);
+ transaction_add_damage(transaction, container_get_box(ws->parent));
+ transaction_commit(transaction);
}
void handle_xdg_shell_surface(struct wl_listener *listener, void *data) {
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 19b30604..da2eda7a 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -220,8 +220,11 @@ static void handle_map(struct wl_listener *listener, void *data) {
if (xdg_surface->toplevel->client_pending.fullscreen) {
view_set_fullscreen(view, true);
+ struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
+ arrange_and_commit(ws);
+ } else {
+ arrange_and_commit(view->swayc->parent);
}
- arrange_and_commit(view->swayc->parent);
xdg_shell_v6_view->commit.notify = handle_commit;
wl_signal_add(&xdg_surface->surface->events.commit,
@@ -264,7 +267,10 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
view_set_fullscreen(view, e->fullscreen);
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
- arrange_and_commit(ws);
+ struct sway_transaction *transaction = transaction_create();
+ arrange_windows(ws, transaction);
+ transaction_add_damage(transaction, container_get_box(ws->parent));
+ transaction_commit(transaction);
}
void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index eea8420d..720ea2fd 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -286,8 +286,11 @@ static void handle_map(struct wl_listener *listener, void *data) {
if (xsurface->fullscreen) {
view_set_fullscreen(view, true);
+ struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
+ arrange_and_commit(ws);
+ } else {
+ arrange_and_commit(view->swayc->parent);
}
- arrange_and_commit(view->swayc->parent);
}
static void handle_destroy(struct wl_listener *listener, void *data) {
@@ -337,7 +340,12 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
return;
}
view_set_fullscreen(view, xsurface->fullscreen);
- arrange_and_commit(view->swayc);
+
+ struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
+ struct sway_transaction *transaction = transaction_create();
+ arrange_windows(ws, transaction);
+ transaction_add_damage(transaction, container_get_box(ws->parent));
+ transaction_commit(transaction);
}
static void handle_set_title(struct wl_listener *listener, void *data) {