Commit Graph

5854 Commits

Author SHA1 Message Date
Rob Bradford
9808da7efe wayland: Only process enter and leave events Clutter created surfaces
When combining with GTK we will receive enter and leave events for surfaces
from both toolkits therefore we must filter our events appropriately.
2013-08-04 15:38:40 +01:00
Rob Bradford
66044b665f wayland: Check there is valid pointer or keyboard focus for events 2013-08-04 15:33:30 +01:00
Rob Bradford
7153863309 wayland: Only create and act on shell_surface for non-foreign surfaces
We should not create a shell surface and set the role for that shell
surface if the surface was a foreign one provided through
clutter_wayland_set_wl_surface

https://bugzilla.gnome.org/show_bug.cgi?id=699578
2013-07-23 18:24:01 +01:00
Chris Cummins
b6d2232150 wayland: Add foreign surface support to stage
This adds support for optionally a providing a foreign Wayland surface
to a ClutterStage before it is first show. Setting a foreign surface
prevents Cogl from allocating a surface and shell surface for the stage
automatically.

v2: add CLUTTER_AVAILABLE_IN_1_16 annotation and API reference docs
    (review from Emmanuele Bassi)
v3: set a boolean to indicate that this stage is using a foreign surface
(Rob Bradford)

https://bugzilla.gnome.org/show_bug.cgi?id=699578
2013-07-23 18:24:00 +01:00
Rob Bradford
a5e44d3934 wayland: Add API for disabling the event dispatching
This allows the integration of Clutter with another library, like GTK+,
that is dispatching the events itself. This is implemented by calling
into the cogl_wayland_renderer_set_event_dispatch_enabled() and since
that function must be called on the newly created renderer the newly
added clutter_wayland_disable_event_retrieval must be called before
clutter_init()

https://bugzilla.gnome.org/show_bug.cgi?id=704279
2013-07-23 18:23:40 +01:00
Adel Gadllah
697f7a3359 clutter-actor: Make clutter_actor_has_mapped_clones public
This allows some optimisations to be done that work when they are no clones.

https://bugzilla.gnome.org/show_bug.cgi?id=703336
2013-07-17 12:43:38 +02:00
Neil Roberts
0cef63b837 win32: Disable event retrieval in Cogl
Since commit 4543ed6ac3 in Cogl, Cogl will now try to consume
Windows message itself. This doesn't really cause any problems because
both message loops just call DispatchMessage which will cause the
message to be routed through Clutter's window procedure either way.
However, it's not great to have two sources listening for messages so
this patch disables Cogl's message retrieval.

https://bugzilla.gnome.org/show_bug.cgi?id=701356
2013-07-12 17:59:54 +01:00
Emmanuele Bassi
c2d5dd2d11 x11: Remove unused variable 2013-07-12 09:57:23 +01:00
Jasper St. Pierre
01707f0da9 input-device-x11: Remove more dead code
It seems this API has never been used..
2013-07-11 14:09:43 -04:00
Jasper St. Pierre
e62cf4745f device-manager: Select for events on XIAllMasterDevices
This removes a bit of work that we have to do for every device, and makes it
easy for mutter to patch out parts of the event mask it doesn't want.

https://bugzilla.gnome.org/show_bug.cgi?id=703969
2013-07-11 14:09:43 -04:00
Jasper St. Pierre
032688800c device-manager: Don't pass the event mask around
There's no point in doing this, as we always use a constant event mask.
Simply do what everything else does.

https://bugzilla.gnome.org/show_bug.cgi?id=703969
2013-07-11 14:09:43 -04:00
Jasper St. Pierre
e38ea7a20f x11: Remove support for XInput 1
Now we either use core X11 or XInput 2.

https://bugzilla.gnome.org/show_bug.cgi?id=703969
2013-07-11 14:03:43 -04:00
Jasper St. Pierre
0b32f99bd1 backend-x11: Remove bad branch prediction
This will only get once, at in Clutter initialization time.

