Commit graph

94 commits

Author SHA1 Message Date
oldosfan
17571b6f97 Implement keyboard shortcut inhibition
* 12to11.c (XLMain): Initialize keyboard shortcut inhibition.
* Imakefile (SRCS): Add keyboard_shortcuts_inhibit.c.
(OBJS): Add keyboard_shortcuts_inhibit.o.
* compositor.h (enum _ClientDataType): Add ShortcutInhibitData.
(struct _ClientData): New structure.
(struct _Surface): Make client data a linked list.
* pointer_constraints.c (Reconfine, XLPointerBarrierLeft)
(XLPointerBarrierCheck, XLPointerConstraintsSurfaceMovedTo):
Adjust to new client data storage approach.
* seat.c (struct _Seat): New fields `last_focus_time' and
`external_grab_time'.
(HandleBind, SelectDeviceEvents, SetFocusSurface): Use size_t to
represent mask length.
(DispatchFocusIn): Set last focus time.
(FakePointerEdge, XLSelectStandardEvents): Likewise; use size_t.
(XLSeatExplicitlyGrabSurface): Clear active grab.
(XLSeatBeginDrag): Use size_t to represent XI mask length.
(XLSeatApplyExternalGrab, XLSeatCancelExternalGrab): New
functions.
* subsurface.c (Teardown, XLSubsurfaceHandleParentCommit):
Adjust client data storage.
* surface.c (HandleSurfaceDestroy, XLSurfaceGetClientData):
Adjust client data storage to use a linked list.
(XLSurfaceFindClientData): New function.
* text_input.c (FilterInputCallback): Pacify cppcheck.
2022-10-18 05:35:52 +00:00
oldosfan
f683d8c30f Check in files for keyboard shortcut inhibition
* keyboard-shortcuts-inhibit-unstable-v1.xml:
* keyboard_shortcuts_inhibit.c: New files.
2022-10-18 05:21:33 +00:00
oldosfan
167001689a Fix bugs discovered by static analyzers and fix buffer damage calculation
* compositor.h (XLAssert): Make a macro.
* dnd.c (HandleCirculateNotify, HandleReparentNotify): Fix NULL
checks.
(ReadProtocolProperties): Return suitable values for windows
that aren't in the cache.
* egl.c (HaveEglExtension1): Avoid redundant assignment to n.
* fns.c (XLAssert): Delete function.
* picture_renderer.c (GetRenderDevice): Remove redundant TODO.
(BufferFromShm): Assert that pict_format is non-NULL.
(ValidateShmParams): Likewise.
* pointer_constraints.c (ApplyLines): Remove redundant
assignment to i.
* renderer.c (PickRenderer): Fix build with non-GCC compilers.
* seat.c (ComputeHotspot): Return values when surface is NULL.
(XLSeatExplicitlyGrabSurface): Don't save keyboard grab state.
* shm.c (CreatePool): Close fd and return if pool could not be
allocated.
* subcompositor.c (GetContentScale): Move earlier.
(ViewDamageBuffer, ViewGetContentScale): New functions.
(SubcompositorUpdate): Remove redundant assignment.
* surface.c (ApplyViewport): Make dest_width and dest_height
double.
(ApplyDamage): Call ViewDamageBuffer.
(ScaleToWindow):
* text_input.c (HandleNewIM):
* xdg_toplevel.c (SendDecorationConfigure1, HandleWmStateChange)
(HandleAllowedActionsChange, HandleDecorationResourceDestroy):
Avoid NULL pointer dereferences in various cases.
2022-10-17 04:44:49 +00:00
oldosfan
c1959e5f22 Implement relative pointer protocol
* 12to11.c (XLMain): Initialize relative pointer.
* 12to11.man: Document new protocol.
* Imakefile (SRCS): Add relative_pointer.c.
(OBJS): Add relative_pointer.o.
(relative-pointer-unstable-v1): New scanner target.
* README: Document support for new protocol.
* compositor.h: Update prototypes.
* pointer_constraints.c (HandleResourceDestroy)
(HandleSeatDestroyed): Don't destroy commit callback if not
attached.
* seat.c (struct _Keyboard): Fix comment.
(struct _RelativePointer): New structure.
(struct _SeatClientInfo): Add relative pointer fields.
(CreateSeatClientInfo, ReleaseSeatClientInfo): Initialize and
check relative pointer list.
(SendRelativeMotion): New function.
(EnteredSurface): Clear surface coordinate set flag.
(DispatchMotion): Dispatch relative motion if possible.
(DispatchBarrierHit, XLGetGEWindowForSeats, XLSelectStandardEvents)
(XLDispatchGEForSeats): Handle barrier hit events for relative
motion.
(XLSeatGetRelativePointer, XLSeatDestroyRelativePointer): New
functions.
2022-10-16 11:35:56 +00:00
oldosfan
297c79d600 Check in files for relative pointer support
* relative-pointer-unstable-v1.xml:
* relative_pointer.c: New files.
2022-10-16 11:31:56 +00:00
oldosfan
5687fbca6d Improve reliability of timestamp handling
* 12to11.c (DetermineServerTime): Correctly handle server time
truncation.
* Imakefile (SRCS): Add time.c
(OBJS): Add time.o.
* compositor.h (struct _Timestamp, enum _TimestampDifference):
New structure and enum.
(TimestampIs, TimeIs): New macros.
(struct _CreateOfferFuncs): Accept Timestamp, not Time.
* data_device.c (UpdateSingleReferenceWithForeignOffer)
(XLSetForeignSelection, XLClearForeignSelection): Accept
Timestamp, not Time.
* dnd.c (XLDoDragMotion):
* picture_renderer.c (InitRenderFuncs):
* primary_selection.c (UpdateSingleReferenceWithForeignOffer)
(XLSetForeignPrimary, XLClearForeignPrimary): Adjust for changed
timestamp handling.
* seat.c (struct _Seat): New field `last_user_time'.
(HandleRawKey, DispatchMotion): Record last user time as
timestamp.
(GetLastUserTime, XLSeatGetLastUserTime): Return Timestamp, not
Time.
* select.c (FindWriteTransfer, TransferFinished)
(TransferBecameReadable, ConvertSelectionMultiple)
(HandleSelectionRequest, DrainQueuedTransfers)
(HandlePropertyDelete, HandlePropertyNotify): Allow duplicate
write transfers if the other is only waiting for property
deletion.
* xdata.c (ReceiveBody, HandleOfferResourceDestroy)
(AllocateTimestamp, CreateOffer, CreatePrimaryOffer, SendOffers)
(SendPrimaryOffers, HandleNewSelection, NoticeClipboardCleared)
(NoticePrimaryCleared, HandleSelectionNotify)
(XLNoteSourceDestroyed, NoteLocalSelectionBody)
(NoteLocalSelectionFooter): Adjust timestamp handling to use
wraparound-safe Timestamp and not Time.
2022-10-16 03:31:52 +00:00
oldosfan
08c70b8e3e Check in new file for improved time handling
* time.c: New file.
2022-10-16 03:29:55 +00:00
oldosfan
98bbad068c Implement support for zwp_pointer_constraints_v1
* 12to11.c (XLMain): Initialize pointer constraints.
* 12to11.conf: Add Emacs local variables section.
* 12to11.man: Document new protocol.
* Imakefile (SRCS): Add pointer_constraints.c.
(OBJS): Add pointer_constraints.o.
(pointer-constraints-unstable-v1): New scanner target.
* README: Update accordingly.
* compositor.h (enum _ClientDataType): Add
PointerConfinementData.
* dmabuf.c (struct _BufferParams): Rearrange for alignment.
(struct _Buffer): Rearrange for alignment.
* dnd.c (struct _DndState, struct _DragState)
(struct _WindowCacheEntry):
* seat.c (struct _SeatCursor, struct _ScrollValuator)
(struct _SeatClientInfo, struct _Seat): Rearrange for alignment.
(SendMotion): Do not send pointer motion to locked seats.
(CheckPointerBarrier): New function.
(EnteredSurface, DispatchMotion): Check for pointer confinement
changes.
(XLSeatGetPointerDevice): New function.
(XLPointerGetSeat, XLSeatGetMouseData, XLSeatLockPointer)
(XLSeatUnlockPointer): New functions.
* shm.c (HandleResourceDestroy, CreatePool, HandleBind): Remove
redundant `all_shms' field.
* subcompositor.c (struct _View): New function `maybe_resized'.
(ViewAfterSizeUpdate): Call it if necessary.
(ViewAttachBuffer): Update a comment.
(ViewSetMaybeResizedFunction): New function.
* subsurface.c (MoveFractional):
* surface.c (ApplyInputRegion, HandleScaleChanged, MaybeResized)
(XLCreateSurface, XLWindowFromSurface): Update pointer
constraints.
* xdata.c (struct _ReadTargetsData, struct _ConversionTransferInfo)
(struct _TargetMappingTable): Rearrange for alignment.
(XLInitXData): Require fixes 1.5.
* xdg_surface.c (struct _XdgRole): Rearrange fr alignment.
(AckConfigure): Fix serial monotonicity checking.
(NoteConfigure): Update pointer constraints.
* xdg_toplevel.c (struct _XdgToplevel): Rearrange for alignment.
2022-10-15 07:58:40 +00:00
oldosfan
7810cbb79f Check in new files for pointer constraint support
* pointer-constraints-unstable-v1.xml:
* pointer_constraints.c: New files.
2022-10-15 07:47:44 +00:00
oldosfan
713eb811ea Add support for DRM leasing and significantly rework composition code
* 12to11.c (HandleCmdline): Improve messages printed during
-help.
(XLMain): Initialize DRM leasing.
* 12to11.man: Document changes.
* Imakefile (LOCAL_LIBRARIES): Add xcb-randr, xf86drm and
XPresent.
(SRCS): Add drm_lease.c.
(OBJS): Add drm_lease.o.
* atoms.c (names): Add CONNECTOR_ID.
(CONNECTOR_ID): New atom.
(XLInitAtoms): Intern CONNECTOR_ID.
* compositor.h (struct _RenderFuncs): Require event mask to be
passed to target_from_window.  New functions
`set_standard_event_mask', `present_to_window',
`cancel_presentation_callback', and `cancel_presentation'.
(struct _BufferFuncs): Move buffer release machinery here.
(enum _FrameMode): New enum.
* egl.c (TargetFromWindow, SetStandardEventMask,
egl_render_funcs): Adjust functions accordingly.
* frame_clock.c (struct _FrameClock): New fields
`end_frame_called' and `pending_sync_value'.
(HandleEndFrame, PostEndFrame, StartFrame, EndFrame): Clean up
frame synchronization code.  Do not end upon predicted
presentation time if EndFrame was not called in time.
(FreezeForValue): New function.
(XLFrameClockHandleFrameEvent): Defer actually freezing until
StartFrame happens.
(XLFrameClockGetFrameTime): New function.
* icon_surface.c (ReleaseBuffer): Use RenderWaitForIdle.
(RunFrameCallbacks, AfterFrame): Pass frame clock to callbacks.
Use frame time if available.
(XLGetIconSurface): Require wait_for_idle to work.
* output.c (change_hook): New hook.
(XLHandleOneXEventForOutputs): Run hook if set.
(XLOutputSetChangeFunction): New function.
(XLInitRROutputs): Select for RRResourceChangeNotify if
providers are supported.
* picture_renderer.c (struct _PresentRecord)
(struct _BufferActivityRecord, struct _IdleCallback)
(struct _PictureBuffer, struct _PictureTarget)
(struct _DrmFormatInfo, struct _DmaBufRecord)
(struct _PresentCompletionCallback): New record structures.
(all_formats, SendRoundtripMessage, FindBufferActivityRecord)
(RecordBufferActivity, RunIdleCallbacks, MaybeRunIdleCallbacks)
(UnlinkActivityRecord, HandleActivityEvent, InitRenderFuncs)
(TargetFromDrawable, TargetFromPixmap, TargetFromWindow)
(SetStandardEventMask, NoteTargetSize, PictureFromTarget)
(DestroyRenderTarget, FillBoxesWithTransparency)
(ServerRegionFromRegion, ClearRectangle, Composite)
(FindPresentRecord, AllocateRecord, PresentToWindow)
(CancelPresentationCallback, CancelPresentation)
(picture_render_funcs, FindSupportedModifiers, InitDrmFormats)
(PictFormatIsPresentable, BufferFromDmaBuf, FinishDmaBufRecord)
(BufferFromDmaBufAsync, BufferFromShm, BufferFromSinglePixel)
(FreeShmBuffer, FreeDmabufBuffer, FreeSinglePixelBuffer)
(AddIdleCallback, CancelIdleCallback, IsBufferIdle)
(IdleEventPredicate, WaitForIdle, SetNeedWaitForIdle)
(picture_buffer_funcs, HandlePresentCompleteNotify)
(HandlePresentIdleNotify, HandlePresentationEvent)
(HandleOneXEventForPictureRenderer, InitPictureRenderer): Allow
presenting pixmaps directly, and move buffer release tracking
machinery here.
* renderer.c (RenderTargetFromWindow): Update signature.
(RenderPresentToWindow, RenderCancelPresentationCallback)
(RenderCancelPresentation, RenderAddIdleCallback)
(RegisterStaticRenderer): New wrapper functions.
* run.c (HandleOneXEvent): Handle picture renderer events
earlier.
* seat.c (MaybeCreateCursor): Require wait_for_idle.
(ReleaseBuffer): Wait for buffer to become idle on each target
in the cursor ring.
* subcompositor.c (struct _Subcompositor): New callback
`note_frame'.
(SubcompositorSetNoteFrameCallback, NoViewsAfter)
(PresentCompletedCallback): New functions.
(SubcompositorUpdate): Try to present the buffer if possible,
and run completion callbacks.
(SubcompositorFree): Free presentation key.
* surface.c (XLSurfaceRunFrameCallbacksMs): New function.
* text_input.c: Improve commentary.
* xdg-shell.xml: Update from wayland-protocols.
* xdg_surface.c (struct _XdgRole): New fields `pending_frame',
`last_specified_serial'.
(struct _ReleaseLaterRecord): Replace free function with idle
callback key and xdg role pointers.
(RemoveRecord): Delete function.
(FreeRecords): Stop cancelling buffer destroy listener.
(ReleaseLaterExtBufferFunc): Delete function.
(RunFrameCallbacks): Use frame clock time if it is set.
(HandleReleaseLaterMessage): Delete function.
(BufferIdleCallback): New function.
(ReleaseLater): Delete function.
(XLHandleXEventForXdgSurfaces): Stop handling buffer release
events here.
(AckConfigure): Improve debug code and reject duplicate serials.
(Commit): Unfreeze earlier; also, in general...
(NoteFrame): Move frame handling implementation here.
(ReleaseBuffer, Subframe, EndSubframe, AfterFrame, ResizeForMap)
(SelectExtraEvents): Set standard event mask.
(XLGetXdgSurface, XLXdgRoleSendConfigure): ...Replace frame
clock logic with that in NoteFrame.
2022-10-12 12:53:09 +00:00
oldosfan
de26ffa123 Check in new file
* 12to11.conf: New file.
2022-10-12 12:22:55 +00:00
oldosfan
7f1d2b4046 Update files for DRM leasing
* drm-lease-v1.xml:
* drm_lease.c: New files.
* libraries.def: Remove.
2022-10-12 12:22:39 +00:00
oldosfan
694952b7f7 Minor fixes to input method handling
* compositor.h (struct _TextInputFuncs): Make filter_input
return a KeySym.
(ConfigureWidth, ConfigureHeight): Remove macros.
* seat.c (LookupKeysym): New function.
(DispatchKey): Handle keysym return from filter input function.
* text_input.c (CurrentCursorX, CurrentCursorY, CurrentCursorWidth)
(CurrentCursorHeight): New functions.
(DoGeometryAllocation, Commit): Handle scaling correctly.
(ConvertWcharString, PreeditDrawCallback): Handle wide character
strings.
(CreateIC): Do geometry allocation before setting the focus, not
after.
(LookupString): Only prefer keysym if control chars were
returned.
(FilterInputCallback): Return keysym.
(XLTextInputDispatchCoreEvent): Improve debugging code.
* xdg_toplevel.c (HandleConfigureEvent): Fix scaling of event
coordinates during resize.
2022-10-07 02:08:41 +00:00
oldosfan
b6dec13e99 ; * single_pixel_buffer.c (CreateU32RgbaBuffer): Fix typo. 2022-10-06 10:47:13 +00:00
oldosfan
f2e3baad45 Add support for more resources and single pixel buffers
* 12to11.c (HandleCmdline): Handle `-xrm'.
(XLMain): Initialize single pixel buffers.
* 12to11.man: Improve documentation.
* Imakefile (SRCS): Add single_pixel_buffer.c.
(OBJS): Add single_pixel_buffer.o.
(single-pixel-buffer-v1): Add new scanner target.
* README: Document new supported protocol.
* compositor.h (struct _BufferFuncs): Add single pixel buffer
functions.
* egl.c (enum _EglBufferType): New buffer type.
(struct _EglSinglePixelBuffer): New struct.
(struct _EglBuffr): Add EglSinglePixelBuffer.
(struct _CompositeProgram): Add source_color uniform.
(EglCompileCompositeProgram): Look for both uniforms.
(EglCompileShaders): Compile single pixel shader.
(FindProgram, GetTextureTarget, Composite, UpdateTexture)
(EnsureTexture, UpdateBuffer): Handle single pixel buffers.
(BufferFromSinglePixel, FreeSinglePixelBuffer): New functions.
(egl_buffer_funcs): Add new buffer functions.
* picture_renderer.c (BufferFromSinglePixel,
FreeSinglePixelBuffer): New functions.
(picture_buffer_funcs): Add new buffer functions.
* renderer.c (RenderBufferFromSinglePixel)
(RenderUpdateBufferForDamage): New functions.
(ReadRendererResource, PickRenderer): Read resource if no
environment variable was specified.
* shaders.txt (Composite Rectangle Fragment Shader Single
Pixel): New shader.
* text_input.c (struct _TextInput, UpdatePreedit)
(PreeditStartCallback, PreeditCaretCallback): Correctly handle
caret types and style.
(XLInitTextInput): Fix failure message.
2022-10-06 10:46:54 +00:00
oldosfan
a5c7565eb0 Check in files for single pixel buffer support
* single-pixel-buffer-v1.xml:
* single_pixel_buffer.c: New files.
2022-10-06 10:42:20 +00:00
oldosfan
c190ead122 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.
2022-10-06 02:09:36 +00:00
oldosfan
46aa84e4e5 Check in files for text input support
* text-input-unstable-v3.xml:
* text_input.c: New files.
2022-10-06 02:03:29 +00:00
oldosfan
666947c94d Minor fixes to EGL renderer and toplevel resizing
* compositor.h (struct _RenderFuncs): Accept damage in
finish_render.
* egl.c (EglInitFuncs): Load eglSwapBuffersWithDamageEXT.
(FinishRender): Accept damage and swap only damaged area if
possible.
(UpdateBuffer): Always update textures.
* explicit_synchronization.c (XLSyncRelease): Fix comment.
* renderer.c (RenderFinishRender): Accept damage argument.
* subcompositor.c (ViewWidth, ViewHeight): Fix computation of
destination width and height when there is a content scale;
those values have already been adjusted into window coordinates.
(SubcompositorUpdate, SubcompositorExpose): Pass damage to
RenderFinishRender.
* surface.c (ApplyDamage): Fix some aspects of damage
calculation.
* xdg_surface.c (IsRoleMapped): Fix crash when destroying client
with subsurfaces.
(Commit, NoteBounds, ResizeForMap, XLXdgRoleSendConfigure)
(XLXdgRoleSetBoundsSize, XLXdgRoleResizeForMap): Really fix
window state reverting to maximized during unmaximization.  This
had two causes: the first was that the window geometry would be
set even before ack_configure, which was fixed by moving setting
the window geometry into NoteBounds, and the second was that
NoteBounds would sometimes resize the window back to its old
dimensions if a commit (or subsurface update) happened between
SetBoundsSize and the configure event arriving, also confusing
the window manager.
* xdg_toplevel.c (NoteConfigureTime): Fix coding style.
(HandleConfigureEvent): Call SetBoundsSize before posting the
configure event.
2022-10-01 02:50:58 +00:00
oldosfan
a5f2c99939 Implement support for XDG window decoration
* 12to11.c (XLMain): Initialize window decoration.
* Imakefile (SRCS, OBJS): Add decoration.c and decoration.o.
* README: Document support for zdg_decoration_manager_v1.
* compositor.h: Update prototypes.
* xdg_toplevel.c (XdgDecoration, DecorationMode): New types.
(enum _DecorationMode): New structures.
(struct _XdgToplevel): New fields `decor' and `decoration'.
(struct _XdgDecoration): New struct.
(SendDecorationConfigure): New function.
(Commit): Apply decoration should it be dirty.
(HandleResourceDestroy): Detach decoration object.
(Destroy): Post error if decoration object would be orphaned.
(DestroyDecoration, SetMode, UnsetMode)
(HandleDecorationResourceDestroy, XLXdgToplevelGetDecoration):
New functions.
2022-09-30 07:38:12 +00:00
oldosfan
e09fe5f5b5 Check in files for XDG decoration support
* decoration.c:
* xdg-decoration-unstable-v1.xml: New files.
2022-09-30 07:34:55 +00:00
oldosfan
23e4bf9bac Add code to make tarballs
* Imakefile (.PHONY): Add dist.
(dist, 12to11.tar.gz): New targets.

