First step towards drag and drop protocol
[profile/ivi/wayland.git] / TODO
1 Core wayland protocol
2
3  - generate pointer_focus (and drag focus) on raise/lower, move
4    windows, all kinds of changes in surface stacking.
5
6  - glyph cache
7
8  - dnd, figure out large object transfer: through wayland protocol or
9    pass an fd through the compositor to the other client and let them
10    sort it out?
11
12  - DnD issues:
13
14    How to roboustly handle failing drag, ie the case where an
15    application gets a button event, tries to activate a drag, but when
16    the server gets the drag request, the button has already been
17    released and the grab is no longer active.  What's the concern:
18
19     - Application may set a drag cursor that doesn't revert back,
20       since a failed drag doesn't result in a pointer_focus event to
21       give focus back to the surface.  We could just do that: if the
22       pointer_focus is the same surface as we tried to start a grab
23       for, just remove and give back pointer_focus.
24
25       Alternatively, set drag cursors only in response to drag events,
26       like drag focus.  But drag_focus and drag_motion are sent to the
27       drag target, so the source surface won't always get those.  We
28       may also end up setting the cursor after the drag ends, but in
29       this case the drag started and ended and we'll get a
30       pointer_focus event, which will make the application reset the
31       pointer image.  Could introduce a drag start event that
32       indicates that the drag active.
33
34    How to handle drop decline (accept with type=NULL)
35
36     - Targets must send a NULL type in accept if they don't accept a
37       drop at the drag_focus/drag_motion position.  Root window will
38       send a NULL type or x-wayland/root-something type if the source
39       offers that.
40
41    Races between pointer motion, ending the drag, the target sending
42    accept request and the source receiving the target event.
43
44     - We've sent a drag focus or motion event to the source, but
45       haven't received an accept request corresponding to that event
46       and now the button is release.  The compositor could wait for
47       the source to reply to outstanding focus/motion events before
48       sending the finish event to the source.  Or we could send the
49       finish event through the source so that it needs to reply to the
50       finish event too.  Either way, the state of the drag blocks on
51       the client.  What if we drag to a client that doesn't doo dnd?
52
53  - copy-n-paste, store data in server (only one mime-type available)
54    or do X style (content mime-type negotiation, but data goes away
55    when client quits).
56
57  - Optional pointer images.
58
59  - Discard buffer, as in "wayland discarded your buffer, it's no
60    longer visible, you can stop updating it now.", reattach, as in "oh
61    hey, I'm about to show your buffer that I threw away, what was it
62    again?".  for wayland system compositor vt switcing, for example,
63    to be able to throw away the surfaces in the session we're
64    switching away from.  for minimized windows that we don't want live
65    thumb nails for. etc.
66
67  - Initial placement of surfaces.  Guess we can do, 1)
68    surface-relative (menus), 2) pointer-relative (tooltips and
69    right-click menus) or 3) server-decides (all other top-levels).
70
71  - When a surface is the size of the screen and on top, we can set the
72    scanout buffer to that surface directly.  Like compiz unredirect
73    top-level window feature.  Except it won't have any protocol state
74    side-effects and the client that owns the surface won't know.  We
75    lose control of updates.  Should work well for X server root window
76    under wayland.  Should be possible for yuv overlays as well.
77
78     - what about cursors then?  maybe use hw cursors if the cursor
79       satisfies hw limitations (64x64, only one cursor), switch to
80       composited cursors if not.
81
82     - clients needs to allocate the surface to be suitable for
83       scanout, which they can do whenever they go fullscreen.
84
85  - multihead, screen geometry and crtc layout protocol, hotplug
86
87  - input device discovery, hotplug
88
89     - Advertise axes as part of the discovery, use something like
90       "org.wayland.input.x" to identify the axes.
91
92     - keyboard state, layout events at connect time and when it
93       changes, keyboard leds
94
95     - relative events
96
97     - multi touch?
98
99     - synaptics, 3-button emulation, scim
100
101  - Figure out if we need the batch/commit scheme and what to do
102    instead.  Since dropping the "copy" request, we have a race between
103    copy from back to front and reporting damage.  "copy" did this
104    atomically, but copy is a rendering operation (wayland doesn't do
105    rendering) and requires synchronization between server and client
106    before client can reuse backbuffer.
107
108    The race condition happens when a client copies new content into
109    its window and then, before the client reports the damage, the
110    compositor then does a partial repaint (triggered by another
111    client) that only pulls in part of the repainted area.  It's only a
112    one-frame glitch, as the client will submit the damage and the
113    compositor will repaint the damaged area next frame.  And ideally
114    clients should do all rendering as early in the frame as possible
115    to avoid this race.
116
117  - auth; We need to generate a random socket name and advertise that
118    on dbus along with a connection cookie.  Something like a method
119    that returns the socket name and a connection cookie.  The
120    connection cookie is just another random string that the client
121    must pass to the wayland server to become authenticated.  The
122    Wayland server generates the cookie on demand when the dbus method
123    is called and expires it after 5s or so.
124
125     - or just pass the fd over dbus
126
127  - drm bo access control, authentication, flink_to
128
129  - Range protocol may not be sufficient... if a server cycles through
130    2^32 object IDs we don't have a way to handle wrapping.  And since
131    we hand out a range of 256 IDs to each new clients, we're just
132    talking about 2^24 clients.  That's 31 years with a new client
133    every minute...  Maybe just use bigger ranges, then it's feasible
134    to track and garbage collect them when a client dies.
135
136  - Add protocol to let applications specify the effective/logical
137    surface rectangle, that is, the edge of the window, ignoring drop
138    shadows and other padding.  The compositor needs this for snapping
139    and constraining window motion.  Also, maybe communicate the opaque
140    region of the window (or just a conservative, simple estimate), to
141    let the compositor reduce overdraw.
142
143  - multi gpu, needs queue and seqno to wait on in requests
144
145 Clients and ports
146
147  - port gtk+
148
149     - eek, so much X legacy stuff there...
150
151     - draw window decorations in gtkwindow.c
152
153     - start from alexl's client-side-windows branch
154
155     - Details about pointer grabs. wayland doesn't have active grabs,
156       menus will behave subtly different.  Under X, clicking a menu
157       open grabs the pointer and clicking outside the window pops down
158       the menu and swallows the click.  without active grabs we can't
159       swallow the click.  I'm sure there much more...
160
161  - Port Qt?  There's already talk about this on the list.
162
163  - X on Wayland
164
165     - move most of the code from xf86-video-intel into a Xorg wayland
166       module.
167
168     - don't ask KMS for available output and modes, use the info from
169       the wayland server.  then stop mooching off of drmmode.c.
170
171     - map multiple wayland input devices to MPX in Xorg.
172
173     - rootless; avoid allocating and setting the front buffer, draw
174       window decorations in the X server (!), how to map input?
175
176  - gnome-shell as a wayland session compositor
177
178     - runs as a client of the wayland session compositor, uses
179       clutter+egl on wayland
180
181     - talks to an Xorg server as the compositing and window manager
182       for that server and renders the output to a wayland surface.
183       the Xorg server should be modified to take input from the system
184       compositor through gnome-shell, but not allocate a front buffer.
185
186     - make gnome-shell itself a nested wayland server and allow native
187       wayland clients to connect and can native wayland windows with
188       the windows from the X server.
189
190  - qemu as a wayland client; session surface as X case
191
192     - qemu has too simple acceleration, so a Wayland backend like the
193       SDL/VNC ones it has now is trivial.
194
195     - paravirt: forward wayland screen info as mmio, expose gem ioctls as mmio
196
197     - mapping vmem is tricky, should try to only use ioctl (pwrite+pread)
198
199     - not useful for Windows without a windows paravirt driver.
200
201     - two approaches: 1) do a toplevel qemu window, or 2) expose a
202       wayland server in the guest that forwards to the host wayland
203       server, ie a "remote" compositor, but with the gem buffers
204       shared.  could do a wl_connection directly on mmio memory, with
205       head and tail pointers.  use an alloc_head register to indicate
206       desired data to write, if it overwrites tail, block guest.  just
207       a socket would be easier.
208
209  - moblin as a wayland compositor
210
211     - clutter as a wayland compositors
212
213     - argh, mutter