Commit Graph

777 Commits

Author SHA1 Message Date
Kristian Høgsberg
4abc56bd6d Introduce wl_resource_queue_event() for sending events later
Some events, such as the display.delete_id, aren't very urgent and we
would like to not always send them immdiately and cause an unnecessary
context switch.  The wl_resource_queue_event() function will place the
event in the connection output buffer but not request the main loop to
poll for writable.  The effect is that the event will just sit in the
output buffer until a more important event comes around and requires
flushing.
2011-11-17 17:52:01 -05:00
Kristian Høgsberg
3a1e6df39a Add display event to acknowledge ID deletion
We need to make sure the client doesn't reuse an object ID until the
server has seen the destroy request.  When a client destroys an ID
the server will now respond with the display.delete_id event, which lets
the client block reuse until it receives the event.
2011-11-17 17:37:52 -05:00
Kristian Høgsberg
51f50b8c64 util: Add wl_list_insert_list() 2011-11-15 13:48:41 -05:00
Andrea Canciani
3175e91efa hash: Improve double hashing
Instead of artificially introducing collisions in the step value by
replacing 0 with 1 (which causes the value 1 to have twice the
frequency of any other value), the step value can simply be computed
as an uniformly distributed value in the range [1, rehash], extremes
included.

This is safe because any step value smaller than the hash modulus is
co-prime with it, hence induces an orbit which includes every integer
in [0, size - 1].
2011-11-15 10:15:48 -05:00
Kristian Høgsberg
e742dcc9ed scanner: Check name == NULL for enum entries
From a clang static analysis warning.
2011-10-31 11:21:38 -04:00
Benjamin Franzke
3f1063f92a connection: Check object types in message parameters 2011-10-31 11:13:13 -04:00
Kristian Høgsberg
f86338d611 event-loop: Fix idle handler dispatch corner case
When the last idle handler queues another idle handler, we fail to
dispatch that last handler.  The wl_list_for_each_safe loop looks up
the next pointer before running the handler, and at that point it points
to the head of the list and the loop terminates.

Instead, just loop until the list is empty.
2011-10-29 14:27:33 -04:00
Kristian Høgsberg
7e57dc143e scanner: Fix typo in error message 2011-10-24 17:05:39 -04:00
Kristian Høgsberg
bfe54cbe37 protocol: Change global_remove arg to be 'name' insteadl of 'id'
Consistent with global args.
2011-10-24 16:05:04 -04:00
Kristian Høgsberg
d63884b0c7 scanner: Catch more invalid attribute combinations for arg
Spotted by Jakob Bornecrantz.
2011-10-24 16:04:09 -04:00
Kristian Høgsberg
1ac009473b debug: Print debug message when client wakes up
This helps spot and remove extraneous round trips and context switches.
2011-10-20 15:05:11 -04:00
Kristian Høgsberg
65fe6fc418 Silence a valgrind warning 2011-10-12 16:30:08 -04:00
Kristian Høgsberg
8bc1abd1f5 wayland-server: Track input_device resource for focused surface
We no long track the focused surface, but expect the compositor to set
focus when the focus changes.  We do track the resource for the input
device that corresponds to the current surface, in case that goes away.
2011-10-11 22:19:34 -04:00
Kristian Høgsberg
ffe8ee8d60 wayland-server: Always use the display_resource for posting wl_display errors 2011-10-11 14:37:45 -04:00
Mathias Fiedler
a05546376c wayland-server: fix resource destroy
Object ID was read from freed memory.
2011-10-11 14:23:45 -04:00
Mathias Fiedler
c8dbd8cf9e wayland-server: fix crash on invalid resource
Using display_resource to post error about invalid resource.

Reviewed-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-10-11 13:58:18 -04:00
Benjamin Franzke
1482b9e906 scanner: Fix indent for *_add_listener 2011-10-11 13:24:18 -04:00
Kristian Høgsberg
34b26802d7 Rename motion_grab to implicit_grab
Let's just use the same terms as X.
2011-09-06 18:12:43 -04:00
Kristian Høgsberg
468c9bd9e7 Add back get/set user data wrappers for wl_display 2011-09-04 09:51:44 -04:00
Kristian Høgsberg
25fddf65a8 server: Make error posting functions take a resource instead of a client 2011-09-01 09:53:33 -04:00
Kristian Høgsberg
c640571c00 Remove the wl_visual interface
The visual interface was meant to be a generic mechanism for
specifying the content of a buffer.  It goes back to before we had the
buffer factory interfaces (like wl_drm and wl_shm) and we wanted to
keep it open-ended enough that yuv, png or even svg buffer or so would
be possible.

