1
0
Fork 0
Commit graph

6007 commits

Author SHA1 Message Date
Jasper St. Pierre
dcaf5686a2 evdev: Always create the main seat
There could be times when we may not necessarily see a device appear
at initialization time, like when we're VT switched away when we
initialize, and thus we can't ever rely on a main seat appearing.

Always create a main seat with logical pointer/keyboard devices, and
tie the first physical seat that comes in to the main seat.

https://bugzilla.gnome.org/show_bug.cgi?id=726199
2014-03-13 12:46:28 -04:00
Jasper St. Pierre
defe55ff09 evdev: Extract code for setting the libinput seat out
We're going to create the main seat at an earlier time, when
we don't have the physical libinput_seat yet, so we need to
do the association later.

https://bugzilla.gnome.org/show_bug.cgi?id=726199
2014-03-13 12:46:28 -04:00
Jasper St. Pierre
5facd710c8 evdev: Set the initial pointer position for all pointer devices
Rather than just those on the main seat.

https://bugzilla.gnome.org/show_bug.cgi?id=726199
2014-03-13 12:46:27 -04:00
Jasper St. Pierre
e23f77f1e6 evdev: Extend the device open callback with a close callback as well
We need to return the device to logind with ReleaseDevice().

https://bugzilla.gnome.org/show_bug.cgi?id=726199
2014-03-13 12:46:27 -04:00
Emmanuele Bassi
aa5a4e9e3c stage: Use the correct types for debug note 2014-03-12 19:30:04 +00:00
Bastian Winkler
70835c904a grid-layout: Use correct orientation when requesting preferred child size
Otherwise width and height are swapped.

https://bugzilla.gnome.org/show_bug.cgi?id=725722
2014-03-12 00:30:40 +01:00
Chun-wei Fan
c1fd29df7a Fix The Win32 Backend for Newer Visual Studio Versions
The GetSystemMetrics() function returns wrong values for SM_CXSIZEFRAME,
SM_CYSIZEFRAME, SM_CXFIXEDFRAME and SM_CYFIXEDFRAME when built with Visual
Studio 2012 and 2013 (unless the XP compatibility setting for the
PlatformToolset entry is turned on), causing the window of Clutter programs
to automatically shrink to a point where they become unusable.

This patch uses AdjustWindowRectEx() for builds using Visual Studio 2012
and later, which deduces the required height and width of the Window
properly.  Unfortunately we can't use this for the VS 2008/2010 builds as
they cause the Window to continually expand as the program is run.

https://bugzilla.gnome.org/show_bug.cgi?id=725873
2014-03-08 18:35:50 +08:00
Chun-wei Fan
acd7d9555c Fix Build of clutter-test-utils.c on Windows
The use of "environ" clashes with a #define in Window's stdlib.h, at least
on Visual Studio, so fix the build by prefixing environ with test_.

https://bugzilla.gnome.org/show_bug.cgi?id=725716
2014-03-08 18:35:49 +08:00
Emmanuele Bassi
c73f45ca7c text: Use the keymap direction when focused
If the ClutterText actor has key focus then we should ask for the
direction of the key map, instead of the direction of the actor.

https://bugzilla.gnome.org/show_bug.cgi?id=705779
2014-03-03 23:42:33 +00:00
Emmanuele Bassi
3209129d6b x11: Add keymap direction query
We should use the Xkb API to query the direction of the key map,
depending on the group. To get a valid result we need to go over
the Unicode equivalents of the key symbols for each group, so we
should cache the result.

The code used to query and cache the key map direction is taken
from GDK.

https://bugzilla.gnome.org/show_bug.cgi?id=705779
2014-03-03 23:42:33 +00:00
Emmanuele Bassi
a000349978 backend: Add private accessor for the keymap direction
We need to ask the backend (wherever possible) for the direction of the
current keymap.

https://bugzilla.gnome.org/show_bug.cgi?id=705779
2014-03-03 23:42:33 +00:00
Emmanuele Bassi
6faf6dfe42 text: Use the resolved text direction
Now that we compute the effective text direction when creating the Pango
layout, we should also use it when painting it.

https://bugzilla.gnome.org/show_bug.cgi?id=705779
2014-03-03 23:42:33 +00:00
Emmanuele Bassi
50b6b59d02 text: Discover the direction of the contents
We should set the direction on the PangoContext when creating a
PangoLayout based on a best effort between the contents of the text
itself and the text direction of the widget, in case that fails.