* README: Remove wayland-scanner dependency when not building
from a repository checkout.
2022-09-30 03:27:16 +00:00
oldosfan
085f493150 Fix subsurface visibility lifecycle
* compositor.h: Update prototypes.
* dmabuf.c (MakeFeedback): Fix comment.
* shm.c (Pool): New field `flags'.
(DereferencePool, ResizePool, CreatePool): Detect whether or not
accessing a pool cannot result in SIGBUS, and refrain from
adding bus traps if that is the case.
* subcompositor.c (IsSkipped, SetSkipped, ClearSkipped): New
view state.
(SubcompositorUpdateBounds, SubcompositorUpdateBoundsForInsert)
(ViewRecomputeChildren, ViewAfterSizeUpdate, ViewMove, ViewFree)
(SubcompositorUpdate, SubcompositorExpose,
SubcompositorLookupView): Skip "skipped" views.
* subsurface.c (AfterParentCommit): Unskip views.
(Setup): Mark view as unskipped.
2022-09-30 03:13:11 +00:00
oldosfan
4d2e85d002 Implement wp_viewporter support and fix scaling for fractional values
* 12to11.c (XLMain): Initialize wp_viewporter.
* Imakefile (ETAGS): Remove unused variable.
(SRCS, OBJS): Add wp_viewporter.c and wp_viewporter.o.
(GENHEADERS): Remove unnecessary headers.
(viewporter): New scanner target.
* README: Document support for wp_viewporter.
* compositor.h (struct _ViewportExt): New forward declaration.
(struct _DrawParams): New fields for cropping and stretching.
(struct _RenderFuncs): Describe how composite works.
(struct _BufferFuncs): Make update_buffer_for_damage take
DrawParams as an argument.
(struct _State): New fields for viewporting.
(struct _Surface): New field `viewport' and associated input
delta.
(struct _XdgRoleImplementationFuncs): New field
`is_window_mapped'.  Do not commit while unmapped.
* dmabuf.c (XLInitDmabuf): Remove outdated comment.
* dnd.c (HandleMotion): Use TruncateWindowToSurface.
* egl.c (struct _EglBuffer): Add 3x3 reverse transformation
matrix.
(struct _CompositeProgram): Rename `scale' to `source'.
(Index): New macro.
(PickBetterVisual, FindVisual): Compensate for EGL picking a
non-RGBA visual.
(EglCompileCompositeProgram): Look for source, not scale.
(ComputeTransformMatrix): New function.
(Composite): Compute transformation matrix and draw using that.
(BufferFromDmaBuf, BufferFromShm): Copy identity transform and
stop setting scale.
(ReverseTransformToBox): New function.
(UpdateShmBufferIncrementally): Accept DrawParams and invert
damage according to that.
(UpdateBuffer, UpdateBufferForDamage): Pass draw params to the
incremental buffer update function.
* fns.c (XLExtendRegion): New function.
* frame_clock.c (CurrentHighPrecisionTimestamp): Delete
function.
(HighPrecisionTimestamp, HighPrecisionTimestamp32): New
functions.
(PostEndFrame): Handle X server time truncation to 32 bits.
(XLFrameClockFreeze): Remove trailing whitespace.
* picture_renderer.c (GetSourceX, GetSourceY, CompareStretch):
New functions.
(MaybeApplyTransform): Check more values before applying
transformations.  Then, handle stretch and offset.
* positioner.c (GetAdjustmentOffset, ApplyConstraintAdjustment)
(XLPositionerCalculateGeometry): Scale coordinates using new
functions.
* renderer.c (RenderUpdateBufferForDamage): Accept DrawParams
instead of scale.
* shaders.txt (Composite Rectangle Fragment Shader RGBA)
(Composite Rectangle Fragment Shader RGBX)
(Composite Rectangle Fragment Shader External): Stop
transforming texcoords.
(Composite Rectangle Vertex Shader): Transform texcoords in the
vertex shader instead.
* subcompositor.c (IsViewported, SetViewported,
ClearViewported): New functions.
(struct _View): New fields for tracking viewports and fractional
offsets.
(ViewAttachBuffer): Do not garbage upon buffer size change if a
viewport is set.
(ViewMoveFractional): New function.
(ViewDamage): Describe what the damage is and is not transformed
by.
(GetContentScale): New function.
(ViewWidth, ViewHeight): Apply viewport.
(ViewSetScale): Use ViewAfterSizeUpdate instead of duplicating
code.
(ViewSetViewport, ViewClearViewport): New functions.
(ViewComputeTransform): Compute transform for viewports.  New
arg draw; use it to determine whether or not to include a
fractional offset.
(IntersectBoxes): Fix intersection calculation.
(SubcompositorUpdate): Don't keep calling ViewWidth and
ViewHeight in a loop.
(SubcompositorExpose): Adjust for changes to buffer damage
uploading.
* subsurface.c (MoveFractional): New function.  Handle
fractional offsets after scaling.
(MaybeUpdateOutputs, AfterParentCommit, Setup, Rescale): Use
that function to move the subsurface instead.
* surface.c (ApplyScale): Update comment.
(ApplyViewport, CheckViewportValues): New functions.
(HandleScaleChanged): Apply the viewport as well upon scale
change.
(ApplyDamage): Improve damage calculation for viewported
surfaces.
(SavePendingState, InternalCommit): Save and commit viewport
state; check old values upon buffer commit.
(InitState): Initialize viewport to initial values.
(XLSurfaceRunFrameCallbacks): Handle overflows of 32-bit time at
the 49-day mark.
(SurfaceToWindow, ScaleToWindow, WindowToSurface, ScaleToSurface)
(TruncateScaleToWindow, TruncateScaleToWindow)
(TruncateWindowToSurface, TruncateScaleToSurface): New functions
for handling scale.
* xdg_popup.c (MoveWindow, IsWindowMapped, XLGetXdgPopup):
* xdg_surface.c (IsRoleMapped, Commit, Subframe)
(GetResizeDimensions, XLXdgRoleCalcNewWindowSize):
* xdg_toplevel.c (IsWindowMapped, NoteConfigureTime, SendStates)
(RecordStateSize, HandleWindowGeometryChange, NoteWindowPreResize)
(XLGetXdgToplevel): Use them instead of manually multiplying
with the factor.
2022-09-30 01:17:47 +00:00
oldosfan
dfcd969d3e Add files for viewporter support
* transform.c:
* viewporter.xml:
* wp_viewporter.c: New files.
2022-09-30 01:00:09 +00:00
oldosfan
7f33ba9ae3 Improve handling buffer scale factors
* compositor.h (struct _DrawParams): New structure.
(struct _RenderFuncs): Remove `apply_transform' and
`reset_transform'.  Make `composite' accept DrawParams.
(struct _BufferFuncs): Give scale to update_buffer_for_damage.
(struct _Surface): New field `factor'.
(struct _RoleFuncs): New callback `parent_rescale'.
* dnd.c (HandleMotion): Fix some aspects of scale handling.
* egl.c (struct _EglBuffer): Remove `scale' field.
(ApplyTransform): Delete function.
(Composite): Pass scale specified in params as uniform to
program.
(ResetTransform): Delete function.
(egl_render_funcs): Delete apply_transform and reset_transform.
(BufferFromDmaBuf, BufferFromShm): Stop setting scale attribute.
(UpdateBufferForDamage): Accept new arg `scale' and use it.