https://bugzilla.gnome.org/show_bug.cgi?id=703969
2013-07-10 17:22:48 -04:00
Neil Roberts
78f20627ac wayland: Don't pass the shell and compositor down to Cogl
The Wayland 1.0 API allows orthoganal components of an application to
query the shell and compositor themselves by querying their own
wl_registry. The corresponding API in Cogl has been removed so Clutter
shouldn't call it anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=703878
2013-07-10 13:29:35 +01:00
Neil Roberts
6c66148faf Update ClutterWaylandSurface to use a resource instead of wl_buffer
The Wayland server API has changed so that wl_shm_buffer is no longer
a type of wl_buffer and wl_buffer will become an opaque type. This
changes ClutterWaylandSurface to accept resources for a wl_buffer
instead of directly taking the wl_buffer so that it can do different
things depending on whether the resource points to an SHM buffer or a
normal buffer. This matches similar changes to Cogl:

https://git.gnome.org/browse/cogl/commit/?id=9b35e1651ad0e46ed48989

https://bugzilla.gnome.org/show_bug.cgi?id=703608
2013-07-10 13:28:52 +01:00
Neil Roberts
fa8809d716 Add COGL_DISABLE_DEPRECATION_WARNINGS to the build flags
Cogl 1.16 has deprecated a lot of API which it will be difficult for
Clutter to catch up with. For the time being the warnings are just
being disabled to keep the build output clean.

https://bugzilla.gnome.org/show_bug.cgi?id=703877
2013-07-10 13:28:12 +01:00
Lionel Landwerlin
eed9496056 clutter-text: prevent text buffer creation if not needed
When allocating or asking for preferred width/height on a ClutterText,
it can notify a change on buffer/text/max-length if no text has been
set.

https://bugzilla.gnome.org/show_bug.cgi?id=703882
2013-07-10 11:16:09 +01:00
Emmanuele Bassi
6227f7a0f5 actor: Deprecate realize and unrealize
There is no reasonable use case for having the functions, the virtual
functions, and the signals for realization and unrealization; the
concept belongs to an older era, when we though it would have been
possible to migrate actors across different GL contexts, of in case a GL
context would not have been available until the main loop started
spinning. That is most definitely not possible today, and too much code
would utterly break if we ever supported that.
2013-07-10 11:16:09 +01:00
Rob Bradford
7df59887d7 wayland: Use a fake millisecond monotonic time source for event times
The majority of Clutter input events require a time so that that the
upper levels of abstraction can identify the ordering of events and also
work out a click count.

Although some Wayland events have microsecond timestamps not all those
that Clutter expects do have. Therefore we would need to create some
fake times for those events. Instead we always calculate our own time
using the monotonic time.

https://bugzilla.gnome.org/show_bug.cgi?id=697285
2013-07-10 10:30:17 +01:00
Rob Bradford
8df5aba361 wayland: add support for connecting to a foreign display
This allows the reuse of the display connection and hence objects with
existing code that is using Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=703566
2013-07-09 12:35:29 +01:00
Emmanuele Bassi
5b614cda1c paint-nodes: Use the correct wrap mode for TextureNode
If we allow content repeats on the texture nodes, then we need to use
the "automatic" wrap mode for the texture layer in the pipeline, instead
of the clamp-to-edge one.

Reported-by: Matthew Watson <matthew@endlessm.com>
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2013-07-04 16:32:58 +01:00
Emmanuele Bassi
1f37798b4c Revert "cogl: Replace deprecated Cogl API"
This reverts commit 6dd9da05c7.

