mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-15 05:34:33 -04:00
feat: support input method
The ime.c is basically derived from sway's text_input.c.
This commit is contained in:
parent
360e259ca5
commit
d2316a3407
9 changed files with 960 additions and 19 deletions
19
cage.c
19
cage.c
|
|
@ -52,6 +52,7 @@
|
|||
#endif
|
||||
|
||||
#include "idle_inhibit_v1.h"
|
||||
#include "ime.h"
|
||||
#include "output.h"
|
||||
#include "seat.h"
|
||||
#include "server.h"
|
||||
|
|
@ -527,6 +528,24 @@ main(int argc, char *argv[])
|
|||
goto end;
|
||||
}
|
||||
|
||||
server.input_method_manager_v2 = wlr_input_method_manager_v2_create(server.wl_display);
|
||||
if (!server.input_method_manager_v2) {
|
||||
wlr_log(WLR_ERROR, "Unable to create the input method manager");
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
server.new_input_method.notify = cg_ime_handle_new_input_method;
|
||||
wl_signal_add(&server.input_method_manager_v2->events.input_method, &server.new_input_method);
|
||||
|
||||
server.text_input_manager_v3 = wlr_text_input_manager_v3_create(server.wl_display);
|
||||
if (!server.text_input_manager_v3) {
|
||||
wlr_log(WLR_ERROR, "Unable to create the text input manager");
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
server.new_text_input.notify = cg_ime_handle_new_text_input;
|
||||
wl_signal_add(&server.text_input_manager_v3->events.text_input, &server.new_text_input);
|
||||
|
||||
#if CAGE_HAS_XWAYLAND
|
||||
struct wlr_xcursor_manager *xcursor_manager = NULL;
|
||||
struct wlr_xwayland *xwayland = wlr_xwayland_create(server.wl_display, compositor, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue