Commit graph

14 commits

Author SHA1 Message Date
Peter Hutterer
e3c34830db ei: rename ei_set_connection to ei_set_socket
Current plans are to use the "connection" term for the ei_connection
interface in the (future) protocol, so let's rename this to avoid
clashes.
2023-03-03 11:20:42 +10:00
Peter Hutterer
b6f477fb96 util-object: split macro to generate unref into one two
One macro that also defines the cleanup function, one macro that only
defines the unref. This is required for any place where we want to
use cleanup from multiple source files - like the test suite.
2022-03-03 05:41:15 +00:00
Peter Hutterer
46681e2855 Add SPDX identifiers to all source files
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-03 00:27:36 +00:00
Peter Hutterer
5f2afdf806 Fix a bunch of compiler warnings
Most are signed vs unsigned, the remaining ones are an unused
variables/functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-01 23:28:49 +00:00
Peter Hutterer
31800cf870 util: make the OBJECT_IMPLEMENT_CREATE no longer static by default
Better for consistency with the other functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-15 23:23:51 +00:00
Olivier Fourdan
325d7e6a43 libei: Do not abort if LIBEI_SOCKET is not set
When called with NULL as the path to the EI socket, the function
ei_setup_backend_socket() will fallback to the LIBEI_SOCKET environment
variable to determine the path to the socket.

If that environment variable is not set, ei_setup_backend_socket() will
abort.

That means that an innocent client running in an environment without EI
support will be killed. If that client happens to be Xwayland, that would
abort the Xserver and take all X11 clients with it, including the window
manager itself in the case of mutter.

Return -ENOENT instead so that clients have a chance to recover and
survive the lack of EI support.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2020-09-15 22:19:03 +00:00
Peter Hutterer
f6c2f24a22 util: add xconnect to connect to a socket
Makes this re-usable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-25 11:47:07 +10:00
Peter Hutterer
f3a60ca6b3 Fix maybe-uninitialized warnings
Building with a releaes build reshuffles things so this ends causing potential
issues. Initialize to NULL to avoid around this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-20 16:07:54 +10:00
Peter Hutterer
14ee9f6e31 libei: replace the logger utility with a custom logger handling
The logger utilities are useful for quick prototyping, but we've reached the
point where we need the "proper" implementation of a log handler.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-20 14:44:38 +10:00
Peter Hutterer
15cf73ad11 libei: remove unused connection field
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-06 15:12:19 +10:00
Peter Hutterer
311bc6b4fc libei: rename to ei_setup_backend_socket()
Now that the backend is more of an implementation detail, namespace for
ei_setup_backend_foo()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-06 14:52:54 +10:00
Peter Hutterer
283cc87416 libei: switch to a single ei_new() function
The main reason for having different functions to create the initial context
was so we can nest the ei struct inside the context-specific struct. That
shouldn't leak into the API though and our use-case is probably one where we
create one context, then iterate through possible backends until one succeds -
having different contexts here doesn't help then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-06 14:47:40 +10:00
Peter Hutterer
6062a0f676 libei: take the LIBEI_SOCKET variable if the socket path is NULL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-30 15:38:40 +10:00
Peter Hutterer
802dfd4ca6 Add the minimal implementation for a UNIX socket libei client
This is the minimum framework to support connecting to a libeis server, adding
a device and sending relative pointer motion events.It's missing a bunch of
checks and verifications, many of the hooks are still missing, etc.

See the tools/ directory for an example. The protocol is as outlined in
commit f7a24b2fbd.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-29 16:18:24 +10:00