Neil Roberts [Thu, 12 Jan 2012 15:48:02 +0000 (15:48 +0000)]
server: In default grab, update focus resource after sending release
The default grab implementation in wayland-server was updating the
focus resource before sending the button event. This would cause the
button release to be dropped from the implicit grab if the pointer is
moved away from the focus surface. This patch just swaps the order
around.
Kristian Høgsberg [Wed, 11 Jan 2012 19:19:50 +0000 (14:19 -0500)]
shm: Drop non-premul format, use less ambiguous ARGB8888 naming convention
This also matches the new wl_drm format names.
Kristian Høgsberg [Thu, 5 Jan 2012 13:50:25 +0000 (08:50 -0500)]
Add new wl_shell popup surface type
Kristian Høgsberg [Thu, 5 Jan 2012 02:40:21 +0000 (21:40 -0500)]
Move data device implementation into wayland-server
Kristian Høgsberg [Thu, 5 Jan 2012 02:29:17 +0000 (21:29 -0500)]
Move default grab implementation to wayland-server
Kristian Høgsberg [Thu, 5 Jan 2012 02:27:26 +0000 (21:27 -0500)]
New grab API
This commit changes the way struct wl_grab works in a couple of ways:
- The grab itself now decides when it ends instead of hardcoding button
up as the terminating event. We remove the end vfunc since a grab now
always know when it ends and can just clean up at that point.
- We add a new focus vfunc that is invoked every time the pointer enters
a new surface, regardless of any grabs. The callback receives the
surface and the surface-relative pointer coordinates. The callback lets
a grab send enter/leave events and change the grab focus.
- The grab has a focus surface, wich determines the coordinate space
for the motion callback coordinates.
- The input device always tracks the current surface, ie the surface that
currently contains the pointer, and coordinates relative to that surface.
With these changes, we will be able to pull the core input event delivery
and the drag and drop grab into the core wayland-server library.
Kristian Høgsberg [Wed, 4 Jan 2012 14:13:27 +0000 (09:13 -0500)]
server: Allocate server ID for when resource->object.id is 0
Pekka Paalanen [Tue, 3 Jan 2012 14:32:41 +0000 (16:32 +0200)]
server: remove wl_display::callback_list as unused
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 3 Jan 2012 14:32:40 +0000 (16:32 +0200)]
server: add wl_input_device_release()
Add a clean-up function for destroying all objects created in
wl_input_device_init(). Can be used to fix memory leaks reported by
Valgrind in the demos.
The init function was also missing an explicit initialisation of the
'keys' array. Add the explicit array init, although it is redundant with
the zeroing of the whole struct.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
krh: Edited to rename function to *_release()
Kristian Høgsberg [Thu, 29 Dec 2011 03:47:37 +0000 (22:47 -0500)]
Fix WL_EVENT_WRITEABLE typo
Kristian Høgsberg [Tue, 27 Dec 2011 18:53:59 +0000 (13:53 -0500)]
Drop unused hash table
We now just use a table for looking up object IDs so we should drop the
hash table.
Kristian Høgsberg [Thu, 22 Dec 2011 20:32:37 +0000 (15:32 -0500)]
Rename all instances of typeof
Kristian Høgsberg [Thu, 22 Dec 2011 20:23:54 +0000 (15:23 -0500)]
Use __typeof__ instead of typeof
Thiago Macieira compiles with -std=c++11.
Pekka Paalanen [Thu, 22 Dec 2011 14:52:37 +0000 (16:52 +0200)]
server: destroy the socket event source on display destroy
On wl_display_add_socket(), the listening socket fd is added to the
event loop. However, wl_event_source object is not stored and hence
cannot be freed, resulting in a minor leak.
Store wl_event_source pointer in struct wl_socket so we can track it,
and destroy it on wl_display_destroy(). The event loop itself must be
destroyed after destroying the event sources linked to it.
Fixes a Valgrind reported memory leak.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Tiago Vignatti [Wed, 21 Dec 2011 17:34:08 +0000 (19:34 +0200)]
protocol: update touch_down with focus surface
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Kristian Høgsberg [Mon, 19 Dec 2011 18:15:06 +0000 (13:15 -0500)]
protocol: Add a bit of documentation
Kristian Høgsberg [Sat, 17 Dec 2011 21:05:44 +0000 (16:05 -0500)]
connection: Fix printf format warnings
Laszlo Agocs [Fri, 16 Dec 2011 08:29:36 +0000 (10:29 +0200)]
Increase closure buffer size and fail gracefully for too big closures.
Buffer size changed from 256 to 1024 bytes. Marshalling will now stop
if the buffer is not big enough.
Andy Nichols [Thu, 24 Nov 2011 09:19:18 +0000 (10:19 +0100)]
Removed superfluous call to wl_copy_connection
The only purpose those code seems to serve is to introduce a buffer
overflow when events contain more than 128 bytes of data.
Jørgen Lind [Tue, 13 Dec 2011 21:01:34 +0000 (22:01 +0100)]
Make wl_list_for_each* work for c++
Pekka Paalanen [Tue, 13 Dec 2011 12:53:54 +0000 (14:53 +0200)]
client: fix a strdup memory leak
Memory leak found by valgrinding simple-shm client.
struct wl_global::interface is a strdup()'d string that was never freed.
Make a function for freeing a wl_global, and use it.
krh: Edit to name wl_global destructor wl_global_destroy.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 5 Dec 2011 08:04:37 +0000 (10:04 +0200)]
client: unset WAYLAND_SOCKET env variable
WAYLAND_SOCKET contains a file descriptor that is an open connection to
a Wayland server. It is private to us, and makes no sense to relay the
same value (or any value) to our child processes.
Unset the environment variable to prevent it from being accidentally
relayed to other processes.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 29 Nov 2011 12:32:32 +0000 (14:32 +0200)]
server: do not send delete_id to a dead client
During client tear-down, all objects are destroyed in id order.
Therefore the display object is destroyed first.
If the destroy listeners of any object destroy another object by calling
wl_resoruce_destroy(), we try to send a delete_id event to the client.
This leads to a segmentation fault without a display object.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 24 Nov 2011 14:19:03 +0000 (16:19 +0200)]
protocol: introduce wl_shell_surface
Requests like 'move' and 'set_toplevel' are really methods of a surface,
not methods of a global shell object. Move all these methods to a new
interface, wl_shell_surface.
The global object wl_shell will contain only 'get_shell_surface'
request, which creates and associates a wl_shell_surface object to a
given wl_surface object.
This will also give the shell plugin (if you look at the demo
compositor) means to store per-surface private data in a natural way.
Due to a limitation in delete_id event handling on client side, the
client must destroy its wl_shell_surface object before destroying the
wl_surface object. Otherwise it may just leak an id.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 28 Nov 2011 10:23:32 +0000 (12:23 +0200)]
server: document wl_resource_post_event() arguments
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 9 Nov 2011 14:27:07 +0000 (16:27 +0200)]
util: clear pointers on wl_list_remove()
Set the next and prev pointers of the removed list element to NULL. This
will catch programming errors that would use invalid list pointers,
double-remove for instance.
It also helps debugging, making it easy to see in gdb if an object is
not in a list.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 28 Nov 2011 07:47:15 +0000 (09:47 +0200)]
server: no errors to a dead client
Do not try to send errors to an already dead client, while in the
middle of cleanup.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Kristian Høgsberg [Tue, 15 Nov 2011 13:58:34 +0000 (08:58 -0500)]
New drag and drop / selection protocol
This commit brings a big change to the DND and copy/paste interfaces.
Most importantly the functionality is now independent of wl_shell.
The wl_shell interface is intended for desktop style UI interaction and
an optional and experimental interface.
The new interface also allows receiving the DND data multiple times or
multiple times during the drag, and the mechanism for offering and receiving
data is now shared between DND and selections.
Kristian Høgsberg [Wed, 23 Nov 2011 15:34:50 +0000 (10:34 -0500)]
server: Stop special casing the compositor
wl_compositor_init() was just adding the global and providing a helper
bind function. Not useful enough to warrent API.
Kristian Høgsberg [Sat, 19 Nov 2011 02:59:36 +0000 (21:59 -0500)]
Add support for server allocated object IDs
We set aside a range of the object ID space for use by the server. This
allows the server to bind an object to an ID for a client and pass that
object to the client. The client can use the object immediately and the
server can emit events to the object immdiately.
Kristian Høgsberg [Tue, 22 Nov 2011 19:03:33 +0000 (14:03 -0500)]
debug: Use unsigned for object IDs
Kristian Høgsberg [Sat, 19 Nov 2011 02:23:33 +0000 (21:23 -0500)]
scanner: Only strdup interface_name after making sure it's not NULL
Kristian Høgsberg [Fri, 18 Nov 2011 18:46:56 +0000 (13:46 -0500)]
Move private definitions and prototypes to new wayland-private.h
Kristian Høgsberg [Fri, 18 Nov 2011 18:11:58 +0000 (13:11 -0500)]
Fix unused variable warning
Kristian Høgsberg [Thu, 17 Nov 2011 21:46:36 +0000 (16:46 -0500)]
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.
Kristian Høgsberg [Wed, 16 Nov 2011 03:20:28 +0000 (22:20 -0500)]
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.
Kristian Høgsberg [Tue, 15 Nov 2011 18:48:41 +0000 (13:48 -0500)]
util: Add wl_list_insert_list()
Andrea Canciani [Mon, 14 Nov 2011 09:24:47 +0000 (10:24 +0100)]
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].
Kristian Høgsberg [Mon, 31 Oct 2011 15:21:38 +0000 (11:21 -0400)]
scanner: Check name == NULL for enum entries
From a clang static analysis warning.
Benjamin Franzke [Mon, 31 Oct 2011 10:06:35 +0000 (11:06 +0100)]
connection: Check object types in message parameters
Kristian Høgsberg [Sat, 29 Oct 2011 18:27:33 +0000 (14:27 -0400)]
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.
Kristian Høgsberg [Mon, 24 Oct 2011 21:05:39 +0000 (17:05 -0400)]
scanner: Fix typo in error message
Kristian Høgsberg [Mon, 24 Oct 2011 20:05:04 +0000 (16:05 -0400)]
protocol: Change global_remove arg to be 'name' insteadl of 'id'
Consistent with global args.
Kristian Høgsberg [Mon, 24 Oct 2011 20:04:09 +0000 (16:04 -0400)]
scanner: Catch more invalid attribute combinations for arg
Spotted by Jakob Bornecrantz.
Kristian Høgsberg [Thu, 20 Oct 2011 19:05:11 +0000 (15:05 -0400)]
debug: Print debug message when client wakes up
This helps spot and remove extraneous round trips and context switches.
Kristian Høgsberg [Wed, 12 Oct 2011 20:30:08 +0000 (16:30 -0400)]
Silence a valgrind warning
Kristian Høgsberg [Wed, 12 Oct 2011 02:19:34 +0000 (22:19 -0400)]
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.
Kristian Høgsberg [Tue, 11 Oct 2011 18:36:49 +0000 (14:36 -0400)]
wayland-server: Always use the display_resource for posting wl_display errors
Mathias Fiedler [Tue, 11 Oct 2011 18:23:45 +0000 (14:23 -0400)]
wayland-server: fix resource destroy
Object ID was read from freed memory.
Mathias Fiedler [Tue, 11 Oct 2011 17:58:18 +0000 (13:58 -0400)]
wayland-server: fix crash on invalid resource
Using display_resource to post error about invalid resource.
Reviewed-by: Tiago Vignatti <tiago.vignatti@intel.com>
Benjamin Franzke [Tue, 9 Aug 2011 12:31:36 +0000 (14:31 +0200)]
scanner: Fix indent for *_add_listener
Kristian Høgsberg [Tue, 6 Sep 2011 22:12:43 +0000 (18:12 -0400)]
Rename motion_grab to implicit_grab
Let's just use the same terms as X.
Kristian Høgsberg [Sun, 4 Sep 2011 13:51:24 +0000 (09:51 -0400)]
Add back get/set user data wrappers for wl_display
Kristian Høgsberg [Thu, 1 Sep 2011 13:53:33 +0000 (09:53 -0400)]
server: Make error posting functions take a resource instead of a client
Kristian Høgsberg [Wed, 31 Aug 2011 01:26:19 +0000 (21:26 -0400)]
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.
Kristian Høgsberg [Mon, 29 Aug 2011 20:50:02 +0000 (16:50 -0400)]
Update TODO
Kristian Høgsberg [Mon, 29 Aug 2011 19:01:41 +0000 (15:01 -0400)]
server: Disconnect client on error
Kristian Høgsberg [Mon, 29 Aug 2011 19:01:26 +0000 (15:01 -0400)]
shm: Compare resource interface when validating visual
Kristian Høgsberg [Sat, 27 Aug 2011 16:05:09 +0000 (12:05 -0400)]
server: Pass struct wl_resource for object references
Kristian Høgsberg [Sat, 27 Aug 2011 01:39:33 +0000 (21:39 -0400)]
Don't special case object ID 1 lookup
Kristian Høgsberg [Sat, 20 Aug 2011 19:48:11 +0000 (15:48 -0400)]
server: wl_display and wl_input_device are no longer resources
Kristian Høgsberg [Sat, 20 Aug 2011 02:52:49 +0000 (22:52 -0400)]
Update TODO
Kristian Høgsberg [Sat, 20 Aug 2011 02:50:53 +0000 (22:50 -0400)]
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.
Kristian Høgsberg [Fri, 19 Aug 2011 21:26:57 +0000 (17:26 -0400)]
Remove range protocol
Kristian Høgsberg [Fri, 19 Aug 2011 21:07:14 +0000 (17:07 -0400)]
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.
Kristian Høgsberg [Fri, 19 Aug 2011 20:57:48 +0000 (16:57 -0400)]
Always allocate a new wl_resource when binding an object
Previously we would bind some resources into multiple client hash tables.
Kristian Høgsberg [Fri, 19 Aug 2011 18:48:16 +0000 (14:48 -0400)]
Add wl_hash_table_for_each()
Kristian Høgsberg [Fri, 19 Aug 2011 17:44:01 +0000 (13:44 -0400)]
Bind globals to client provided object IDs
Kristian Høgsberg [Fri, 19 Aug 2011 17:40:28 +0000 (13:40 -0400)]
server: Hand code all wl_display client stubs
Kristian Høgsberg [Fri, 19 Aug 2011 15:08:09 +0000 (11:08 -0400)]
server: Assign global id as part of wl_display_add_global()
Kristian Høgsberg [Fri, 19 Aug 2011 15:06:37 +0000 (11:06 -0400)]
server: Make object hash table per-client
Kristian Høgsberg [Fri, 19 Aug 2011 15:05:01 +0000 (11:05 -0400)]
Rename global 'func' to 'bind'
Kristian Høgsberg [Thu, 18 Aug 2011 21:53:50 +0000 (17:53 -0400)]
server: Make everything in the object hash a wl_resource
Kristian Høgsberg [Sat, 30 Jul 2011 02:51:22 +0000 (19:51 -0700)]
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.
Paulo Zanoni [Fri, 26 Aug 2011 22:41:05 +0000 (19:41 -0300)]
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>
Kristian Høgsberg [Fri, 12 Aug 2011 20:32:13 +0000 (16:32 -0400)]
connection: Object ID 0 is not a valid new object ID
Kristian Høgsberg [Fri, 12 Aug 2011 20:23:07 +0000 (16:23 -0400)]
event-loop: Quiet a few warnings
There's no good error recovery possible in these cases though.
Jørgen Lind [Thu, 4 Aug 2011 05:56:04 +0000 (07:56 +0200)]
Make expat a dependency to the scanner
Kristian Høgsberg [Fri, 12 Aug 2011 19:09:00 +0000 (15:09 -0400)]
Rename source subdir from wayland to src
Kristian Høgsberg [Thu, 11 Aug 2011 18:51:31 +0000 (14:51 -0400)]
Change scanner.c license to MIT
Kristian Høgsberg [Wed, 27 Jul 2011 19:05:34 +0000 (12:05 -0700)]
scanner: Silence warning
Kristian Høgsberg [Wed, 27 Jul 2011 12:50:41 +0000 (05:50 -0700)]
scanner: Initialize protocol.copyright to NULL
Tiago Vignatti [Tue, 26 Jul 2011 08:43:19 +0000 (11:43 +0300)]
protocol: Delete screenshooter.xml
The protocol interface is on compositor's side now.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Kristian Høgsberg [Tue, 26 Jul 2011 01:14:20 +0000 (18:14 -0700)]
scanner: Take copyright notice from xml file
Kristian Høgsberg [Tue, 19 Jul 2011 17:01:46 +0000 (10:01 -0700)]
connection: Use static strings instead of sprintf and buffer overflow
Spotted by Samuel Rødal <samuel.rodal@nokia.com>
Kristian Høgsberg [Mon, 18 Jul 2011 17:35:18 +0000 (13:35 -0400)]
Link to -lrt for clock_gettime()
Casey Dahlin [Mon, 18 Jul 2011 06:00:25 +0000 (02:00 -0400)]
Pass object ID not pointer when sending a global announce event
When the type for the first argument of the global event changed from new_id to
uint, wl_connection_vmarshal started expecting an integer argument rather than
an object argument. As a result we were sending the client a chunk of pointer
rather than a useful global identifier.
Kristian Høgsberg [Mon, 18 Jul 2011 17:10:49 +0000 (13:10 -0400)]
conection: Handle demarshal errors a little less dramatically
Casey Dahlin [Mon, 18 Jul 2011 06:00:24 +0000 (02:00 -0400)]
Fix segfault in client when demarshalling fails
Tiago Vignatti [Thu, 14 Jul 2011 15:56:51 +0000 (18:56 +0300)]
protocol: fix key event and related comments
Tiago Vignatti [Thu, 14 Jul 2011 15:56:40 +0000 (18:56 +0300)]
debug: add timestamps when logging
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Kristian Høgsberg [Tue, 12 Jul 2011 17:22:59 +0000 (13:22 -0400)]
protocol: Fix type of visual arg in token_visual event
Kristian Høgsberg [Tue, 12 Jul 2011 17:22:25 +0000 (13:22 -0400)]
scanner: Output type info for new_id arguments
Kristian Høgsberg [Mon, 11 Jul 2011 15:15:00 +0000 (11:15 -0400)]
protocol: Make id arg of display.global event be just a uint
Global names are different from object IDs.
Kristian Høgsberg [Thu, 7 Jul 2011 17:39:08 +0000 (13:39 -0400)]
scanner: map 'int' to int32_t.
Laszlo Agocs [Wed, 29 Jun 2011 14:54:11 +0000 (17:54 +0300)]
Add touch events to protocol.
Kristian Høgsberg [Wed, 29 Jun 2011 15:43:11 +0000 (11:43 -0400)]
server: Add wl_client_flush()
Flush output queue up for the specified client.
Kristian Høgsberg [Thu, 23 Jun 2011 10:43:47 +0000 (06:43 -0400)]
event-loop: Make idle handlers work again
Kristian Høgsberg [Tue, 21 Jun 2011 20:25:28 +0000 (16:25 -0400)]
Update TODO
Kristian Høgsberg [Tue, 21 Jun 2011 16:15:31 +0000 (12:15 -0400)]
Merge remote-tracking branch 'bnf/buffer.release'