Commit graph

197 commits

Author SHA1 Message Date
e0c73347ca egl: fix EGL crash on nvidia (createPlatformWindowSurface fail)
createPlatformWindowSurface fails and returns NO_SURFACE which
aborts the program.
Nvidia doesn't seem to support EGL_BUFFER_SIZE 32 with opengl es,
and it seems like we dont need it anyways?
2025-06-16 22:31:14 +02:00
143af553ea wl_output: fix incorrect version check for name callback
wl_output name callback is defined in version 4, not 3.
2025-06-17 00:35:09 +05:00
0fe255c3ce Update drm references to use correct path (libdrm, not drm). 2025-06-17 00:35:09 +05:00
cat
f5299ad7ae
Add .gitignore 2025-06-13 01:50:40 +00:00
hujianwei
c1d313b526 * README: Add updates. 2022-11-24 06:13:19 +00:00
hujianwei
151473bfb5 Fully implement tearing control
* 12to11.man: Document new protocol.
* compositor.h (enum _RenderMode): Add RenderModeVsyncAsync.
* picture_renderer.c (SwapBackBuffers, PresentToWindow)
(NotifyMsc): Handle new render mode.
* sync_source.c (GetWantedSynchronizationType): Use presentation
if the mode is VsyncAsync.
(NoteFrame): Set the vsync presentation mode to
RenderModeVsyncAsync.
2022-11-24 06:12:06 +00:00
hujianwei
bd3d0a96e0 Fix dispatch of leave events with built-in move
* 12to11-test.xml (test_manager) <error>: New error
`resize_rejected'.
<resize_edge>: New enum.
(test_surface) <move_resize, resize_finished>: New events and
requests.

* compositor.h: Update prototypes.

* seat.c (CancelResizeOperation): Fix dangling pointer.
(FakePointerEdge):
(HandlePointerEdge): Always use builtin resize on test seats.
(XLMoveToplevel): Return status code.

* test.c (struct _TestSurface): New field `resize_callbacks'.
(HandleResizeDone): New function.
(DestroyBacking): Free resize callbacks.
(GetResizeDimensions, MoveResize): New functions.
(test_surface_impl, GetTestSurface): Attach new role hooks etc.

* tests/seat_test.c (enum test_expect_event_kind): New event
kind.
(struct test_recorded_button_event): Add serial field.  Set it.
(struct test_recorded_resize_finished_event): New struct.
(enum test_kind): New test.
(test_names): Name that test.
(LAST_TEST): Set it to the new test.
(run_resize_test, test_single_step): Implement the new test.
(expect_button_event): Return the serial of the button event.
(expect_surface_enter, handle_test_surface_resize_finished)
(test_surface_listener, handle_pointer_button)
(handle_keyboard_enter): Adjust for changes to event handling.
2022-11-24 02:23:11 +00:00
hujianwei
3213ef6493 Fix scaling of built in resize dimensions
* xdg_toplevel.c (PostResize): Scale specified dimensions to the
surface coordinate system.
2022-11-22 12:50:42 +00:00
hujianwei
8672edcb43 * tests/tearing_control_test.c (LAST_TEST): Fix definition. 2022-11-22 11:58:13 +00:00
hujianwei
c83e7243e1 Fix the tests
* tests/damage_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/dmabuf_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/scale_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/seat_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/simple_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/single_pixel_buffer_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/subsurface_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/transform_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/viewporter_test.c (handle_test_surface_committed)
(test_surface_listener):
* tests/xdg_activation_test.c (handle_test_surface_committed)
(test_surface_listener): Add new committed listeners.
2022-11-22 11:10:40 +00:00
hujianwei
2973069bd0 * sync_source.c: New file. 2022-11-22 10:58:26 +00:00
hujianwei
1ce5081dfa Major refactoring of the frame clock code
This is in preparation for a migration to the Present extension
on systems that do not support frame synchronization.

