forked from 12to11/12to11
9 commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
![]() |
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. |
||
![]() |
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. |
||
![]() |
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. |
||
![]() |
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. |
||
![]() |
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. |
||
![]() |
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. |
||
![]() |
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. |
||
![]() |
40d19a4595 |
Fix typo in man page
* 12to11.man: Say 12to11 instead of oclock. |
||
![]() |
528f7ba858 | Import files |