aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-09-14 19:21:44 +0200
committerLibravatar emersion <contact@emersion.fr>2018-09-14 19:21:44 +0200
commit7699c5444c32289a22ce2c57d1daadabed87e7ac (patch)
tree74696e6dd2f405e8629061ee010e14e3d6cf0b37
parentMerge pull request #2628 from RyanDwyer/remove-rejigger-assertion (diff)
downloadsway-7699c5444c32289a22ce2c57d1daadabed87e7ac.tar.gz
sway-7699c5444c32289a22ce2c57d1daadabed87e7ac.tar.zst
sway-7699c5444c32289a22ce2c57d1daadabed87e7ac.zip
Update for swaywm/wlroots#1243
-rw-r--r--include/sway/input/seat.h6
-rw-r--r--include/sway/layers.h8
-rw-r--r--include/sway/server.h4
-rw-r--r--protocols/wlr-layer-shell-unstable-v1.xml2
-rw-r--r--sway/desktop/layer_shell.c24
-rw-r--r--sway/desktop/output.c16
-rw-r--r--sway/input/cursor.c4
-rw-r--r--sway/input/seat.c2
-rw-r--r--sway/server.c4
9 files changed, 35 insertions, 35 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index e006faba..7b756ef3 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -1,7 +1,7 @@
1#ifndef _SWAY_INPUT_SEAT_H 1#ifndef _SWAY_INPUT_SEAT_H
2#define _SWAY_INPUT_SEAT_H 2#define _SWAY_INPUT_SEAT_H
3 3
4#include <wlr/types/wlr_layer_shell.h> 4#include <wlr/types/wlr_layer_shell_v1.h>
5#include <wlr/types/wlr_seat.h> 5#include <wlr/types/wlr_seat.h>
6#include <wlr/util/edges.h> 6#include <wlr/util/edges.h>
7#include "sway/input/input-manager.h" 7#include "sway/input/input-manager.h"
@@ -53,7 +53,7 @@ struct sway_seat {
53 struct wl_list focus_stack; // list of containers in focus order 53 struct wl_list focus_stack; // list of containers in focus order
54 54
55 // If the focused layer is set, views cannot receive keyboard focus 55 // If the focused layer is set, views cannot receive keyboard focus
56 struct wlr_layer_surface *focused_layer; 56 struct wlr_layer_surface_v1 *focused_layer;
57 57
58 // If exclusive_client is set, no other clients will receive input events 58 // If exclusive_client is set, no other clients will receive input events
59 struct wl_client *exclusive_client; 59 struct wl_client *exclusive_client;
@@ -119,7 +119,7 @@ void seat_set_focus_surface(struct sway_seat *seat,
119 struct wlr_surface *surface, bool unfocus); 119 struct wlr_surface *surface, bool unfocus);
120 120
121void seat_set_focus_layer(struct sway_seat *seat, 121void seat_set_focus_layer(struct sway_seat *seat,
122 struct wlr_layer_surface *layer); 122 struct wlr_layer_surface_v1 *layer);
123 123
124void seat_set_exclusive_client(struct sway_seat *seat, 124void seat_set_exclusive_client(struct sway_seat *seat,
125 struct wl_client *client); 125 struct wl_client *client);
diff --git a/include/sway/layers.h b/include/sway/layers.h
index 96155eae..51878fc9 100644
--- a/include/sway/layers.h
+++ b/include/sway/layers.h
@@ -3,10 +3,10 @@
3#include <stdbool.h> 3#include <stdbool.h>
4#include <wlr/types/wlr_box.h> 4#include <wlr/types/wlr_box.h>
5#include <wlr/types/wlr_surface.h> 5#include <wlr/types/wlr_surface.h>
6#include <wlr/types/wlr_layer_shell.h> 6#include <wlr/types/wlr_layer_shell_v1.h>
7 7
8struct sway_layer_surface { 8struct sway_layer_surface {
9 struct wlr_layer_surface *layer_surface; 9 struct wlr_layer_surface_v1 *layer_surface;
10 struct wl_list link; 10 struct wl_list link;
11 11
12 struct wl_listener destroy; 12 struct wl_listener destroy;
@@ -22,7 +22,7 @@ struct sway_layer_surface {
22struct sway_output; 22struct sway_output;
23void arrange_layers(struct sway_output *output); 23void arrange_layers(struct sway_output *output);
24 24
25struct sway_layer_surface *layer_from_wlr_layer_surface( 25struct sway_layer_surface *layer_from_wlr_layer_surface_v1(
26 struct wlr_layer_surface *layer_surface); 26 struct wlr_layer_surface_v1 *layer_surface);
27 27
28#endif 28#endif
diff --git a/include/sway/server.h b/include/sway/server.h
index 07e0949a..5dabb61f 100644
--- a/include/sway/server.h
+++ b/include/sway/server.h
@@ -7,7 +7,7 @@
7#include <wlr/render/wlr_renderer.h> 7#include <wlr/render/wlr_renderer.h>
8#include <wlr/types/wlr_compositor.h> 8#include <wlr/types/wlr_compositor.h>
9#include <wlr/types/wlr_data_device.h> 9#include <wlr/types/wlr_data_device.h>
10#include <wlr/types/wlr_layer_shell.h> 10#include <wlr/types/wlr_layer_shell_v1.h>
11#include <wlr/types/wlr_server_decoration.h> 11#include <wlr/types/wlr_server_decoration.h>
12#include <wlr/types/wlr_xdg_shell_v6.h> 12#include <wlr/types/wlr_xdg_shell_v6.h>
13#include <wlr/types/wlr_xdg_shell.h> 13#include <wlr/types/wlr_xdg_shell.h>
@@ -35,7 +35,7 @@ struct sway_server {
35 struct wlr_idle *idle; 35 struct wlr_idle *idle;
36 struct sway_idle_inhibit_manager_v1 *idle_inhibit_manager_v1; 36 struct sway_idle_inhibit_manager_v1 *idle_inhibit_manager_v1;
37 37
38 struct wlr_layer_shell *layer_shell; 38 struct wlr_layer_shell_v1 *layer_shell;
39 struct wl_listener layer_shell_surface; 39 struct wl_listener layer_shell_surface;
40 40
41 struct wlr_xdg_shell_v6 *xdg_shell_v6; 41 struct wlr_xdg_shell_v6 *xdg_shell_v6;
diff --git a/protocols/wlr-layer-shell-unstable-v1.xml b/protocols/wlr-layer-shell-unstable-v1.xml
index 6a5d5d35..2bb72edd 100644
--- a/protocols/wlr-layer-shell-unstable-v1.xml
+++ b/protocols/wlr-layer-shell-unstable-v1.xml
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="wlr_layer_shell_unstable_v1"> 2<protocol name="wlr_layer_shell_v1_unstable_v1">
3 <copyright> 3 <copyright>
4 Copyright © 2017 Drew DeVault 4 Copyright © 2017 Drew DeVault
5 5
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 076bacc4..e09282b2 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -3,7 +3,7 @@
3#include <string.h> 3#include <string.h>
4#include <wayland-server.h> 4#include <wayland-server.h>
5#include <wlr/types/wlr_box.h> 5#include <wlr/types/wlr_box.h>
6#include <wlr/types/wlr_layer_shell.h> 6#include <wlr/types/wlr_layer_shell_v1.h>
7#include <wlr/types/wlr_output_damage.h> 7#include <wlr/types/wlr_output_damage.h>
8#include <wlr/types/wlr_output.h> 8#include <wlr/types/wlr_output.h>
9#include <wlr/util/log.h> 9#include <wlr/util/log.h>
@@ -86,8 +86,8 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
86 wlr_output_effective_resolution(output->wlr_output, 86 wlr_output_effective_resolution(output->wlr_output,
87 &full_area.width, &full_area.height); 87 &full_area.width, &full_area.height);
88 wl_list_for_each(sway_layer, list, link) { 88 wl_list_for_each(sway_layer, list, link) {
89 struct wlr_layer_surface *layer = sway_layer->layer_surface; 89 struct wlr_layer_surface_v1 *layer = sway_layer->layer_surface;
90 struct wlr_layer_surface_state *state = &layer->current; 90 struct wlr_layer_surface_v1_state *state = &layer->current;
91 if (exclusive != (state->exclusive_zone > 0)) { 91 if (exclusive != (state->exclusive_zone > 0)) {
92 continue; 92 continue;
93 } 93 }
@@ -146,7 +146,7 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
146 } 146 }
147 if (box.width < 0 || box.height < 0) { 147 if (box.width < 0 || box.height < 0) {
148 // TODO: Bubble up a protocol error? 148 // TODO: Bubble up a protocol error?
149 wlr_layer_surface_close(layer); 149 wlr_layer_surface_v1_close(layer);
150 continue; 150 continue;
151 } 151 }
152 // Apply 152 // Apply
@@ -154,7 +154,7 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
154 apply_exclusive(usable_area, state->anchor, state->exclusive_zone, 154 apply_exclusive(usable_area, state->anchor, state->exclusive_zone,
155 state->margin.top, state->margin.right, 155 state->margin.top, state->margin.right,
156 state->margin.bottom, state->margin.left); 156 state->margin.bottom, state->margin.left);
157 wlr_layer_surface_configure(layer, box.width, box.height); 157 wlr_layer_surface_v1_configure(layer, box.width, box.height);
158 } 158 }
159} 159}
160 160
@@ -223,13 +223,13 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) {
223 wl_list_remove(&sway_layer->link); 223 wl_list_remove(&sway_layer->link);
224 wl_list_init(&sway_layer->link); 224 wl_list_init(&sway_layer->link);
225 sway_layer->layer_surface->output = NULL; 225 sway_layer->layer_surface->output = NULL;
226 wlr_layer_surface_close(sway_layer->layer_surface); 226 wlr_layer_surface_v1_close(sway_layer->layer_surface);
227} 227}
228 228
229static void handle_surface_commit(struct wl_listener *listener, void *data) { 229static void handle_surface_commit(struct wl_listener *listener, void *data) {
230 struct sway_layer_surface *layer = 230 struct sway_layer_surface *layer =
231 wl_container_of(listener, layer, surface_commit); 231 wl_container_of(listener, layer, surface_commit);
232 struct wlr_layer_surface *layer_surface = layer->layer_surface; 232 struct wlr_layer_surface_v1 *layer_surface = layer->layer_surface;
233 struct wlr_output *wlr_output = layer_surface->output; 233 struct wlr_output *wlr_output = layer_surface->output;
234 if (wlr_output == NULL) { 234 if (wlr_output == NULL) {
235 return; 235 return;
@@ -312,13 +312,13 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
312 unmap(sway_layer); 312 unmap(sway_layer);
313} 313}
314 314
315struct sway_layer_surface *layer_from_wlr_layer_surface( 315struct sway_layer_surface *layer_from_wlr_layer_surface_v1(
316 struct wlr_layer_surface *layer_surface) { 316 struct wlr_layer_surface_v1 *layer_surface) {
317 return layer_surface->data; 317 return layer_surface->data;
318} 318}
319 319
320void handle_layer_shell_surface(struct wl_listener *listener, void *data) { 320void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
321 struct wlr_layer_surface *layer_surface = data; 321 struct wlr_layer_surface_v1 *layer_surface = data;
322 struct sway_server *server = 322 struct sway_server *server =
323 wl_container_of(listener, server, layer_shell_surface); 323 wl_container_of(listener, server, layer_shell_surface);
324 wlr_log(WLR_DEBUG, "new layer surface: namespace %s layer %d anchor %d " 324 wlr_log(WLR_DEBUG, "new layer surface: namespace %s layer %d anchor %d "
@@ -345,7 +345,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
345 if (!output) { 345 if (!output) {
346 if (!sway_assert(root->outputs->length, 346 if (!sway_assert(root->outputs->length,
347 "cannot auto-assign output for layer")) { 347 "cannot auto-assign output for layer")) {
348 wlr_layer_surface_close(layer_surface); 348 wlr_layer_surface_v1_close(layer_surface);
349 return; 349 return;
350 } 350 }
351 output = root->outputs->items[0]; 351 output = root->outputs->items[0];
@@ -382,7 +382,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
382 382
383 // Temporarily set the layer's current state to client_pending 383 // Temporarily set the layer's current state to client_pending
384 // So that we can easily arrange it 384 // So that we can easily arrange it
385 struct wlr_layer_surface_state old_state = layer_surface->current; 385 struct wlr_layer_surface_v1_state old_state = layer_surface->current;
386 layer_surface->current = layer_surface->client_pending; 386 layer_surface->current = layer_surface->client_pending;
387 arrange_layers(output); 387 arrange_layers(output);
388 layer_surface->current = old_state; 388 layer_surface->current = old_state;
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index e49c4cca..a5db15cd 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -182,9 +182,9 @@ void output_layer_for_each_surface(struct sway_output *output,
182 void *user_data) { 182 void *user_data) {
183 struct sway_layer_surface *layer_surface; 183 struct sway_layer_surface *layer_surface;
184 wl_list_for_each(layer_surface, layer_surfaces, link) { 184 wl_list_for_each(layer_surface, layer_surfaces, link) {
185 struct wlr_layer_surface *wlr_layer_surface = 185 struct wlr_layer_surface_v1 *wlr_layer_surface_v1 =
186 layer_surface->layer_surface; 186 layer_surface->layer_surface;
187 output_surface_for_each_surface(output, wlr_layer_surface->surface, 187 output_surface_for_each_surface(output, wlr_layer_surface_v1->surface,
188 layer_surface->geo.x, layer_surface->geo.y, iterator, 188 layer_surface->geo.x, layer_surface->geo.y, iterator,
189 user_data); 189 user_data);
190 } 190 }
@@ -240,15 +240,15 @@ struct sway_workspace *output_get_active_workspace(struct sway_output *output) {
240} 240}
241 241
242bool output_has_opaque_overlay_layer_surface(struct sway_output *output) { 242bool output_has_opaque_overlay_layer_surface(struct sway_output *output) {
243 struct wlr_layer_surface *wlr_layer_surface; 243 struct wlr_layer_surface_v1 *wlr_layer_surface_v1;
244 wl_list_for_each(wlr_layer_surface, &server.layer_shell->surfaces, link) { 244 wl_list_for_each(wlr_layer_surface_v1, &server.layer_shell->surfaces, link) {
245 if (wlr_layer_surface->output != output->wlr_output || 245 if (wlr_layer_surface_v1->output != output->wlr_output ||
246 wlr_layer_surface->layer != ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) { 246 wlr_layer_surface_v1->layer != ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
247 continue; 247 continue;
248 } 248 }
249 struct wlr_surface *wlr_surface = wlr_layer_surface->surface; 249 struct wlr_surface *wlr_surface = wlr_layer_surface_v1->surface;
250 struct sway_layer_surface *sway_layer_surface = 250 struct sway_layer_surface *sway_layer_surface =
251 layer_from_wlr_layer_surface(wlr_layer_surface); 251 layer_from_wlr_layer_surface_v1(wlr_layer_surface_v1);
252 pixman_box32_t output_box = { 252 pixman_box32_t output_box = {
253 .x2 = output->width, 253 .x2 = output->width,
254 .y2 = output->height, 254 .y2 = output->height,
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index dc66d82d..85951c09 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -807,8 +807,8 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
807 807
808 // Handle clicking a layer surface 808 // Handle clicking a layer surface
809 if (surface && wlr_surface_is_layer_surface(surface)) { 809 if (surface && wlr_surface_is_layer_surface(surface)) {
810 struct wlr_layer_surface *layer = 810 struct wlr_layer_surface_v1 *layer =
811 wlr_layer_surface_from_wlr_surface(surface); 811 wlr_layer_surface_v1_from_wlr_surface(surface);
812 if (layer->current.keyboard_interactive) { 812 if (layer->current.keyboard_interactive) {
813 seat_set_focus_layer(seat, layer); 813 seat_set_focus_layer(seat, layer);
814 } 814 }
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 8704f90f..ab5047b2 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -769,7 +769,7 @@ void seat_set_focus_surface(struct sway_seat *seat,
769} 769}
770 770
771void seat_set_focus_layer(struct sway_seat *seat, 771void seat_set_focus_layer(struct sway_seat *seat,
772 struct wlr_layer_surface *layer) { 772 struct wlr_layer_surface_v1 *layer) {
773 if (!layer && seat->focused_layer) { 773 if (!layer && seat->focused_layer) {
774 seat->focused_layer = NULL; 774 seat->focused_layer = NULL;
775 struct sway_node *previous = seat_get_focus_inactive(seat, &root->node); 775 struct sway_node *previous = seat_get_focus_inactive(seat, &root->node);
diff --git a/sway/server.c b/sway/server.c
index 09ebe83f..58843944 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -11,7 +11,7 @@
11#include <wlr/types/wlr_gamma_control.h> 11#include <wlr/types/wlr_gamma_control.h>
12#include <wlr/types/wlr_gamma_control_v1.h> 12#include <wlr/types/wlr_gamma_control_v1.h>
13#include <wlr/types/wlr_idle.h> 13#include <wlr/types/wlr_idle.h>
14#include <wlr/types/wlr_layer_shell.h> 14#include <wlr/types/wlr_layer_shell_v1.h>
15#include <wlr/types/wlr_primary_selection.h> 15#include <wlr/types/wlr_primary_selection.h>
16#include <wlr/types/wlr_screencopy_v1.h> 16#include <wlr/types/wlr_screencopy_v1.h>
17#include <wlr/types/wlr_server_decoration.h> 17#include <wlr/types/wlr_server_decoration.h>
@@ -67,7 +67,7 @@ bool server_init(struct sway_server *server) {
67 server->idle_inhibit_manager_v1 = 67 server->idle_inhibit_manager_v1 =
68 sway_idle_inhibit_manager_v1_create(server->wl_display, server->idle); 68 sway_idle_inhibit_manager_v1_create(server->wl_display, server->idle);
69 69
70 server->layer_shell = wlr_layer_shell_create(server->wl_display); 70 server->layer_shell = wlr_layer_shell_v1_create(server->wl_display);
71 wl_signal_add(&server->layer_shell->events.new_surface, 71 wl_signal_add(&server->layer_shell->events.new_surface,
72 &server->layer_shell_surface); 72 &server->layer_shell_surface);
73 server->layer_shell_surface.notify = handle_layer_shell_surface; 73 server->layer_shell_surface.notify = handle_layer_shell_surface;