Commit Graph

6319 Commits

Author SHA1 Message Date
Emmanuele Bassi
6bed552cfe docs: Improve deprecation notices for ClutterTableLayout 2015-03-05 13:04:09 +00:00
Emmanuele Bassi
51b46bc093 docs: Improve deprecation notices for ClutterBox 2015-03-05 12:57:26 +00:00
Emmanuele Bassi
423a126c95 docs: Improve deprecation notices for ClutterRectangle 2015-03-05 12:57:08 +00:00
Emmanuele Bassi
ec26ae2b5a docs: Update deprecation notes for ClutterTexture
Point to ClutterImage, ClutterContent, and ClutterActor where needed, so
that developers trying to port their code will have a chance at figuring
out how.
2015-03-04 16:08:18 +00:00
Emmanuele Bassi
253292802c Drop the UProf dependency
Nobody has been compiling Clutter with profiling enabled in a long time.

UProf itself hasn't been updated in 5 years, and it still depends on
deprecated components like dbus-glib, with no port to GDBus in sight.

The profiling code was moderately useful in the past, but these days
it's probably better to profile Cogl than Clutter itself; timing
information can be extracted by the timestamp on each diagnostic message
that is now available by default in the CLUTTER_NOTE macro, and we can
add ad hoc counters where needed.
2015-03-03 17:44:15 +00:00
Emmanuele Bassi
df15f04fc0 build: Use libtool macros to find libm
Instead of using `-lm` everywhere, use LT_LIB_M inside configure.ac, and
$(LIBM) inside Makefile.am.
2015-03-03 17:23:37 +00:00
Emmanuele Bassi
faf90f5ddd docs: Fix a gtk-doc annotation in the Mir backend 2015-03-03 16:14:15 +00:00
Emmanuele Bassi
6b70343d09 docs: Minimal fixes for the API reference 2015-03-03 15:53:04 +00:00
Emmanuele Bassi
3b98103b72 gdk/stage: Warn if CoglContext is not available
Instead of crashing inside Cogl later on.

https://bugzilla.gnome.org/show_bug.cgi?id=745229
2015-03-02 16:08:18 +00:00
Owen W. Taylor
c32dc34080 Allow setting up quad-buffer stereo output
Add clutter_x11_set_use_stereo_stage() that can be called
before clutter_init() so that the CoglDisplay we create and all
stages created from that CoglDisplay will be created with a
stereo fbconfig.

This is done in clutter-x11 because of the similarity to the
existing clutter_x11_set_use_argb_visual(), and because it's
not clear without other examples whether the need to have
stereo enabled from before clutter_init() is universal or
somethign specific to GLX.

Cogl required version is increased to 1.20, which has the
required API.

https://bugzilla.gnome.org/show_bug.cgi?id=732706
2015-02-23 16:39:21 -05:00
Marco Trevisan (Treviño)
77db999339 clutter: add Mir windowing/input backend
Added support for Mir, now clutter can natively draw on MirSurfaces.
This depends on latest cogl git.

Run your clutter apps using CLUTTER_BACKEND=mir

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2015-02-21 00:46:17 +00:00
Giovanni Campagna
10cce00440 ClutterActor: expose setter for the opacity override
Toolkits may need to paint actors internally outside the normal tree
(for example to create a shadow shape), in which case they need to
control the opacity directly.

https://bugzilla.gnome.org/show_bug.cgi?id=677412

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2015-02-21 00:26:40 +00:00
Lionel Landwerlin
a4d0b157b6 gdk: master-clock: force scheduling new frames for timelines alive
As long as we have timelines alive, we need to keep asking the
GdkFrameClock for new frames. Otherwise animations might stall.

https://bugzilla.gnome.org/show_bug.cgi?id=744684
2015-02-18 11:37:53 +00:00
Lionel Landwerlin
018cd7bb5c gdk: implement a MasterClock based on GdkFrameClock
https://bugzilla.gnome.org/show_bug.cgi?id=744668
2015-02-17 19:12:40 +00:00
Lionel Landwerlin
e94285693f main: Make the MasterClock an interface
Move the implementation of the MasterClock into MasterClockDefault, so
backends can provide their own implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=744668
2015-02-17 18:55:23 +00:00
Lionel Landwerlin
a9f2300af1 stage: Process state update event immediately
The _clutter_stage_update_state() function is currently putting events
into the Clutter event queue. This leads to problems in the gdk
backend because there are assumptions upon the numbers of queued
events, and how many of them should be moved from the main event queue
to the ClutterStages' event queues.

This change triggers the processing of the state update events on the
stage directly, so the main event queue retains the expected number of
events.

https://bugzilla.gnome.org/show_bug.cgi?id=744604
2015-02-16 17:15:04 +00:00
Jasper St. Pierre
6c057e3171 input-device: Reset the focused actor when it becomes unreactive
https://bugzilla.gnome.org/show_bug.cgi?id=743865
2015-02-06 09:42:17 -08:00
Rui Matos
b192ad1300 gdk: Disable cogl wayland event dispatching if requested
If gdk event retrieval has been disabled and gdk's backend is wayland
we must also disable cogl's wayland event dispatching otherwise cogl
will try to dispatch wayland events itself which blocks the main
loop.