Now that we have the buffer abstraction, we can add different buffer
types by introducing new interfaces that create buffers.  It only
makes sense to leave it to those interfaces to specify the contents of
the buffers.

For wl_shm, this means that we now just specify the pixel format using
an enum.  For EGL buffers, the exact pixel formats are controlled by
the implementation (part of wl_drm and similar), and from the client
point of view, everything is controlled using EGLConfigs.
2011-08-31 18:34:21 -04:00
Kristian Høgsberg
f9c8a691b2 Update TODO 2011-08-29 16:54:01 -04:00
Kristian Høgsberg
58b9c1bf17 server: Disconnect client on error 2011-08-29 15:01:41 -04:00
Kristian Høgsberg
47b446987d shm: Compare resource interface when validating visual 2011-08-29 15:01:26 -04:00
Kristian Høgsberg
b15259bff4 server: Pass struct wl_resource for object references 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
990809c063 Don't special case object ID 1 lookup 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
2b6f3cd2b8 server: wl_display and wl_input_device are no longer resources 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
e489e824fa Update TODO 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
c8147edc3a Store objects in wl_map data structure
The wl_map data structure is just an array with a free-list that lets the
client recycle unused client IDs and keep range of client IDs under control.
2011-08-27 12:06:11 -04:00
Kristian Høgsberg
4a39081c1d Remove range protocol 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
0e16b00b86 Destroy client resource by walking client hash table
All resources are now in the client hash table and we can clean up
just by walking the hash.
2011-08-27 12:06:11 -04:00
Kristian Høgsberg
cc6fd94d6a Always allocate a new wl_resource when binding an object
Previously we would bind some resources into multiple client hash tables.
2011-08-27 12:06:11 -04:00
Kristian Høgsberg
c4774d55e9 Add wl_hash_table_for_each() 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
e908893080 Bind globals to client provided object IDs 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
a7c6824328 server: Hand code all wl_display client stubs 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
3ac8757ec3 server: Assign global id as part of wl_display_add_global() 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
e065b7eafa server: Make object hash table per-client 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
84c13ab810 Rename global 'func' to 'bind' 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
e8a192ca61 server: Make everything in the object hash a wl_resource 2011-08-27 12:06:10 -04:00
Kristian Høgsberg
0af17ed98c Use a callback object instead of ad-hoc lists for sync and frame events
So obvious in retrospect.  The object system can do all the work for us
and keep track of pending calls as regular objects and we don't need to
abuse the resource system to get them cleaned up on client exit.  We
don't need the custom key management or (broken) lookup, we just sue
object IDs.  And last but not least, anybody can receive the callback,
not just display listeners.
2011-08-27 12:06:10 -04:00
Paulo Zanoni
1648109c84 connection: fix libffi usage, our functions return void
All clients were segfaulting on my machine.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2011-08-27 12:06:10 -04:00
Kristian Høgsberg
f6ede01b68 connection: Object ID 0 is not a valid new object ID 2011-08-16 22:33:36 -04:00
Kristian Høgsberg
efeb9e9778 event-loop: Quiet a few warnings
There's no good error recovery possible in these cases though.
2011-08-12 16:25:18 -04:00
Jørgen Lind
f2665e21ce Make expat a dependency to the scanner 2011-08-12 16:25:18 -04:00
Kristian Høgsberg
4c260db68c Rename source subdir from wayland to src 2011-08-12 16:25:14 -04:00
Kristian Høgsberg
3733157d55 Change scanner.c license to MIT 2011-08-11 14:57:36 -04:00
Kristian Høgsberg
9a606bedfd scanner: Silence warning 2011-07-28 07:47:54 -07:00
Kristian Høgsberg
eb13ae17b4 scanner: Initialize protocol.copyright to NULL 2011-07-27 05:50:41 -07:00
Tiago Vignatti
7a291117e7 protocol: Delete screenshooter.xml
The protocol interface is on compositor's side now.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-07-26 08:21:49 -07:00
Kristian Høgsberg
986703ac73 scanner: Take copyright notice from xml file 2011-07-25 18:14:20 -07:00