Commit Graph

6442 Commits

Author SHA1 Message Date
Rui Matos
18a4b9fb2c clutter/evdev: Dispatch libinput before generating key repeat events
Since both the libinput event source and the key repeat timer have the
same priority, the order in which both handlers are called is
arbitrary if both sources are ready on the same poll return. This
means that sometimes we generate key repeats when there's already a
real key event queued on libinput that would cancel the repeat timer
if only it was processed before.

One solution would be lowering the repeat timer source priority a
notch lower than the libinput source but that would mean that a steady
stream of events from libinput (e.g. pointer device motion) would
prevent any key repeats to happen.

Instead, we can fix this problem by trying to dispatch libinput from
the key repeat timer and checking if the timer source has been
destroyed before generating more key repeats.

https://bugzilla.gnome.org/show_bug.cgi?id=774989
2017-01-25 13:10:15 +01:00
Rui Matos
2166a496fe clutter/evdev: Avoid losing key repeat timestamp resolution
Commit 9214d5029c changed the notify*
API to use microseconds and we already have a microsecond time source
here so we can use the timestamp directly without losing resolution at
this layer.

https://bugzilla.gnome.org/show_bug.cgi?id=774989
2017-01-25 13:10:14 +01:00
Rui Matos
5ec5e29422 clutter/stage: Fix framebuffer capture origin offset (again)
Commit 5fbb479301 was wrong too. What we
really want to do here is getting view relative coordinates given the
view's and the rectangle's global coordinates so we need to subtract
the view's origin from the rectangle's.

https://bugzilla.gnome.org/show_bug.cgi?id=771502
2016-10-17 13:48:56 +02:00
Florian Müllner
a4e69f338d clutter: Reuse GTK+'s RTL/LTR handling
Commit a4fb7ef5a3 dropped translations of our internal cogl/clutter
forks, which broke the local-based text direction support. Instead
of bringing back translations just for this purpose, we can re-use
GTK's translations which use the same technique.

https://bugzilla.gnome.org/show_bug.cgi?id=771549
2016-09-19 23:10:57 +02:00
Rui Matos
5fbb479301 clutter/stage: Fix framebuffer capture origin offset
Commit f36fa53b0e had the offset math
wrong and the reviewer didn't notice it.

https://bugzilla.gnome.org/show_bug.cgi?id=771502
2016-09-19 22:28:05 +02:00
Jonas Ådahl
342532a98d ClutterStageCogl: Don't get buffer damage dirty pixel when not supported
Now with the existance of offscreen view framebuffers the buffer age
damage regions are only valid if the view in question doesn't doesn't
have an intermediate offscreen. So, for views that doesn't have buffer
age, return the dirty pixel (0,0).

https://bugzilla.gnome.org/show_bug.cgi?id=770672
2016-09-15 10:14:20 +08:00
Jonas Ådahl
219d2304e0 clutter: Let the stage window translate dirty pixel according to view
Otherwise if buffer age is not supported the dirty pixel would be
shifted potentially in unpaintable position.

https://bugzilla.gnome.org/show_bug.cgi?id=770672
2016-09-15 10:14:20 +08:00
Jonas Ådahl
fb6b0de48b clutter: Use non-deprecated pixel reading function when picking
This wont fix anything, it just one small step away from using
deprecated cogl functions.

https://bugzilla.gnome.org/show_bug.cgi?id=770672
2016-09-15 10:14:20 +08:00
Jonas Ådahl
b78b8c9578 ClutterStageView: Always blit full texture on full onscreen framebuffer
When blitting an offscreen onto an onscreen, the whole offscreen should
always be drawn on the whole onscreen. Thus, don't try to convert
between coordinate spaces, just draw the whole offscreen on the whole
onscreen.

https://bugzilla.gnome.org/show_bug.cgi?id=770672
2016-09-15 10:14:20 +08:00
Olivier Fourdan
4c106a9c9b wayland: save/restore numlock state
Save the state on NumLock so that is can be (optionally) restored on
next login.

bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=757943
2016-09-09 19:07:10 +02:00
Jonas Ådahl
d893adb290 clutter: Compress instead of discard motion events
Clutter discards any motion event if next event happens to also be a
motion event. This is problematic when the motion event carries
relative motion deltas, since the information about them is completely
lost.