https://bugzilla.gnome.org/show_bug.cgi?id=744058
2015-02-05 18:31:44 +01:00
Jonas Ådahl
e9e9578dca evdev: Ignore non seat wide pointer button events
Pointer button events will be received from a device where a button has
been pressed, even though an equivalent button has been pressed (same
button code) on a device connected to the same seat. notify_button()
expects to only be called as if there was only one pointer device
associated with the given seat, so to achieve this, ignore every event
where forwarding it would result in multiple 'pressed' or 'released'
notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=743615
2015-02-04 17:46:44 +08:00
Jonas Ådahl
32ce45aa89 evdev: Ignore non seat wide keyboard key events
Keyboard key events will be received from a device where a key has
been pressed, even though an equivalent key has been pressed (same
key code) on a device connected to the same seat. notify_key()
expects to only be called as if there was only one keyboard device
associated with the given seat, so to achieve this, ignore every event
where forwarding it would result in multiple 'pressed' or 'released'
notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=743615
2015-02-04 17:46:44 +08:00
Lionel Landwerlin
c185d2187b gdk: report an error when initialization fails
https://bugzilla.gnome.org/show_bug.cgi?id=743355
2015-01-22 17:35:14 +00:00
Emmanuele Bassi
8a24892f2d Depend on a Cairo release with cairo_surface_set_device_scale()
We are checking for Cairo ≥ 1.12 and then do an additional check for the
existence of the cairo_surface_set_device_scale() function because there
were no stable releases of Cairo with it. Now that Cairo 1.14 is out, we
can simply bump up the dependency.
2015-01-22 14:13:11 +00:00
Peter Hutterer
ede13b11d7 evdev: use libinput's new merged scroll events
libinput's API changed from separate scroll events for vert/horiz scrolling to
a single event that contains both axes if they changed.

Updated by Armin K. to use the discrete axis value for wheel events as done
in Weston.

https://bugzilla.gnome.org/show_bug.cgi?id=742829
2015-01-16 14:45:47 +00:00
Emmanuele Bassi
7eb1a3d35f Deprecate unused enumeration types
Some enumerations types are only used by deprecated API, so it's better
to deprecate them as well.
2015-01-13 00:46:47 +00:00
Emmanuele Bassi
8859ed44e1 gdk: Support GdkWayland
We need to set up the Wayland display when using GDK and Wayland's
client-side API.
2015-01-12 17:48:04 +00:00
Emmanuele Bassi
00efa5371d gdk: Compare integer values
Stage sizes are always pixel aligned, so we can do a proper
integer comparison.
2015-01-12 15:05:02 +00:00
Emmanuele Bassi
2aac32694c gdk: Implement get_scale_factor()
Otherwise scaling will not work correctly.
2015-01-12 15:04:27 +00:00
Emmanuele Bassi
87c553e94f docs: Deprecate ClutterTextureFlags
It's pointless, now that ClutterTexture has been deprecated.
2015-01-12 13:42:59 +00:00
Emmanuele Bassi
e77adac16a docs: Remove a couple of FIXMEs
Document the ClutterKeyframeTransition instance and class structures.
2015-01-12 13:42:33 +00:00
Emmanuele Bassi
60dbeb9425 Try again at using the GDK backend by default
We tried once with commit 398a7ac7 and ended up reverting because of
regressions in the input layer and on Wayland.

We should try again, now that those regressions have been fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=734587
2015-01-11 16:48:47 +00:00
Carlos Garnacho
f5f523c63a evdev: Set vendor/product IDs on input devices
This is fetched right away from libinput API.

https://bugzilla.gnome.org/show_bug.cgi?id=740759
2015-01-09 17:01:22 +01:00
Carlos Garnacho
c0d5d58e8b x11: Set vendor/product IDs on input devices
This is fetched from XInput device properties

https://bugzilla.gnome.org/show_bug.cgi?id=740759
2015-01-09 17:01:22 +01:00
Carlos Garnacho
78fdefcf0c input-device: Add vendor/product ID properties and getters
This may be useful when trying to identify the device across sessions.

https://bugzilla.gnome.org/show_bug.cgi?id=740759
2015-01-09 17:01:22 +01:00
Jonas Danielsson
9660b001f7 device-manager-xi2: Fix scaling of coordinates
Do not CLAMP to width/height before applying the scale factor
we will lose all information we need to scale properly.

https://bugzilla.gnome.org/show_bug.cgi?id=730815
2015-01-09 06:38:24 -05:00
Emmanuele Bassi
c04c631e8c keysyms: Update the list of key symbols 2015-01-03 20:05:22 +00:00
Emmanuele Bassi
506f2c4431 Remove unused pointer
The PangoContext has been moved into ClutterActor.
2015-01-01 15:16:40 +00:00
Emmanuele Bassi
1b9650da38 Remove global "actor id"
It's absolutely, positively pointless. Every surviving call has long
since been deprecated, and should have not been public in the first
place.
2015-01-01 15:10:54 +00:00
Emmanuele Bassi
abda3ee4ce Improve debugging notes for main loop start/stop
This way, we can track when we quit the main loop.
2015-01-01 15:09:23 +00:00
Emmanuele Bassi
5b9c6f49c4 Improve the warning message in clutter_main_quit()
If you call clutter_main_quit() without calling clutter_main()

[ South Park ski instructor]

You're going to have a bad time.
2015-01-01 15:07:19 +00:00
Emmanuele Bassi
eb51f6cf10 actor: Do not restore the easing state in finalize()
The easing state is part of the AnimationInfo structure, which is stored
inside the GObject's datalist. Each instance frees the data stored there
during finalization, so there is no point for us to restore an easing
state (which may or may not be the last one) just to have everything
cleared out once we chain up to GObject's own finalize() implementation.
2015-01-01 12:48:39 +00:00
Emmanuele Bassi
d930bdf3fc stage: Use the symbolic constant for event handled
Clarifies the intent for everybody.
2015-01-01 12:45:11 +00:00
Emmanuele Bassi
2034e75658 Use the proper debug category
Backend-related notes should use the `BACKEND` category, not `MISC`.
2015-01-01 12:44:19 +00:00
Emmanuele Bassi
c67dcd59c1 Add proper annotations for the test utilities
This avoids g-ir-scanner complaining.
2014-12-16 13:59:41 +00:00
Emmanuele Bassi
f589b6f63a Revert "bind-constraint: Update the preferred size"
This reverts commit fcc67e99bc.