* picture_renderer.c (struct _PictureBuffer): New structure.
Store picture and last seen draw parameters.
(ApplyTransform): Delete function.
(GetScale): New function.
(MaybeApplyTransform): New function.
(Composite): Recompute and set pictures if draw parameters
change.
(ResetTransform): Delete function.
(picture_render_funcs): Remove unused hooks.
(BufferFromDmaBuf, FinishDmaBufRecord, BufferFromShm)
(FreeShmBuffer, FreeDmabufBuffer): Replace xid with wrapper
structure.

* positioner.c (TryFlipX, TryFlipY, GetAdjustmentOffset)
(ApplyConstraintAdjustment):
* renderer.c (RenderApplyTransform, RenderComposite)
(RenderResetTransform, RenderFinishRender)
(RenderUpdateBufferForDamage):
* seat.c (UpdateCursorOutput, ComputeHotspot, HandleRawButton)
(TransformToView, DispatchEntryExit, DispatchMotion, CancelGrab)
(DispatchButton, ForceEntry):
* subcompositor.c (GetTxTy, ViewApplyTransform, ViewHaveTransform)
(ViewComputeTransform, SubcompositorUpdate,
SubcompositorExpose):
* subsurface.c (MaybeUpdateOutputs, AfterParentCommit, Rescale)
(Teardown, GetSubsurface, XLUpdateOutputsForChildren): Use
surface-specific scale factors.
* surface.c (ApplyScale): Compute a new scale factor to convert
between window and surface scale.
(ApplyOpaqueRegion, ApplyInputRegion, HandleScaleChanged)
(ApplySurfaceDamage, InternalCommit, XLCreateSurface): Use new
factors instead.
* xdg_popup.c (MoveWindow):
* xdg_surface.c (GetResizeDimensions,
XLXdgRoleCalcNewWindowSize):
* xdg_toplevel.c (NoteConfigureTime, SendStates, RecordStateSize)
(HandleWindowGeometryChange, NoteWindowPreResize): Use
surface-specific scale factors.
2022-09-27 01:37:31 +00:00
oldosfan
0f07b2205b Minor improvements to cursor handling and picture renderer
* egl.c (TargetFromPixmap): Set new `IsPixmap' flag.
(FinishRender): Call glFinish on single-buffered pixmap surface.
* picture_renderer.c (HavePixmapFormat): New function.
(FindSupportedFormats): Check that the relevant pixmap format is
supported.
(DepthForFormat): Return bpp in new bpp argument.
(BufferFromShm): Adjust accordingly.
(GetScanlinePad): New function.
(Roundup): New macro.
(ValidateShmParams): Take into account bytes per pixel and
scanline pad.
(SetupMitShm): Require pixmap formats mandated by Wayland
specification.
(InitBufferFuncs): Initialize supported pixmap formats.
* seat.c (CursorRingElements, CursorRingBusy): New macros.
(struct _CursorRing): New struct.
(struct _SeatCursor): Assign cursor ring to seat cursor.
(MakeCursorRing, MaybeCreateCursor, GetUnusedCursor)
(FreeCursorRing, ResizCursorRing): New functions for managing a
ring of cursor render targets.
(UpdateCursorOutput, FreeCursor, UpdateCursorFromSubcompositor)
(ApplyEmptyCursor, Subframe, EndSubframe): Use cursors provided
by that ring to avoid creating new render targets while
animating cursors.
2022-09-26 03:43:28 +00:00
oldosfan
ebcc957302 Implement explicit synchronization
* 12to11.c (XLMain): Initialize explicit synchronization.
* Imakefile (SRCS, OBJS): Remove generated files.
(ScannerTarget): New macro.
(clean): Clean GENSRCS as well.
(linux-dmabuf-unstable-v1.h):
(linux-dmabuf-unstable-v1.c):
(xdg-shell.h):
(xdg-shell.c):
(primary-selection-unstable-v1.h):
(primary-selection-unstable-v1.c): Remove and replace with
ScannerTarget.
* README: Announce explicit synchronization support.
* compositor.h (union _RenderFence): New union.
(struct _RenderFuncs): Add fence functions.
(struct _Surface): New fields for explicit synchronization
objects and release callbacks.
* egl.c (EglInitFuncs, EglInitGlFuncs, EglInitDisplay):
Initialize functions and extensions used for explicit
synchronization, and set render func flags.
(ImportFdFence, WaitFence, DeleteFence, HandleFenceReadable)
(GetFinishFence): New functions.
(egl_render_funcs): Add those functions.
(AddRenderFlag): New function.
* fns.c (MaybeInstallBusHandler): Fix coding style.
* picture_renderer.c (ImportFdFence, WaitFence, DeleteFence)
(GetFinishFence): New stubs.
(picture_render_funcs): Add those functions; they should never
be called.
* renderer.c (RenderImportFdFence):
(RenderWaitFence):
(RenderDeleteFence):
(RenderGetFinishFence): New wrapper functions.
* run.c (struct _PollFd, XLAddWriteFd, XLAddReadFd): Add pollfd
field to callback args.
(RunStep): Pass them to callbacks.  Also, fix a comment.
* surface.c (DoRelease): New function.
(DestroySurface): Clear release if possible.
(SavePendingState, TryEarlyRelease): Extract release code to
DoRelease.
(InternalCommit): Wait for sync fences before continuing.
(Commit): Close acquire fence and release sync release object.
(HandleSurfaceDestroy): Destroy release callback and close
acquire fence.
(XLCreateSurface): Clear acquire fence field with right initial
value.
* xdata.c (NoticeTransferWritable):
(NoticeTransferReadable):
(NoticeConversionTransferReadable):
(NoticeConversionTransferWritable): Adjust arguments for new
callback data.
2022-09-25 08:21:31 +00:00
oldosfan
28f1410e35 Check in new files for explicit synchronization
* explicit_synchronization.c:
* linux-explicit-synchronization-unstable-v1.xml: New files.
2022-09-25 08:13:27 +00:00
oldosfan
86216a1164 Speed up compositing
* subcompositor.c (IntersectBoxes): New function.
(SubcompositorUpdate): Intersect boxes instead of regions when
updating from global update region.
2022-09-25 07:54:16 +00:00
oldosfan
459de34ca7 Implement various improvements to egl renderer
* 12to11.c (MakeColormap): Delete function.
(XLMain): Stop making colormap here.
* compositor.h (ImmediateRelease): New flag.
(struct _BufferFuncs): New field can_release_now.
(struct _State): New flag `BufferAlreadyReleased'.
* egl.c (struct _CompositeProgram): New field `invert_y'.
(EglCompileCompositeProgram): Get new uniform index.
(Composite): Apply InvertY.
(egl_render_funcs): Set ImmediateRelease flag.
(BufferFromDmaBuf): Set InvertY flag if set.
(UpdateTexture, UpdateShmBufferIncrementally): Set CanRelease
flag on SHM buffers.
(UpdateBuffer): Don't update if damage is empty.
(CanReleaseNow): New function.
(egl_buffer_funcs): Add CanReleaseNow.
* picture_renderer.c (MakeCheckWindow): New function.
(FindSupportedModifiers): Use a more similar window to look for
modifiers.
(CanReleaseNow): New function.
(picture_buffer_funcs): Add CanReleaseNow.
* renderer.c (RenderCanReleaseNow): New wrapper function.
(InstallRenderer): Create colormaps here, so the buffer init
function can get it.
* shaders.txt (Composite Rectangle Fragment Shader RGBA)
(Composite Rectangle Fragment Shader RGBX)
(Composite Rectangle Fragment Shader External): New uniform
`invert_y'.
(main): Use it.
* subcompositor.c (SubcompositorUpdate): Always update attached
buffer from damage, even if damage is empty.
* surface.c (TryEarlyRelease): New function.
(InternalCommit): Call it.  Also, do not call role
release_buffer hook if ImmediateRelease is specified by the
renderer.
(SavePendingState): Likewise, release buffers immediately if
possible.
2022-09-24 01:53:15 +00:00
oldosfan
1ab2633f35 Update for new versions of xdg-shell
* xdg-shell.xml: Update protocol definition.
* xdg_popup.c (Commit, AckConfigure): Fix repositioning by
adding ommitted flag.
* xdg_toplevel.c (SetParent): Disallow circular parenting.
2022-09-24 00:44:24 +00:00
oldosfan
ab30a03d24 Add support for projective scale transforms to EGL renderer
* egl.c (struct _EglBuffer): New field `scale'.  Save the
projective scale here.
(struct _CompositeProgram): New field `scale'.  Save the index
of new uniform here.
(EglCompileCompositeProgram): Fetch location of new uniform.
(ApplyTransform): Set scale.
(Composite): Apply value of new uniform.
(BufferFromDmaBuf, BufferFromShm): Initialize scale to 0.
(UpdateBufferForDamage): Scale damage if it and damage are set.