* 12to11.man: Remove option that is no longer useful.
* Imakefile (SRCS, OBJS): Add `sync_source.c.'.
* compositor.h (enum _RenderMode): New enum.
(struct _RenderFuncs): Add some new functions.
(enum _FrameMode): Remove ModeNotifyDisablePresent.

* frame_clock.c (struct _FrameClockCallback): Add draw time to
frame callback.
(struct _FrameClock): Rearrange for alignment and remove many
unused members.
(BumpFrame): New function.
(FreezeForValue): Remove code that is no longer useful, as
clock->frozen no longer exists.
(StartFrame, EndFrame): Remove clock "freezing" logic.  Only
`need_configure' remains.
(RunFrameCallbacks, NoteFakeFrame): Add frame drawn time.
(XLFrameClockAfterFrame): Adjust for new type of callback.
(XLFrameClockFreeze): Remove function.
(XLFrameClockFrameInProgress): Remove test for
`frozen_until_end_frame'.
(XLFrameClockHandleFrameEvent): Improve code in accordance with
above changes.
(XLFrameClockUnfreeze, XLFrameClockNeedConfigure): Remove
functions.
(XLFrameClockIsFrozen): Remove function.
(XLFrameClockSetFreezeCallback): Accept new callback
`fast_forward_callback'.
(XLFrameClockGetFrameTime): Remove unused function.

* icon_surface.c (struct _IconSurface, ReleaseBacking)
(ReleaseBuffer, RunFrameCallbacks, AfterFrame, Commit)
(SubsurfaceUpdate, XLGetIconSurface)
(XLHandleOneXEventForIconSurfaces): Switch the icon surface to
the sync helper abstraction, and allow asynch buffer release
from inside.

* picture_renderer.c (struct _PictureTarget): New field
`next_msc' and `render_mode'.
(SwapBackBuffers): Respect the render mode.
(InitSynchronizedPresentation): Delete function.
(InitAdditionalModifiers): Remove incorrect comment.
(InitRenderFuncs): Stop initializing obsolete option.
(SetRenderMode): New function.
(PresentToWindow): Respect the render mode.
(NotifyMsc): New function.
(picture_render_funcs): Add notify_msc.
(HandlePresentCompleteNotify): Call completion callback with the
fraame counter.

* renderer.c (RenderSetRenderMode):
(RenderNotifyMsc): New functions.

* subcompositor.c (struct _Subcompositor)
(SubcompositorSetNoteFrameCallback): Add msc and ust to note
frame callback.
(PresentCompletedCallback, RenderCompletedCallback): Call with
msc and ust.
(BeginFrame): When presentation is being synchronized and there
is no existing presentation callback, ask for an event to be
sent on the next frame.
(EndFrame): Do not clear the presentation callbacks, as the
update might not touch anything.

* test.c (NoteFrame): Update prototype.
* xdg_popup.c (InternalReposition): Stop "freezing" the frame
clock.

* xdg_surface.c (struct _XdgRole): Replace the frame clock with
the sync helper abstraction.
(RunFrameCallbacks): Run with the frame time.
(RunFrameCallbacksConditionally): Save the pending frame time.
(UpdateFrameRefreshPrediction): Delete function.
(XLHandleXEventForXdgSurfaces): Give events to the sync helper
instead.
(Unfreeze, IsRoleMapped, CheckFrame): Remove functions.
(Commit, SubsurfaceUpdate): Update using the sync helper
instead, only if not pending ack commit.
(MaybeRunLateFrame, AfterFrame): Delete functions.
(NoteConfigure, NoteBounds): Update for the sync helper.
(WriteRedirectProperty): Always require redirection for now.
Disabling redirection requires sorting out some Present problems
on the X server side.
(WasFrameQueued, NoteFrame): Delete functions.
(HandleFreeze): Delete function.
(HandleResize, CheckFastForward, HandleFrameCallback): New
functions.
(XLGetXdgSurface): Use the sync helper for most things.
(XLXdgRoleSendConfigure, XLXdgRoleReconstrain)
(XLXdgRoleGetFrameClock): Delete function.
(XLXdgRoleNoteRejectedConfigure): Clean up for using the sync
clock instead.
2022-11-22 10:57:50 +00:00
hujianwei
ed9a704e69 Add tearing control protocol
* 12to11-test.xml (test_surface) <committed>: New event.
* 12to11.c (XLMain): Initialize tearing control.
* Imakefile (SRCS, OBJS): Add tearing_control.c/.o.
(tearing-control-v1): New scanner target.

