aboutsummaryrefslogtreecommitdiff
path: root/examples
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 /examples
parentd466cc117f95d34e239049a5af701b7ba696d336 (diff)
Identify topmost interactive layer surface
Diffstat (limited to 'examples')
-rw-r--r--examples/layer-shell.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/layer-shell.c b/examples/layer-shell.c
index f084d10f..591213d0 100644
--- a/examples/layer-shell.c
+++ b/examples/layer-shell.c
@@ -36,6 +36,7 @@ static int32_t margin_top = 0;
static double alpha = 1.0;
static bool run_display = true;
static bool animate = false;
+static bool keyboard_interactive = false;
static double frame = 0;
static int cur_x = -1, cur_y = -1;
static int buttons = 0;
@@ -274,7 +275,7 @@ int main(int argc, char **argv) {
int32_t margin_right = 0, margin_bottom = 0, margin_left = 0;
bool found;
int c;
- while ((c = getopt(argc, argv, "nw:h:o:l:a:x:m:t:")) != -1) {
+ while ((c = getopt(argc, argv, "knw:h:o:l:a:x:m:t:")) != -1) {
switch (c) {
case 'o':
output = atoi(optarg);
@@ -354,6 +355,9 @@ int main(int argc, char **argv) {
case 'n':
animate = true;
break;
+ case 'k':
+ keyboard_interactive = true;
+ break;
default:
break;
}
@@ -407,9 +411,10 @@ int main(int argc, char **argv) {
zwlr_layer_surface_v1_set_exclusive_zone(layer_surface, exclusive_zone);
zwlr_layer_surface_v1_set_margin(layer_surface,
margin_top, margin_right, margin_bottom, margin_left);
+ zwlr_layer_surface_v1_set_keyboard_interactivity(
+ layer_surface, keyboard_interactive);
zwlr_layer_surface_v1_add_listener(layer_surface,
- &layer_surface_listener, layer_surface);
- // TODO: interactivity
+ &layer_surface_listener, layer_surface);
wl_surface_commit(wl_surface);
wl_display_roundtrip(display);