~ubuntu-branches/ubuntu/saucy/xorg-docs/saucy

« back to all changes in this revision

Viewing changes to specs/Composite/protocol

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2009-01-19 19:53:29 UTC
  • mfrom: (3.1.3 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090119195329-yzysic30lu3pzyoy
Tags: 1:1.4-4
* Add upstream URL to the copyright file (closes: #512132).
* Upload with the upstream tarball.  For some reason this package had gone
  native.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
                        Composite Extension
2
 
 
3
 
                            Version 0.2
4
 
                              2004-7-8
5
 
                            Keith Packard
6
 
                          keithp@keithp.com
7
 
 
8
 
                            Version 0.3
9
 
                              2006-5-13
10
 
                            Deron Johnson
11
 
                        deron.johnson@sun.com   
12
 
 
13
 
 
14
 
1. Introduction
15
 
 
16
 
Many user interface operations would benefit from having pixel contents of
17
 
window hierarchies available without respect to sibling and antecedent
18
 
clipping.  In addition, placing control over the composition of these pixel
19
 
contents into a final screen image in an external application will enable
20
 
a flexible system for dynamic application content presentation.
21
 
 
22
 
2. Acknowledgements
23
 
 
24
 
This small extension has been brewing for several years, contributors to
25
 
both early prototypes and the final design include:
26
 
 
27
 
 +      Bill Haneman for motivating the ability to magnify occluded windows
28
 
        with his work on accessibility
29
 
 
30
 
 +      Carsten Haitzler for Enlightenment, the original eye-candy window
31
 
        manager which demonstrated that clever hacks are an awfully
32
 
        close substitute for changes in the underlying system.
33
 
 
34
 
 +      Jim Gettys for key insights into the relationship between damage
35
 
        events and per-window pixmap usage
36
 
 
37
 
 +      Mike Harris and Owen Taylor for figuring out what to call it.
38
 
 
39
 
3. Architecture
40
 
 
41
 
The composite extension provides two related mechanisms:
42
 
 
43
 
 1.     Per-hierarchy storage.  The rendering of an entire hierarchy of windows
44
 
        is redirected to off-screen storage.  The pixels of that hierarchy
45
 
        are available whenever it is viewable.  Storage is automatically
46
 
        reallocated when the top level window changes size.  Contents beyond
47
 
        the geometry of the top window are not preserved.
48
 
 
49
 
 2.     Automatic shadow update.  When a hierarchy is rendered off-screen,
50
 
        the X server provides an automatic mechanism for presenting those
51
 
        contents within the parent window.  The implementation is free to
52
 
        make this update lag behind actual rendering operations by an
53
 
        unspecified amount of time.  This automatic update mechanism may
54
 
        be disabled so that the parent window contents can be completely
55
 
        determined by an external application.
56
 
 
57
 
Per-hierarchy storage may be created for individual windows or for all
58
 
children of a window.  Manual shadow update may be selected by only a single
59
 
application for each window; manual update may also be selected on a
60
 
per-window basis or for each child of a window.  Detecting when to update
61
 
may be done with the Damage extension.
62
 
 
63
 
The off-screen storage includes the window contents, its borders and the
64
 
contents of all descendants.
65
 
 
66
 
Version 0.2 of the protocol introduces a mechanism for associating an XID
67
 
with the off-screen pixmap used to store these contents.  This can be used
68
 
to hold onto window contents after the window is unmapped (and hence animate
69
 
it's disappearance), and also to access the border of the window, which is
70
 
not reachable through the Window ID itself.  A new pixmap is created each
71
 
time the window is mapped or resized; as these events are nicely signalled
72
 
with existing events, no additional notification is needed.  The old pixmap
73
 
will remain allocated as long as the Pixmap ID is left valid, it is
74
 
important that the client use the FreePixmap request when it is done with
75
 
the contents and to create a new name for the newly allocated pixmap.
76
 
 
77
 
In automatic update mode, the X server is itself responsible for presenting
78
 
the child window contents within the parent.  It seems reasonable, then, for
79
 
rendering to the parent window to be clipped so as not to interfere with any
80
 
child window content.  In an environment with a mixure of manual and
81
 
automatic updating windows, rendering to the parent in the area nominally
82
 
occupied by a manual update window should be able to affect parent pixel
83
 
values in those areas, but such rendering should be clipped to automatic
84
 
update windows, and presumably to other manual update windows managed by
85
 
other applications.  In any of these cases, it should be easy to ensure that
86
 
rendering has no effect on any non-redirected windows.
87
 
 
88
 
Instead of attempting to define new clipping modes for rendering, the
89
 
Composite extension instead defines ClipByChildren rendering to the parent
90
 
to exclude regions occupied by redirected windows (either automatic or
91
 
manual).  The CreateRegionFromBorderClip request can be used along with
92
 
IncludeInferiors clipping modes to restrict manual shadow updates to the
93
 
apporpriate region of the screen.  Bracketing operations with
94
 
GrabServer/UngrabServer will permit atomic sequences that can update the
95
 
screen without artifact.  As all of these operations are asynchronous,
96
 
network latency should not adversely affect update latency.
97
 
 
98
 
4. Errors
99
 
 
100
 
The composite extension does not define any new errors.
101
 
 
102
 
5. Types
103
 
 
104
 
        UPDATETYPE      { Automatic, Manual }
105
 
 
106
 
6. Events
107
 
 
108
 
The composite extension does not define any new events.
109
 
 
110
 
7. Extension Initialization
111
 
 
112
 
The client must negotiate the version of the extension before executing
113
 
extension requests.  Otherwise, the server will return BadRequest for any
114
 
operations other than QueryVersion.
115
 
 
116
 
    QueryVersion
117
 
 
118
 
                client-major-version:           CARD32
119
 
                client-minor-version:           CARD32
120
 
 
121
 
                ->
122
 
 
123
 
                major-version:                  CARD32
124
 
                minor-version:                  CARD32
125
 
 
126
 
        The client sends the highest supported version to the server and
127
 
        the server sends the highest version it supports, but no higher than
128
 
        the requested version.  Major versions changes can introduce
129
 
        incompatibilities in existing functionality, minor version
130
 
        changes introduce only backward compatible changes.  It is
131
 
        the client's responsibility to ensure that the server supports
132
 
        a version which is compatible with its expectations.  Servers
133
 
        are encouraged to support multiple versions of the extension.
134
 
 
135
 
8. Hierarchy Redirection
136
 
 
137
 
    RedirectWindow
138
 
 
139
 
                window:                         Window
140
 
                update:                         UPDATETYPE
141
 
 
142
 
                errors: Window, Access, Match
143
 
 
144
 
        The hierarchy starting at 'window' is directed to off-screen
145
 
        storage.  'automatic-update' specifies whether the contents
146
 
        are mirrored to the parent window automatically or not.  Only
147
 
        one client may specify this flag, another attempt will result in an
148
 
        Access error.  When all clients enabling redirection terminate,
149
 
        the redirection will automatically be disabled.
150
 
 
151
 
        The root window may not be redirected.  Doing so results in a Match
152
 
        error.
153
 
 
154
 
    RedirectSubwindows
155
 
 
156
 
                window:                         Window
157
 
                update                          UPDATETYPE
158
 
 
159
 
                errors: Window, Access
160
 
 
161
 
        Hierarchies starting at all current and future children of window
162
 
        will be redirected as in RedirectWindow.  If update is Manual,
163
 
        then painting of the window background during window manipulation
164
 
        and ClearArea requests is inhibited.
165
 
 
166
 
    UnredirectWindow:
167
 
 
168
 
                window:                         Window
169
 
 
170
 
                errors: Window, Value
171
 
 
172
 
        Redirection of the specified window will be terminated.  If
173
 
        the specified window was not selected for redirection by the
174
 
        current client, a 'Value' error results.
175
 
 
176
 
    UnredirectWindows:
177
 
 
178
 
                window:                         Window
179
 
 
180
 
                errors: Window, Value
181
 
 
182
 
        Redirection of all children of window will be terminated.  If
183
 
        the specified window was not selected for sub-redirection by the
184
 
        current client, a 'Value' error results.
185
 
 
186
 
9. Clip lists
187
 
 
188
 
    CreateRegionFromBorderClip
189
 
 
190
 
                region:                         Region
191
 
                window:                         Window
192
 
 
193
 
                errors: Window, IDChoice
194
 
 
195
 
        This request creates a region containing the "usual" border clip
196
 
        value; that is the area of the window clipped against siblings and
197
 
        the parent.  This region can be used to restrict rendering to
198
 
        suitable areas while updating only a single window.  The region
199
 
        is copied at the moment the request is executed; future changes
200
 
        to the window hierarchy will not be reflected in this region.
201
 
 
202
 
10. Associating a Pixmap ID with the off-screen storage (0.2 and later)
203
 
 
204
 
    NameWindowPixmap
205
 
 
206
 
                window:                         Window
207
 
                pixmap:                         Pixmap
208
 
 
209
 
                errors: Window, Match, IDChoice
210
 
 
211
 
        This request makes 'pixmap' a reference to the off-screen storage
212
 
        for 'window'.  This pixmap will remain allocated until freed, even
213
 
        if 'window' is unmapped, reconfigured or destroyed.  However,
214
 
        'window' will get a new pixmap allocated each time it is
215
 
        mapped or resized, so this request will need to be reinvoked for
216
 
        the client to continue to refer to the storage holding the current
217
 
        window contents.  Generates a 'Match' error if 'window' is not
218
 
        redirected.
219
 
 
220
 
Version 0.3:
221
 
 
222
 
11. Composite Overlay Window
223
 
 
224
 
The Composite Overlay Window provides composite managers with a
225
 
surface on which to draw without interference. This window is always
226
 
above normal windows and is always below the screen saver window. It
227
 
is an InputOutput window whose width and height are the screen
228
 
dimensions. Its visual is the root visual and its border width is
229
 
zero.  Attempts to redirect it using the composite extension are
230
 
ignored.  This window does not appear in the reply of the QueryTree
231
 
request. It is also an override redirect window. These last two
232
 
features make it invisible to window managers and other X11
233
 
clients. The only way to access the XID of this window is via the
234
 
CompositeGetOverlayWindow request. Initially, the Composite Overlay
235
 
Window is unmapped.
236
 
 
237
 
CompositeGetOverlayWindow returns the XID of the Composite Overlay
238
 
Window. If the window has not yet been mapped, it is mapped by this
239
 
request. When all clients who have called this request have terminated
240
 
their X11 connections the window is unmapped.
241
 
 
242
 
Composite managers may render directly to the Composite Overlay
243
 
Window, or they may reparent other windows to be children of this
244
 
window and render to these. Multiple clients may render to the
245
 
Composite Overlay Window, create child windows of it, reshape it, and
246
 
redefine its input region, but the specific arbitration rules followed
247
 
by these clients is not defined by this specification; these policies
248
 
should be defined by the clients themselves.
249
 
 
250
 
    CompositeGetOverlayWindow
251
 
 
252
 
                window:                         Window
253
 
 
254
 
                ->
255
 
 
256
 
                overlayWin:                     Window
257
 
 
258
 
    This request returns the XID of the Composite Overlay Window for 
259
 
    the screen specified by the argument 'window'. This request 
260
 
    indicates that the client wishes to use the Composite Overlay 
261
 
    Window of this screen. If this Composite Overlay Window has not 
262
 
    yet been mapped, it is mapped by this request.
263
 
 
264
 
    The Composite Overlay Window for a particular screen will be 
265
 
    unmapped when all clients who have invoked this request have 
266
 
    also invoked CompositeReleaseOverlayWindow for that screen. Also,
267
 
    CompositeReleaseOverlayWindow for a screen will be implicitly 
268
 
    called when a client using the Composite Overlay Window on that 
269
 
    screen terminates its X11 connection.
270
 
 
271
 
 
272
 
    CompositeReleaseOverlayWindow
273
 
 
274
 
                window:                         Window
275
 
 
276
 
    This request specifies that the client is no longer using the 
277
 
    Composite Overlay Window on the screen specified by the 
278
 
    argument 'window'. A screen's Composite Overlay Window is 
279
 
    unmapped when there are no longer any clients using it.
280
 
 
281