* compositor.h (enum _PresentationHint): New enum.
(struct _State): Add fields for tearing control.
(enum _ClientDataType): Add tearing control type.
* surface.c (SavePendingState, InternalCommit1): Handle
presentation hints.
* test.c (Commit): Send new committed event.
* tests/Imakefile (OBJS16, SRCS16): Add
tearing_control_test.c/tearing_control_test.o.
(PROGRAMS): Add tearing_control_test.
(tearing-control-v1): New scanner target.

* tests/buffer_test.c (test_names): Fix typos.
* tests/run_tests.sh (standard_tests): Add tearing_control_test.
* tests/svnignore.txt: Add tearing_control_test.
* xdg_surface.c (UpdateFrameRefreshPrediction): Return whether
or not refresh prediction is on.
(MaybeRunLateFrame): Don't clear StateLateFrame until after
SubcompositorUpdate.
(WasFrameQueued): New function.
(NoteFrame): If a frame was queued and async presentation was
requested, present now.
2022-11-19 06:36:56 +00:00
hujianwei
4c7b4a2c5a Check in new files for tearing control protocol
* tearing-control-v1.xml:
* tearing_control.c:
* tests/tearing_control_test.c: New files.
2022-11-19 06:28:50 +00:00
hujianwei
94333293c8 Fix compatibility with Chromium
* dmabuf.c (struct _Buffer): New field `is_fallback'.
(DestroyBacking): Destroy fallback buffers appropriately.
(CreatePlaceholderBuffer): New function.
(CreateImmed): Create palceholder buffers upon a `failed' event
being sent.
* xdg_toplevel.c (UnsetMaximized, UnsetFullscreen): Add
workarounds for Chromium bugs.
2022-11-18 13:11:22 +00:00
hujianwei
042e10486a Fix set_maximized and set_fullscreen for unmapped toplevels
* xdg_toplevel.c (Map): Apply queued window manager state.
(SetMaximized, UnsetMaximized, SetFullscreen, UnsetFullscreen):
Set a flag to apply the state later, upon mapping.  If the state
is already set, just send a configure event in response.
2022-11-18 06:16:57 +00:00
hujianwei
bc22380754 Add buffer release test
* tests/Imakefile (OBJS15, SRCS15): New files.
(PROGRAMS): Add buffer_test.
(buffer_test): New program target.
* tests/run_tests.sh (standard_tests): Add buffer_test.
* tests/svnignore.txt: Add buffer_test
* tests/test_harness.c (handle_wl_buffer_release, get_test_buffer)
(test_buffer_committed, verify_buffer_released): New functions.
* tests/test_harness.h (struct test_buffer): New struct.
2022-11-18 02:38:36 +00:00
hujianwei
b35873d200 Add buffer release test
* tests/buffer_test.c: New file.
2022-11-18 02:34:32 +00:00
hujianwei
d894bcd0a0 Add new single-pixel buffer tests
* tests/Imakefile (OBJS14, SRCS14): Add
single_pixel_buffer_test.c/.o.
(single_pixel_buffer_test): New test.
* tests/run_tests.sh (standard_tests): New test.
* tests/svnignore.txt: Add single_pixel_buffer_test.
2022-11-17 11:12:05 +00:00
hujianwei
b2fdfdb2f4 Check in new files for single pixel buffer tests
* tests/single_pixel_buffer.dump:
* tests/single_pixel_buffer_test.c:
* tests/single_pixel_buffer_viewport.dump: New files.
2022-11-17 11:09:46 +00:00
hujianwei
1b02ff9833 Fix crash trying to update seat cursor outputs
* seat.c (UpdateCursorOutput): Do not update if the surface has
been destroyed.
2022-11-17 06:18:50 +00:00
hujianwei
01a957737b Fix precision of vertex shader
* shaders.txt (Composite Rectangle Vertex Shader): Use medium
precision.
2022-11-17 06:07:30 +00:00
hujianwei
5e2d83c0d0 Make test reference data work on systems other than mine
* tests/test_harness.c (struct image_difference_statistics): New
struct.
(compare_single_row_8bpc4, compare_single_row_8bpc4x1)
(compare_single_row): Allow slight differences to compensate for
hardware differences.
(verify_image_data): Adjust accordingly.
2022-11-17 06:06:45 +00:00
hujianwei
ac7b6b5915 Allow running tests with an always garbaged subcompositor
* 12to11-test.xml (test_surface) <set_always_garbage>: New
request.
* compositor.h: Update prototypes.
* subcompositor.c (SubcompositorUpdate): Don't clear garbaged
flag if the subcompositor is always garbaged.
(SubcompositorSetAlwaysGarbaged): New function.
* test.c (SetAlwaysGarbage): New function.
(test_surface_impl): Add function.
* tests/test_harness.c (make_test_surface): Always garbage the
subcompositor if TEST_ALWAYS_GARBAGE is set.
2022-11-17 04:56:55 +00:00
hujianwei
d2abef20c4 Pacify more compiler warnings
* text_input.c (EncodeIMString):
* xdata.c (GetConversionCallback, PostReceiveConversion): Pacify
GCC suspecting memory leaks after iconv_open returns -1.
2022-11-17 02:45:33 +00:00
hujianwei
69e0902cfc Implement wl_output version 4
* 12to11.man:
* README: Update documentation.
* output.c (struct _Output): Rearrange structure for alignment.
(HandleBind): Send output name if necessary.
(CompareOutputs): Handle name changes separately.
(MakeGlobal): Support version 4 or later.
(SendUpdates): Handle name changes separately.
2022-11-17 02:26:27 +00:00
hujianwei
d4df421f8b Implement output transforms
* output.c (ComputeTransform): Handle all combinations of
rotation and X axis reflection.
2022-11-17 02:11:15 +00:00
hujianwei
7128095c18 Fix names of reference data
* tests/buffer_scale_2_5_1.dump:
* tests/buffer_scale_2_5_2.dump:
* tests/buffer_scale_3_5_1.dump:
* tests/buffer_scale_3_5_2.dump: Fix reference data names.
2022-11-17 01:56:08 +00:00
hujianwei
7deac88eae Add new scale tests
* tests/scale_test.c (enum test_kind): New test for 2x5 scale.
(test_names): Add new test name.
(LAST_TEST): Set to new test.
(do_verify_window_size): New function.
(test_single_step): Verify window sizes as well.  Implement new
test.

