summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* backends/x11: Stop translating a property IDpiotrdrag/update-potfiles-201122Piotr Drąg2020-11-281-2/+2
| | | | These are not visible to users.
* Update POTFILES.inPiotr Drąg2020-11-281-0/+1
|
* backends/native: Pass xkb_state directly when updating MetaKeymapNativeCarlos Garnacho2020-11-273-11/+7
| | | | | | | | | | | | Figuring out the MetaSeatImpl this much indirectly is fairly awkward when the keymap is only updated from the MetaSeatImpl, pass instead the seat impl's xkb_state, as we have it handy in all the places this is called. This will not break on NULL seats during initialization, should the numlock state be restored from previous sessions. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1556 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1612>
* barrier: Complain loudly if bogus barriers are createdJonas Ådahl2020-11-271-0/+4
| | | | | | | | | | | | The API allows for invalid barriers to be created; in an X11 session, this could result in involutary early exit, so guard against those with soft asserts. These will be logged in the journal as warnings, but will avoid the crash unless compiled out. Note that this doesn't fix the bug, it just makes it more detectable. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1901610 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1611>
* backends/native: Add distinct meta-input-thread.h headerCarlos Garnacho2020-11-2718-23/+67
| | | | | | | | Make it impossible to add individual includes of input thread objects. This must go through meta-input-thread.h now, which should be enough to make anyone think it twice. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Add a bunch of "_in_impl" suffixes to functionsCarlos Garnacho2020-11-2714-541/+548
| | | | | | | | They're a dime a dozen. If it gets called exclusively from the input thread, it got one. Hopefully these breadcrumbs will be enough so people don't lose their way here. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Add input thread inside MetaSeatImplCarlos Garnacho2020-11-274-101/+256
| | | | | | | | | | | | | | | | | | | | | | This (now) doesn't change anything in regards to the API that the UI thread should access from the MetaSeatImpl. The MetaInputDeviceNative, MetaInputSettings and MetaKeymap objects are now considered owned by the input thread, as well as all of libinput objects. The MetaEventSource now dispatches events in a GMainContext that is the thread default to this thread, and all UI-thread-accessible API (seat and virtual input device API) will be handled in a serialized manner by that same input thread. The MetaSeatImpl itself is still considered to be owned by the caller thread, and all the signals that this object emits will be emitted in the GMainContext that is default at the time of calling meta_seat_impl_new(). The MetaInputSettings configuration changes will likewise be handled in the input thread, close to libinput devices. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Add missing seat finalization pathsCarlos Garnacho2020-11-272-0/+16
| | | | | | On finalize we leak the clutter backend, which leaks the stage and seat. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Do not emit signals during ClutterBackend finalizationCarlos Garnacho2020-11-271-1/+1
| | | | | | Missed because nobody does that ATM. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Update keyboard a11y status in seat implCarlos Garnacho2020-11-277-63/+44
| | | | | | | | | Instead of going through the event queue, stage handling code, and back to the input device via a vmethod call, do this directly in the MetaSeatImpl. This is not too different from X11, where everything happens inside the backend. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Add vmethod to find out group for pad featuresCarlos Garnacho2020-11-277-88/+178
| | | | | | | Do it so the wayland bits don't have to access native input devices internals. The data is still readonly, idempotent, etc. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Make MetaInputSettingsNative vmethods "async"Carlos Garnacho2020-11-271-11/+78
| | | | | | | Those that are exposed via MetaInputSettings API that's still accessible in other parts of the backend. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Shuffle keyboard a11y signal connection into MetaSeatImplCarlos Garnacho2020-11-272-28/+20
| | | | | | | This signal gets emitted in the input thread, and does things that belong to it. Make it clear by moving to the MetaSeatImpl. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Straighten MetaInputSettings creationCarlos Garnacho2020-11-275-39/+35
| | | | | | | | We have "create" and "get" methods, and a "create" vmethod. Make it all "get" so the backend implementations can keep their own reference without completely lying. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Move ClutterInputDevice fields to private structCarlos Garnacho2020-11-275-102/+182
| | | | | | | | | | | | | All that is left in the "public" struct is all state that ClutterStage delegates on ClutterInputDevice. That should move somewhere else, but not here, not now. All private fields belong to construct-only properties, with only getter API, and idempotent vmethods (except keyboard a11y, atm). This should be enough to make ClutterInputDevice obviously thread safe, outside the backend. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop keycode_to_evdev vmethodCarlos Garnacho2020-11-278-76/+13
| | | | | | | This is just used in the native backend, move it to an utility function there. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop ClutterInputDevice private tool maintenance APICarlos Garnacho2020-11-274-59/+16
| | | | | | | This is just used in the native backend (with the X11 going its own way). Just keep a HT of tools there, and drop this API. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Move scroll valuator accounting to backends/x11Carlos Garnacho2020-11-275-125/+122
| | | | | | This is just used there. Another X11 detail that got open coded. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop ClutterInputDevice axis APICarlos Garnacho2020-11-276-337/+158
| | | | | | | | Most of this comes from X11 peculiarities that were open coded in the Clutter ABI. We don't need this except in X11, so move this axis handling there. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop internal update_from_tool() vmethodCarlos Garnacho2020-11-276-65/+0
| | | | | | | This is kinda pointless now, and will be made completely unneeded by dropping device axes. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Forward event axes as array of ClutterInputAxes elementsCarlos Garnacho2020-11-274-76/+26
| | | | | | | Instead of encoding arrays in ways that we need the ClutterInputDevice to decode them, use ClutterInputAxes as the array index. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Make axes part of the device toolCarlos Garnacho2020-11-276-60/+93
| | | | | | | This info can be construct-only there, as opposed to devices. Move this info to tools, so we can drop it from devices. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop clutter_input_device_get_associated_device()Carlos Garnacho2020-11-275-165/+4
| | | | | | | And the private setter. One may ask the seat for the pointer/keyboard instead of asking the device for its counterpart. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop clutter_input_device_get_physical_devices() APICarlos Garnacho2020-11-275-109/+4
| | | | | | This is unused, we have the seat for this kind of stuff. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop clutter_input_device_get_key()/n_keys APICarlos Garnacho2020-11-274-158/+0
| | | | | | | And the corresponding setters. This is completely unused, and unrecommended. In xkb we trust. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop clutter_input_device_get_modifier_state() APICarlos Garnacho2020-11-273-30/+2
| | | | | | | This is using ClutterSeat state queries underneath, let the only caller do that, and drop this call. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Drop clutter_input_device_get_coords() methodCarlos Garnacho2020-11-2712-48/+24
| | | | | | | This is not device state anymore. It uses ClutterSeat API underneath, so let callers do that instead. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Make pointer cursor invisible until the stage is shownCarlos Garnacho2020-11-272-1/+12
| | | | | | We are able to show the cursor before that, it doesn't mean we should. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Make MetaVirtualInputDevice vmethods "async"Carlos Garnacho2020-11-271-191/+507
| | | | | | | These are one-way API calls, that now should get executed in the MetaSeatImpl context. Use the MetaSeatImpl async task plumbing so that's the case. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Make some MetaSeatImpl API "async"Carlos Garnacho2020-11-272-44/+211
| | | | | | | | This API is the one accessed from different bits of the UI thread, make it "async" (it's basically one-way setters, so API stays the same in the surface) and able to run in the MetaSeatImpl main context. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Handle numlock saving/restoring directly in backendsCarlos Garnacho2020-11-2711-152/+111
| | | | | | | | Simplify the handling of numlock state, so it can be entirely handled within the input thread. Since the saving/restoring is triggered inside each backend code, there's no need anymore for meta_backend_set_numlock(). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Shuffle xkb_keymap creationCarlos Garnacho2020-11-275-71/+74
| | | | | | | | | | | | | Push it a little bit down to the MetaSeatNative. As both the UI thread and the input thread are interested in dealing with the xkb_keymap and it is not meant to be used in different threads, keep 2 separate copies around. The keyboard map will always be set from the UI thread, so the xkb_keymap owned by the MetaSeatNative (owned by the UI thread) can be considered canonical. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Seal MetaKeymapNative xkb usageCarlos Garnacho2020-11-273-18/+31
| | | | | | | | | | | | | Don't let the vfuncs (meant to be called from the UI thread) deal with xkb state itself. Instead store the current state in struct fields, which is then fetched in vfuncs. This makes the keymap able to be used from the UI thread, while being maintained by the input thread. Same caveats apply than clutter_seat_query_state(), you are asking for the most up-to-date state, but it still may be changing under your feet. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Surround device state queries/updates with RW lockCarlos Garnacho2020-11-273-6/+50
| | | | | | | | | | | | | | | | | | | Wrap all keyboard state updates, and all pointer/stylus/touch cursor position with a write lock, and ::query_state() (The only entrypoint to this state from other threads) with a read lock. The principle is that query_state may be called from different threads (UI so far, but maybe KMS too in the future), while the input thread may (or may not) be updating it. This state is fetched "atomically" (eg. x/y will be consistently old or new, if the input thread were updating it at the same time). There's other places deep in backends/native that read this state, they all will run in the input thread, so they count as "other readers" to the other thread. Those changes are already mutually exclusive with updates, so they don't explicitly need the RW lock. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Protect MetaBarrierManagerNativeCarlos Garnacho2020-11-271-7/+57
| | | | | | | | | | While barriers will be added from the main thread, the native barrier manager will sit close to the MetaSeatImpl in its own thread. Add the necessary locking so that we can pass MetaBarrierImplNative from the UI thread to the input thread, and ensure the MetaBarrier signals are still emitted in the UI thread. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Switch to GAsyncQueue for ClutterMainContext event queueCarlos Garnacho2020-11-273-23/+24
| | | | | | | We will be moving to having events produced in one thread and consumed in another. Make this an async event queue in preparation for that. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Move MetaInputSettings ownership to MetaSeatImplCarlos Garnacho2020-11-277-35/+188
| | | | | | | Together with keymaps and devices, MetaInputSettings will live in the ninth circle of hell with MetaSeatImpl, forever tied to it. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Do not use clutter_seat_list_devices() in MetaInputSettingsCarlos Garnacho2020-11-271-21/+15
| | | | | | Make it keep its own list of devices, it's not that far off. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Make device tracking at MetaInputSettings ad-hoc APICarlos Garnacho2020-11-276-47/+55
| | | | | | | | | | | | | Depending on the backend, we want to integrate this object at different levels. It will sit close to the MetaBackendX11/MetaSeatX11 in X11, but it will be put deep down with MetaSeatImpl in the native backend, in a separate thread. Since we can't depend on a single object type, nor are able to track ClutterSeat signals neatly, make this API something to be called explicitly by backends. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Simplify function argumentsCarlos Garnacho2020-11-271-9/+3
| | | | | | | We just pass a device in order to check it with the seat pointer, we can do without this. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Update device for the current tool in backendsCarlos Garnacho2020-11-273-3/+6
| | | | | | This should happen deeper in backends, not here in clutter-main. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Proxy modifier state changes via MetaSeatImplCarlos Garnacho2020-11-272-1/+20
| | | | | | | This changes within the MetaSeatImpl realm, so use a signal to forward this to the MetaSeatNative/MetaKeymapNative one. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Proxy bell notifications from within the MetaSeatImplCarlos Garnacho2020-11-274-1/+24
| | | | | | | As with other changes from within the MetaSeatImpl realm, proxy that through a MetaSeatImpl signal, instead of poking directly on the ClutterSeat. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Proxy touch-mode via MetaSeatImplCarlos Garnacho2020-11-273-2/+25
| | | | | | | | Handle this via a MetaSeatImpl signal, as the heuristics that apply here are based on libinput events. The MetaSeatNative just forwards the touch-mode changes now. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Forward keyboard a11y changes via the MetaSeatImplCarlos Garnacho2020-11-274-17/+90
| | | | | | | | These changes will happen in the input event management code, so let them be emitted via the MetaSeatImpl, as that's what we'll have neat access to. The ClutterSeat signals are now emitted from there. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backend/native: Let cursor renderer/tracker be updated by events after warpCarlos Garnacho2020-11-271-6/+0
| | | | | | | We will generate a motion event, which will end up with the same result, at a time we can ensure it did happen. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends/native: Spin MetaSeatImpl off MetaSeatNativeCarlos Garnacho2020-11-2712-2967/+3461
| | | | | | | | | Move most of the functional bits (those meant to run on a standalone thread) to a MetaSeatImpl object. This object is managed by the MetaSeatImpl and not exposed outside the friend MetaSeatNative/MetaInputDeviceNative/ MetaInputSettings classes. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* clutter: Make ClutterSeat::handle_device_event vfunc more genericCarlos Garnacho2020-11-277-29/+28
| | | | | | | | Make it able to handle not just device added/removed events, but perform any kind of post-processing that needed to be done on ClutterEvents at the seat level. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Move keyboard a11y into backendsCarlos Garnacho2020-11-2713-235/+227
| | | | | | | And out of Clutter API. This is mainly set via settings, or the windowing itself, so we don't need to leak these details up our own backend. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* backends: Make MetaInputMapper take over MetaInputSettings public APICarlos Garnacho2020-11-277-94/+93
| | | | | | | | | | Banish MetaInputSettings from MetaBackend "public" API, it's now meant to spend the rest of its days in the backend dungeons, maybe hanging off a thread. MetaInputMapper replaces all external uses. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>