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