Commit Graph

6568 Commits

Author SHA1 Message Date
Jonas Ådahl
abe682efa0 virtual-input/evdev: Translate from button internal codes to evdev
Sending button events to a ClutterVirtualInputDevice, the API expects
button codes to be of the internal clutter type. The evdev
implementation incorrectly assumed it was already prepared evdev event
codes, which was not the case. Fix the evdev implementation to translate
from the internal representation to evdev before passing it along to
ClutterSeatEvdev.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/190

(cherry picked from commit 24aef44baf)
2018-08-29 20:40:39 -05:00
Carlos Garnacho
2e0d758811 clutter/x11: Implement keycode lookup from keysyms on virtual key devices
Unfortunately XKeysymToKeycode() falls short in that it coalesces keysyms
into keycodes pertaining to the first level (i.e. lowercase). Add a
ClutterKeymapX11 method (much alike its GdkKeymap counterpart) to look up
all matches for the given keysym.

Two other helper methods have been added so the virtual device can fetch
the current keyboard group, and latch modifiers for key emission. Combining
all this, the virtual device is now able to handle keycodes in further
levels.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/135

(cherry picked from commit 85284acb00)
2018-08-29 20:40:39 -05:00
Daniel van Vugt
2ad5a39bd0 clutter-text: Avoid clipping the wrong framebuffer
`ClutterText` painting for editable single_line_mode actors like `StEntry`
is always clipped by:

`cogl_framebuffer_push_rectangle_clip (fb, 0, 0, alloc_width, alloc_height)`

So it's difficult to get the rectangle wrong. However in cases where the
target framebuffer has changed (`cogl_push_framebuffer`) such as when
updating `ClutterOffscreenEffect` we had the wrong old value of `fb`. And
so would be clipping the wrong framebuffer, effectively not clipping at all.


(cherry picked from commit b8340f1355)
2018-08-30 01:11:33 +00:00
Marco Trevisan (Treviño)
e73b321c2e device-manager-evdev: Add main seat to seats by default
Treat the main seat as other seats, so we don't have to handle it differently
in specific places. This was already the case before when a real device
was plugged before the startup, but not applied when hotplugging a device.


(cherry picked from commit 15f41c9f68)
2018-05-29 10:48:56 +00:00
Marco Trevisan (Treviño)
b6dc2052c3 device-manager-evdev: Free the main seat on finalize
(cherry picked from commit 2a38601b42)
2018-05-29 10:47:20 +00:00
Marco Trevisan (Treviño)
72965aaaf0 device-manager-evdev: Set and unset the stage for the main seat too
When no input devices are available on startup the device manager might be fast
enough to be constructed so that no default stage is set yet, and thus when
main seat virtual devices are created they won't have a proper stage set.
If then we plug a real device, the events that an input manager could generate
won't be associated to any stage and thus won't be processed.

We need then ensure that when we update the stage for the device manager we
(un)associate it also to the main seat devices.


(cherry picked from commit d7bdc1591f)
2018-05-29 10:46:03 +00:00
Marco Trevisan (Treviño)
2a6782dc10 clutter-device-evdev: Get devices from main seat if no real seat is set
In devices such as ARM boards there could be no input devices connected on
startup, leading to a crash when we try to process artificial events that
could be queued (as gnome-shell does when syncing pointer).

Those events still should refer to a device and, in case we don't have one
provided by libinput we should still return the core devices defined in the
main seat.


(cherry picked from commit 3e85ac8131)
2018-05-29 10:43:41 +00:00
Marco Trevisan (Treviño)
5142c8c7e7 clutter-seat-evdev: Add function to get device by id
(cherry picked from commit 5f83d9a5c8)
2018-05-29 10:43:17 +00:00
Olivier Fourdan
2dd9fc17c1 clutter/evdev: Don't ignore CAPS lock as modifier
Mark CAPS lock as a modifier (as it should) so that when using XKB
options to change the default behaviour of CAPS lock, the new assigned
key can by used as a sticky key as well.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/112
(cherry picked from commit 6df2b7af55)
2018-05-15 10:26:29 +02:00
Olivier Fourdan
c7a38c3139 clutter/evdev: ignore injected events from IM
Input method can inject key events, which leads to multiple reported key
press/release events for a single user action.

