Commit Graph

6061 Commits

Author SHA1 Message Date
Jasper St. Pierre
a96daf82c2 egl: Add a way to set the KMS FD
This is needed for the logind integration work, where logind will
send us an already-opened FD to KMS.

https://bugzilla.gnome.org/show_bug.cgi?id=726198
2014-03-14 14:12:26 -04:00
Adel Gadllah
06387c3fd7 stage-cogl: Fix feature check in clutter_stage_cogl_redraw
We do not strictly require the 'swap-region' Cogl feature in order to use
clipped redraws: they work equally well with just the 'buffer-age' Cogl
feature.

https://bugzilla.gnome.org/show_bug.cgi?id=726313
2014-03-14 17:56:40 +01:00
Adel Gadllah
f649d732f9 clutter-stage-wayland: Enable clipped redraws
_clutter_stage_window_can_clip_redraws is used to check for clipped redraws
support but can_clip_redraws is not implemented by clutter-stage-wayland so
it always returns FALSE causing full screen redraws.

Fix that by implementing can_clip_redraws in clutter-stage-wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=726315
2014-03-14 17:56:13 +01:00
Adel Gadllah
e4497baaf0 eglnative: Add clutter-stage-window implementation
Add a ClutterStageEglNative implemennation that implements
can_clip_redraws so that clipped redraws can work
on eglnative.

https://bugzilla.gnome.org/show_bug.cgi?id=726341
2014-03-14 17:55:19 +01:00
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
Alejandro Piñeiro
c681e901e4 a11y: compute properly if there is text selected
https://bugzilla.gnome.org/show_bug.cgi?id=722188
2014-01-14 18:43:48 +01:00
Emmanuele Bassi
ad39d3d1ae Make abicheck.sh output TAP
So that we can run it under the TAP harness like the rest of the
conformance test suite.
2013-12-12 18:51:11 +00:00
Emmanuele Bassi
b1eb412c23 tests: Use an internal setter for disabling vblank sync
Instead of using g_setenv().
2013-12-12 18:51:11 +00:00
Emmanuele Bassi
2a660fa298 Fully rework the conformance test suite
The current conformance test suite is suboptimal in many ways.

All tests are built into the same binary, which makes adding new tests,
builting tests, and running groups of tests much more awkward than it
needs to be. The first issue, especially, raises the bar of contribution
in a significant way, while the other two take their toll on the
maintainer. All of these changes were introduced back when we had both
Clutter and Cogl tests in tree, and because we were building the test
suite for every single change; since then, Cogl moved out of tree with
all its tests, and we build the conformance test suite only when running
the `check` make target.

This admittedly large-ish commit changes the way the conformance test
suite works, taking advantage of the changes in the GTest API and test
harness.

First of all, all tests are now built separately, using their own test
suite as defined by each separate file. All tests run under the TAP
harness provided by GTest and Automake, to gather a proper report using
the Test Anything Protocol without using the `gtester` harness and the
`gtester-report` script. We also use the Makefile rules provided by GLib
to vastly simplify the build environment for the conformance test suite.

On top of the changes for the build and harness, we also provide new API
for creating and running test suites for Clutter. The API is public,
because the test suite has to use it, but it's minimal and mostly
provides convenience wrappers around GTest that make writing test units
for Clutter easier.

This commit disables all tests in the conformance test suite, as well as
moving the data files outside of the tests/data directory; the next few
commits will re-establish the conformance test suite separately so we
can check that everything works in a reliable way.
2013-12-12 18:51:11 +00:00
Emmanuele Bassi
ed2fdf85f6 gesture: Make threshold-trigger-edge public
When the threshold-trigger-edge property was introduced in
GestureAction, it was late in the cycle and I elected to keep it
private, given the fact that nobody was subclassing GestureAction
outside of Clutter itself.

