mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-08-29 15:22:07 +02:00
Added --non-exclusive parameter to skip requesting exclusive zone from compositor
This allows wvkbd to show on top of existing windows, not pushing them out of the way. Ref: https://github.com/jjsullivan5196/wvkbd/issues/102 Ref: https://github.com/jjsullivan5196/wvkbd/issues/93
This commit is contained in:
@@ -102,6 +102,7 @@ struct kbd {
|
|||||||
double preferred_scale, preferred_fractional_scale;
|
double preferred_scale, preferred_fractional_scale;
|
||||||
bool landscape;
|
bool landscape;
|
||||||
bool shift_space_is_tab;
|
bool shift_space_is_tab;
|
||||||
|
bool exclusive;
|
||||||
uint8_t mods;
|
uint8_t mods;
|
||||||
uint8_t compose;
|
uint8_t compose;
|
||||||
struct key *last_press;
|
struct key *last_press;
|
||||||
|
8
main.c
8
main.c
@@ -717,6 +717,9 @@ usage(char *argv0)
|
|||||||
" -l - Comma separated list of layers\n");
|
" -l - Comma separated list of layers\n");
|
||||||
fprintf(stderr, " --landscape-layers - Comma separated list of "
|
fprintf(stderr, " --landscape-layers - Comma separated list of "
|
||||||
"landscape layers\n");
|
"landscape layers\n");
|
||||||
|
fprintf(stderr, " --non-exclusive - Allow the keyboard to overlap"
|
||||||
|
" windows. Do not request an exclusive zone from the"
|
||||||
|
"compositor\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -783,7 +786,9 @@ show()
|
|||||||
|
|
||||||
zwlr_layer_surface_v1_set_size(layer_surface, 0, height);
|
zwlr_layer_surface_v1_set_size(layer_surface, 0, height);
|
||||||
zwlr_layer_surface_v1_set_anchor(layer_surface, anchor);
|
zwlr_layer_surface_v1_set_anchor(layer_surface, anchor);
|
||||||
|
if (keyboard.exclusive) {
|
||||||
zwlr_layer_surface_v1_set_exclusive_zone(layer_surface, height);
|
zwlr_layer_surface_v1_set_exclusive_zone(layer_surface, height);
|
||||||
|
}
|
||||||
zwlr_layer_surface_v1_set_keyboard_interactivity(layer_surface, false);
|
zwlr_layer_surface_v1_set_keyboard_interactivity(layer_surface, false);
|
||||||
zwlr_layer_surface_v1_add_listener(layer_surface, &layer_surface_listener,
|
zwlr_layer_surface_v1_add_listener(layer_surface, &layer_surface_listener,
|
||||||
NULL);
|
NULL);
|
||||||
@@ -852,6 +857,7 @@ main(int argc, char **argv)
|
|||||||
keyboard.layer_index = 0;
|
keyboard.layer_index = 0;
|
||||||
keyboard.preferred_scale = 1;
|
keyboard.preferred_scale = 1;
|
||||||
keyboard.preferred_fractional_scale = 0;
|
keyboard.preferred_fractional_scale = 0;
|
||||||
|
keyboard.exclusive = true;
|
||||||
|
|
||||||
uint8_t alpha = 0;
|
uint8_t alpha = 0;
|
||||||
bool alpha_defined = false;
|
bool alpha_defined = false;
|
||||||
@@ -987,6 +993,8 @@ main(int argc, char **argv)
|
|||||||
(!strcmp(argv[i], "--list-layers"))) {
|
(!strcmp(argv[i], "--list-layers"))) {
|
||||||
list_layers();
|
list_layers();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
} else if ((!strcmp(argv[i], "-non-exclusive")) || (!strcmp(argv[i], "--non-exclusive"))) {
|
||||||
|
keyboard.exclusive = false;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Invalid argument: %s\n", argv[i]);
|
fprintf(stderr, "Invalid argument: %s\n", argv[i]);
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
|
Reference in New Issue
Block a user