It seems this causes some recursion overflow in GNOME Shell's usage of
constraints, and needs more investigation.
2014-12-16 13:33:16 +00:00
Emmanuele Bassi
8df2efca6b constraint: Fix update_allocation()'s return value
The update_allocation() method returns TRUE if the allocation was
changed.
2014-12-16 00:46:16 +00:00
Emmanuele Bassi
1fe391606d docs: Add ClutterConstraintClass.update_preferred_size() 2014-12-16 00:38:27 +00:00
Emmanuele Bassi
fcc67e99bc bind-constraint: Update the preferred size
Bind the preferred size of an actor using a BindConstraint to the
preferred size of the source of the constraint, depending on the
coordinate of the constraint.
2014-12-16 00:37:07 +00:00
Emmanuele Bassi
66d48bcca0 actor: Update preferred size using constraints
If an actor has any constraint that may affect its preferred size, then
it should query them when computing its preferred size.
2014-12-16 00:37:07 +00:00
Emmanuele Bassi
391f1d8dd4 constraint: Add the ability to update the preferred size
Constraints can only update an existing allocation, which means they
live only halfway through the layout management system used by Clutter;
this limitation makes it impossible, for instance, to query the
preferred size of an actor, if the actor is only using constraints to
manage its own size.
2014-12-16 00:37:06 +00:00
Emmanuele Bassi
82fffaedb6 constraint: Add a private header
And move the only private ClutterConstraint method to it.

This commit also sneaks in a change that makes sense for the debugging
of the update_allocation() method, which checks if the allocation was
effectively changed.
2014-12-16 00:37:06 +00:00
Emmanuele Bassi
2f490c9dcc build: More out of tree build fixes 2014-12-16 00:15:58 +00:00
Emmanuele Bassi
c337100c14 Use new introspection annotation syntax
Instead of the deprecated one.
2014-12-15 23:45:25 +00:00
Emmanuele Bassi
4f03b32eea actor: Queue a relayout if we use the content's preferred size
In case the ClutterContent changes, and the actor uses the content's
preferred size to drive its own.
2014-12-15 23:39:05 +00:00
Emmanuele Bassi
e2eb0b0ada build: Use subdir-objects 2014-12-15 23:13:30 +00:00
Sjoerd Simons
1be019852f device-manager-xi2: Fix core pointer retrieval race
The core pointer concept doesn't really exist anymore in an XI2 world,
so the clutter API is a bit of a mismatch with what X provides. Using
XIGetClientPointer doesn't really help, as far as i can tell the
semantics of XIGetClientPointer are essentially: Whatever the X server
picked when it had to reply with device-dependant data to a query
without a device specifier. Not very useful...

To make matters worse, whether XIGetClientPointer returns a valid
pointer depends on whether there has been a query that forced it to pick
one in the first place, making the whole thing pretty non-deterministic.

This patch changes things around such that instead of using
XIGetClientPointer to determine the core pointer, we simply pick the
first master pointer device. In practise this will essentially always
be the X virtual core pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=729462
2014-12-15 17:29:52 +00:00
Jonas Ådahl
5281425a53 DeviceManagerXi2: Update cached core pointer in getter if NULL
XIGetClientPointer() may return the device id '0' when called early.
This patch makes pointer cursors work in nested mutter Wayland
sessions again.

https://bugzilla.gnome.org/show_bug.cgi?id=729462
2014-12-15 17:24:59 +00:00
Emmanuele Bassi
b7c4120399 osx: Clean up installed clutter-osx.h header
The installed header should not have private API declarations and
macros. Let's move those into the uninstalled clutter-backend-osx.h
header file instead.
2014-12-15 16:51:05 +00:00
cee1
9efda7eac7 clutter/osx: add clutter_osx_disable_event_retrieval
https://bugzilla.gnome.org/show_bug.cgi?id=719962
2014-12-15 16:47:24 +00:00
Emmanuele Bassi
d005c6a880 script: Do not overwrite ObjectInfo fields
When merging multiple definitions it's possible that the ObjectInfo
fields may get overwritten. Instead of trampling over the fields, we
should reset them only when they actually change — especially the
"is_actor" one, which controls the destruction of the objects when
unmerging happens.

https://bugzilla.gnome.org/show_bug.cgi?id=669743
2014-12-14 23:05:17 +00:00
Emmanuele Bassi
f851d5b985 docs: Add missing deprecation annotations
https://bugzilla.gnome.org/show_bug.cgi?id=709252
2014-12-14 20:27:46 +00:00
Emmanuele Bassi
d546c0c121 actor: Reset the content box when setting a new content
We want to recompute the content box when changing the content instance,
in case the preferred size is different and the content gravity uses the
preferred size; the change of content with different preferred size and
same gravity should also trigger an implicit transition.

https://bugzilla.gnome.org/show_bug.cgi?id=711182
2014-12-13 14:29:30 +00:00
Emmanuele Bassi
1e2132eca4 actor: Bail when setting the same content
No need to do all the work, if the content instance is the same.
2014-12-13 14:28:46 +00:00
Emmanuele Bassi
300aa465c7 actor: Add CLUTTER_REQUEST_CONTENT_SIZE mode
Some actors want to have a preferred size driven by their content, not
by their children or by their fixed size.

In order to achieve that, we can extend the ClutterRequestMode
enumeration so that clutter_actor_get_preferred_size() defers to the
ClutterContent's own preferred size.

https://bugzilla.gnome.org/show_bug.cgi?id=676326
2014-12-13 13:37:05 +00:00
Samuel Degrande
e7d1458298 Easing modes are not used when computing the value of a KeyframeTransition
An easing mode can be set on a frame of a KeyframeTransition.
However, the progress value of the current frame is computed using using
a linear function.
This patch adds a call to clutter_easing_for_mode() to compute
the actual progress value.
Note that parametrized easing modes (bezier and 'step') are not taken
into account.