These days, people are experimenting more with the GestureAction API, so
they will need access to the various knobs that control the class
default behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 15:20:39 +00:00
Lionel Landwerlin
b0227644ff gesture-action: set default edge value to NONE to restore initial behavior
https://bugzilla.gnome.org/show_bug.cgi?id=710229

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 15:20:39 +00:00
Emmanuele Bassi
8cb326dc54 Explicitly set the trigger edge in GestureAction subclasses
Each GestureAction subclass has its own trigger edge handling, so we
want to be resilient in case of changes in the super-class.

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 15:20:39 +00:00
Emmanuele Bassi
154ca6ef99 gesture: Clean up trigger edge accessors
Use G_GNUC_INTERNAL instead of the leading underscore, as we may make
the accessor functions public at some point. Also, clean up the
documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 15:20:39 +00:00
Lionel Landwerlin
97724939c8 gesture-action: fix memory corruption
abcf1d589f introduced a crasher because
the 'point' variable points to a piece of memory that is being
reallocated by the begin_gesture (by a g_array_set_size) call 5 lines
before.

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 14:42:21 +00:00
Owen W. Taylor
cbb9d1e062 ClutterStageCogl: Ignore a clip the size of the stage
If the clip region includes the entire stage, ignore it - we aren't
actually clipped.

https://bugzilla.gnome.org/show_bug.cgi?id=719901
2013-12-05 08:38:16 -05:00
Owen W. Taylor
97dcb108d0 ClutterStageCogl: Clip in the right coordinate system
Our clip coordinates are relative to the stage, not model-view
transformed. cogl_framebuffer_push_rectangle_clip() was accidentally
used instead of cogl_framebuffer_push_scissor_clip() when porting
to the framebuffer clip API.

https://bugzilla.gnome.org/show_bug.cgi?id=719900
2013-12-05 08:38:16 -05:00
Owen W. Taylor
a2551dfa60 ClutterStage: Don't add empty actors to the stage clip
Currently, if an actor with an empty paint volume is queued for redraw, it
will union in the box +0+0x1x1 to the stage clip bounds - avoid that
by special casing empty paint volumes.

https://bugzilla.gnome.org/show_bug.cgi?id=719747
2013-12-04 21:53:52 -05:00
Emmanuele Bassi
3fdee4efe9 docs: Fix syntax errors in annotations 2013-12-04 16:09:09 +00:00
Emmanuele Bassi
a64742f3e4 paint-node: Get the framebuffer from the root node
The PaintNode hierarchy should have the ability to retrieve the
current active framebuffer by itself, instead of asking Cogl using the
global state API.

In order to do this, we ask the root node of a PaintNode graph for the
active framebuffer. In the current, 1.x-compatibility mode we have two
potential root node types: ClutterRootNode, used by ClutterStage; and
ClutterDummyNode, used a local root for each actor. The former takes a
framebuffer as part of its construction; the latter takes the actor that
acts as the local top-level during the actor's paint sequence, which
means we can get the active framebuffer from the stage associated to the
actor.

By keeping track of the active framebuffer on the node themselves we can
drop the usage of cogl_get_draw_framebuffer() in their implementation.
2013-12-04 16:07:17 +00:00
Emmanuele Bassi
e619de20d8 text: Add a hacky fallback for the framebuffer
The text-cache conformance test breaks because ClutterText gets a paint
without an active framebuffer associated to the ClutterStage. Keep a
fallback while we investigate the issue.
2013-12-04 16:07:17 +00:00
Emmanuele Bassi
705640367a Use the non-deprecated Cogl clipping API
Cogl 1.18 deprecated the global clipping API in favour of the
per-framebuffer one, but since we're using the 2.0 API internally we
don't have access to the deprecated symbols any more.

This is pretty much a mechanical port for all the places where we're
still using the old 1.x API.
2013-12-04 16:07:17 +00:00
Emmanuele Bassi
1b45841414 actor: Add private getter for the active framebuffer
Instead of asking every internal user to get the stage and get the
active framebuffer from it, we can wrap it up ourselves, and do some
sanity checks as well.
2013-12-04 16:07:17 +00:00
Florian Müllner
992f2ca7b5 input-device: Guard against double free
Dispose() may be called more than once, so calling g_free directly
on the device name is unsafe. Instead, use g_clear_pointer() to
make sure we don't attempt to free the memory again.

https://bugzilla.gnome.org/show_bug.cgi?id=719563
2013-11-29 15:56:48 +00:00
Owen W. Taylor
2e85269368 Don't queue redraws when reallocating actor that haven't moved
When support for implicit animation of actor position was added,
the optimization for not queueing when allocating an actor back
to the same location was lost. This optimization is important
since when we are hierarchically allocating down from the top of
the stage we constantly reallocate the actors at the top of the
hierarchy back to the same place.

