Commit Graph

16 Commits

Author SHA1 Message Date
Derek Foreman
583fbcda3b libweston: Use weston_coord in struct weston_pointer
Convert the bare x,y coordinates into struct weston_coord and update all
users.

We keep the surface position in wl_fixed_t for now so it still exactly
matches the position most recently sent to clients.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-02-17 13:51:23 +00:00
Derek Foreman
84a2a84045 input: Use weston_coord for pointer clamping
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-02-17 13:51:23 +00:00
Marius Vlad
e9a0c0648b libinput-seat: Cascade errors and bail out in case of failure
Errors happening to devices being added or removed shouldn't fail
silently so exit if any of that happens.

Sprinkle some debug logs for other cases as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
2021-11-25 10:47:04 +02:00
Marius Vlad
eb34f827dd input: Handle correctly failure to compile XKB keymaps
And ultimately, fail to start when there are no input devices on the
system. Patchs adds consistency to touch/pointer initialization to
return -1 in case same thing happens.

Further more, when the device is not created we can't assume to retrieve
a valid one from a libinput_device so guard against it. This takes care of
hot-plugging situations when we couldn't create the (keyboard) device,
or when removing it.

Fixes: #117, #402, #485

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
2021-07-31 13:44:47 +00:00
Samu Nuutamo
58a2faf716 libinput-seat: update leds when a new device is added
Fix an issue where the keyboard leds will go out of sync when a new
keyboard is connected.

The issue can be easily reproduced by connecting two keyboards, enabling
caps lock, and reconnecting one of the keyboards. Without the patch the
leds on both keyboards will turn off while the actual caps lock state
will stay enabled.

Signed-off-by: Samu Nuutamo <samu.nuutamo@gmail.com>
2021-05-31 11:31:22 +00:00
Marius Vlad
4e03629f44 libweston: Remove internal weston-log set-up function out of public header
We have dedicated header for the internal parts of the logging
framework, use that for the set-up part instead of the libweston public
API header.

Further more this removes weston_vlog() from public header as well and
moves them to weston-log-internal.h file.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 13:34:04 +03:00
Marius Vlad
5d649b611a libweston: Migrate functions that operate on 'weston_seat'
All 'notify_()*' belong in the private backend header file.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 06:43:38 +00:00
Marius Vlad
0bf3f5ac2c libweston: Migrate functions that operate on 'weston_seat'
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 06:43:38 +00:00
Pekka Paalanen
3d5d9476e3 Rename compositor.h to libweston/libweston.h
The main idea is to make libweston users use the form

 #include <libweston/libweston.h>

instead of the plain

 #include <compositor.h>

which is prone to name conflicts. This is reflected both in the installed
files, and the internal header search paths so that Weston would use the exact
same form as an external project using libweston would.

The public headers are moved under a new top-level directory include/ to make
them clearly stand out as special (public API).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Emmanuel Gil Peyrot
426c24673f Fix typos all around (thanks codespell!) 2019-02-20 16:47:35 +01:00
Pekka Paalanen
8dc6db8c76 libweston: require connected heads for input devices
The use case driving this change is a clone mode setup, where the user
is hotplugging or unplugging a cloned touchscreen. Even if the output
and head are force-enabled, the touch device should still follow the
connector connection status. If there is no video signal for the
touchscreen (disconnected connector), then the touch input should be
ignored as well.

When the output is force-enabled, we need to trigger
output_heads_changed from connector status changes. If the head or
output are not force-enabled, the compositor will likely attach and
detach the head as appropriate. In clone mode, the attach or detach
needs to trigger output_heads_changed directly. In other cases, it may
be handled through the output getting enabled or disabled which are
different signals.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-20 15:27:54 +03:00
Pekka Paalanen
fd02efbc84 libinput: use head names for output matching
Associating input devices with weston_outputs by the output name fails
when one output has several heads. We need to match against head names
instead of output names to be able to find all names.

This fixes touchscreen output association in shared-CRTC clone mode when
outputs or input devices appear or disappear.

Even though notify_output_create() is called only when new outputs
appear, the implementation is prepared to also remove output
associations. This will be handy in the future when this function will
handle also head detaching from an output that remains enabled.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-20 15:27:54 +03:00
Derek Foreman
0e4e570cae input: Stop leaking libinput event source on session deactivation
This is easily noticed as a leaked fd on every VC switch.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-27 14:44:49 +03:00
Daniel Díaz
75b7197f4e Add configuration option for no input device.
As it has been discussed in the past [1], running Weston
without any input device at launch might be beneficial for
some use cases.

Certainly, it's best for the vast majority of users (and
the project) to require an input device to be present, as
to avoid frustration and hassle, but for those brave souls
that so prefer, this patch lets them run without any input
device at all.

This introduces a simple configuration in weston.ini:
  [core]
  require-input=true

True is the default, so no behavioral change is introduced.

[1] https://lists.freedesktop.org/archives/wayland-devel/2015-November/025193.html

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-10-22 15:04:58 +01:00
Jussi Kukkonen
649bbce607 include stdint.h for int32_t/uint32_t
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-26 16:26:08 -07:00
Pekka Paalanen
b5e3ea218b Rename src/ to libweston/
This clarifies what is supposed to be the libweston code.

v2: screen-share.c is already in compositor/ instead.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
2016-06-23 17:44:54 +03:00