https://bugzilla.gnome.org/show_bug.cgi?id=740997
2014-12-11 22:37:22 +00:00
Emmanuele Bassi
d2a2e5ba9c Add 1.22 version macros
The 1.22 cycle did start a while ago.
2014-12-11 22:35:13 +00:00
Carlos Garnacho
a0e2ba62a1 x11: Resort to device name matching for non-mt touchpads
If a touchpad is not multitouch, or does not report MT axes (eg. through
the libinput driver), resort to name matching before falling back to
CLUTTER_POINTER_DEVICE.

https://bugzilla.gnome.org/show_bug.cgi?id=741350
2014-12-11 11:48:06 +01:00
Carlos Garnacho
1cabee8d24 evdev: Lookup config to report touchpads as such
Check a touchpad-only setting, and if it returns an expected value there,
the device must be a CLUTTER_DEVICE_TOUCHPAD.

https://bugzilla.gnome.org/show_bug.cgi?id=741350
2014-12-11 11:48:06 +01:00
Carlos Garnacho
a18b2f067b evdev: Prefer pointer/touch devices over keyboard devices
In keyboard/mouse wireless combos, it is rather common for the mouse to
claim it contains the multimedia keys, this makes libinput enable both
the pointer and keyboard capabilities on this device, and Clutter thus
to create a keyboard ClutterInputDevice for it.

Ideally clutter devices should be able to reflect their full capabilities,
or maybe account for the fact that certain events can be sent from
seemingly unexpected device types. But this will bring a somewhat better
behavior on such devices.

https://bugzilla.gnome.org/show_bug.cgi?id=740518
2014-12-11 11:35:56 +01:00
Emmanuele Bassi
8afb499ce5 image: Do not put large textures in the atlas
Atlasing is fine for smaller textures, but once they get too large its
downsides outweight the benefits. At worst, the larger texture will end
up inside its own atlas, but at worst it will require copying and/or
resizing of an existing atlas.

The cut-off at 512x512 pixels is a bit arbitrary, and we can change it
at any point; it would be nice if we could get the texture limit from
Cogl, and then use a fraction of that size as the cut-off limit. Sadly,
that's not portable, and it's not guaranteed to work either.
2014-12-03 12:12:43 +00:00
Emmanuele Bassi
54efcf0e90 gdk: Use non-deprecated GdkCursor API
The non-display safe variant has been deprecated in GTK+ 3.15.
2014-12-03 12:11:55 +00:00
Emmanuele Bassi
7d7eb8aabd gdk: Disable deprecation warnings
We don't want to break the build because GDK deprecated some symbol.
2014-12-03 12:07:06 +00:00
Emmanuele Bassi
3879bacc78 Avoid a compiler warning
Initialize a pointer variable.
2014-12-03 12:05:37 +00:00
Emmanuele Bassi
47df16ec3b Revert "actor: Plug a leak in the implicit transition removal"
This reverts commit 158af1ff59.

This commit introduced a regression, so the leak will have to be fixed
in another way.
2014-11-26 12:46:51 +00:00
Jasper St. Pierre
46877cc2bd actor: Create a PangoContext per actor
For a variety of complicated reasons, ClutterText currently sets fields
on the PangoContext when creating a layout. This causes ClutterText to
behave somewhat erratically in certain cases, since the PangoContext is
currently shared between all actors.

GTK+ creates a PangoContext for every single GtkWidget, so it seems like
we should do the same here.

Move the private code that was previously in clutter-main.c into
clutter-actor.c and clean it up a bit. This gives every actor its own
PangoContext it can mutilate whenever it wants, at its heart's content.

https://bugzilla.gnome.org/show_bug.cgi?id=739050
2014-10-23 12:30:54 -07:00
Jasper St. Pierre
14d28e7908 main: Don't update the PangoContext in clutter_set_font_flags
clutter_set_font_flags already calls clutter_backend_set_font_options,
which emits a signal which our PangoContext listens to, so this is just
duplicate and unneeded code.

https://bugzilla.gnome.org/show_bug.cgi?id=739050
2014-10-23 12:30:53 -07:00
Carlos Garnacho
7764fd2079 evdev: Flush event queue before removing an input device
libinput_suspend() will trigger the removal of input devices, but also
the emission of button/key releases pairing everything that is pressed
at that moment. These events are queued, but the ClutterInputDevice
pointers in these will point to invalid memory at the time these are
processed.

Fix this by flushing the event queue, in order to ensure there are no
unprocessed input events after libinput_suspend().

https://bugzilla.gnome.org/show_bug.cgi?id=738520
2014-10-14 13:43:17 +02:00
Rico Tzschichholz
084dc49a0c x11: Add missing closure annotation to ClutterX11FilterFunc 2014-10-02 09:27:36 +02:00
Emmanuele Bassi
c55922dac1 docs: Fix the examples for ClutterText.set_font_name()
We shouldn't be using "pt": PangoFontDescription.from_string() assumes
points, and only accepts "px" for absolute font sizes.

https://bugzilla.gnome.org/show_bug.cgi?id=736826
2014-09-22 11:30:52 +01:00
Emmanuele Bassi
f409671d91 docs: Fix annotation for has_mapped_clones() method
The Returns: stanza is missing.
2014-09-17 14:59:22 +01:00
Emmanuele Bassi
28a5104e11 Remove gtk-doc tags from clutter_test_* API
The API is public because we use it in the test suite, but it's not
documented.
2014-09-17 14:58:17 +01:00
Emmanuele Bassi
14da1c5027 actor: Unallocated children do not contribute to the paint volume
Just like unmapped children.

Apparently, layers above Clutter allow mapped children without an
allocation, instead of unmapping them. This means we need to ignore
them when computing the paint volume.

