aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2018-06-06 17:12:02 -0400
committerBrian Ashworth <bosrsf04@gmail.com>2018-06-06 20:11:24 -0400
commita0bbe67076b8e32b47a272bc1e96be853006c65d (patch)
tree3faf1af6058947968b958d2bdabdbc47ea3bfa06 /sway/desktop
parenta1b5b93d299bfe129f2b3409a7f642049fcce1d6 (diff)
Address emersions comments on output re-enabling
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/layer_shell.c4
-rw-r--r--sway/desktop/output.c10
2 files changed, 4 insertions, 10 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 2d355b74..3accdefb 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -252,7 +252,7 @@ static void unmap(struct sway_layer_surface *sway_layer) {
return;
}
struct sway_output *output = wlr_output->data;
- if (output == NULL) {
+ if (output == NULL || output->swayc == NULL) {
return;
}
output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y,
@@ -279,7 +279,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&sway_layer->surface_commit.link);
if (sway_layer->layer_surface->output != NULL) {
struct sway_output *output = sway_layer->layer_surface->output->data;
- if (output != NULL) {
+ if (output != NULL && output->swayc != NULL) {
arrange_layers(output);
}
wl_list_remove(&sway_layer->output_destroy.link);
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 5d02f5eb..cb53a980 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -1221,6 +1221,8 @@ void handle_new_output(struct wl_listener *listener, void *data) {
output->server = server;
list_add(root_container.sway_root->outputs, output);
+ output->damage = wlr_output_damage_create(wlr_output);
+
if (!wl_list_empty(&wlr_output->modes)) {
struct wlr_output_mode *mode =
wl_container_of(wlr_output->modes.prev, mode, link);
@@ -1233,14 +1235,6 @@ void handle_new_output(struct wl_listener *listener, void *data) {
void output_enable(struct sway_output *output) {
struct wlr_output *wlr_output = output->wlr_output;
- if (!wlr_output->data) {
- wlr_output->data = output;
- }
-
- if (!output->damage) {
- output->damage = wlr_output_damage_create(wlr_output);
- }
-
output->swayc = output_create(output);
if (!output->swayc) {
// Output is disabled