https://bugzilla.gnome.org/show_bug.cgi?id=705779
2014-03-03 23:42:33 +00:00
Jasper St. Pierre
9b097eb4d8 device-manager-evdev: Make sure to reset released when reclaiming devices
Otherwise, Clutter will tell us that we forgot to call reclaim_devices
the next time we call release_devices... but we didn't!
2014-03-03 11:57:58 -05:00
Adel Gadllah
4a3ad9c3af DeviceManagerXi2: Cache the client pointer
Currently clutter_device_manager_xi2_get_core_device always
does a round trip to query the client.

So avoid that by caching the client pointer and only update it when the
xi devices change.

https://bugzilla.gnome.org/show_bug.cgi?id=725561
2014-03-03 15:06:11 +01:00
Jasper St. Pierre
fdd553d2a9 evdev: Kill compile warning 2014-02-28 09:50:36 -05:00
Rui Matos
64508e48b6 evdev: Add missing CLUTTER_AVAILABLE_IN_* annotations 2014-02-27 11:31:34 +01:00
Rui Matos
2c9a4fd220 evdev: Add missing 'Since' and 'Stability' doc tags 2014-02-27 11:31:34 +01:00
Rui Matos
458de1178d evdev: Set the initial core pointer coordinates to a sane value
ClutterInputDevice's default initial coordinates is (-1, -1) and since
they're updated from events in a relative way it means that the
pointer can go outside the stage right from the first event.

We usually let this up to higher layers to fix through the pointer
constraint callback but that doesn't work if the first event doesn't
put the pointer immediately inside the stage.

https://bugzilla.gnome.org/show_bug.cgi?id=725103
2014-02-27 11:31:33 +01:00
Rui Matos
d67b38f960 evdev: Make the keymap available
Make the keymap available so that consumers don't have to duplicate it
if they need it.

https://bugzilla.gnome.org/show_bug.cgi?id=725102
2014-02-27 11:31:33 +01:00
Rui Matos
2a7d5503d8 evdev: Don't update xkb state with pressed keys on keymap change
Doing so is unlikely to work reliably. Instead, switching the keymap
should be done at a time when no key is currently pressed down, but
let's leave that task to higher level code.

This allows us to remove key state tracking at yet another level in
the stack since higher level code likely already tracks this for other
purposes.

https://bugzilla.gnome.org/show_bug.cgi?id=725102
2014-02-27 10:59:16 +01:00
Rui Matos
945ee5764a evdev: Keep latched and locked modifier state when switching keymaps
https://bugzilla.gnome.org/show_bug.cgi?id=725102
2014-02-27 10:59:15 +01:00
Rui Matos
a6bd53ec42 evdev: Implement keyboard repeat
The kernel keyboard repeat functionality isn't configurable and
libinput rightfully ignores it.

This implements keyboard repeat in userspace allowing for consumers to
set the initial delay and repeat intervals.

https://bugzilla.gnome.org/show_bug.cgi?id=725102
2014-02-27 10:59:15 +01:00
Rui Matos
133f95fd0d evdev: Add a conditional define guard to expose API
The evdev backend has always been excluded from Clutter's API
stability guarantee though in an informal way. This commit makes it
explicit by forcing users to define CLUTTER_ENABLE_COMPOSITOR_API.

https://bugzilla.gnome.org/show_bug.cgi?id=725102
2014-02-27 10:59:15 +01:00
Jonas Ådahl
dacb515e27 evdev: Port evdev input backend to libinput
Instead of having its own evdev input device processing implementation,
make clutter's evdev backend use libinput to do input device processing
for it.

Two GObject parameters of ClutterInputDeviceEvdev (sysfs-path and
device-path) are removed as they are not used any more.

Before ClutterDeviceManagerEvdev had one virtual core keyboard and one
virtual core pointer device. These are now instead separated into seats,
which all have one virtual core keyboard and pointer device respectively.

The 'global' core keyboard and pointer device are the core keyboard and
pointer device of the first seat that is created.

A ClutterInputDeviceEvdev can, as before, both represent a real physical
device or a virtual device, but is now instead created either via
_clutter_input_device_evdev_new() for real devices, and
_clutter_input_device_new_virtual() for virtual devices.

