No description
Find a file
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
12to11.c Implement primary selections, and minor improvements elsewhere 2022-09-13 11:41:07 +00:00
12to11.man Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
alloc.c Import files 2022-09-12 13:24:50 +00:00
atoms.c Import files 2022-09-12 13:24:50 +00:00
buffer.c Import files 2022-09-12 13:24:50 +00:00
compositor.c Import files 2022-09-12 13:24:50 +00:00
compositor.h Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
data_device.c Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
dmabuf.c Import files 2022-09-12 13:24:50 +00:00
dnd.c Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
ewmh.c Import files 2022-09-12 13:24:50 +00:00
fns.c Import files 2022-09-12 13:24:50 +00:00
frame_clock.c Import files 2022-09-12 13:24:50 +00:00
icon_surface.c Import files 2022-09-12 13:24:50 +00:00
Imakefile Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
libraries.def Import files 2022-09-12 13:24:50 +00:00
linux-dmabuf-unstable-v1.xml Import files 2022-09-12 13:24:50 +00:00
media_types.txt Import files 2022-09-12 13:24:50 +00:00
mime0.awk Import files 2022-09-12 13:24:50 +00:00
mime1.awk Implement primary selections, and minor improvements elsewhere 2022-09-13 11:41:07 +00:00
mime2.awk Import files 2022-09-12 13:24:50 +00:00
mime3.awk Import files 2022-09-12 13:24:50 +00:00
mime4.awk Import files 2022-09-12 13:24:50 +00:00
output.c Import files 2022-09-12 13:24:50 +00:00
positioner.c Import files 2022-09-12 13:24:50 +00:00
primary-selection-unstable-v1.xml Check in new files for primary selection support 2022-09-13 11:33:57 +00:00
primary_selection.c Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
README Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
region.c Import files 2022-09-12 13:24:50 +00:00
run.c Import files 2022-09-12 13:24:50 +00:00
seat.c Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
select.c Import files 2022-09-12 13:24:50 +00:00
shm.c Import files 2022-09-12 13:24:50 +00:00
subcompositor.c Import files 2022-09-12 13:24:50 +00:00
subsurface.c Import files 2022-09-12 13:24:50 +00:00
surface.c Implement primary selections, and minor improvements elsewhere 2022-09-13 11:41:07 +00:00
timer.c Import files 2022-09-12 13:24:50 +00:00
xdata.c Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
xdg-shell.xml Import files 2022-09-12 13:24:50 +00:00
xdg_popup.c Import files 2022-09-12 13:24:50 +00:00
xdg_surface.c Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
xdg_toplevel.c Various improvements to primary selections and resize handling 2022-09-15 02:08:55 +00:00
xdg_wm.c Import files 2022-09-12 13:24:50 +00:00
xerror.c Import files 2022-09-12 13:24:50 +00:00
xsettings.c Import files 2022-09-12 13:24:50 +00:00

This is a tool for running Wayland applications on an X server,
preferably with a compositing manager running.

It is not yet complete.  What is not yet implemented includes support
for touchscreens, input methods, device switching in dmabuf feedback,
and the viewporter protocol extension.

There are also problems with output reporting in subsurfaces.

It is not portable to systems other than recent versions of GNU/Linux
running the X.Org server 1.20 or later, and has not been tested on
window (and compositing) managers other than GNOME Shell.

It will not work very well unless the compositing manager supports the
EWMH frame synchronization protocol.

Building and running this tool requires the following X protocol
extensions:

  Nonrectangular Window Shape Extension, version 1.1 or later
  MIT Shared Memory Extension, version 1.2 or later
  X Resize, Rotate and Reflect Extension, version 1.3 or later
    (this will soon be 1.4, once support for multiple GPU
     systems is fully implemented)
  X Synchronization Extension, version 1.0 or later
  X Rendering Extension, version 1.2 or later
  X Input Extension, version 2.3 or later
  Direct Rendering Interface 3, version 1.2 or later
  X Fixes Extension, version 1 or later

In addition, it requires Xlib to be built with the XCB transport, and
the XCB bindings for MIT-SHM and DRI3 to be available.

The following Wayland protocols are implemented to a more-or-less
complete degree:

  'wl_output',                                  version:  2
  'wl_compositor',                              version:  5
  'wl_shm',                                     version:  1
  'xdg_wm_base',                                version:  5
  'wl_subcompositor',                           version:  1
  'wl_seat',                                    version:  7
  'wl_data_device_manager',                     version:  3
  'zwp_linux_dmabuf_v1',                        version:  4
  'zwp_primary_selection_device_manager_v1',    version:  1

With the main caveat being that zwp_linux_dmabuf_v1 has no real
support for multiple-provider setups (help wanted).

Window decorations are also not supported, even though they fit in
nicely with X window management.

It would also be nice to have pinch gesture support.

This directory is organized as follows:

  Imakefile     - the top level Makefile template
  libraries.def - files for libraries that don't provide Imakefiles
  *.xml         - Wayland protocol definition source
  *.c, *.h      - C source code

Building the source code is simple, provided that you have the
necessary libwayland-server library, wayland-scanner, pixman, XCB, and
X extension libraries installed:

  xmkmf # to generate the Makefile
  make  # to build the binary

Running the binary should be simple as well:

  ./12to11

Wayland programs will then run as regular X windows.