Windowing system features we need are not mapped on cogl_has_feature().

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2013-07-04 16:12:27 +01:00
Emmanuele Bassi
6dd9da05c7 cogl: Replace deprecated Cogl API 2013-07-03 18:35:55 +01:00
Emmanuele Bassi
5a061ed4a3 gdk: Replace deprecated Cogl API 2013-07-03 18:35:44 +01:00
Emmanuele Bassi
dc7d42d87a x11: Replace deprecated Cogl API 2013-07-03 18:24:27 +01:00
Emmanuele Bassi
5cc7a1ee57 deprecated: Disable Cogl deprecation warnings
Like we do for Clutter: we know we are using deprecated API.
2013-07-03 18:15:31 +01:00
Emmanuele Bassi
bb45f17979 deprecated: Use the new macros for instance private data 2013-07-03 18:12:47 +01:00
Emmanuele Bassi
41bb03da2d Use the new macros for adding private data 2013-07-03 18:04:32 +01:00
Emmanuele Bassi
8532ca2104 cally: Use the new macros for adding private data 2013-07-03 14:02:09 +01:00
Emmanuele Bassi
2e905dd9d4 Fix annotations for signal arguments
The introspection scanner started warning about mismatched arguments
number.
2013-07-03 13:13:41 +01:00
Rob Bradford
e352047499 wayland: make the surface toplevel when showing the stage
Cogl (as of 0b2b46ce) now only sets the shell surface as toplevel when
the CoglOnscreen is shown.

Without calling wl_shell_surface_set_toplevel the compositor will not
know what role to give to the compositor and thus the stage will not
appear.

When we look to support multiple roles / foreign surfaces we will need
to revisit this call and ensure we only call it when we are working in
the default case.

https://bugzilla.gnome.org/show_bug.cgi?id=703188
2013-07-02 16:01:55 +01:00
Rob Bradford
5758ab5c89 wayland: Do not poll the Wayland socket for events
Since Cogl also polls on this file descriptor we can get into situations
where our event source is woken up to handle events but those events
have instead been handled by Cogl resulting in the source sitting in
poll().

We can safely rely on Cogl to handle the polling on the event source and
to dispatch those events.

https://bugzilla.gnome.org/show_bug.cgi?id=702202
2013-06-28 11:43:49 +01:00
Adel Gadllah
180e7d74f3 clutter-offscreen-effect: Allocate the cogl texture directly
Cogl now lazy loads the textures so we cannot rely on getting NULL
from cogl_texture_new_with_size so we have to allocate it by ourselves.

https://bugzilla.redhat.com/show_bug.cgi?id=975171
2013-06-25 20:29:20 +02:00
Cosimo Cecchi
4d8d5a62f3 text: relayout on cursor visibility change
When the cursor visibility changes, we have to relayout the ClutterText
actor instead of just redrawing it - as the cursor changes the
PangoLayout size, a size request cycle is needed.

https://bugzilla.gnome.org/show_bug.cgi?id=702610
2013-06-20 10:05:02 -07:00
Emmanuele Bassi
18f7a4aa12 actor: Remove the was_painted flag
While we still don't want to perform implicit transitions on unmapped
actors, we can relax the requirement on having been painted once; the
was_painted flag was introduced to avoid performing implicit transitions
on the :allocation property, but for that we can use the
needs_allocation flag instead, as needs_allocation will be set to FALSE
when we have been painted as well.

Thus, we retain our original goal of not having actors "flying" into
position on their first allocation, without the side effect of
preventing animations when emitting the ::show signal.
2013-06-15 11:54:18 +01:00
Lionel Landwerlin
fa933b5ec5 clutter-text: prevent reset of user set font descriptions on dpi changes
When setting the font using clutter_text_set_font_description(), the
font settings on a ClutterText actor can be reset when there is a dpi
changes signaled by the backend.

https://bugzilla.gnome.org/show_bug.cgi?id=702016
2013-06-12 13:47:09 +01:00
Sjoerd Simons
3bcee2b122 gesture-action: begin gesture as soon as the number of touchpoints is reached
1ddef9576d87c98fafbcefe3108f04866630c2cd had its logic the
wrong way round, a gesture should begin as soon as the requested number
of touchpoints is reached. Correcting this fixes tap events