Ignore those events as this confuses keyboard accessibility.

(cherry picked from commit c01b099dbd)
2018-05-15 10:25:51 +02:00
Florian Müllner
920dc9e5a1 clutter: Don't reference invalid pc in gir
Cally is built into clutter itself rather than exposed as a separate
library.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 22:06:02 +02:00
Carlos Garnacho
c80e2c9ae5 clutter: Set slave=master in IM forwarded key events
The fix is twofold. On one hand, it makes sense not to relate IM (nor
any other) generated events to a HW device. On the other hand, if we
are unfortunate that an IM event is in flight when we are switching
to another TTY, it may arrive at a time when the source device is no
longer existent.
2018-04-22 12:14:37 +02:00
Carlos Garnacho
de7d7bbf3d clutter: Apply input hints/purpose on ClutterTextInputFocus focus in
And make the ClutterText-level properties independent from the input
focus, as those properties can be set anytime, not just when the
ClutterText actor is focused.

https://gitlab.gnome.org/GNOME/mutter/issues/66

Closes: #66


(cherry picked from commit 3684f6b0ac)
2018-04-03 15:00:01 +00:00
Yussuf Khalil
31779404f0 clutter: Avoid unnecessary relayouts in ClutterText
We can save an unnecessary relayout if the required size to fully draw the text
is equal to the currently allocated size after the underlying text buffer or
attributes that only affect the PangoLayout have changed.
2018-03-22 23:35:27 +01:00
Ting-Wei Lan
4e6114b14d configure: Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE
https://bugzilla.gnome.org/show_bug.cgi?id=792717
2018-03-21 13:14:50 +00:00
handsome-feng
b8a81128e0 Fix some spelling errors
https://gitlab.gnome.org/GNOME/mutter/merge_requests/45
2018-03-21 13:22:35 +08:00
Carlos Garnacho
481e87032c clutter: Give the ClutterTextInputFocus a first stab at handling key events
Actor keybindings were dispatched in an earlier return path, which means
the IM doesn't get to see certain key events. Flip the order around so the
IM has an opportunity to handle all keypresses.

https://gitlab.gnome.org/GNOME/mutter/issues/65

Closes: #65
2018-03-13 20:00:10 +00:00
Carlos Garnacho
0bf0e5780c clutter/x11: Communicate proper group/mode on pad events.
So we can trigger actions for the right mode.

https://gitlab.gnome.org/GNOME/mutter/issues/48

Closes: #48
2018-03-03 16:07:24 +00:00
Carlos Garnacho
d7c5e57134 clutter/x11: Implement missing ClutterInputDevice pad vmethods
Use libwacom to be able to find out modes, groups and button roles on
pad devices.

https://gitlab.gnome.org/GNOME/mutter/issues/48

