Commit Graph

6288 Commits

Author SHA1 Message Date
Emmanuele Bassi
4c6a550d13 Soft-deprecation of actor state macros
These are just terrible API that we've been stringing along since the
0.x days. We cannot truly deprecate them, because they are, in some
cases, the only actual API to perform some operation, and porting all
the code in the world is not going to make us any friends.

For the time being, we use a deprecation notice in the documentation.
2015-04-14 12:46:49 +01:00
Emmanuele Bassi
849607316a actor: Add functions mapping to state query macros
The macros are useless for language bindings, and are terribly unsafe
from C as well. There's always the option of using the GObject
properties they refer to, but it's more efficient to just have a simple
getter function.
2015-04-14 12:37:42 +01:00
Emmanuele Bassi
4006b8524d Add version macros for 1.24 2015-04-14 12:29:58 +01:00
Emmanuele Bassi
877e58a6b4 x11: Plug a leak on error path
If XIGetProperty() does not return what we expect, but still returned
something, we need to free it.
2015-04-09 12:35:23 +01:00
Emmanuele Bassi
83cd36e95f x11: Improve touchpad detection heuristics
We should use the same heuristics used by GDK in order to detect whether
a device is a touchpad or not.

Based on the similar code from Carlos Garnacho for GDK:
https://git.gnome.org/browse/gtk+/commit/?id=6f07d5e7

https://bugzilla.gnome.org/show_bug.cgi?id=747436
2015-04-09 11:03:16 +01:00
Emmanuele Bassi
d362e373bb actor: Fix a compiler warning 2015-03-23 13:24:52 +00:00
Emmanuele Bassi
505801cd09 gdk: Fix stage removal from the master clock
Prevents a double-free in the conformance test suite.
2015-03-23 13:24:44 +00:00
Emmanuele Bassi
4f8643cea3 gdk: Fix mapping between frame clock and stages
While each stage has at most a GdkFrameClock, the same GdkFrameClock
instance may drive multiple stages per frame. This means that the
mapping between a GdkFrameClock and a ClutterStage is a 1:M one, not a
1:1.

We should store a list of stages associated to each frame clock
instance, so that we can iterate over it when we need to update the
stages.

This commit fixes redraws of applications using multiple stages,
especially when using clutter-gtk.
2015-03-23 11:00:00 +00:00
Florian Müllner
38c4807230 cally-actor: Don't assume X11 backend is used when supported
_cally_actor_get_top_level_origin() uses a compile time check
without runtime check, which will obviously fail when another
backend like wayland is used.

https://bugzilla.gnome.org/show_bug.cgi?id=746575
2015-03-23 11:00:00 +00:00
Jonas Ådahl
615b0f46ae evdev: Keep track of the pointer coordinate ourself
When multiple relative motion events are received and queued, we can't
base the relative => absolute motion conversion off of the stage pointer
position, since that is only updated when the queue is processed at
the beginning of each frame. The effect of trying to use the stage
pointer position was that subsequent motion events were effectively
dropped.

To improve things, switch to keeping track of the pointer position
ourselves in the evdev backend and adding to that.

This has the side effect of making the internal function
_clutter_input_device_set_coords not effect the internal coordinate
state of the evdev stage, but AFAICS there is nothing depending on that
so that should be fine.

https://bugzilla.gnome.org/show_bug.cgi?id=746328
2015-03-18 22:45:38 +08:00
Emmanuele Bassi
83caeaae9b stage-cogl: Abort realize() if there's no CoglContext
There's no point in trying to go ahead if we don't have a context to
create the CoglOnscreen framebuffer, and Cogl will crash anyway if we
pass NULL to the constructor.
2015-03-17 13:47:08 +00:00
Emmanuele Bassi
ce2d86515a rectangle: Fix the border drawing conditions
And reorganize the code a bit while we're at it.
2015-03-15 15:10:31 +00:00
Chris Wilson
239280f855 stage-cogl: Fix damage tracking with varying buffer ages
With server-side buffer allocation, buffers may be returned out of order
(e.g. they may be held onto by external references or hardware). As such
we may see older buffers the frame after we discard the history from
seeing a very young buffer. To overcome this we want to keep the history
in a ring so we can keep track of older entries without keeping an
unbounded list. After converting to a ring, the maximum buffer age
observed during testing was 5 (expected value of 4), but before we could
see ages as high as 9 due to the huge latency spikes caused by doing full
buffer redraws (compounded by external listeners doing readback on the
damaged areas, for example vnc, drm/udl, prime). For this reason, a
maximum age of 16 was chosen to be suitably large enough to prevent these
worst cases from taxing the system.

v2: Fix off-by-one in combining the damage histroy into the clipping
rectangle, and apply copious whitespace fixes.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=745512
References: https://bugzilla.gnome.org/show_bug.cgi?id=724788
References: https://bugzilla.gnome.org/show_bug.cgi?id=669122
2015-03-15 14:46:42 +00:00
Chris Wilson
55c957267e stage-cogl: Use swap buffers with damage
cogl provides an interface to pass along damage with the swap buffers
request. This is useful for the display servers and hardware to minimise
the work done in updating the screen and also reducing the work done by
external listeners (such as vnc, drm/udl and PRIME).

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=745512
2015-03-15 14:45:53 +00:00
Emmanuele Bassi
6de3413921 rectangle: Do not draw the border if bigger than the allocation
If the rectangle is allocate a size smaller than the border, drawing the
border will end up with negative coordinates, and will mess up the whole
thing. Since rectangles don't have a minimum preferred size, we cannot
rely on the allocation being big enough to contain the border and the
background color.

If the rectangle is smaller than the border width value, we just paint
the border color as well.
2015-03-14 23:17:27 +00:00
Emmanuele Bassi
1912f28063 docs: Remove leftover DocBook tags
We use markdown for the documentation.
2015-03-12 20:22:57 +00:00
Emmanuele Bassi
fefc2b5321 docs: Improve more deprecation notices 2015-03-08 15:49:45 +00:00
Emmanuele Bassi
79b1253bc8 docs: Improve deprecation notices for ClutterAnimation 2015-03-05 13:18:37 +00:00
Emmanuele Bassi
2a5b6d8753 docs: Add anchors to sections in ClutterActor's description 2015-03-05 13:16:59 +00:00
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