* tests/test_harness.c (verify_window_size): New function.
* tests/test_harness.h: New prototype.
2022-11-17 01:52:55 +00:00
hujianwei
897035e531 Add new buffer scale tests
* tests/buffer_scale_3_5_1.dump:
* tests/buffer_scale_3_5_2.dump: New files.
2022-11-17 01:36:51 +00:00
hujianwei
fb2fd1b5d1 Pacify analyzer warning
* text_input.c (HandleNewIM): Pacify false positive warning.
2022-11-16 11:53:26 +00:00
hujianwei
4772d8cede Fix XDG activation in some edge cases
* 12to11-test.xml (test_manager) <activated>: Add
activator_surface parameter.

* compositor.h (enum _ClientDataType): New XdgActivationData
type.
(struct _RoleFuncs, struct _XdgRoleImplementationFuncs): Pass
activator surface in `activate'.
* seat.c (struct _Seat): New field for the serial of the last
entry event.
(SendKeyboardEnter, XLSeatCheckActivationSerial): Add
workarounds for Firefox.
* surface.c (HandleSurfaceDestroy): Allow client data
free_functions to be NULL.
* test.c (Activate): Accept and send activator surface.

* xdg_activation.c (struct _XdgActivationToken): New fields for
the surface and destroy callback.
(HandleSurfaceDestroyed): New function.
(SetSurface): Really record the activator surface.
(GetIdForSurface): New function.
(Commit): Include activator surface ID.
(HandleResourceDestroy): Destroy activator surface.
(GetSurfaceForId): New function.
(Activate): Pass activator surface whenever specified.

* xdg_surface.c (Activate):
* xdg_toplevel.c (Activate): Adjust accordingly.

* tests/xdg_activation_test.c (check_activation_with_serial):
Check activator surface as well.
(test_single_step): Fix damage rect for dummy buffer.
(handle_test_surface_activated): Record the activator surface.
2022-11-16 07:11:03 +00:00
hujianwei
13b3d3d04b Add new seat tests for key presses
* 12to11-test.xml (test_seat_controller) <dispatch_XI_FocusIn>:
<dispatch_XI_FocusOut>
<dispatch_XI_RawKeyPress>
<dispatch_XI_RawKeyRelease>
<dispatch_XI_KeyPress>
<dispatch_XI_KeyRelease>: New requests.

* seat.c (MakeSeatForDevicePair): Prevent seat->key_pressed from
being NULL as long as keymaps have been initialized.

* test_seat.c (DispatchXIFocusIn, DispatchXIFocusOut)
(GenerateRawEvent, DispatchXIRawKeyRelease, DispatchXIKeyPress)
(DispatchXIKeyRelease): New functions.
(seat_controller_impl): Add new functions.
(XLGetTestSeat): Prevent seat->key_pressed from being NULL.

* tests/seat_test.c (enum test_expect_event_kind): Add keyboard
events.
(struct test_recorded_keyboard_enter_event)
(struct test_recorded_keyboard_key_event)
(struct test_recorded_keyboard_modifiers_event): New structs.
(enum test_kind, test_names): Add new test.
(LAST_TEST): Set to key test.
(run_key_test, test_single_step): Implement new test.
(expect_keyboard_enter_event, expect_keyboard_modifiers_event)
(expect_keyboard_key_event): New function.
(handle_keyboard_keymap, handle_keyboard_enter)
(handle_keyboard_leave, handle_keyboard_key)
(handle_keyboard_repeat_info): New functions.
(keyboard_listener, run_test): Attach new keyboard listener.

* tests/test_harness.c (test_init_seat): Initialize keyboard.
* tests/test_harness.h (struct test_seat): New field `keyboard'.
2022-11-16 02:15:47 +00:00
hujianwei
e7b89cec3b Fix crashes during scale changes
* compositor.h (struct _XdgRoleImplementationFuncs): New
function `rescale'.
* subsurface.c (Rescale): If the parent has been detached, don't
call MoveFractional.
* xdg_surface.c (Rescale): Call rescale hook.
* xdg_toplevel.c (SendOutputBounds): Check that some fields are
present.  Scale geometry correctly.
(Rescale): New function.
(ShowWindowMenu): Scale coordinates correctly.
(XLGetXdgToplevel): Add Rescale hook.
2022-11-15 12:17:26 +00:00
hujianwei
62a055983c * tests/subsurface_test_39.dump: New file. 2022-11-15 05:01:13 +00:00
hujianwei
ad9d1c3d6a Add new test for role actions
* subcompositor.c (ViewSetSubcompositor):
* subsurface.c (Teardown, XLSubsurfaceParentDestroyed):
* surface.c (HandleSurfaceDestroy): Restore previous code with
more comments.

* tests/subsurface_test.c (test_single_step): Test that surface
actions work with unconfirmed subsurfaces.
2022-11-15 05:00:56 +00:00
hujianwei
dfb8378257 Check in new files for subsurface tests
* tests/subsurface_stack_1.png:
* tests/subsurface_stack_2.png:
* tests/subsurface_test_35.dump:
* tests/subsurface_test_36.dump:
* tests/subsurface_test_37.dump:
* tests/subsurface_test_38.dump: New files.
2022-11-15 04:27:18 +00:00
hujianwei
e8b746e7ec Update subsurface tests to handle reparenting and fix discovered bugs
* 12to11-test.xml (test_manager) <set_buffer_label>: New
request.
* 12to11.man:
* README: Add missing documentation.
* buffer.c (ExtBufferDestroy): Free buffer label.
* compositor.h (struct _ExtBuffer): New field `label'
* linux-dmabuf-unstable-v1.xml: Update from wayland-protocols.
* subcompositor.c (IsSkipped, SetSkipped, ClearSkipped): Delete
macros.
(SubcompositorUpdateBounds, SubcompositorUpdateBoundsForInsert)
(SkipSlug): Adjust accordingly.
(DamageIncludingInferiors): Fix function.
(SubcompositorInsert, SubcompositorInsertBefore)
(SubcompositorInsertAfter, ViewIsVisible, ViewRecomputeChildren)
(ViewInsert, ViewInsertAfter, ViewInsertBefore): Call
DamageIncludingInferiors on child, not view.
(ViewSetSubcompositor, ViewAfterSizeUpdate, ViewMove): Get rid
of "skipped" state.
(ViewUnskip, ViewSkip): delete functions.
(ViewFree, DoCull, SubcompositorLookupView): Get rid of
"skipped" state.
* subsurface.c (struct _Subsurface): New field `pending'.
(AfterParentCommit): Attach views whenever pending.
(Setup): Stop attaching views upon setup.
(Teardown): Only detach views when not pending.
(GetSubsurface): Add comment.
(XLSubsurfaceParentDestroyed): Set subcompositor to NULL when
parent is destroyed.
(XLSubsurfaceHandleParentCommit): New function.
* surface.c (RunCommitCallbacks): Run commit callbacks in the
order in which they were created.
(NotifySubsurfaceDestroyed): Assert that a role is present.
(HandleSurfaceDestroy): Clear subsurfaces before releasing role.
Set subsurfaces to NULL.
* test.c (SetBufferLabel): New function.
(test_manager_impl): Implement.
* tests/subsurface_test.c (enum test_kind): New
SUBSURFACE_REPARENT_KIND.
(test_names): Add names
(LAST_TEST): Set to SUBSURFACE_REPARENT_KIND.
(test_single_step): Implement new test.
* tests/test_harness.c (load_png_image): Set buffer debug label.
2022-11-15 04:26:36 +00:00
hujianwei
7919b65eca Fix xdg-positioner implementation
* compositor.h (struct _Positioner): New struct.
* positioner.c (struct _Positioner): Move to compositor.h.
(RetainPositioner, ReleasePositioner): Remove functions.
(HandleResourceDestroy): Destroy positioner instead.
(XLCreateXdgPositioner): Remove reference-counting logic.
(XLRetainPositioner, XLReleasePositioner): Delete functions.
(XLPositionerIsReactive): Delete function.
* xdg_popup.c (struct _XdgPopup): Make positioner a struct
instead of a pointer.
(DestroyBacking, InternalReposition, Reposition)
(HandleParentConfigure, HandleParentResize, XLGetXdgPopup): Copy
positioner instead of taking a reference.
2022-11-14 10:26:58 +00:00
hujianwei
d32e9cbf8a Remove extra debugging code
* xdg_toplevel.c (Activate): Remove left-over debug code.
2022-11-14 06:53:16 +00:00
hujianwei
2979979633 Implement xdg-activation-v1
* 12to11-test.xml (test_surface): <activated>: New event.
* 12to11.c (XLMain): Initialize XDG activation.
* Imakefile (SRCS, OBJS): Add xdg_activation.c and
xdg_activation.o.
(xdg-activation-v1): New scanner target.
* atoms.c (names, XLInitAtoms): New atom `_NET_ACTIVE_WINDOW'.
Adjust accordingly.
* compositor.h (struct _RoleFuncs): New function `activate'.
(struct _XdgRoleImplementationFuncs): Likewise.
* seat.c (XLSeatCheckActivationSerial): New function.
* test.c (Activate): New function.
(GetTestSurface): Attach new hook.
* tests/Imakefile (OBJS13, SRCS13): Add xdg_activation_test.c/o.
(xdg-activation-v1): New scanner target.
(PROGRAMS): Add xdg_activation_test.
(xdg_activation_test): New program target.
* tests/run_tests.sh (standard_tests): Add xdg_activation_test.
* tests/svnignore.txt: Add xdg_activation_test.
* xdg_surface.c (Activate): New function.
(XLGetXdgSurface): Attach hook.
* xdg_toplevel.c (Activate): New function.
(XLGetXdgToplevel): Attach hook.
2022-11-14 06:05:23 +00:00
hujianwei
556cf6dbcc Check in new files for xdg-activation
* xdg-activation-v1.xml:
* xdg_activation.c:
* tests/xdg_activation_test:
* tests/xdg_activation_test.c: New files.
2022-11-14 05:58:00 +00:00
hujianwei
a3e87a1f34 Fix built-in resize with new frame clock logic
* compositor.h (struct _XdgRoleImplementationFuncs): Replace
`commit_inside_frame' with `after_commit'.
* xdg_surface.c (Commit): Call after_commit hook.
(NoteFrame): Stop calling commit_inside_frame.