Closes: #48
2018-03-03 16:07:23 +00:00
Carlos Garnacho
8d2f794bd3 clutter/x11: Plug a leak 2018-02-27 14:09:48 +01:00
Jonas Ådahl
a1517cae1c clutter/device-manager: Add way to check virtual device support
This is needed so that mutter can let applications using the remote
desktop API to know whether touch screens are supported.
2018-02-23 19:33:31 +08:00
Jonas Ådahl
542502be53 clutter/x11: Add pointer motion support to virtual devices
As the other virtual input event delivery mechanisms, this also uses
the XTEST protocol.
2018-02-23 19:33:31 +08:00
Jonas Ådahl
203a0b37ed clutter: Add smooth scroll and touch API to virtual devices
So far only implemented on the evdev backend,as X11 doesn't support touch
devices nor smooth scrolling via XTEST.
2018-02-23 19:33:31 +08:00
Jonas Ådahl
b6477a826d clutter/evdev: Don't treat device touch slots as seat slots
IF two touch devices have colliding touch point IDs they'd interfere on
the seat. To avoid this, always allocate a seat wide slot for each
device wide slot, but don't use device slots directly in the seat.
2018-02-23 19:33:31 +08:00
Jonas Ådahl
95adc45b71 clutter/evdev: Move touch notification to seat 2018-02-23 19:24:07 +08:00
Jonas Ådahl
f20daf567d clutter: Silence gtk-doc warning 2018-02-23 19:24:07 +08:00
Carlos Garnacho
bcd5882081 clutter: Check the ClutterTextInputFocus has focus before filtering events
Checking correct state is responsibility of the ClutterInputFocus user, and
it is indeed possible to get a focused ClutterText while its
ClutterInputFocus didn't get itself focused (eg. lack of IM).

https://gitlab.gnome.org/GNOME/mutter/issues/36

Closes: #36
2018-02-18 15:22:13 +01:00
Carlos Garnacho
37aab9280a clutter/text: Be more pervasive at updating input method state
More concretely, ensure preedit text goes away after commit/focus_out,
and update cursor position right after focus_in.
2018-02-12 14:44:30 +01:00
Jonas Ådahl
61bc1a7d6f clutter/x11: Remove video memory purge API
Clutter doesn't handle it anyway, and mutter now creates the
CoglRenderer object itself so we don't need this API anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2018-02-07 11:04:51 +08:00
Jason Gerecke
91df801ffb clutter/evdev: Add support for BTN_STYLUS3
BTN_STYLUS3 is defined by the Linux 4.15 kernel and is sent when the
third button on a stylus is pressed. At the moment, only Wacom's "Pro
Pen 3D" has three stylus buttons. Pressing this button triggers a button
8 event to be sent under X11, so we use the same mapping here.

https://bugzilla.gnome.org/show_bug.cgi?id=790033
2018-01-30 19:28:02 +01:00
Ray Strode
58bb61e161 clutter/stage: Set framebuffer state directly
clutter_set_viewport always operates on the draw fb, but
mutter sometimes has an offscreen fb it uses instead.

This commit uses the non-deprecated, clutter_framebuffer_set_viewport
function, which takes an explicit fb argument.

Closes: https://gitlab.gnome.org/GNOME/mutter/merge_requests/2
2018-01-25 11:41:54 +08:00
Carlos Garnacho
513c278077 clutter: Make ClutterText request toggling the input panel
So gnome-shell is able to show the OSK for it.
2018-01-18 16:20:45 +01:00
Carlos Garnacho
ac8ee9a08c clutter: Add clutter_text_has_preedit()
This function returns TRUE if there is any preedit going on. This method
will be useful in gnome-shell where similar checks are performed on
StIMText actors.
2018-01-18 16:20:45 +01:00
Carlos Garnacho
952c1fefa2 clutter: Add input-purpose/hint properties to ClutterText
So those properties can be changed or queried within shell UI.
2018-01-18 16:20:45 +01:00
Carlos Garnacho
3a914a915e clutter: Implement ClutterInputFocus subclass for ClutterText
This only applies when the actor is editable. This object will allow
editable ClutterText instances to interact with the input method.
2018-01-18 16:20:45 +01:00
Carlos Garnacho
aa6561a3b1 clutter: Add ClutterInputMethod and ClutterInputFocus
ClutterInputFocus is an abstract object to be subclassed by UI actors and
the wayland interface and represents the user of an input method. It
represents the current focus of the input method, so all emitted signals
and public API hooks are expected to be called when the input method is
currently interfacing with the input focus.

