summaryrefslogtreecommitdiff
path: root/clutter-gtk/gtk-clutter-embed.c
Commit message (Collapse)AuthorAgeFilesLines
* gtk-clutter-embed: don't use queue redraw on gtk+'s draw()Lionel Landwerlin2014-08-171-1/+1
| | | | | | | | | | | | | | Calling clutter_actor_queue_redraw() triggers an asynchronous redraw cycle, which triggers the callback from gtk-clutter-embed on the 'queue-redraw' signal, thus triggering another GTK+ paint cycle. This ends up in a infinite draw loop. This patch uses the clutter_stage_ensure_redraw() methods, which prevents the 'queue-redraw' signal emission (this is exactly what we want). https://bugzilla.gnome.org/show_bug.cgi?id=734906
* gtk-clutter-embed: use draw() from Gtk+ as Expose event for the GDK backendLionel Landwerlin2014-08-171-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | GtkClutterEmbed puts a filter on its GdkWindow to capture events and pass them to the ClutterBackend. That works well for X11, because the filter function receives an XEvent that can be directly fed to the ClutterX11Backend. For the GDK backend we can't do this because the filter function provides an untranslated event to the callee. Thus we can't give a valid GdkEvent to the ClutterGDKBackend. To work around this problem the current GtkClutterEmbed listen to the 'event' signal of its widget, and puts fed them to the ClutterGDKBackend. The problem with this is that Gtk+ already does some filtering, mostly on Expose events. This means that initially a GtkClutterEmbed often appears unpainted with the Gdk backend of Clutter. This patch adds the draw() vfunc on the widget and triggers a clutter_actor_queue_redraw() upon call only for the GDK backend. https://bugzilla.gnome.org/show_bug.cgi?id=734906
* wayland: Use the subsurface protocol to implement GtkClutterEmbedRob Bradford2014-04-161-0/+92
| | | | | | | | | | The subsurface protocol lets us "embed" one surface within another. The compositor will compose the two surfaces together to create a single window. We use it here to take the surface we get from Clutter and make that into a subsurface and then associate that subsurface with the main surface coming from GTK+. https://bugzilla.gnome.org/show_bug.cgi?id=695737
* embed: Pass scaled size back to clutterAdel Gadllah2014-02-141-7/+2
| | | | | | | Instead of messing with the allocation leave it as is and send the scaled size to clutter in the synthetic XConfigureEvent. https://bugzilla.gnome.org/show_bug.cgi?id=724055
* GtkClutterEmbed: Scale allocation by the scale factorAdel Gadllah2014-02-141-0/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=724055
* embed: Receive touch and smooth scroll eventsclutter-gtk-1.4Bastien Nocera2013-04-261-1/+3
| | | | | | | | Otherwise all the clicks from touchscreens will appear as synthetised events coming from the virtual core pointer instead of touch events coming from the touchscreen itself. https://bugzilla.gnome.org/show_bug.cgi?id=698969
* embed: Check whether we're running on X11 at run-timeBastien Nocera2013-03-131-13/+28
| | | | | | Rather than assuming a single backend. https://bugzilla.gnome.org/show_bug.cgi?id=695685
* embed: remove workaround for broken state propagationCosimo Cecchi2013-01-261-13/+0
| | | | | | | | | This shouldn't be needed anymore with recent GTK versions. As a side effect, bump the required GTK version to 3.6. This reverts commit bf3397b588e0209486945e4bd71d28c5dc2e1497 https://bugzilla.gnome.org/show_bug.cgi?id=692399
* embed: be more careful when adding and removing the filter functionCosimo Cecchi2012-12-111-15/+14
| | | | | | | | | | | | The intention of the current code seems to be adding a global event filter instead of one per realized embed; the filter is unconditionally removed in unrealize() though. This is a problem if an embed is unrealized and another one is realized later (for instance because a window is destroyed and another window is recreated later). Fix the bug by tracking the number of realized embeds with a counter, and removing the event filter only when the counter reaches zero. https://bugzilla.gnome.org/show_bug.cgi?id=689879
* GtkClutterEmbed: Make use-layout-size property work properlyTristan Van Berkom2012-10-171-5/+28
| | | | | | | | | | | | This patch makes the GtkClutterEmbed connect to the stage 'queue-relayout' signal and calls gtk_widget_queue_resize() if the 'use-layout-size' property is set. This is needed to ensure the GtkClutterEmbed constantly requests enough size for the stage whenever the stage's geometry is renegotiated. https://bugzilla.gnome.org/show_bug.cgi?id=684171
* embed: Check for state_flags_changed vfuncEmmanuele Bassi2012-08-091-3/+4
| | | | | | | | In GTK+ 3.2, GtkWidgetClass.state_flags_changed did not have an implementation inside GtkWidget, which means that running clutter-gtk with an older GTK+ version will crash. https://bugzilla.gnome.org/show_bug.cgi?id=681462
* Make GtkClutterEmbed redraw resizes nicerAlexander Larsson2012-06-051-0/+15
| | | | | | | | | | | | Currently when you vertically resize a GtkClutterEmbed we draw twice, once with the old window size and once again when the ConfigureNotify gets back with the right size. The first draw is at the wrong position due to the wrong window height used to calculate the viewport position. We fix this by immediately telling cogl about the new size by faking a ConfigureNotify event. https://bugzilla.gnome.org/show_bug.cgi?id=677493
* Allow GtkClutterEmbed to follow the ClutterStage sizeAlexander Larsson2012-06-051-1/+235
| | | | | | | This is nice when you combine Gtk and Clutter layouts, for instance to get a right minimum size for the window. https://bugzilla.gnome.org/show_bug.cgi?id=677282
* Use CLUTTER_PICK_REACTIVE when picking in the GtkClutterEmbedAlexander Larsson2012-05-251-1/+1
| | | | | Otherwise non-reactive actors will cover your Gtk widgets, which doesn't really make sense.
* Add explicit subclassing notes for GtkClutterEmbedEmmanuele Bassi2012-05-011-1/+16
| | | | | | | | | | | | | | | | The reason why GtkClutterEmbed is a GtkContainer is that we need to provide an uninterrupted parents chain from the top-level to widgets embedded using GtkClutterActor. If you override GtkContainer's implementation when subclassing GtkClutterEmbed you can only chain up - and end up triggering an assertion failure, because GtkClutterEmbed only accepts children of GtkClutterOffscreen type; GtkClutterOffscreen is an internal type, though, so you can't use that knowlegde as a filter in your own code. It's better to cut our losses, and just explicitly note in the documentation that overriding GtkContainer is just A Bad Idea™ when subclassing GtkClutterEmbed.
* embed: Add GDK_SCROLL_MASKEmmanuele Bassi2012-04-091-0/+1
| | | | Now that the mask is needed to get scrolling events.
* embed: queue a draw on actors when embed state flag changeCosimo Cecchi2012-03-061-0/+12
| | | | | | | | | When we receive a state-flags-changed signal, we should queue a draw on all of our children, since their appearance might be depending on inherited style values that changed. This should really be done generically by GTK, but doing it there is very bad for performance with the current GTK code, so we do it here.
* Support run-time backend detectionEmmanuele Bassi2011-11-101-55/+123
| | | | | | | Clutter moved to multi-backend support, so we need to perform run-time checks along with the compile-time ones. We can also check for the GDK backend that is available since Clutter 1.9 and use it.
* embed: Install the filter just onceEmmanuele Bassi2011-10-241-1/+7
| | | | | Don't install a global filter multiple times: once is enough, all the heavy lifting is done by Clutter anyway.
* embed: Set up a better initial stateEmmanuele Bassi2011-10-241-6/+17
| | | | | | | | | The GtkClutterEmbed widget should turn on the APP_PAINTABLE flag, since it's responsible for painting everything, including the background. It should also set the h-expand and v-expand properties to TRUE, as the container of the widget should allocate all the extra space; this allows us to get rid of the explicit set_size_request() in a bunch of places.
* Fix gtk-clutter-embed.c on non-X11 systemsChun-wei Fan2011-08-241-1/+1
| | | | | | The XEvent type/struct is something from the X11 libraries, which is most probably not available on systems that do not run X11. Move the #ifdef HAVE_CLUTTER_GTK_X11 line forward to guard the XEvent line.
* fix incorrect return value annotationSimon Wenner2011-07-131-1/+1
| | | | | | gtk_clutter_get_stage should not transfer the ownership of the returned stage. https://bugzilla.gnome.org/show_bug.cgi?id=653934
* embed: unmap: check stage exists before unmappingRaluca Elena Podiuc2011-06-261-1/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=653435
* build: win32 fixesEmmanuele Bassi2011-03-251-1/+1
| | | | | | | | | | | • Use -no-undefined when building for/on win32. • Display a critical warning when trying to use GtkClutterActor on non-X11 platforms. • Fix up clutter-win32.h inclusion path. Based on a patch by: Fridrich Strba <fridrich.strba@bluewin.ch> http://bugzilla.clutter-project.org/show_bug.cgi?id=2444
* Fix compiler warningsEmmanuele Bassi2011-03-181-3/+1
| | | | GCC 4.6 got more noisy.
* embed: Use a global filter for eventsEmmanuele Bassi2011-01-271-1/+3
| | | | | | Instead of using a per-window filter. Clutter will still do the matching with the stage window internally, and GDK won't deliver some events (like XI2 ones) to the per-window filter by default.
* embed: Override ::style-updatedEmmanuele Bassi2010-12-231-5/+30
| | | | | The ::style-set signal has been deprecated along with the rest of the Style API.
* Fixes after the style API changedEmmanuele Bassi2010-12-231-4/+3
| | | | | | | | | The old GtkStyle API has been deprecated, so we need to switch to the newly added GtkStyleContext API. The old clutter-gtk API to convert GtkStyle colors into Clutter colors needs to be removed, since GdkRGBA is much easier to deal with than GdkColor.
* embed: Remove dead codeEmmanuele Bassi2010-12-011-20/+0
|
* Fix compilation with gtk+ ≥ 2.91.0Emmanuele Bassi2010-10-051-17/+4
| | | | Untested, and probably broken. But at least it compiles.
* Fix a few introspection-related build warningsLucas Rocha2010-09-101-2/+2
| | | | http://bugzilla.clutter-project.org/show_bug.cgi?id=2308
* embed: Forward Key eventsEmmanuele Bassi2010-08-091-6/+45
| | | | | | Apparently, the GDK filter function we use with GtkClutterEmbed is not receiving any key event. In order to make them work, we need to fall back to the event forwarding we used prior to 0.90.
* Clean up API and documentationEmmanuele Bassi2010-07-211-4/+0
| | | | | The homegrown size tracking API should be replaced by the Constraint API that were added in Clutter 1.4.
* embed: Ensure the viewport only if we're realizedEmmanuele Bassi2010-07-211-9/+12
| | | | | There's no point in doing that if the ClutterStage doesn't have a foreign window set.
* build: Fix a compiler errorEmmanuele Bassi2010-07-201-1/+0
|
* Completely hide GtkClutterOffscreenEmmanuele Bassi2010-07-201-20/+30
| | | | | | The GtkClutterOffscreen widget is a wrapper around the offscreen window support in GTK+. It's a private object that should not be accessed outside of clutter-gtk.
* embed: Use a GDK filter for event handlingEmmanuele Bassi2010-07-201-240/+52
| | | | | | | | Instead of transforming GdkEvents from GtkWidget's virtual functions into ClutterEvents, we should use a filter function and propagate all events from X to Clutter. This simplifies a great deal of the event handling and allows clutter-gtk to be more resilient against changes in Clutter and GTK+.
* Unbreak GtkClutterEmbed for Clutter >= 1.2Emmanuele Bassi2010-06-161-0/+16
| | | | | | | | | | Since Clutter got the support for INTEL_swap_events, clutter-gtk has been broken because of the unhandled event driving the master clock. One way to fix this is to let Clutter handle the events coming from GDK using a filter function. We should actually move the whole event handling there - since it's cleaner and more resilient to any further change in the Clutter backends.
* Use accessor functions instead direct access.Javier Jardón2010-03-181-32/+44
| | | | | | | | | | | | This is necessary to build with -DGSEAL_ENABLE Required GTK+ version bumped to 2.19.5 Required Clutter version bumped to 1.2.0 http://bugzilla.openedhand.com/show_bug.cgi?id=1808 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* embed: Update input devicesEmmanuele Bassi2010-02-171-24/+100
| | | | | | | | The event handling in Clutter has been changed internally to always use input devices to store the state of the pointers and to emit ENTER/LEAVE event pairs consistently. This means that GtkClutterEmbed should be responsible of updating the state of the input devices, since we're completely overriding the event handling.
* Use 1.1.5 API for ARGB visuals on X11Emmanuele Bassi2010-01-081-0/+5
| | | | | | | | | Commit 5157da9fc of clutter/master reworked the ARGB visual API; it also deprecated clutter_x11_get_stage_visual(), which always was a dubiously named function, in favour of clutter_x11_get_visual_info(). For this reason we should conditionally use the 1.1.5 API, if we are compiled against it.
* Fix typo in the set_child_active() private methodEmmanuele Bassi2010-01-061-3/+3
| | | | Remove the extra 'd' from the function.
* embed: Check the stage before disconnecting signalsEmmanuele Bassi2010-01-061-1/+3
| | | | | | The stage might have been destroyed already when we get to the signal disconnection, in which case we can safely unset the signal handler id and just fall through.
* Make namespace consistent: GTK_IS_CLUTTER_OFFSCREEN -> GTK_CLUTTER_IS_OFFSCREENDanielle Madeley2009-11-181-1/+1
|
* Merge remote branch 'alexl/client-side-windows'Emmanuele Bassi2009-11-021-6/+86
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alexl/client-side-windows: Don't access widget->window unless widget is realized Fix ordering of setting embedder vs unrealize Update to new API Add testcase for GtkClutterActor Send offscreen children change once for each queue-repaint Implement picking of children so that events to embedded widgets work Move getting stage to realize/unrealize Size allocate GtkClutterActor child at right place Fix flicker when size allocating gtk actors Handle mapping from GtkClutterOffscreen coords to parent Add GtkClutterActor for embedding Gtk+ widget in clutter Conflicts: clutter-gtk/Makefile.am Merge the work done by Alex Larsson for embedding GTK+ widgets inside a Clutter scenegraph.
| * Fix ordering of setting embedder vs unrealizeAlexander Larsson2009-07-011-7/+1
| | | | | | | | Fixes a crash on unrealize
| * Update to new APIAlexander Larsson2009-07-011-18/+30
| |
| * Send offscreen children change once for each queue-repaintAlexander Larsson2009-07-011-0/+10
| | | | | | | | | | Ideally we would want it only for relayout, but that implies a repaint, and i think most repaints are relayouts, or?
| * Implement picking of children so that events to embedded widgets workAlexander Larsson2009-07-011-2/+43
| |
| * Add GtkClutterActor for embedding Gtk+ widget in clutterAlexander Larsson2009-07-011-4/+27
| | | | | | | | | | | | | | | | | | | | GtkClutterActor is the container for gtk+ widgets. It has a GtkClutterOfffscreen widget that you can get and put other stuff in. This gets drawn to an offscreen windows, and that pixmap is put into a ClutterTexture object that is a child of the GtkClutterActor. In order for the widget hierarchy to be correct GtkClutterEmbed is made a container of GtkClutterOffscreen widgets.