https://bugzilla.gnome.org/show_bug.cgi?id=700980
2013-06-12 11:19:08 +01:00
Samuel Degrande
76fb468319 deform-effect: Set cull-face mode on the correct pipeline
Fix a function call to set the cull-face mode of the back_pipeline:
the function was called on the 'front-pipeline' instead of the
back-pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=701208
2013-06-12 10:41:57 +01:00
Craig R. Hughes
e54246dd69 Extra ref leak in clutter_actor_set_child_at_index too
https://bugzilla.gnome.org/show_bug.cgi?id=696813
2013-06-12 10:14:26 +01:00
Craig R. Hughes
90f68edbda clutter_actor_set_child_above/below_sibling leaking a reference
https://bugzilla.gnome.org/show_bug.cgi?id=696813
2013-06-12 10:14:25 +01:00
Emmanuele Bassi
cbf0199804 actor: Fix has_constraints() and has_actions()
When we changed the MetaGroup to handle internal effects, we updated
has_effects(), but forgot to fix the equivalent has_constrains() and
has_actions() method.

Now, if we clear the constraints or the actions on an actor, and we
call has_constraints() or has_actions(), we get an false positive.
2013-06-12 10:04:32 +01:00
Emmanuele Bassi
e1fe999db0 stage: Ensure that we don't pick during destruction
When destroying a ClutterStage we should just skip picking operations,
to avoid calling into a state that is being torn down.
2013-06-12 10:04:31 +01:00
Matthias Clasen
d343cc6289 x11: trap errors when calling XIQueryDevice
Devices can disappear at any time, causing XIQueryDevice
to throw an error. At the same time, plug a memory leak.

https://bugzilla.gnome.org/show_bug.cgi?id=701974
2013-06-10 21:45:47 -04:00
Emmanuele Bassi
0065fb459c Revert "units: Handle negative values in clutter_units_from_string()"
Stray commit got pushed too soon.

This reverts commit 44f283bb72.
2013-05-22 14:34:22 +01:00
Bastian Winkler
44f283bb72 units: Handle negative values in clutter_units_from_string()
In order to allow values like "-2cm" in ClutterScript,
clutter_units_from_string() needs to handle negative values as well.
2013-05-22 15:26:12 +02:00
Emmanuele Bassi
19391a9626 cally: Use a weak pointer to hold the key focus in CallyStage
We want to avoid the pointer getting stale, and causing crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=692706
2013-05-17 15:27:51 +01:00
Emmanuele Bassi
755f41f559 canvas: Remove invalidate_with_size()
We can replace it by adding a return value to set_size() that can tell
us if the set_size() invalidated the contents of the canvas or not.
2013-05-15 20:08:02 +01:00
Emmanuele Bassi
323ec19dcc build: Remove INCLUDES directives
They have been deprecated for a while, replaced by AM_CPPFLAGS.
2013-05-15 15:18:13 +01:00
Lionel Landwerlin
9c6f3793e8 offscreen-effect: limit offscreen fbo size to the stage's size
When using a ClutterOffscreenEffect, the size of the offscreen buffer
allocated to perform the effect is currently computed using the paint
volume of the actor it's attached to and in the case the paint volume
cannot be computed, the effect falls back to using the stage's size.

If you scale an actor enough so its paint volume is much bigger that
the size of the stage, you can end up running out of memory (which
leads to your application crashing).

https://bugzilla.gnome.org/show_bug.cgi?id=699675
2013-05-15 14:58:45 +01:00
Chris Cummins
242f611863 clutter-input-device-wayland: Update indentifier name
Fixes a discrepancy between the function name and the gtk-doc identifier
introduced in 8f4e39b6 when the Wayland input protocol changed.
2013-05-14 12:42:08 +01:00