12to11/tests/Imakefile
hujianwei 0bdc502068 Fix text input bugs with grabbed popups and bugs found by new tests
* 12to11-test.xml (test_manager) <error>: Add
invalid_user_time.
<get_serial, serial> New request and event.
(test_seat_controller) <set_last_user_time>: New request.

* compositor.h (struct _TextInputFuncs): Make `filter_input'
return keycode.
* data_device.c (DestroyReference): Check if reference device is
detached before unlinking reference.
* seat.c (LookupKeysym): Delete function.
(DispatchKey): Use keycodes instead.
(XLSeatExplicitlyGrabSurface): Avoid using owner-events keyboard
grab.

* select.c (struct _SelectionOwnerInfo, HandleSelectionRequest):
Allow CurrentTime in selection requests.  Compensate for
wraparound as well.
(OwnSelection, DisownSelection): Use Timestamp instead of Time.
* test.c (GetSerial): New function.
(test_manager_impl): Add new function.
* test_seat.c (SetLastUserTime): New function.
(seat_controller_impl): Add new function.
* tests/Imakefile (LOCAL_LIBRARIES): Remove GBM and DRM.
(SRCS10, OBJS10, SRCS11, OBJS11): New variables.
(dmabuf_test): Only link this program with GBM and DRM.
(PROGRAMS): Add select_test, select_helper.
(select_test, select_helper): New programs.

* tests/README: Document that select_test needs to be run under
vfb.
* tests/run_tests.sh: Add TODO note.
* tests/svnignore.txt: Add select_test and select_helper.
* tests/test_harness.c (handle_test_manager_serial): New
function.
(test_manager_listener): Add new function.
(open_test_display): Clear display->seat.
(test_get_serial): New function.

* tests/test_harness.h (struct test_display): New function
`serial'.

* text_input.c (CreateIC): Improve debugging code.
(CalculateKeycodeForEvent): Move earlier.
(FilterInputCallback): Handle keycodes here as well.
(XLTextInputDispatchCoreEvent): Add more debugging code.

* xdata.c (SelectSelectionInput): Obtain server time here.
(XLOwnDragSelection, NoteLocalSelectionFooter): Convert times to
Timestamp.
2022-11-12 03:51:21 +00:00

80 lines
3.6 KiB
Text

#include "../12to11.conf"
12TO11ROOT = ..
DEPLIBS = $(DEPXLIB)
SYS_LIBRARIES = MathLibrary
LOCAL_LIBRARIES = $(WAYLAND_CLIENT) $(XLIB) $(PNG)
COMMONOBJS = test_harness.o
COMMONSRCS = test_harness.c
HEADER = test_harness.h
GENFILES =
EXTRA_DEFINES := -D_GNU_SOURCE -U_BSD_SOURCE -U_SVID_SOURCE
INCLUDES := $(DRMINCLUDES) $(PIXMANINCLUDES)
#define ScannerTarget(name) @@\
name.h: $(12TO11ROOT)/name.xml @@\
$(WAYLAND_SCANNER) client-header $< $@ @@\
@@\
name.c: $(12TO11ROOT)/name.xml name.h @@\
$(WAYLAND_SCANNER) private-code $< $@ @@\
@@\
COMMONOBJS := $(COMMONOBJS) name.o @@\
COMMONSRCS := $(COMMONSRCS) name.c @@\
GENFILES := $(GENFILES) name.c name.h @@\
HEADER := $(HEADER) name.h @@\
ScannerTarget(12to11-test)
ScannerTarget(viewporter)
ScannerTarget(linux-dmabuf-unstable-v1)
/* Not actually a test. */
SRCS1 = $(COMMONSRCS) imgview.c
OBJS1 = $(COMMONSRCS) imgview.o
SRCS2 = $(COMMONSRCS) simple_test.c
OBJS2 = $(COMMONOBJS) simple_test.o
SRCS3 = $(COMMONSRCS) damage_test.c
OBJS3 = $(COMMONOBJS) damage_test.o
SRCS4 = $(COMMONSRCS) transform_test.c
OBJS4 = $(COMMONSRCS) transform_test.o
SRCS5 = $(COMMONSRCS) viewporter_test.c
OBJS5 = $(COMMONSRCS) viewporter_test.o
SRCS6 = $(COMMONSRCS) subsurface_test.c
OBJS6 = $(COMMONSRCS) subsurface_test.o
SRCS7 = $(COMMONSRCS) scale_test.c
OBJS7 = $(COMMONSRCS) scale_test.o
SRCS8 = $(COMMONSRCS) seat_test.c
OBJS8 = $(COMMONSRCS) seat_test.o
SRCS9 = $(COMMONSRCS) dmabuf_test.c
OBJS9 = $(COMMONSRCS) dmabuf_test.o
SRCS10 = $(COMMONSRCS) select_test.c
OBJS10 = $(COMMONSRCS) select_test.o
SRCS11 = select_helper.c
OBJS11 = select_helper.o
PROGRAMS = imgview simple_test damage_test transform_test viewporter_test subsurface_test scale_test seat_test dmabuf_test select_test select_helper
/* Make all objects depend on HEADER. */
$(OBJS1): $(HEADER)
/* And depend on all sources and headers. */
depend:: $(HEADER) $(COMMONSRCS)
NormalProgramTarget(imgview,$(OBJS1),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(simple_test,$(OBJS2),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(damage_test,$(OBJS3),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(transform_test,$(OBJS4),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(viewporter_test,$(OBJS5),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(subsurface_test,$(OBJS6),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(scale_test,$(OBJS7),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(seat_test,$(OBJS8),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(dmabuf_test,$(OBJS9),NullParameter,$(LOCAL_LIBRARIES) $(GBM) $(DRM),NullParameter);
NormalProgramTarget(select_test,$(OBJS10),NullParameter,$(LOCAL_LIBRARIES) ThreadsLibraries,NullParameter);
NormalProgramTarget(select_helper,$(OBJS11),NullParameter,$(XLIB),NullParameter);
DependTarget3($(SRCS1),$(SRCS2),$(SRCS3))
DependTarget3($(SRCS4),$(SRCS5),$(SRCS6))
DependTarget3($(SRCS7),$(SRCS8),$(SRCS9))
DependTarget3($(SRCS10),$(SRCS11),NullParameter)
all:: $(PROGRAMS)
clean::
$(RM) $(GENFILES)