Until we have moved away made the stage stop discarding motion events,
lets work around the issue by compressing them, effectively adding
multiple relative motion deltas together, would one be discarded.

https://bugzilla.gnome.org/show_bug.cgi?id=771049
2016-09-09 10:03:34 +08:00
Jonas Ådahl
f36fa53b0e clutter/stage: Offset framebuffer capture origin by view layout
The rectangle passed to capture_view() is in stage coordinate space;
thus, to translate to framebuffer coordinate space, the origin need to
be translated by the view layout position.

This fixes capturing views not at position (0, 0).

https://bugzilla.gnome.org/show_bug.cgi?id=770127
2016-09-06 14:59:36 +08:00
Jonas Ådahl
01edf10e82 clutter/evdev: Fix absolute pointer motion events
Absolute pointer events used the X coordinate as both X and Y. This
caused the pointer cursor to be moved incorrectly for absolute pointer
devices, commonly used in virtual machines.

https://bugzilla.gnome.org/show_bug.cgi?id=770557
2016-08-30 15:48:30 +08:00
Carlos Garnacho
a6e15e841b clutter/cogl: Transform swap buffers regions into onscreen coordinates
Those are given in view coordinates, so we must transform into onscreen
coordinates in order to perform swap_buffers on the right damage regions.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:38:05 +02:00
Carlos Garnacho
61e9c5c357 clutter/cogl: Hook up ClutterStageView render-to-texture
"Blit" the result on the framebuffer after each view is painted.
This of course only applies if there is an offscreen buffer to
perform any blitting. Otherwise the onscreen framebuffer is rendered
to directly and this step is not necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:38:05 +02:00
Carlos Garnacho
54dc10f890 clutter: Add infrastructure to render ClutterStageViews to offscreen
The offscreen is given through the ::back-buffer property, the ClutterStageView
will set up the the CoglPipeline used to render it back to the "onscreen"
framebuffer.

The pipeline can be altered through the setup_pipeline() vfunc, so ClutterStageView
implementations can alter the default behavior of blitting from offscreen to
onscreen with no transformations.

All getters of "the framebuffer" that were expecting to get an onscreen have
been updated to call the right clutter_stage_view_get_onscreen() function.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:36:45 +02:00
Sjoerd Simons
913c32ee34 Fix build of clutter tests
Various clutter test directly use cogl symbols, so they should be linked
against mutter-cogl as well.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=769636
2016-08-23 13:45:05 +02:00
Carlos Garnacho
b53b94e6f2 clutter/evdev: Implement ClutterVirtualInputDevice::notify_keyval
This is somewhat gross at the moment, because we're after all mimicking
real keyboard events, we can only lookup keycodes that are available
in the current map, and the control of levels is rather limited.

Eventually, we want to implement the text_input protocol, handle these
events separately to MetaWaylandKeyboard, so event->key.keyval is
is guaranteed to be the final result. Until then, this is the farthest
we can get.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:36:42 +02:00
Carlos Garnacho
4abd31d863 clutter: Add ClutterVirtualInputDevice vmethod to notify keysyms
Evcodes don't cut it when we have something already specifying the
character to be printed, despite the current group/level. This API
allows some more control on the intended output.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:03:18 +02:00
Carlos Garnacho
3c8b1462bc clutter: Make ClutterVirtualInputDevice public
This includes adding documentation and introspection annotations,
and marking the functions as extern.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:03:18 +02:00
Carlos Garnacho
27a77fa115 clutter/evdev: Allow specifying the ClutterInputMode of virtual devices
The seat core keyboard/pointer will be "master", the ones created through
ClutterVirtualInputDevice will be "slaves".

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:03:18 +02:00
Jonas Ådahl
0992b5c53e ClutterVirtualInputDeviceEvdev: Forward button and key presses
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:03:18 +02:00
Jonas Ådahl
e928370bf0 ClutterSeatEvdev: Keep track of button count
libinput does it for us, but only for physical devices. When we add
virtual devices to the same seat, we need to track button press count
ourself.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
d2b05f0305 ClutterVirtualInputDeviceEvdev: Forward motion events
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
bd326d38ac ClutterVirtualInputDeviceEvdev: Create associated ClutterInputDevice
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
8e335ce183 ClutterVirtualInputDeviceEvdev: Construct with a specific seat
We are still single seated, so until we are properly multi seated its
always the main seat.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
364b184f41 ClutterVirtualInputDevice: Store the device type
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
94016f7257 clutter/evdev: Move keyboard and pointer notification into seat
We notify per seat; so lets move the logic there. Touch and tablets to
follow later.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
e38a8363e4 ClutterVirtualInputDevice: Keep track of the device manager
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
76eb27e786 ClutterDeviceManagerEvdev: Split out seat into a separate file
Split out ClutterSeatEvdev functionality into a separate file.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
5db2be414b clutter: Add virtual input device API
Virtual input devices aim to enable injecting input events as if they
came from hardware events. This is useful for things such as remote
controlling, for example via a remote desktop session.