Patch originally by: Adel Gadllah <adel.gadllah@gmail.com>
Signed-off by: Emmanuele Bassi <ebassi@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=736682
2014-09-15 16:53:31 +01:00
Emmanuele Bassi
acd8f86570 actor: Default paint volume does not work without allocation
We already check for needs_allocation before getting the default paint
volume, but explicit is better than implicit.
2014-09-15 16:43:30 +01:00
Jonas Ådahl
a182d4befa ClutterInputDevice: Store the cursor coordinate state as floating point
To support sub-pixel motion events coming from relative events, the
fraction part needs to be stored in the input device state as well. To
do this, simply change the current type from gint to gfloat.

https://bugzilla.gnome.org/show_bug.cgi?id=736413
2014-09-14 16:58:27 +02:00
Alejandro Piñeiro
281a57a6a3 a11y: provide a way to ensure clutter accessibility
If gtk_init is called after clutter_init, it can override clutter
AtkUtil implementation. In that situation, we can't say that
the accessibility is enabled, as the root object would be wrong.

In order to provide a way to prevent this:

* clutter_get_accessibility_enabled returns true of false
  depending on the current AtkUtil implemented
* cally_accessibility_init always override AtkUtil implementation.
2014-09-03 16:03:16 +02:00
Bastien Nocera
908aedbacc gdk: Add window-scaling-factor support
So that we follow GDK's idea of a scaling factor for Clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=734480
2014-09-03 14:21:08 +01:00
Emmanuele Bassi
b3b2af7677 Re-introduce removed GestureAction method
The get_threshold_tigger_egde() method was renamed to fix the typo, but
it obviously broke the ABI. To be fair, nobody in the whole of Debian
was using the symbol, apparently, so it's not like we broke existing
code. Still, it's not nice to break ABI without bumping soname, so let's
put the old symbol back in — obviously, deprecated — as a wrapper to the
newly added one.
2014-09-03 14:16:31 +01:00
Carlos Garnacho
591d31c970 xi2: XSync before getting the client pointer on construction
If the device manager is created and queried for the client pointer at
a very early stage in application lifetime, the device_id returned would
be 0 as the server hasn't apparently decided yet about the client pointer.

For these situations, doing XSync prior to fetching the client pointer
gets the server to device about the client pointer before we query it.

https://bugzilla.gnome.org/show_bug.cgi?id=735388
2014-08-25 16:51:31 +02:00
Adel Gadllah
cfcba18684 clutter-settings: Mark window-scaling-factor as fixed when set by the app
When an application sets the scaling factor manually we should mark it as fixed
and not override it when the xsettings change. This matches GDKs behaviour.

In order for this to work we cannot use the same path when setting the value
internally so introduce a _clutter_settings_set_property_internal and use it
for that.

https://bugzilla.gnome.org/show_bug.cgi?id=735244
2014-08-23 14:02:56 +02:00
Emmanuele Bassi
bd3e4f1709 evdev: Fix compiler warning 2014-08-21 15:26:14 +01:00
Sunjin Yang
158af1ff59 actor: Plug a leak in the implicit transition removal
We need to release the temporary reference we acquired in order for the
signal emission to work.

https://bugzilla.gnome.org/show_bug.cgi?id=734761

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2014-08-21 15:19:18 +01:00
Lionel Landwerlin
ad18f2a996 backend: gdk: add support for foreign windows on wayland
https://bugzilla.gnome.org/show_bug.cgi?id=734935
2014-08-17 16:55:10 +01:00
Lionel Landwerlin
ccd2054fda backend: gdk: add translation code for touch events
https://bugzilla.gnome.org/show_bug.cgi?id=734934
2014-08-17 16:55:10 +01:00
Emmanuele Bassi
be8602fbb4 Revert "backend: try gdk backend before x11/wayland/egl"
This reverts commit 398a7ac713.

We cannot really use the GDK backend without massive regressions inside
the input layer, like touch events and gestures. The GDK backend is not
entirely up to scratch, and it's late in the cycle.