https://bugzilla.gnome.org/show_bug.cgi?id=719368
2013-11-26 12:30:00 -05:00
Owen W. Taylor
0b536c02f9 Bind constraints: Don't force redraws on source relayout
When the source actor potentially changes size, that shouldn't
necessarily result in the target actor being redrawn - it should
be like when a child of a container is reallocated due to changes
in its siblings or parent - it should redraw only to the extent
that it is moved and resized. Privately export an internal function
from clutter-actor.c to allow getting this right.

https://bugzilla.gnome.org/show_bug.cgi?id=719367
2013-11-26 11:12:12 -05:00
Rui Matos
3cd9a70fea device-manager-evdev: Stop using deprecated libevdev API
Fixes compiler warnings with libevdev >= 0.4 and makes use of a new
function to set the clock id instead of doing the ioctl directly.

https://bugzilla.gnome.org/show_bug.cgi?id=712816
2013-11-21 19:34:15 +01:00
Rui Matos
05e6bcc666 device-manager-evdev: Fix a segfault on device removal
Master devices have a NULL sysfs path so use g_strcmp0 to handle them
without crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=712812
2013-11-21 19:34:14 +01:00
Rui Matos
7d8f72a60e device-manager-evdev: Unref devices on removal
https://bugzilla.gnome.org/show_bug.cgi?id=712812
2013-11-21 19:34:14 +01:00
Rui Matos
ce1f8f1dd0 device-manager-xi2: Fix device instances leaking on removal
Don't add an extra reference when adding to the devices hash table. We
already own the initial reference.

https://bugzilla.gnome.org/show_bug.cgi?id=712812
2013-11-21 19:34:14 +01:00
Rui Matos
18b9384e66 input-device: Fix a GArray leak
https://bugzilla.gnome.org/show_bug.cgi?id=712812
2013-11-21 19:34:14 +01:00
Rui Matos
507d8b1cef input-device: Use g_clear_pointer
https://bugzilla.gnome.org/show_bug.cgi?id=712812
2013-11-21 19:34:14 +01:00
Rui Matos
1d11cc324e device-manager: Don't emit device-removed with a finalized instance
https://bugzilla.gnome.org/show_bug.cgi?id=712812
2013-11-21 19:34:14 +01:00
Jasper St. Pierre
a427c120c2 stage: Remove the pick buffer caching
Since the journal is flushed on context switches, trying to use a cached
buffer means that we will use glReadPixels when picking, which isn't what
we want. Instead, always use a clipped draw, and remove the logic for
caching the pick buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=712563
2013-11-19 11:21:14 -05:00
Jasper St. Pierre
9082ccc30b stage: Fix indentation in pick methods
https://bugzilla.gnome.org/show_bug.cgi?id=712563
2013-11-19 11:21:14 -05:00
Emmanuele Bassi
7af55d23e4 Deprecate ClutterTableLayout
The table layout manager has various issues:

  • no support for RTL flipping
  • most of the layout API is legacy, and has been replaced by the
    alignment and expansion flags on ClutterActor
  • the animation API is legacy, and has been replaced by the
    implicitly animatable allocation
  • the spanning cells handling is a bit awkward, as is its API

On top of that, we imported the grid layout management policy from GTK+
into ClutterGridLayout, which provides all the required features in a
more well-designed API.

Instead of wasting time and resources updating TableLayout, we should
deprecate it and point developers of the GridLayout.
2013-11-19 00:31:53 +00:00
Emmanuele Bassi
56b579248e Update symbols file 2013-11-19 00:31:53 +00:00
Neil Roberts
70292672c4 Add API to install an event filter
This adds clutter_event_add/remove_filter which adds a callback
function which will receive all Clutter events just before the event
signal is emitted for them. The event filter will be invoked
regardless of any grabs or captures. This will be used by Mutter which
wants to access the events at a lower level then the event bubbling
mechanism. It needs to see all mouse motion events even if there is a
grab in place.