The API so far only consists of stumps.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:19 +02:00
Jonas Ådahl
adcd0fe9b4 ClutterStageView: Initialize viewport/projection as dirty
Initially the viewport and projection is not calculated and should thus
be marked as dirty.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-08-03 11:20:55 +08:00
Florian Müllner
740748af3e clutter: Fix typo in assert 2016-07-29 11:35:31 +02:00
Carlos Garnacho
2e4eb86340 configure: Require libinput 1.4
We use API recently added in that version.
2016-07-27 13:32:38 +02:00
Carlos Garnacho
80674fc9e4 clutter/evdev: Optionally report abs/rel motions for tablet tools
Depending on clutter_input_device_get_mapping(), or whether the current
tool is either cursor or lens (those don't make any sense in absolute
mode), relative motions will be reported.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
9587a60da4 clutter: Add clutter_input_device_[gs]et_mapping()
This function call only applies to tablets, and thus will error
out unless it's called with CLUTTER_TABLET_DEVICEs. This will
allow setting absolute/relative mapping on those on the fly, as
this is optional.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
af8b938f92 clutter/x11: Set device node information in XI2 devices 2016-07-22 13:31:09 +02:00
Carlos Garnacho
1496a7ead3 clutter/evdev: Set device node information to evdev devices 2016-07-22 13:31:09 +02:00
Carlos Garnacho
e7e62ee4a4 clutter: Add clutter_input_device_get_device_node()
This function is meant to return the device node path (eg. /dev/input/...),
which will be useful to wire up a few things.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
1c23d4bc51 clutter/evdev: Set tool IDs 2016-07-22 13:31:09 +02:00
Carlos Garnacho
2e6bfa8bae clutter: Add ClutterInputDeviceTool:id property 2016-07-22 13:31:09 +02:00
Carlos Garnacho
a59170c09f clutter: Fix ClutterInputDeviceTool:serial setter/getter
The argument is internally handled as a uint64, but only exposed in
API as guint.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
96aed5fd2e clutter: Handle pad button events in clutter_event_get_button() 2016-07-22 13:31:09 +02:00
Carlos Garnacho
88c510c38a clutter/evdev: Translate/emit libinput pad events 2016-07-22 13:31:09 +02:00
Carlos Garnacho
6bcff556b5 clutter/evdev: Handle management of pad devices 2016-07-22 13:31:09 +02:00
Carlos Garnacho
81736b1dea clutter: Add ::n-rings and ::n-strips property to ClutterInputDevice
This will only be practical for pads (and maybe generic buttonsets in
the future?), we just need to know the number as the events will also
contain a number as the identificator.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
cc09ca8892 clutter: Add pad event types
And their management along the pipeline.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
d76aa89be9 clutter: Add clutter_event_get_mode_group()
This event can be used on pad events to find out the group they
pertain to.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
8cd4b0e11f clutter: Add pad event structs
Those map closely what we get from libinput. Button events have
been made its own separate struct, its semantics fall somewhere
in between of ClutterButtonEvent and ClutterKeyEvent, so is better
emitted as its own set.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
6b08990dcc clutter: Add "pad" device type 2016-07-22 13:31:09 +02:00