ClutterInputMethod is an abstract class (to be implemented in the upper
layers) that represents the input method itself. Besides focus management
itself, all public API calls that would be called by the subclasses are
delivered through the current input focus.
2018-01-18 15:35:29 +01:00
Carlos Garnacho
9eb9623288 clutter: Add ClutterBackend IM setter/getter
The input method will be global to Clutter and shared between all the
IM aware foci. These methods allow querying it and setting one up.
2018-01-18 15:33:12 +01:00
Carlos Garnacho
8c988aa632 clutter: Add special event flag for events that went through an IM
This will be useful to let Clutter know whether those should be or have
already been dispatched through an input method.
2018-01-18 15:33:12 +01:00
Carlos Garnacho
7346419295 clutter/evdev: Ensure a valid ClutterEventSequence on single-touch devices
Libinput shall report those as having slot=-1, which gets mistakenly
translated into the special "NULL" ClutterEventSequence. Making those
events get a non-NULL sequence will make single touch devices work.

https://bugzilla.gnome.org/show_bug.cgi?id=792005
2018-01-17 00:22:22 +01:00
Jonas Ådahl
4e3b26d2ed clutter/evdev: Ignore unknown touch points
We might receive touch events for unknown touch points, for example
when starting mutter while touching the screen (resulting in no
touch-down event ever being received). Avoid crashing when this happens
by just dropping these events on the floor.

https://bugzilla.gnome.org/show_bug.cgi?id=791371
2018-01-12 18:57:43 +08:00
Marco Trevisan (Treviño)
2b60fb0144 stage: Push framebuffer before setting up viewport
When capture_view* functions are called with the paint flag set
to TRUE, we need to setup the framebuffer, however this was
happening after setting up the viewport, while the viewport
needs the framebuffer to be valid when calling cogl_set_viewport.

https://bugzilla.gnome.org/show_bug.cgi?id=791809
2017-12-20 05:56:51 -05:00
Olivier Fourdan
7f5f5eb847 wayland/keyboard: preserve layout index
On VT switch, the xkb state layout index is lost and reset to the first
group, so if the first layout is not the last one being used, the xkb
state used in both meta-wayland-keyboard.c and clutter/evdev will be
desynchronized with the keyboard source indicator in the gnome-shell UI.

Save the effective layout chosen along with the seat so it can be
restored when reclaiming devices.

Use the saved layout index from the clutter/evdev's seat to restore the
layout in meta-wayland-keyboard, so that switching VT doesn't reset the
layout and causes further discrepancies with the layout indicator in the
gnome-shell UI.

https://bugzilla.gnome.org/show_bug.cgi?id=791383
2017-12-20 09:56:34 +01:00
Olivier Fourdan
03be6b687b clutter/x11: Configure XKB accessibility
Configure XKB accessibility features from the x11 and xi2 clutter input
device managers, offloading this feature from gnome-settings-daemon.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
32c22d375a clutter/x11: Add xkb accessibility helpers
Adds a set of convenient functions that can be shared between x11 input
device backends (namely core-x11 and xi2) to control XKB accessibility
features.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
bdf3f49a82 clutter/evdev: implement mouse keys support
Control the pointer using the numeric keypad.

When enabled, creates a virtual pointer and emulate the pointer event
based on keyboard events.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
356b4b0dc5 clutter/evdev: implement toggle keys support
Keeping Shift pressed for 8 seconds enables slow keys, pressing Shift 5
times in a row enables sticky keys.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
06d976e853 clutter/evdev: implement sticky keys support
One key press on a modifier latches it, two consecutive presses lock it.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
96ebd1c214 clutter/evdev: implement bounce keys support
Ignore multiple consecutive identical key presses within a time frame.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
fa28481736 clutter/evdev: implement slow keys support
Delay emitting clutter key press events when slow key is enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
76b064cffc clutter/evdev: Implement a11y configuration hooks
Apply the keyboard accessibility settings to the master keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00