https://bugzilla.gnome.org/show_bug.cgi?id=707560
2013-11-14 14:32:17 -05:00
Jasper St. Pierre
c2b0b9aace input-device-xi2: Calculate the correct state for button events
The state that the X server sends for button events, by specification,
contains the button state before the event. We need to synthesize in
the result of the event in order to determine what the current button
state is.

https://bugzilla.gnome.org/show_bug.cgi?id=712322
2013-11-14 14:30:30 -05:00
Jasper St. Pierre
0fda81feab Remove use of XFixes for showing/hiding the cursor
XFixesShowCursor / XFixesHideCursor does not actually take the suppled
window argument into account -- the effect is actually global. Use
XDefineCursor instead.

https://bugzilla.gnome.org/show_bug.cgi?id=707071
2013-11-14 18:34:40 +00:00
Jasper St. Pierre
98e03fc03f device-manager-xi2: Clamp coordinates of events to the stage coordinates
The X server can sometimes send us coordinates in the negatives or above
our window in extreme cases. Ensure that the user never sees this.
2013-11-14 18:34:40 +00:00
Jasper St. Pierre
1de024b5fa device-manager-xi2: Don't divide by the scale factor twice
The coordinates we pass into translate_axes are already scaled.
2013-11-14 18:34:40 +00:00
Bastian Winkler
354c3c7977 interval: Call g_object_set_property in set_custom_property()
Otherwise it would prevent potential subclasses of ClutterInterval from
having own scriptable properties.
2013-11-14 18:34:40 +00:00
Bastian Winkler
e56785501b interval: Implement ClutterScriptable interface
This allows the creation of ClutterTransition objects in ClutterScript:
 {
   "id" : "scripted-transition",
   "type" : "ClutterPropertyTransition",
   "property-name" : "background-color",
   "interval" : {
     "type" : "ClutterInterval",
     "value-type" : "ClutterColor",
     "initial" : "red",
     "final" : "blue"
   }
 }
2013-11-14 18:34:40 +00:00
Jasper St. Pierre
46c22de01e stage: Destroy all children when we dispose
Destroying an actor is supposed to destroy all of its children, so
it makes sense to reason that destroying the stage should destroy all
of its children, too.

Unfortunately, it seems that the stage removed all of its children
without destroying them before chaining up to what would destroy all
of its children, for whatever reason. Change this to a destroy so
resources get cleaned up.
2013-11-14 18:34:40 +00:00
Lionel Landwerlin
f70eee0748 drag-action: don't mix touch and pointer events
https://bugzilla.gnome.org/show_bug.cgi?id=709762
2013-11-14 18:34:40 +00:00
Jonas Ådahl
7c2b88f73b wayland: Implement support for 'cursor-visible' stage property
This will allow clutter Wayland clients to either not draw any pointer
cursor or draw its own.

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

https://bugzilla.gnome.org/show_bug.cgi?id=709590
2013-11-14 18:34:40 +00:00
Emmanuele Bassi
bceca34ef9 paint-nodes: Clarify color handling for TextureNode
The TextureNode premultiplies the blend color passed to the node
constructor, so we need to document the fact properly to avoid
causing premultiplication twice.

We can also allow passing NULL for a color, and use a fully opaque
white, to make the code slightly more friendly.
2013-10-10 13:50:10 +01:00
Emmanuele Bassi
0c39138200 Add 1.18 version macros
We're still going to do a 1.x release cycle.
2013-10-10 13:50:10 +01:00
Emmanuele Bassi
32ccff8525 image: Do not premultiply the blend color
ClutterTextureNode will do that for us when converting the ClutterColor
to a CoglColor, so we can simply pass a white color with the correct
alpha channel.
2013-10-10 13:40:42 +01:00
Lionel Landwerlin
c87b794739 stage: implement touch event throttling
https://bugzilla.gnome.org/show_bug.cgi?id=709761
2013-10-09 21:56:50 +01:00
Bastien Nocera
676a7cdc94 ClutterEvent: Mention _get_source_device() in docs
It's too easy getting bitten by the ->device red herring, thinking
that it's the original input device the event originated from.

https://bugzilla.gnome.org/show_bug.cgi?id=709620
2013-10-08 14:56:31 +02:00