summaryrefslogtreecommitdiff
path: root/src/backends/native/meta-seat-native.c
Commit message (Collapse)AuthorAgeFilesLines
* seat-native: Fix has_touchscreen becoming FALSE when a non touchscreen ↵Hans de Goede2020-11-271-1/+2
| | | | | | | | | | | | | | | | device gets added Unconditionally setting has_touchscreen to check_touch_mode when a new device gets added leads to has_touchscreen becoming false when during runtime e.g. an USB keyboard gets plugged in. Fix this by setting has_touchscreen to TRUE when check_touch_mode is TRUE and leaving it alone otherwise. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1506 (cherry picked from commit 6c240dc83b33d26696825c6ee70560e201542fd7) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1610>
* backends/native: Don't crash if keymap is misconfiguredSimon McVittie2020-11-271-0/+1
| | | | | | | | | | | | | | | | | xkb recently gained support for user-specified keymaps, which means we can no longer assume that the configuration data is necessarily fully complete or correct; and the configuration language is quite a labyrinth, so it's easy to get wrong. If setting the keymap fails, leave it in whatever state it previously had, since that seems preferable to crashing with a NULL pointer dereference. Resolves: https://gitlab.gnome.org/GNOME/mutter/-/issues/1555 Signed-off-by: Simon McVittie <smcv@debian.org> (cherry picked from commit 60f647df8ec5a74bddffcc3a20577a7efcef105c) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1609>
* backends/native: Wait to have an stage before emitting CLUTTER_DEVICE_ADDEDCarlos Garnacho2020-11-231-7/+28
| | | | | | | | | | | | | | | | During seat initialization, we process early libinput events (adding all known devices) before the seat gets a stage assigned. This causes warnings when trying to handle the corresponding CLUTTER_DEVICE_ADDED events, as they are sent stageless. As it is definitely too soon to have those events sent meaningfully, filter those events out and instead handle the CLUTTER_DEVICE_ADDED emission for all known devices after the seat receives an stage. This makes the events guaranteed to be emitted early in initialization, but not so soon that they can't be handled yet. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1549 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1597>
* clutter/backend: Don't dispatch libinput events too earlyOlivier Fourdan2020-11-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | At startup, libinput dispatch is called from the MetaSeatNative constructed callback. That means that we may get libinput events even before the default seat is set. In turn, processing those events may trigger the use the default seat while it's still not set yet, and cause a crash of gnome-shell/mutter at startup. A simple reproducer for this is to start gnome-shell/mutter with a tablet connected and the stylus in proximity, the proximity event will cause gnome-shell/mutter to crash at startup. To avoid that issue, avoid dispatching libinput events early from the MetaSeatNative constructed callback, those events will eventually get processed when the seat and the backend are all setup. https://gitlab.gnome.org/GNOME/mutter/-/issues/1501 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1534 (cherry picked from commit c618b8a0eb1919219da29934945b303fd0a311ed)
* backends/native: Remove unused functionCarlos Garnacho2020-09-231-18/+0
| | | | | | This meta_seat_native_get_device() function has been unused for some time. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1448
* clutter/backends: Rename master and slave devicesFlorian Müllner2020-08-311-8/+8
| | | | | | | | | | | Just because X11/XI uses a particular terminology doesn't mean we have to use the same terms in our own API. The replacement terms are in line with gtk@1c856a208, which seems a better precedent for consistency. Follow-up to commit 17417a82a5. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1425
* seat-native: Process device added/removed events as ClutterEventsMarco Trevisan (Treviño)2020-08-291-51/+57
| | | | | | | | Delay the addition and removal of devices using ClutterDeviceEvent's so that they are processed following the libinput event order, and that we don't have to flush the events on removal. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1371
* *: Fix spelling mistakes found by codespellBjörn Daase2020-08-291-1/+1
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1410
* clutter: Remove multi thread mutexesJonas Ådahl2020-07-021-14/+1
| | | | | | | | | The mutexes was used by ClutterTexture's async upload and to match GDK's mutexes on X11. GDK's X11 connection does not share anything with Clutter's, we don't have the Gdk Clutter backend left, and we have already removed ClutterTexture, so lets remove these mutexes as well. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
* clutter/seat: Add private method to peek list of input devicesJonas Dreßler2020-06-161-9/+4
| | | | | | | | | | | | | | Add a method to ClutterSeat that allows peeking the list of input devices and allow looping through devices a bit faster. The API left is private so we can make use of peeking the GList internally, but don't have to expose any details to the outside, which means we'd have to eventually stick with a GList forever to avoid breaking API. Since we now have the peek_devices() API internally, we can implement ClutterSeats public list_devices() API using g_list_copy() on the list returned by peek_devices(). https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1275
* backends/native: Drop external keyboard detection for ::touch-modeCarlos Garnacho2020-05-291-44/+4
| | | | | | | | | | | | | | | | | | | | | | | | This cannot be made to work reliably. Some factoids: - Internal devices may be connected via USB. - The ACPI spec provides the _PLD (Physical location of device) hook to determine how is an USB device connected, with an anecdotal success rate. Internal devices may be seen as external and vice-versa, there is also an "unknown" value that is widely used. - There may be non-USB keyboards, the old "AT Translated Set 2 Keyboard" interface does not change on hotplugging. - Libinput has an internal series of quirks to classify keyboards as internal of external, also with an "unknown" value. These heuristics are kinda hopeless to get right by our own hand. Drop this external keyboard detection in the hope that there will be something more deterministic to rely on in the future (e.g. the libinput quirks made available to us directly or indirectly). Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2378 Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2353 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1277
* backends/native: Translate coordinates of absolute motion eventsJonas Troeger2020-04-071-0/+3
| | | | | | | | | | The motion events of tablets for example need to be mapped on the selected screen area if the input device is configured to use only a part of the active logical monitor. To achieve this behavior each motion event is transformed using the transformation matrix set for the input device. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1118
* backends/native: Shuffle udev client initialization in MetaSeatNativeCarlos Garnacho2020-02-261-2/+2
| | | | | | | | | | | | | This may be used indirectly before creation as we dispatch libinput events right after creation (to let input devices be known), so those device additions would trigger the touch-mode checks. Creating it in advance results in checks being correctly performed, although redundantly. Spotted by Bastien Nocera. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1067
* backends/native: Also check touch-mode on object initializationJonas Dreßler2020-02-211-0/+2
| | | | | | | | | | | | | On a Surface Pro 2017, touch-mode is currently only detected correctly after detaching and attaching the Type Cover (detachable keyboard) once, it seems that `has_external_keyboard` is only set to the correct value after MetaSeatNative is initialized. So fix that and call `update_touch_mode()` once again when the object is initialized and the `has_external_keyboard` and `has_touchscreen` properties have been finally updated. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1075
* backends/native: Replace tabs with spacesJonas Dreßler2020-02-191-5/+5
| | | | | | | Replace the few remaining places where tabs are used for indentation with spaces. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1065
* util: Add INPUT debug topicJonas Dreßler2020-02-191-11/+38
| | | | | | | Allow debugging input issues more easily by adding an INPUT debug topic. Currently there are only debug messages for the native backend. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1065
* backends/native: Override the right property nameCarlos Garnacho2020-02-111-1/+1
| | | | | Fixup to https://gitlab.gnome.org/GNOME/mutter/merge_requests/1044, clearly it's not enough to compile check after "just a minor rename".
* backends: Implement ClutterSeat::touch-mode on MetaSeatNativeCarlos Garnacho2020-02-101-1/+142
| | | | | | | | | | | | This taps on: 1) Touchscreen availability 2) Availability of external keyboards 3) Tablet mode switch, if existent So we get this property enabled whenever it makes sense to show touch focused features (eg. the OSK). https://gitlab.gnome.org/GNOME/mutter/merge_requests/1044
* backends: Use latest pointer position if no pointer constrain existsCarlos Garnacho2020-01-301-2/+2
| | | | | | | | | | | | | The meta_seat_native_constrain_pointer() function receives the current pointer position, and the new pointer position as in/out parameters. We were however calculating the new coordinates based on the last pointer position if there was no pointer constrain in place. Fortunately to us, this didn't use to happen often/ever, as a pointer constrain function is set on MetaBackend initialization. This behavior did also exist previously in MetaDeviceManagerNative. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1028
* backends: Move warp_pointer() to ClutterSeatCarlos Garnacho2020-01-301-24/+16
| | | | | | | The onscreen pointer sprite is a per-seat element, so it makes sense to move pointer warping over there too. https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* backends: Move native keymap manipulation functions to MetaSeatNativeCarlos Garnacho2020-01-301-0/+156
| | | | | | | Since the ClutterKeymap is obtained through the ClutterSeat, it makes sense to have these manipulation functions in the ClutterSeat impl. https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* clutter: Move motion compression handling to ClutterSeatCarlos Garnacho2020-01-301-0/+26
| | | | | | Another responsibility taken away from ClutterDeviceManager https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* clutter: Move virtual device management to ClutterSeatCarlos Garnacho2020-01-301-0/+21
| | | | | | A11y in general may be considered a per-seat feature. https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* clutter: Move keyboard a11y from ClutterDeviceManager to ClutterSeatCarlos Garnacho2020-01-301-0/+13
| | | | | | A11y in general may be considered a per-seat feature. https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* clutter: Move platform event data management to ClutterSeatCarlos Garnacho2020-01-301-0/+25
| | | | https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* clutter: Move keymap from ClutterBackend to ClutterSeatCarlos Garnacho2020-01-301-25/+27
| | | | | | Keymaps are a per-seat feature, so move it there. https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* clutter: Move bell_notify() from ClutterBackend to ClutterSeatCarlos Garnacho2020-01-301-0/+10
| | | | | | Bells can be considered to be a per-seat feature, so move it there. https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* native: Implement ClutterSeatCarlos Garnacho2020-01-301-72/+2103
| | | | | | | | We had the MetaSeatNative struct around, so use it as the base of this Clutter object. A few responsibilities were drawn from ClutterDeviceManager. https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
* cleanup: Use g_clear_handle_id() for g_source_remove()Robert Mader2019-11-221-2/+1
| | | | | | | | It makes sure we do not forget to zero the id and lets us avoid zero checks before. We use it for all new code, lets clean up the existing code base. https://gitlab.gnome.org/GNOME/mutter/merge_requests/947
* Replace ClutterPoint by graphene_point_tGeorges Basile Stavracas Neto2019-10-161-1/+1
| | | | | | | | Remove the tests for ClutterPoint since it's corresponding code moved to private ClutterStage methods. https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
* backends: Don't use glib types in new native backend objectsCarlos Garnacho2019-08-241-14/+14
| | | | https://gitlab.gnome.org/GNOME/mutter/merge_requests/672
* clutter: Move evdev input to src/backends/nativeCarlos Garnacho2019-08-241-0/+904
The end goal is to have all clutter backend code in src/backends. Input is the larger chunk of it, which is now part of our specific MutterClutterBackendNative, this extends to device manager, input devices, tools and keymap. This was supposed to be nice and incremental, but there's no sane way to cut this through. As a result of the refactor, a number of private Clutter functions are now exported for external backends to be possible. https://gitlab.gnome.org/GNOME/mutter/merge_requests/672