Let's land this early in 3.15, and get it up to par with X11.
2014-08-15 12:11:20 +01:00
Emmanuele Bassi
f12c174d72 Remove unused internal 'in-resize' flag
A remnant of days gone by.
2014-08-15 12:07:48 +01:00
Lionel Landwerlin
398a7ac713 backend: try gdk backend before x11/wayland/egl
Quite a few people at Guadec complained of pinpoint being broken in
speaker+fullscreen mode, with slides being half displayed. It turns
out that the X11 backend of clutter was being used and this backend
assumes the size of the current monitor is the size of the X screen
(that's not the case with multiple monitors).

To work around the shortcomings of the X11 backend we should probably
position the GDK one before. GDK implements most of the logic the
ClutterStage needs and is probably more tested.

https://bugzilla.gnome.org/show_bug.cgi?id=734587
2014-08-10 20:26:02 +01:00
Rui Matos
f95493e7bf evdev: Add API to set the xkb layout index
https://bugzilla.gnome.org/show_bug.cgi?id=733202
2014-08-07 11:43:00 +01:00
Tom Beckmann
72aaeed3f5 canvas: assign white to paint color for texture node
To get correct premultiplied opacity on a canvas content, white needs
to be assigned to the color that is passed to the texture node. The
content will be very dark for lower opacity values otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=733385
2014-07-25 09:31:57 +01:00
Carlos Garnacho
0c0c069b3f input-device: Ensure crossing events are paired for touch sequences
When the sequence is lifted the actor wouldn't be unset, so the corresponding
CLUTTER_LEAVE event would never be sent for the touch sequence.

https://bugzilla.gnome.org/show_bug.cgi?id=733560
2014-07-23 14:32:24 +02:00
Carlos Garnacho
9e8c92d66a evdev: Update xkb state after input is resumed
xkb_state creation has been refactored out of clutter_evdev_set_keyboard_map(),
and used too in clutter_evdev_reclaim_devices(), so the xkb_state is fresh
clean after input is paused/resumed (and keyboard state possibly changed in
between)

https://bugzilla.gnome.org/show_bug.cgi?id=733562
2014-07-23 14:27:38 +02:00
Carlos Garnacho
958ffd4d40 event: define a boxed type for ClutterEventSequence
This allows for some minimal interaction from bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=733561
2014-07-23 14:23:20 +02:00
Giovanni Campagna
c167d3a4d3 ClutterAnimation: fix memory leak
We need to unref the timeline

https://bugzilla.gnome.org/show_bug.cgi?id=733300
2014-07-17 16:41:08 +02:00
Carlos Garnacho
f6fd02970c evdev: Set button modifier state to input devices.
Input devices must get the proper button state, in addition to keyboard
modifiers.

https://bugzilla.gnome.org/show_bug.cgi?id=733062
2014-07-11 15:39:05 +02:00
Carlos Garnacho
8d669ab8ce gesture-action: Prepare for clutter_gesture_action_cancel() within ::gesture-end
There may be odd situations where full gesture cancellation may be wanted at once
when the first touch is lifted and ::gesture-end is emitted on a gesture action.
Although calling clutter_gesture_action_cancel() within the ::gesture-end handler
causes 2 critical warnings that are otherwise harmless.

https://bugzilla.gnome.org/show_bug.cgi?id=732907
2014-07-08 18:48:20 +02:00
Owen W. Taylor
ec911dc8b9 ClutterStage: Replace clutter_stage_set_paint_callback() with ::after-paint signal
clutter_stage_set_paint_callback() has the disadvantage that it only
works for a single caller, and subsequent callers will overwrite and
break previous callers. Replace it with an ::after-paint signal that is
emitted at the same point - after all painting for the stage is
completed but before the drawing is presented to the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=732342
2014-06-27 14:39:02 -04:00
Emmanuele Bassi
036c2b3764 gesture-action: Use event type getter
Don't use direct struct access.
2014-06-25 16:58:18 +01:00
Carlos Garnacho
02590f08ac gesture-action: Ignore any other event than press/update/release ones
CLUTTER_ENTER/LEAVE might be processed too, leading to accounting of the
NULL sequence (ie. pointer) in the gesture, and fooling the gesture with
a static extra point that wouldn't go away.

https://bugzilla.gnome.org/show_bug.cgi?id=732235
2014-06-25 16:55:41 +01:00
Carlos Garnacho
4c4e72a9dc x11: Set the input device stage on XI_TouchBegin, if not already set
Until now, touch events sort of rely on XI_Enter/XI_Leave events accompanying
the pointer emulating touch in order to have a stage set on the device, These
events won't happen though if it's not a pointer emulating touch which happens
on the stage, causing touch events to be ignored.

Fix this by ensuring that the input device has a stage on XI_TouchBegin itself,
but only if it's not already set, so we don't possibly steal touch events to
an already interacting stage.

https://bugzilla.gnome.org/show_bug.cgi?id=732234
2014-06-25 16:55:16 +01:00
Carlos Garnacho
42f6828c9c input-device: Do not unset the device stage after the last touch is lifted
On X11 the pointer will follow a "pointer emulating" touch sequence, so the
pointer will be effectively left inside the stage after that touch is lifted,
even though the master device stage is unset. This makes pointer events get
ignored until the pointer leaves and enters again the stage.

https://bugzilla.gnome.org/show_bug.cgi?id=732234
2014-06-25 16:55:16 +01:00
Emmanuele Bassi
8d89294ef6 drop-action: Use the right state for events
The 'state' field should be used for pointer events without button
information. Pointer events that have button information should use
the 'button' field.

https://bugzilla.gnome.org/show_bug.cgi?id=732143
2014-06-25 15:16:30 +01:00
Emmanuele Bassi
ac26dbbbe9 evdev: Update after libinput API changes 2014-06-25 12:21:39 +01:00
Jasper St. Pierre
4cdcbcb2b1 evdev: Add clutter_evdev_warp_pointer
https://bugzilla.gnome.org/show_bug.cgi?id=731536
2014-06-11 17:21:15 -04:00
Jonas Ådahl
31749cfa47 evdev: Follow libinput enum rename
s/libinput_pointer_button_state/libinput_button_state/
s/LIBINPUT_POINTER_BUTTON_STATE_/LIBINPUT_BUTTON_STATE_/

https://bugzilla.gnome.org/show_bug.cgi?id=731254
2014-06-10 11:17:25 +01:00
Jonas Ådahl
61929e26e1 evdev: Used floating point instead of fixed point numbers
Following the API change in libinput, change the uses of fixed point
numbers to floating point numbers.

https://bugzilla.gnome.org/show_bug.cgi?id=731178
2014-06-10 10:39:42 +01:00
Gustavo Noronha Silva
fcdd222c61 device-manager-xi2: use allocation for clamping
The coordinates translated by the XI2 device manager were being clamped using
the X window size kept by StageX11. However, when the stage is fullscreen,
that size is not updated to the screen size, but kept the same in order to
allow going back to it when the stage goes out of fullscreen.

https://bugzilla.gnome.org/show_bug.cgi?id=731268
2014-06-05 15:03:10 -03:00
Jonas Ådahl
7ed92c845f Fix scaling of pointer axis vectors
The vector of libinput and Wayland pointer axis events are in pointer
motion coordinate space. To convert to clutter's internal representation
the vectors need to be scaled to Xi2 scroll steps.

https://bugzilla.gnome.org/show_bug.cgi?id=723560
2014-05-28 10:20:13 +01:00
Jonas Ådahl
3da27a4f08 wayland: Fix coding style issues
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=723560
2014-05-28 10:20:13 +01:00
Carlos Garnacho
ed538a6d2c stage: Only compress consecutive touch events from the same sequence
And get CLUTTER_EVENT_LEAVE out of the touch event compression logic, as
touches are always implicitly grabbed. If no sequence check is done, only
the last touch update would be emitted, even if multiple sequences got
updated.

https://bugzilla.gnome.org/show_bug.cgi?id=730577
2014-05-22 13:44:53 +02:00
Carlos Garnacho
fd8705b9c6 gesture-action: Fix typo in clutter_gesture_action_get_threshold_trigger_egde()
Let's cross fingers and hope nobody notices. If this went unnoticed so far, likely
means this function has never been used. If any complain is raised about this, a
stub function should be added (and marked deprecated).
2014-05-21 15:15:01 +02:00
Carlos Garnacho
9510d6ac95 evdev: Add clutter_evdev_event_sequence_get_slot()
This function helps know the libinput slot used by a sequence.

https://bugzilla.gnome.org/show_bug.cgi?id=728968
2014-05-21 14:09:33 +02:00
Carlos Garnacho
50b3d7cd9b evdev: Manage LIBINPUT_EVENT_TOUCH_* events
Those are translated into CLUTTER_TOUCH_* ClutterEvents. As the
"NULL" ClutterEventSequence is special cased, the slot=0 value is
avoided.

Frame events are ignored, as there is no Clutter equivalence, and
Cancel events are sent to all current individual touches.

https://bugzilla.gnome.org/show_bug.cgi?id=728968
2014-05-21 14:09:33 +02:00
Carlos Garnacho
76d48f79d6 evdev: Set core device on translated events
And ensure the core pointer shares the same stage than the slave
device when those events are set. This fixes problems on the evdev
backend where the last touch unsets the stage on the device, but
nothing sets it back afterwards.

https://bugzilla.gnome.org/show_bug.cgi?id=728968
2014-05-21 14:09:33 +02:00
Carlos Garnacho
8857b19d49 evdev: Add function to get the libinput_device from a ClutterInputDevice
This may be useful for deeper libinput integration that's not in the scope
of Clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=728967
2014-05-21 14:09:22 +02:00
Carlos Garnacho
91ee1ceca4 evdev: Add evdev specific event filter function
This function can be used to intercept or translate events
that are unmanaged by clutter itself.

https://bugzilla.gnome.org/show_bug.cgi?id=728967
2014-05-21 14:09:22 +02:00
Jasper St. Pierre
b66fec0450 egl: Add a way to pause the ClutterMasterClock
When VT switched away, we need to pause the ClutterMasterClock,
stop processing events, and stop trying to flip.

https://bugzilla.gnome.org/show_bug.cgi?id=730215
2014-05-19 15:48:39 -04:00
Jasper St. Pierre
32af6a3ef4 evdev: Fix a compile warning
device_type_str is only used inside a CLUTTER_NOTE, which evaluate
to nothing when CLUTTER_ENABLE_DEBUG is off.
2014-05-19 15:47:57 -04:00
Emmanuele Bassi
d708c30765 Provide 1.20 version macros 2014-05-19 17:55:52 +01:00
Gustavo Noronha Silva
bf5fe70e23 clutter-canvas: cache the texture to avoid uploads
When an actor carrying canvas content is repainted, it will currently reupload
the data from the buffer to a texture. While this is not a performance problem
on a desktop, some mobile environments take a big performance hit. This
change tracks data changes and only recreates the texture if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=729144
2014-05-01 11:48:51 -03:00
Emmanuele Bassi
0255b5a133 docs: Add an explicit example of image loading
Using GdkPixbuf, which is what we expect people to use anyway.
2014-04-26 20:50:43 +01:00
Emmanuele Bassi
10ff9a4679 docs: Fix the ClutterImage example URL 2014-04-26 20:50:29 +01:00
Gustavo Noronha Silva
d7b183a4e3 clutter-main: start mainloop timer on clutter_init()
By creating and starting the timer on clutter_main() an assumption is made
that that is how the main loop will be run for all clutter applications.
With more and more applications moving to GApplication, this assumption no
longer holds true.

Moving to clutter_init() means we are starting the timer earlier than we
should, and by not stopping it when the main loop quits we are taking a
measure that is later than we should. I believe it is safe to consider
those are close enough to the actual beginning and quitting of the main
loop in practice.

https://bugzilla.gnome.org/show_bug.cgi?id=728521
2014-04-18 19:05:37 -03:00
Emmanuele Bassi
ef2a94de93 master-clock: Clean up the over-budget diagnostic
Use the difference between the elapsed time and the available budget, so
that the message can be read more easily.
2014-04-14 22:24:47 +01:00
Adel Gadllah
3517c11c9b stage-cogl: Don't mess with the damage_history list when buffer_age is not available 2014-04-10 21:30:15 +02:00
Emmanuele Bassi
f9d99d1c4e test-utils: Skip tests if no DISPLAY is set
Instead of just bailing out when initializing the test suite, we can do
a much better job and skip all the tests. This means that the TAP driver
will work correctly instead of dying a horrible death, and we get a nice
report with a proper cause of the test skipping.
2014-04-02 19:25:55 +01:00
Emmanuele Bassi
f065a34e46 Remove clutter.symbols
The Visual Studio build files have been updated to not use it, so we can
remove it from the repository.
2014-04-02 18:48:59 +01:00
Emilio Pozuelo Monfort
363c0d2f7a wayland: Add missing CLUTTER_AVAILABLE annotations
Signed-off-by: Emilio Pozuelo Monfort <pochu27@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=727020
2014-03-25 14:05:46 +01:00
David Warman
5d53620bb9 stage: re-implement minimal paint() method to respect Z order
Without a paint() implementation in clutter-stage, the function
from clutter-group is used.  That class has its own child list,
but attempts to use sort_depth_order, which is empty in this case.

This provides a partial fix by replacing a minimal paint(), see:

https://bugzilla.gnome.org/show_bug.cgi?id=711645
2014-03-20 17:26:37 +00:00
Chun-wei Fan
2b3fac8b3d clutter-version.h.in: Refine how CLUTTER_VAR is Defined
Define CLUTTER_VAR like how it is done on GLib, so that the version
constants can be exported and imported appropriately on different
compilers.

https://bugzilla.gnome.org/show_bug.cgi?id=726762
2014-03-21 00:33:10 +08:00
Chun-wei Fan
4c204a4f3e clutter-event-win32.c: Avoid a Crash
Commit e70a0109 simplified the dispatching of events by passing the event's
owernership to ClutterStage, but it may be so that any.stage is NULL at
some point on Windows, which will either cause _clutter_stage_queue_event()
to crash or issue a critical warning.  Avoid this problem by checking
whether event->any.stage is not NULL before trying to call
_clutter_stage_queue_event().

https://bugzilla.gnome.org/show_bug.cgi?id=726765
2014-03-20 22:37:17 +08:00
Chun-wei Fan
891d3fce00 Fix on Last Commit of config.h.win32.in
Missed a /* before an #undef line, causing build warnings, oops, sorry.
2014-03-20 09:30:17 +08:00
Chun-wei Fan
44d688cdfb Update config.h.win32.in Further
...so that its entries will reflect the entries that are checked by the
autotools builds on config.h.in.  Also take into consideration for MinGW
builds and for newer Visual Studio versions, such as the availability for
inttypes.h.  Update the layout of the file cosmetic-wise as well.
2014-03-20 09:18:57 +08:00
Chun-wei Fan
783bc64a02 Visual Studio Builds: Don't Generate a .def File
Clutter, like GTK+ and GLib, has recently switched to a visibility-based
method of exporting symbols, so update the Visual Studio build files to
do likewise, by using __declspec (dllexport). This eliminats the need to
use a .def file to export the symbols.  The pre-configured
config.h.win32.in is also updated accordingly for this purpose.  The
clutter.symbols file can be dropped if it is not being used otherwise.
2014-03-20 08:57:06 +08:00
Emmanuele Bassi
4f5dd5ad43 docs: Remove last stray DocBook tags 2014-03-18 14:15:01 +00:00
Emmanuele Bassi
ddc1955f6b docs: Port backend-specific sections to markdown 2014-03-17 23:10:07 +00:00
Emmanuele Bassi
46051bfb20 docs: Port deprecated sections to markdown syntax
And drop docbook tags along the way.
2014-03-17 23:09:27 +00:00
Emmanuele Bassi
12370bd4f8 docs: Move to markdown
We're removing docbook tags in favour of the markdown syntax.
2014-03-17 23:07:58 +00:00
Emmanuele Bassi
115104db8c cally: Remove docbook tags 2014-03-17 23:05:09 +00:00
Emmanuele Bassi
8fc47244b0 build: Remove abicheck.sh
We now control the visibility of symbols directly from the header files,
so we always have the correct ABI.
2014-03-17 19:26:49 +00:00
Emmanuele Bassi
386be83f24 New visibility handling in Clutter
Instead of listing every public symbol inside an ancillary file, we can
use compiler annotations. This scheme is also used by GLib and GTK+.

The symbols file is left in tree until the Visual Studio rules are
fixed, but it's not used any more during distcheck.

I double-checked that the exposed ABI is the same before and after this
change, except for symbols that were never meant to be public in the
first place, and that escaped our attention when we generated the first
version of the symbols file.
2014-03-17 19:26:49 +00:00
Emmanuele Bassi
5c4c2aa52f symbols: Fix the expected ABI
Some symbols that were never meant to be exported ended up in the
symbols file.
2014-03-17 19:26:49 +00:00
Emmanuele Bassi
3b21999494 Use _CLUTTER_EXTERN to define CLUTTER_VAR
The macro is defined outside of the header, and does all the heavy
lifting of getting the proper attributes.
2014-03-17 19:26:49 +00:00
Emmanuele Bassi
c44f73a7f1 Include "config.h"
Otherwise the symbol annotation won't be expanded correctly.
2014-03-17 19:26:49 +00:00
Emmanuele Bassi
53a86e91d9 Annotate symbols in backend-specific headers
Like we did for the rest of the API.
2014-03-17 19:26:49 +00:00
Emmanuele Bassi
66826bc6ba Annotate symbol visibility in Cally
Like we did for the main library.
2014-03-17 19:26:27 +00:00
Emmanuele Bassi
c69bb976b3 Annotate all public symbols
We are going to switch to compiler annotations to determine the
visibility of the symbols.
2014-03-17 18:53:27 +00:00
Rui Matos
e70a0109f2 Avoid needless event copies when queueing from a backend to a stage
All backends follow the same pattern of queueing events first in
ClutterMainContext, then copying them to a ClutterStage queue and
immediately free them. Instead, we can just pass ownership of events
directly to ClutterStage thus avoiding the allocation and copy in
between.

https://bugzilla.gnome.org/show_bug.cgi?id=711857
2014-03-15 19:44:57 +00:00
Emmanuele Bassi
572504db4d Edit an incorrect comment
The location of the cool-off handling of clipped redraws has been moved
to clutter-stage-x11.c a long time ago (commit 1b1e77b4).
2014-03-15 19:31:54 +00:00
Jasper St. Pierre
79ece182dc egl: Only expose clutter_egl_set_kms_fd if we have KMS support
And only call the proper Cogl functions in that case, too. This
fixes the build on platforms without KMS, like the BSDs.

https://bugzilla.gnome.org/show_bug.cgi?id=726198
2014-03-15 19:09:55 +00:00
Jonas Ådahl
a4440b718d wayland: Keep track of button modifier state
Keep track of the button modifier mask state in
ClutterInputDeviceWayland and push its state to new button events going
out.

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

https://bugzilla.gnome.org/show_bug.cgi?id=708781
2014-03-14 18:24:03 -04:00
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