* shaders.txt (Composite Rectangle Fragment Shader RGBA)
(Composite Rectangle Fragment Shader RGBX)
(Composite Rectangle Fragment Shader External): New uniform
`scale'.
(main): Divide texcoord by scale.
2022-09-23 10:55:29 +00:00
oldosfan
b4ee06589e Add support for EGL, for YUV image formats
EGL support is still incomplete; stuff like scaling is missing.

* 12to11.c (PickVisual, XLMain): Remove function.  Initialize
renderers, and rely on that to initialize the visuals.
* 12to11.man: Document new environment variables.
* Imakefile (SRCS, OBJS): Add picture_renderer.c and renderer.c
and their associated objects.
(GENHEADERS): New variable for generated headers.
(EGL_SRCS, EGL_OBJS): New variables.
(LOCAL_LIBRARIES, SRCS, OBJS, DEFINES): [HaveEglSupport]: Add
EGL defines, libraries, and objects.:(shaders.h): New rule.
(depend, cleandir): Depend on generated headers and SRCs.
$($(OBJS)): Depend on $(GENHEADERS).
* README: Write how to build with EGL support and update content
descriptions.
* buffer.c (XLPictureFromBuffer): Delete function.
(XLRenderBufferFromBuffer): New function.
(XLPixmapFromBuffer): Delete function.
* compositor.h (enum _Operation, struct _SharedMemoryAttributes)
(struct _DmaBufAttributes, union _RenderTarget)
(union _RenderBuffer, struct _RenderFuncs, struct _DrmFormat)
(struct _ShmFormat, struct _BufferFuncs, struct
_ExtBufferFuncs): New structures.
(Fallthrough): New define.  Define to __attribute__
((fallthrough)) wherever supported.  Replace uses of Picture
with RenderBuffer.
* dmabuf.c (struct _DrmFormatInfo): Remove structures.
(struct _BufferParams): Remove link.
(struct _Buffer): Replace pixmap and picture with render buffer
object.
(dri3_opcode, all_formats, pending_success, next_roundtrip_id)
(round_trip_window): Delete.
(ReleaseBufferParams, HandleParamsResourceDestroy, ForceRoundTrip)
(DepthForFormat, XLHandleErrorForDmabuf, PictFormatForFormat)
(DestroyBacking, GetPictureFunc, GetPixmapFunc, GetBufferFunc)
(CreateBufferFor, ModifierHigh, FinishBufferCreation)
(XLHandleOneXEventForDmabuf, CreateHeader, Create, CreateImmed)
(FindFormatMatching, FindSupportedModifiers, FindSupportedFormats)
(SendSupportedFormats, HandleBind, InitDrmDevice, WriteFormatTable)
(ReallyInitDmabuf, ReadSupportedFormats, XLInitDmabuf): Remove
various functions and reimplement as a wrapper around the
renderer abstraction, instead of DRI3.
* fns.c (struct _Busfault): New structure.
(busfault_tree, bus_handler_installed): New variables.
(GetHeight, FixHeights, RotateLeft, RotateRight, RebalanceBusfault)
(RecordBusfault, DetectBusfault, DeleteMin, RemoveBusfault)
(HandleBusfault, MaybeInstallBusHandler, BlockSigbus)
(UnblockSigbus, XLRecordBusfault, XLRemoveBusfaults): New
functions to store non-overlapping regions of mapped memory in
an AVL tree, and to ignore SIGBUS events that trap within.
* icon_surface.c (struct _IconSurface): Replace picture with
rendering target.
(ReleaseBacking, XLGetIconSurface): Use rendering targets
instead of pictures.
* libraries.def: Add defines for EGL.
* run.c (HandleOneXEvent): Replace old dmabuf code with renderer
code.
* seat.c (CursorFromRole, PictureForCursor, ApplyCursor)
(UpdateCursorFromSubcompositor, Subframe, EndSubframe): Rewrite
cursor code to use rendering targets and not pictures.
* shm.c (Buffer, DereferencePool): Remove SIGBUS protection.
(DereferenceBuffer): Reimplement in terms of renderer functions.
(GetPictureFunc): Delete function.
(GetBufferFunc): New function.
(GetPixmapFunc): Delete function.
(PrintBuffer): Remove now-broken implementation.
(DepthForFormat, PictFormatForFormat): Delete functions, as they
are now part of the rendering backend.
(IsFormatSupported): New function.
(CreateBuffer): Reimplement in terms of renderer functions.
(ResizePool): Change SIGBUS protection for resize.
(CreatePool): Protect buffer data from SIGBUS should a client
truncate the file.
(PostFormats): Reimplement in terms of RenderGetShmFormats.
(XLInitShm): Stop initializing MIT-SHM.
* subcompositor.c (IsTargetAttached): New flag and associated
macros.
(struct _View): Remove useless field.
(struct _Subcompositor): Change target to RenderTarget.  Add
fields for prior damage.
(MakeSubcompositor): Initialize new fields.
(SubcompositorSetTarget): Accept RenderTarget, not picture, and
set target attached flag.
(ViewGetTransform): Delete function.
(ViewApplyTransform): New function.
(FillBoxesWithTransparency): Reimplement in terms of renderer
functions.
(StorePreviousDamage): New function.
(SubcompositorUpdate): Reimplement in terms of renderer
functions.  Also, learn to deal with situations where the buffer
reflects the state 1 to 2 swaps ago.
(SubcompositorExpose): Reimplement in terms of renderer
functions.
(SubcompositorFree): Free new fields.
(SubcompositorInit): Remove no longer required initialization of
identity matrix.
* xdata.c (ReceiveBody): Fix coding style.
* xdg_surface.c (struct _XdgRole, ReleaseBacking,
XLGetXdgSurface): Switch from pictures to RenderTargets.
* xerror.c (ErrorHandler): Handle errors for picture renderer
instead of dmabuf.c.
2022-09-23 08:44:37 +00:00
oldosfan
970b60268f Check in new files for EGL support
* egl.c:
* picture_renderer.c:
* renderer.c:
* shaders.awk:
* shaders.txt: New files.  Move old XRender code to
picture_renderer.c.
2022-09-23 08:28:48 +00:00
oldosfan
266c3e5c1e Minor code pruning
* dmabuf.c (struct _BufferParams): Prune unused code.
* shm.c (CreateBuffer): Fix offset checks.
* xdg_toplevel.c (SetAppId): Don't allow setting the app ID on a
mapped surface.
2022-09-15 07:04:20 +00:00
oldosfan
007ba43dba Resolve some TODOs
* 12to11.c (PickVisual): Remove redundant TODOs.
* dmabuf.c (CreateHeader): Handle flags like wlroots.
* dnd.c (HandleXdndPositionEvent):
* subsurface.c:
* xdg_surface.c (CurrentRootPosition, XLGetXdgSurface): Remove
outdated TODOs.
2022-09-15 02:38:06 +00:00
oldosfan
424ab2966f Also initialize primary selection on startup
* xdata.c (SelectSelectionInput): If PRIMARY has an owner,
notice it as well.
2022-09-15 02:11:02 +00:00
oldosfan
112c4d4fbe Various improvements to primary selections and resize handling
* 12to11.man: Document new environment variables.
* Imakefile ($(OBJS)): Also depend on protocol headers.
* README: Update implementation status.
* compositor.h: Update prototypes.
* data_device.c (DataOfferSetActions): Fix error sent when the
offer is invalid.
* dnd.c: Remove out of date comment.

* primary_selection.c (struct _PDataSource): Move declaration to
compositor.h.  New field `atom_types'.
(Offer): Record atom types as well.
(HandleSourceResourceDestroy): Maybe disown the primary
selection, and free offered MIME types.
(XLResourceFromPDataSource, XLPDataSourceHasAtomTarget)
(XLPDataSourceHasTarget, XLPDataSourceTargetCount)
(XLPDataSourceGetTargets): New functions.
(UpdateForSingleReference): Handle foreign selections correctly.
(SetSelection): Try to own the X selection.
(XLSetForeignPrimary, XLClearForeignPrimary): New functions.