XKB state and button state is moved to the seat structure and is thus
separated per seat. Seats are not a concept exposed outside of clutter's
evdev backend.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=720566
2014-02-27 09:57:29 +01:00
Carlos Garnacho
488639eb63 x11: Avoid invalid ClutterInputDevice pointers in the device list
Due to the way add_device() invariably adds to the master/slave device
lists, while keeping ClutterInputDevices 1:1 with device IDs, it may
leave invalid pointers in the list if add_device() is called multiple
times for the same device ID. There are two situations where this may
happen:

1) If devices are disabled and later enabled: devices are added invariably
   to the master/slave lists on constructed(), but then on XIDeviceEnabled
   they'd get added yet again.
2) Racy cases where the ClutterDeviceManager is created around the same time
   XIHierarchyEvents are sent. When getting the XIDeviceInfo on constructed(),
   these devices may already appear as enabled, even though XIDeviceEnabled
   is seen through XIHierarchyEvents processed in the event loop sortly after.

   This last case can be seen when starting gnome-shell on a different tty,
   and entering in the one it's been spawned on, clutter initialization
   happens around the same time devices are added back because of the tty
   switch, and multiple extra ClutterInputDevices are created.

https://bugzilla.gnome.org/show_bug.cgi?id=724971
2014-02-25 10:18:20 +01:00
Adel Gadllah
2639395533 stage-cogl: Fix buffer_age code path
Currently we where checking whether the damage_history list contains
more or equal then buffer_age entries. This is wrong because we prepend
our current clip to the list just before the check.

Fix that to check whether we have more entries instead of more or equal.

https://bugzilla.gnome.org/show_bug.cgi?id=724788
2014-02-20 12:00:20 +01:00
Emmanuele Bassi
8935ee4a78 Add missing exported symbols 2014-02-19 13:04:09 +00:00
Adel Gadllah
197d170364 stage_cogl: Don't scale the current_damage when adding to the damage_list
Otherwise we will union the scaled rectange with the clip_region which is
unscaled causing us to redraw a larger area.
2014-02-14 13:16:52 +01:00
Bastien Nocera
32b3d27bb9 GestureActions: Add per-action thresholds
Instead of relying on the dnd drag threshold, add per-action
horizontal and vertical thresholds. Use them in the swipe action
as well.

https://bugzilla.gnome.org/show_bug.cgi?id=724242
2014-02-13 18:53:24 +01:00
Bastien Nocera
54e2657cb0 GestureActions: Set threshold-trigger-edge at right time
It was set during the _init(), and swiftly overridden with the
default value in construct. Do it in constructed() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=724242
2014-02-13 18:53:24 +01:00
Emmanuele Bassi
f73b4d334a actor: Extend :scale-[xyz] factors in the negative range
The corresponding methods accept negative values already.

https://bugzilla.gnome.org/show_bug.cgi?id=706311
2014-02-10 18:35:12 +00:00
Emmanuele Bassi
dd08b6fd98 docs: Explicitly mention that Transition is abstract
https://bugzilla.gnome.org/show_bug.cgi?id=710232
2014-02-10 18:32:36 +00:00
Emmanuele Bassi
33ebe92fdb color: Fix documentation of 'hsla()' parsing
The documentation for the s and l components is incorrect; these have to
be percentage values and must have a '%' character right after the
number.

Based on a patch by: Pablo Pissanetzky <pablo@trickplay.com>