* xdg_toplevel.c (CommitInsideFrame): Remove function.
(AfterCommit): New function.  Post pending resize here instead.
(XLGetXdgToplevel): Attach after_commit hook.
2022-11-14 01:42:01 +00:00
hujianwei
ecac908923 Fix some comments
* drm_lease.c:
* subcompositor.c (ViewUnparent):
* xdata.c (NoticeTransferWritable): Remove obsolete TODO
comments.
2022-11-14 01:12:49 +00:00
hujianwei
30f22613b8 Fix some minor problems
* seat.c (DispatchEntryExit): Understand all kinds of entry and
exit events instead of just non-grab ones.
* subcompositor.c (SubcompositorComposite1): Remove redundant
assignment.
* xerror.c (CategorizeClients): Add new assertion.

* tests/select_test.c (verify_sample_text):
(verify_sample_text_multiple): Fix typos.
2022-11-13 13:45:11 +00:00
hujianwei
563422d8cf Improve handling of pointer unlock events
* compositor.h: Update prototypes.
* idle_inhibit.c (DestroyIdleInhibitManager): New function.
(idle_inhibit_manager_impl): Add missing op handler.
* seat.c (struct _Seat): Remove pointer unlock surface.  Add
last_seen_subcompositor.
(ReleaseSeat): Release the last seen subcompositor callback.
(ClearPointerUnlockSurface, SwapUnlockSurface): Delete
functions.
(HandleSubcompositorDestroy): New function.
(EnteredSurface): Stop calling SwapUnlockSurface.
(DispatchEntryExit): Set the last seen subcompositor.
(DispatchMotion, CancelGrab1, CancelGrab): Use the last seen
subcompositor to decide where to unlock instead.
(LockSurfaceFocus, DispatchButton, DispatchGesturePinch)
(DispatchGestureSwipe): Stop calling SwapUnlockSurface.
(FakePointerEdge, ForceEntry): Stop calling SwapUnlockSurface.