* seat.c (XLSeatResizeInProgress): New function.

* xdata.c (struct _ReadTargetsData): New field `selection'.
(struct _DataConversion): Pass send function and source resource
to conversion function.
(last_primary_time): New timestamp variable.
(x_primary_targets, num_x_primary_targets, primary_data_source):
New variables.
(HasSelectionTarget, FindTranslationForMimeType): Accept arg
`is_primary', meaning that the primary selection data should be
used instead.
(ReceiveBody): Extract generic code from Receive.
(Receive): Replace with above macro.
(Finish, SetActions): Correctly post errors on DND-specific
actions.
(ReceivePrimary): New function.
(primary_offer_impl): New interface implementation.
(CreatePrimaryOffer): New function.
(SendOffers1): Extract generic code from SendOffers.
(SendOffers, SendPrimaryOffers): Reimplement in terms of
SendOffers1.
(HandleNewSelection): Handle PRIMARY selection changes.
(TargetsFinishCallback): Pass selection to HandleNewSelection.
(NoticeClipboardChanged): Set TargetsReadData selection.
(NoticePrimaryChanged): New function.
(NoticeClipboardCleared): Free unused data.
(NoticePrimaryCleared): New function.
(HandleSelectionNotify): Handle notifications for both CLIPBOARD
and PRIMARY.
(MimeTypeFromTarget, TypeFromTarget): Accept argument `primary',
meaning to use the primary selection when determining whether or
not to call a conversion callback.
(GetClipboardCallback): Pass resource and functions to the
clipboard callback.
(GetConversionCallback): Update to use provided functions and
resource.
(GetDragCallback, XLNoteSourceDestroyed): Fix typos in debug
string.
(XLNotePrimaryDestroyed): New function.
(NoteLocalSelectionBody, NoteLocalSelectionFooter): Extract
selection-generic code from XLNoteLocalSelection.
(XLNoteLocalSelection): Reimplement in terms of the above two
macros.
(XLNoteLocalPrimary, GetPrimaryCallback): New functions.
(XLInitXData): Select for selection input from XA_PRIMARY as
well.
* xdg_surface.c (AckConfigure): Improve debug code.
(Commit): Clear that flag.
(NoteBounds): If that flag is set, return.
(HandleFreeze): Assume a configure event will arrive after a
sync request; set flags accordingly.
(XLGetXdgSurface): Add HandleFreeze.
(XLXdgRoleSendConfigure): Clear some flags and add new state
flag `StateWaitingForAckCommit'.  Set it.  It means that no
commit has yet happened after ack_configure.
(XLXdgRoleNoteRejectedConfigure): New function.  Clear flags if
the configure event following _NET_WM_SYNC_REQUEST was rejected.
* xdg_toplevel.c (struct _XdgToplevel): New state flags
StatePendingResize, StateConfigureSize,
StatePendingConfigureStates.  New field `configuration_timer'.
(batch_state_changes): New flag.
(DestroyBacking): Clear configuration timer.
(NoteConfigureTime): New function; apply queued state changes.
(HandleWmStateChange, HandleConfigureEvent): By default, queue
state changes and configure events so they can be applied in one
go.
(Unmap): Clear delayed configuration timer.
(Commit, CommitInsideFrame, PostResize): Improve movement delta
adjustment for min_width and min_height, and queue pending
motion for after ack_configure.
(XLInitXdgToplevels): Set `batch_state_changes' depending on the
DIRECT_STATE_CHANGES' environment variable.
2022-09-15 02:08:55 +00:00
oldosfan
40d19a4595 Fix typo in man page
* 12to11.man: Say 12to11 instead of oclock.
2022-09-13 11:44:42 +00:00
oldosfan
6c7801f0fd Implement primary selections, and minor improvements elsewhere
* 12to11.c (XLMain): Initialize primary selections.  Transfer
between X and Wayland programs is still incomplete.
* Imakefile (SRCS, OBJS): Add primary selection related objects
and sources.
(primary-selection-unstable-v1.h):
(primary-selection-unstable-v1.c): New targets.
* README: Update what is not supported.
* compositor.h: New prototypes.