https://bugzilla.gnome.org/show_bug.cgi?id=662818
2014-02-10 17:54:06 +00:00
Emmanuele Bassi
d157602924 timeline: Fix bad logic in check
https://bugzilla.gnome.org/show_bug.cgi?id=711540
2014-02-10 17:43:16 +00:00
Emmanuele Bassi
dd034cccad x11: Fix bad logic in axis check
https://bugzilla.gnome.org/show_bug.cgi?id=711540
2014-02-10 17:43:16 +00:00
Emmanuele Bassi
0dc4986f66 text: Fix the implementation of delete_chars()
The internal delete_text() implementation takes a start and an end
position, whereas the public delete_chars() method takes a number of
characters to delete starting from the current cursor position.
2014-01-24 18:49:18 +00:00
Emmanuele Bassi
773e544c51 settings: Make unscaled-font-dpi override font-dpi
The :unscaled-font-dpi property is used to override the existing
:font-dpi value when running on high DPI density displays; since it's a
write-only property we don't need to have a separate storage, nor we
need to choose between :font-dpi and :unscaled-font-dpi depending on
whether or not either has been set. If we select which one to use
between :font-dpi and :unscaled-font-dpi when computing the font
resolution, we end up breaking the code that relies on changing
:font-dpi directly on a per-Settings basis.
2014-01-23 12:17:09 +00:00
Emmanuele Bassi
696a536b26 settings: Add CLUTTER_DPI_SCALE
Like we do for the windowing surfaces, we should have a run time knob
(in the form of an environment variable) to allow changing the scaling
factor of the font resolution.
2014-01-23 12:17:09 +00:00
Emmanuele Bassi
30d1e47c4e x11/stage: Store new size on unrealized resize()
If the StageX11 is asked to resize itself while not being realized, then
we just need to store the new size and return.
2014-01-23 12:17:09 +00:00
Emmanuele Bassi
857f53f42d canvas: Add scale-factor property
We need to provide an escape hatch to ClutterCanvas so that it's
possible to override the window-scaling-factor ClutterSetting. This is
going to be useful in the future in case the user has better knowledge
of the window scaling factor that is going to be used with a specific
set of ClutterCanvas contents (e.g. on different outputs or stages).

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2014-01-20 12:26:46 +00:00
Emmanuele Bassi
c1d6194d24 canvas: Use the window-scaling-factor setting
ClutterCanvas is a ClutterContent interface implementation; this means
that it can be created and modified regardless of whether it is
associated to a specific actor or a stage. For this reason, we cannot
walk the hierarchy and get the window scaling factor for high DPI
density displays out of the ClutterStage when we create the Cairo
surface that we will use to draw the canvas contents on.

We can use ClutterSettings:window-scaling-factor instead, since it's
what each ClutterStage will use anyway.

This will get slightly more complicated when we support per-output
window scaling factors (like on Wayland), but that will require changes
in the entire settings architecture anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2014-01-20 12:26:46 +00:00
Emmanuele Bassi
ed0633468f settings: Remove explicit stage scaling factor update
We can rely on the window-scaling-factor property notification instead.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2014-01-20 12:26:46 +00:00
Emmanuele Bassi
c1c59bd898 x11/stage: Resize on window-scaling-factor changes
If we get a change in the window scaling factor we want to resize the
backing store of each stage, so we use the notification on the
ClutterSettings:window-scaling-factor property to do so.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2014-01-20 12:26:46 +00:00
Emmanuele Bassi
2c8a19b8c1 x11/stage: Remove CLUTTER_SCALE handling
Use the ClutterSettings:window-scaling-factor property instead.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2014-01-20 12:26:46 +00:00
Emmanuele Bassi
afd87abb70 settings: Handle window scaling factor internally
We want the settings object to handle setting and getting the
window scaling factor value, both through backend-specific settings and
through the CLUTTER_SCALE environment variable. This means turning the
ClutterSettings:window-scaling-factor property into a readwrite one,
instead of write-only, so that ClutterStage implementations will be able
to query the window scaling factor on construction.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2014-01-20 12:26:46 +00:00
Emmanuele Bassi
69eb2e5f3b settings: Add window scaling related settings
We share two settings with GDK, so we can pick the window scaling factor
and the unscaled font resolution when we initialize Clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
2014-01-20 12:26:46 +00:00
Emmanuele Bassi
33316ce168 stage: Check coordinate validity in do_pick()
We do some argument validation inside _clutter_stage_do_pick(), which is
the internal version of clutter_stage_get_actor_at_pos(), but we don't
do coordinate space validation, and instead we rely on call sites doing
the right thing.

We should, instead, remove the argument validation from the internal
function, which is pointless and against the coding practices, but do
coordinate space validation internally.

https://bugzilla.gnome.org/show_bug.cgi?id=722322
2014-01-20 12:26:46 +00:00
Alejandro Piñeiro
cadbeceff0 clutter-text: emitting ClutterText::insert-text before actual changes on the text
https://bugzilla.gnome.org/show_bug.cgi?id=722220
2014-01-16 18:04:22 +01:00
Alejandro Piñeiro
bbc7d20f5e clutter-text: emitting ClutterText::delete-text before actual changes on the text
https://bugzilla.gnome.org/show_bug.cgi?id=722220
2014-01-16 17:39:48 +01:00