summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2015-09-07 12:21:18 +0100
committerLionel Landwerlin <llandwerlin@gmail.com>2015-09-07 18:17:10 +0100
commita9b38fefdc097427cc33ca2b8d527415ee4f157b (patch)
tree46118224eeec39bfcae762e1aba9e5a45616bf5e
parent5733ad58e5a3989f5cb836d42a1cebf3884e7c36 (diff)
downloadclutter-a9b38fefdc097427cc33ca2b8d527415ee4f157b.tar.gz
gdk: stage: disable some operations for foreign windows
Some operations like : * resize * show/hide * set_title * set_user_resizable should be handled by the embedding framework, so disable them for foreign windows. https://bugzilla.gnome.org/show_bug.cgi?id=754671
-rw-r--r--clutter/gdk/clutter-stage-gdk.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/clutter/gdk/clutter-stage-gdk.c b/clutter/gdk/clutter-stage-gdk.c
index 8a301ae73..05c6fe354 100644
--- a/clutter/gdk/clutter-stage-gdk.c
+++ b/clutter/gdk/clutter-stage-gdk.c
@@ -141,6 +141,12 @@ clutter_stage_gdk_resize (ClutterStageWindow *stage_window,
{
ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window);
+ /* No need to resize foreign windows, it should be handled by the
+ * embedding framework.
+ */
+ if (stage_gdk->foreign_window)
+ return;
+
if (width == 0 || height == 0)
{
/* Should not happen, if this turns up we need to debug it and
@@ -350,7 +356,7 @@ clutter_stage_gdk_set_fullscreen (ClutterStageWindow *stage_window,
if (stage == NULL || CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return;
- if (stage_gdk->window == NULL)
+ if (stage_gdk->window == NULL || stage_gdk->foreign_window)
return;
CLUTTER_NOTE (BACKEND, "%ssetting fullscreen", is_fullscreen ? "" : "un");
@@ -393,7 +399,7 @@ clutter_stage_gdk_set_title (ClutterStageWindow *stage_window,
{
ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window);
- if (stage_gdk->window == NULL)
+ if (stage_gdk->window == NULL || stage_gdk->foreign_window)
return;
gdk_window_set_title (stage_gdk->window, title);
@@ -406,7 +412,7 @@ clutter_stage_gdk_set_user_resizable (ClutterStageWindow *stage_window,
ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window);
GdkWMFunction function;
- if (stage_gdk->window == NULL)
+ if (stage_gdk->window == NULL || stage_gdk->foreign_window)
return;
function = GDK_FUNC_MOVE | GDK_FUNC_MINIMIZE | GDK_FUNC_CLOSE;
@@ -424,7 +430,7 @@ clutter_stage_gdk_set_accept_focus (ClutterStageWindow *stage_window,
{
ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window);
- if (stage_gdk->window == NULL)
+ if (stage_gdk->window == NULL || stage_gdk->foreign_window)
return;
gdk_window_set_accept_focus (stage_gdk->window, accept_focus);
@@ -440,10 +446,14 @@ clutter_stage_gdk_show (ClutterStageWindow *stage_window,
clutter_actor_map (CLUTTER_ACTOR (CLUTTER_STAGE_COGL (stage_gdk)->wrapper));
- if (do_raise)
- gdk_window_show (stage_gdk->window);
- else
- gdk_window_show_unraised (stage_gdk->window);
+ /* Foreign window should be shown by the embedding framework. */
+ if (!stage_gdk->foreign_window)
+ {
+ if (do_raise)
+ gdk_window_show (stage_gdk->window);
+ else
+ gdk_window_show_unraised (stage_gdk->window);
+ }
}
static void
@@ -454,7 +464,10 @@ clutter_stage_gdk_hide (ClutterStageWindow *stage_window)
g_return_if_fail (stage_gdk->window != NULL);
clutter_actor_unmap (CLUTTER_ACTOR (CLUTTER_STAGE_COGL (stage_gdk)->wrapper));
- gdk_window_hide (stage_gdk->window);
+
+ /* Foreign window should be hidden by the embedding framework. */
+ if (!stage_gdk->foreign_window)
+ gdk_window_hide (stage_gdk->window);
}
static gboolean