* data_device.c (XLDataDeviceSendEnter): Handle resource
allocation failures.
* mime1.awk: Update generated code for changes in target entry
structures.
* seat.c (SetFocusSurface): Handle focus change for primary
selections as well.
(FindSurfaceUnder): Cut off fractional portion instead of
rounding the given coordinates, so the correct surface is found
when the cursor is moved just inside the rightmost pixel.
* surface.c (XLSurfaceRunFrameCallbacks): Handle timestamp
overflow.
* xdata.c (struct _TargetMapping): Rename atom to atom_flag, and
use it to store flags.
(MappingAtom, MappingFlag, MappingIsNextDuplicate, MappingSetFlag)
(MappingUnsetFlag, MappingIs): New macros.
(struct _TargetMappingTable): New structure.
(Duplicate): New definition.
(direct_transfer): Update duplicate types.
(mapping_table): New hash table.
(HashMimeString, SetupMappingTable): New functions.
(FindTranslationForMimeType, Receive): Use the target mapping
table to look up targets instead.
(CheckDuplicate): New function.
(SendOffers): Call CheckDuplicates.
(XLInitXData): Set up duplicate relationship between UTF8_STRING
and is conversion entry, and the targets mapping table.
2022-09-13 11:41:07 +00:00
oldosfan
0965f5b3eb Check in new files for primary selection support 2022-09-13 11:33:57 +00:00
oldosfan
2a23ba365f Remove extra file
* svn-commit.tmp: Remove file.
2022-09-12 13:28:40 +00:00
oldosfan
528f7ba858 Import files 2022-09-12 13:24:50 +00:00