Implement support for zwp_text_input_manager_v3

* 12to11.c (HandleCmdline): New function.
(XLMain): Handle locale, initialize text input and and set up
the resource database.
* 12to11.man: Document resources and command-line arguments.
* Imakefile (SRCS, OBJS): Add text_input.c and text_input.o.
(text-input-unstable-v3): New scanner target.
* README: Document support for zwp_text_input_manager_v3.
* alloc.c (XLMalloc, XLCalloc, XLRealloc): Allow alloc of size 0
to return NULL.
* atoms.c (resource_quark, app_quark, QString): New quarks.
(XLInitAtoms): Initialize some quarks.
* compositor.h (struct _Compositor): Add resource and app names.
(struct _RoleFuncs): Add `select_extra_events'.
(struct _TextInputFuncs): New structure.
* run.c (HandleOneXEvent): Filter events if necessary.
* seat.c (AllKeyMask): New define.
(input_funcs): New variable.
(MakeSeatForDevicePair, NoticeDeviceDisabled): Always assign a
single seat the role of "text input seat".
(ClearFocusSurface, SetFocusSurface): Call input method hooks.
(HackKeyboardModifiers): New function.
(DispatchKey): Ignore repeated key events.
(XLSeatGetFocus): New function.
(XLSeatSetTextInputFuncs, XLSeatGetKeyboardDevice)
(XLSeatGetInputMethodSeat, XLSeatDispatchCoreKeyEvent): New
function.
* surface.c (XLSurfaceSelectExtraEvents): New function.
* xdg_surface.c (DefaultEventMask): Add core event mask here.
(XLHandleXEventForXdgSurfaces): Handle core key events.
(Commit, NoteBounds): Improve debug code.
(SelectExtraEvents): New function.
(XLGetXdgSurface, XLXdgRoleSetBoundsSize): Improve debug code.
(XLInitXdgSurfaces): Reduce size of assoc table.
* xdg_toplevel.c (SendConfigure, SendDecorationConfigure, Map)
(HandleConfigureEvent, SetMode, UnsetMode): Avoid sending
decoration configure before initial commit.
This commit is contained in:
oldosfan 2022-10-06 02:09:36 +00:00
parent 46aa84e4e5
commit c190ead122
12 changed files with 526 additions and 49 deletions

View file

@ -21,7 +21,7 @@ SRCS = 12to11.c run.c alloc.c fns.c output.c compositor.c \
dmabuf.c buffer.c select.c xdata.c xsettings.c dnd.c \
icon_surface.c primary_selection.c renderer.c \
picture_renderer.c explicit_synchronization.c transform.c \
wp_viewporter.c decoration.c
wp_viewporter.c decoration.c text_input.c
OBJS = 12to11.o run.o alloc.o fns.o output.o compositor.o \
surface.o region.o shm.o atoms.o subcompositor.o positioner.o \
@ -30,7 +30,7 @@ OBJS = 12to11.o run.o alloc.o fns.o output.o compositor.o \
dmabuf.o buffer.o select.o xdata.o xsettings.o dnd.o \
icon_surface.o primary_selection.o renderer.o \
picture_renderer.o explicit_synchronization.o transform.o \
wp_viewporter.o decoration.o
wp_viewporter.o decoration.o text_input.o
GENHEADERS = transfer_atoms.h
@ -111,6 +111,7 @@ ScannerTarget(primary-selection-unstable-v1)
ScannerTarget(linux-explicit-synchronization-unstable-v1)
ScannerTarget(viewporter)
ScannerTarget(xdg-decoration-unstable-v1)
ScannerTarget(text-input-unstable-v3)
/* Make OBJS depend on scanner headers, and depend on both them and SRCS. */
$(OBJS): $(GENHEADERS)