* subcompositor.c (struct _SubcompositorDestroyCallback): New
struct.
(struct _Subcompositor): New field `destroy_callbacks'.
(MakeSubcompositor): Initialize new field.
(SubcompositorFree): Run and free destroy callbacks.
(SubcompositorOnDestroy, SubcompositorRemoveDestroyCallback):
New functions.
* tests/run_tests.sh:
* tests/select_test.c (verify_sample_text_multiple): Fix
ommissions and typos.
2022-11-13 11:18:44 +00:00
hujianwei
b54e5a1a01 * tests/select_helper.c: Make atom_names big enough. 2022-11-13 05:46:38 +00:00
hujianwei
3244ab82f2 Track keyboard modifiers on a per-seat basis
* seat.c (MakeSeatForDevicePair): Get keyboard state and select
for events from the master keyboard.
(UpdateModifiersForSeats): Rename to UpdateModifierForSeat.
Accept seat arg.
(SetupKeymap): Stop selecting for state changes here.
(HandleXkbEvent): Associate each XkbStateNotify with an
extension device's keyboard.
2022-11-13 03:00:08 +00:00
hujianwei
442f80b667 Implement support for multiple providers
* README: Document changes.
* compositor.h (struct _BufferFuncs): Rename `get_render_device'
to `get_render_devices' and make it return a list of providers.
* dmabuf.c (MakeFeedback): Send 1 tranche for each device.
(InitDrmDevice): Rename to InitDrmDevices.  Set up for multiple
devices.
(WriteFormatTable): Adjust call accordingly.

* egl.c (GetRenderDevice): Remove function.
(GetRenderDevices): New function.
(egl_buffer_funcs): Change accordingly.

* output.c (XLInitRROutputs): Require RandR 1.4.

* picture_renderer.c (GetRenderDevice): Remove calls to open.
(GetRenderDevices): New function.
(picture_buffer_funcs): Adjust accordingly.

* renderer.c (RenderGetRenderDevice): Delete function.
(RenderGetRenderDevices): New function.
2022-11-13 02:08:10 +00:00
hujianwei
b022f0dbd9 Fix handling of MULTIPLE selections and add test
* select.c (SignalConversionPerformed): Improve diagnostic
messages.
(ConvertSelectionMultiple): Use correct atoms.
(HandleSelectionRequest): Allow selection requests with target
MULTIPLE.

* tests/Imakefile (SRCS12, OBJS12): Add select_helper_multiple.c
and .o.
(PROGRAMS): Add select_helper_multiple.
(select_helper_multiple): New program.
* tests/select_helper.c (main): Fix typo.

* tests/select_test.c (verify_sample_text_multiple): New function.
(test_single_step): Call it.
* tests/svnignore.txt: Add select_helper_multiple.
2022-11-12 08:07:43 +00:00