weston-keyboard: Enable to set as overlay panel

input-method-v1 protocol provides two surface type for the input
panel, `toplevel` and `overlay`. But there is no example for the later
one. This change enables to set weston-keyboard as overlay panel by the
environment variable `WESTON_KEYBOARD_SURFACE_TYPE=overlay` to
demonstrate this feature. In Addition, add weston.ini option
`overlay-keyboard` to set it.

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
This commit is contained in:
Takuro Ashie
2021-09-15 13:54:29 +09:00
parent beff0bd0f9
commit 5ff978a52b
3 changed files with 38 additions and 2 deletions
+7
View File
@@ -103,6 +103,7 @@ struct text_backend {
struct {
char *path;
bool overlay_keyboard;
struct wl_client *client;
unsigned deathcount;
@@ -993,6 +994,9 @@ launch_input_method(struct text_backend *text_backend)
if (strcmp(text_backend->input_method.path, "") == 0)
return;
if (text_backend->input_method.overlay_keyboard)
setenv("WESTON_KEYBOARD_SURFACE_TYPE", "overlay", 1);
text_backend->input_method.client =
weston_client_start(text_backend->compositor,
text_backend->input_method.path);
@@ -1060,6 +1064,9 @@ text_backend_configuration(struct text_backend *text_backend)
weston_config_section_get_string(section, "path",
&text_backend->input_method.path,
client);
weston_config_section_get_bool(section, "overlay-keyboard",
&text_backend->input_method.overlay_keyboard,
false);
free(client);
}