Commit Graph

6136 Commits

Author SHA1 Message Date
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