aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-27 17:18:16 -0400
committerDrew DeVault <sir@cmpwn.com>2018-03-27 18:51:41 -0400
commit52fe2688ea1068d5cd0801ead4fc078c3a37dea1 (patch)
treecf8b5a52b3117cd1ff3aa188d059b0a466145b2a /rootston
parent13edb19a6ca89da3fcbafd3be01d89251658178d (diff)
Address @emersion's feedback
Diffstat (limited to 'rootston')
-rw-r--r--rootston/desktop.c6
-rw-r--r--rootston/layer_shell.c19
2 files changed, 11 insertions, 14 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index a0659250..9ea392f6 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -209,12 +209,6 @@ void view_arrange_maximized(struct roots_view *view) {
usable_area.x += output_box->x;
usable_area.y += output_box->y;
- wlr_log(L_DEBUG, "output area: %dx%d@%d,%d",
- output_box->width, output_box->height,
- output_box->x, output_box->y);
- wlr_log(L_DEBUG, "usable area: %dx%d@%d,%d",
- usable_area.width, usable_area.height,
- usable_area.x, usable_area.y);
view_move_resize(view, usable_area.x, usable_area.y,
usable_area.width, usable_area.height);
view_rotate(view, 0);
diff --git a/rootston/layer_shell.c b/rootston/layer_shell.c
index 5efdf3c9..809ddbf3 100644
--- a/rootston/layer_shell.c
+++ b/rootston/layer_shell.c
@@ -82,14 +82,8 @@ static void arrange_layer(struct wlr_output *output, struct wl_list *list,
wl_list_for_each(roots_surface, list, link) {
struct wlr_layer_surface *layer = roots_surface->layer_surface;
struct wlr_layer_surface_state *state = &layer->current;
- if (exclusive) {
- if (state->exclusive_zone <= 0) {
- continue;
- }
- } else {
- if (state->exclusive_zone > 0) {
- continue;
- }
+ if (exclusive != (state->exclusive_zone >0)) {
+ continue;
}
struct wlr_box bounds;
if (state->exclusive_zone == -1) {
@@ -212,6 +206,10 @@ static void handle_output_mode(struct wl_listener *listener, void *data) {
arrange_layers((struct wlr_output *)data);
}
+static void handle_output_transform(struct wl_listener *listener, void *data) {
+ arrange_layers((struct wlr_output *)data);
+}
+
static void handle_surface_commit(struct wl_listener *listener, void *data) {
struct roots_layer_surface *layer =
wl_container_of(listener, layer, surface_commit);
@@ -254,6 +252,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
}
wl_list_remove(&layer->output_destroy.link);
wl_list_remove(&layer->output_mode.link);
+ wl_list_remove(&layer->output_transform.link);
arrange_layers(layer->layer_surface->output);
free(layer);
}
@@ -304,6 +303,10 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
wl_signal_add(&layer_surface->output->events.mode,
&roots_surface->output_mode);
+ roots_surface->output_transform.notify = handle_output_transform;
+ wl_signal_add(&layer_surface->output->events.transform,
+ &roots_surface->output_transform);
+
roots_surface->destroy.notify = handle_destroy;
wl_signal_add(&layer_surface->events.destroy, &roots_surface->destroy);
roots_surface->map.notify = handle_map;