aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-02 15:16:14 -0400
committerDrew DeVault <sir@cmpwn.com>2018-04-02 15:16:14 -0400
commit883d8d306c704a4bcc496402b2ce5f67934440c5 (patch)
tree69dbe09fc4ea27eb85970010b445ab327c001f8a /rootston
parentd466cc117f95d34e239049a5af701b7ba696d336 (diff)
Identify topmost interactive layer surface
Diffstat (limited to 'rootston')
-rw-r--r--rootston/layer_shell.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/rootston/layer_shell.c b/rootston/layer_shell.c
index d3a91659..0304cff4 100644
--- a/rootston/layer_shell.c
+++ b/rootston/layer_shell.c
@@ -192,6 +192,29 @@ void arrange_layers(struct roots_output *output) {
arrange_layer(output->wlr_output,
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND],
&usable_area, false);
+
+ // Find topmost keyboard interactive layer, if such a layer exists
+ uint32_t layers_above_shell[] = {
+ ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
+ ZWLR_LAYER_SHELL_V1_LAYER_TOP,
+ };
+ struct roots_layer_surface *layer, *topmost = NULL;
+ for (size_t i = 0;
+ i < sizeof(layers_above_shell) / sizeof(layers_above_shell[0]);
+ ++i) {
+ wl_list_for_each_reverse(layer,
+ &output->layers[layers_above_shell[i]],
+ link) {
+ if (layer->layer_surface->current.keyboard_interactive) {
+ topmost = layer;
+ break;
+ }
+ }
+ if (topmost != NULL) {
+ break;
+ }
+ }
+ wlr_log(L_DEBUG, "topmost interactive layer: %p", topmost);
}
static void handle_output_destroy(struct wl_listener *listener, void *data) {