[mutter] clutter: Remove ability to be user resizable



commit 4064d9a7a7eae6a3b97a8a2221e1033f15f6c873
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Sat Jun 8 16:32:44 2019 +0200

    clutter: Remove ability to be user resizable
    
    It's a functionality from the application centric clutter that we don't
    need for compositors.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/616

 clutter/clutter/clutter-enums.h                  |  2 -
 clutter/clutter/clutter-stage-window.c           |  8 ---
 clutter/clutter/clutter-stage-window.h           |  4 --
 clutter/clutter/clutter-stage.c                  | 82 ------------------------
 clutter/clutter/clutter-stage.h                  |  5 --
 clutter/clutter/x11/clutter-backend-x11.c        |  3 +-
 clutter/clutter/x11/clutter-stage-x11.c          | 34 ++--------
 clutter/tests/interactive/test-actors.c          |  1 -
 clutter/tests/interactive/test-bind-constraint.c |  1 -
 clutter/tests/interactive/test-cairo-clock.c     |  1 -
 clutter/tests/interactive/test-content.c         |  1 -
 clutter/tests/interactive/test-image.c           |  1 -
 clutter/tests/interactive/test-rotate-zoom.c     |  1 -
 clutter/tests/interactive/test-stage-sizing.c    | 21 ------
 clutter/tests/interactive/test-state-script.c    |  1 -
 clutter/tests/interactive/test-table-layout.c    |  1 -
 clutter/tests/interactive/test-touch-events.c    |  1 -
 src/backends/meta-stage.c                        |  1 -
 18 files changed, 6 insertions(+), 163 deletions(-)
---
diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h
index bb83a4a90..462bdee6e 100644
--- a/clutter/clutter/clutter-enums.h
+++ b/clutter/clutter/clutter-enums.h
@@ -995,7 +995,6 @@ typedef enum
  * @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
  * @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
  * @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
- * @CLUTTER_FEATURE_STAGE_USER_RESIZE: Set if stage is able to be user resized.
  * @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
  * @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
  * @CLUTTER_FEATURE_OFFSCREEN: Set if the backend supports offscreen rendering.
@@ -1013,7 +1012,6 @@ typedef enum
   CLUTTER_FEATURE_TEXTURE_YUV            = (1 << 4),
   CLUTTER_FEATURE_TEXTURE_READ_PIXELS    = (1 << 5),
   CLUTTER_FEATURE_STAGE_STATIC           = (1 << 6),
-  CLUTTER_FEATURE_STAGE_USER_RESIZE      = (1 << 7),
   CLUTTER_FEATURE_STAGE_CURSOR           = (1 << 8),
   CLUTTER_FEATURE_SHADERS_GLSL           = (1 << 9),
   CLUTTER_FEATURE_OFFSCREEN              = (1 << 10),
diff --git a/clutter/clutter/clutter-stage-window.c b/clutter/clutter/clutter-stage-window.c
index e8fa976a7..29930b2c7 100644
--- a/clutter/clutter/clutter-stage-window.c
+++ b/clutter/clutter/clutter-stage-window.c
@@ -82,14 +82,6 @@ _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
     iface->set_cursor_visible (window, is_visible);
 }
 
-void
-_clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
-                                          gboolean            is_resizable)
-{
-  CLUTTER_STAGE_WINDOW_GET_IFACE (window)->set_user_resizable (window,
-                                                               is_resizable);
-}
-
 gboolean
 _clutter_stage_window_realize (ClutterStageWindow *window)
 {
diff --git a/clutter/clutter/clutter-stage-window.h b/clutter/clutter/clutter-stage-window.h
index 6c3601745..e374e2fa6 100644
--- a/clutter/clutter/clutter-stage-window.h
+++ b/clutter/clutter/clutter-stage-window.h
@@ -34,8 +34,6 @@ struct _ClutterStageWindowInterface
                                                  gboolean            is_fullscreen);
   void              (* set_cursor_visible)      (ClutterStageWindow *stage_window,
                                                  gboolean            cursor_visible);
-  void              (* set_user_resizable)      (ClutterStageWindow *stage_window,
-                                                 gboolean            is_resizable);
 
   gboolean          (* realize)                 (ClutterStageWindow *stage_window);
   void              (* unrealize)               (ClutterStageWindow *stage_window);
@@ -87,8 +85,6 @@ void              _clutter_stage_window_set_fullscreen     (ClutterStageWindow *
                                                             gboolean            is_fullscreen);
 void              _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
                                                             gboolean            is_visible);
-void              _clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
-                                                            gboolean            is_resizable);
 
 gboolean          _clutter_stage_window_realize                 (ClutterStageWindow *window);
 void              _clutter_stage_window_unrealize               (ClutterStageWindow *window);
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index f5189c5c8..3d8d666bc 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -154,7 +154,6 @@ struct _ClutterStagePrivate
   guint redraw_pending         : 1;
   guint is_fullscreen          : 1;
   guint is_cursor_visible      : 1;
-  guint is_user_resizable      : 1;
   guint use_fog                : 1;
   guint throttle_motion_events : 1;
   guint use_alpha              : 1;
@@ -175,7 +174,6 @@ enum
   PROP_CURSOR_VISIBLE,
   PROP_PERSPECTIVE,
   PROP_TITLE,
-  PROP_USER_RESIZABLE,
   PROP_USE_FOG,
   PROP_FOG,
   PROP_USE_ALPHA,
@@ -1738,10 +1736,6 @@ clutter_stage_set_property (GObject      *object,
       clutter_stage_set_title (stage, g_value_get_string (value));
       break;
 
-    case PROP_USER_RESIZABLE:
-      clutter_stage_set_user_resizable (stage, g_value_get_boolean (value));
-      break;
-
     case PROP_USE_FOG:
       clutter_stage_set_use_fog (stage, g_value_get_boolean (value));
       break;
@@ -1812,10 +1806,6 @@ clutter_stage_get_property (GObject    *gobject,
       g_value_set_string (value, priv->title);
       break;
 
-    case PROP_USER_RESIZABLE:
-      g_value_set_boolean (value, priv->is_user_resizable);
-      break;
-
     case PROP_USE_FOG:
       g_value_set_boolean (value, priv->use_fog);
       break;
@@ -1988,21 +1978,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
   g_object_class_install_property (gobject_class,
                                    PROP_CURSOR_VISIBLE,
                                    pspec);
-  /**
-   * ClutterStage:user-resizable:
-   *
-   * Whether the stage is resizable via user interaction.
-   *
-   * Since: 0.4
-   */
-  pspec = g_param_spec_boolean ("user-resizable",
-                                P_("User Resizable"),
-                                P_("Whether the stage is able to be resized via user interaction"),
-                                FALSE,
-                                CLUTTER_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_USER_RESIZABLE,
-                                   pspec);
   /**
    * ClutterStage:color:
    *
@@ -2335,7 +2310,6 @@ clutter_stage_init (ClutterStage *self)
   priv->event_queue = g_queue_new ();
 
   priv->is_fullscreen = FALSE;
-  priv->is_user_resizable = FALSE;
   priv->is_cursor_visible = TRUE;
   priv->use_fog = FALSE;
   priv->throttle_motion_events = TRUE;
@@ -2805,62 +2779,6 @@ clutter_stage_get_fullscreen (ClutterStage *stage)
   return stage->priv->is_fullscreen;
 }
 
-/**
- * clutter_stage_set_user_resizable:
- * @stage: a #ClutterStage
- * @resizable: whether the stage should be user resizable.
- *
- * Sets if the stage is resizable by user interaction (e.g. via
- * window manager controls)
- *
- * Since: 0.4
- */
-void
-clutter_stage_set_user_resizable (ClutterStage *stage,
-                                  gboolean      resizable)
-{
-  ClutterStagePrivate *priv;
-
-  g_return_if_fail (CLUTTER_IS_STAGE (stage));
-
-  priv = stage->priv;
-
-  if (clutter_feature_available (CLUTTER_FEATURE_STAGE_USER_RESIZE)
-      && priv->is_user_resizable != resizable)
-    {
-      ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
-      ClutterStageWindowInterface *iface;
-
-      iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
-      if (iface->set_user_resizable)
-        {
-          priv->is_user_resizable = resizable;
-
-          iface->set_user_resizable (impl, resizable);
-
-          g_object_notify (G_OBJECT (stage), "user-resizable");
-        }
-    }
-}
-
-/**
- * clutter_stage_get_user_resizable:
- * @stage: a #ClutterStage
- *
- * Retrieves the value set with clutter_stage_set_user_resizable().
- *
- * Return value: %TRUE if the stage is resizable by the user.
- *
- * Since: 0.4
- */
-gboolean
-clutter_stage_get_user_resizable (ClutterStage *stage)
-{
-  g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
-
-  return stage->priv->is_user_resizable;
-}
-
 /**
  * clutter_stage_show_cursor:
  * @stage: a #ClutterStage
diff --git a/clutter/clutter/clutter-stage.h b/clutter/clutter/clutter-stage.h
index 5730af7bd..a3f0de3b8 100644
--- a/clutter/clutter/clutter-stage.h
+++ b/clutter/clutter/clutter-stage.h
@@ -181,11 +181,6 @@ void            clutter_stage_set_title                         (ClutterStage
                                                                  const gchar           *title);
 CLUTTER_EXPORT
 const gchar *   clutter_stage_get_title                         (ClutterStage          *stage);
-CLUTTER_EXPORT
-void            clutter_stage_set_user_resizable                (ClutterStage          *stage,
-                                                                gboolean               resizable);
-CLUTTER_EXPORT
-gboolean        clutter_stage_get_user_resizable                (ClutterStage          *stage);
 
 CLUTTER_EXPORT
 void            clutter_stage_set_minimum_size                  (ClutterStage          *stage,
diff --git a/clutter/clutter/x11/clutter-backend-x11.c b/clutter/clutter/x11/clutter-backend-x11.c
index 8c5ebc834..4caf66b1f 100644
--- a/clutter/clutter/x11/clutter-backend-x11.c
+++ b/clutter/clutter/x11/clutter-backend-x11.c
@@ -563,8 +563,7 @@ clutter_backend_x11_dispose (GObject *gobject)
 static ClutterFeatureFlags
 clutter_backend_x11_get_features (ClutterBackend *backend)
 {
-  ClutterFeatureFlags flags = CLUTTER_FEATURE_STAGE_USER_RESIZE
-                            | CLUTTER_FEATURE_STAGE_CURSOR;
+  ClutterFeatureFlags flags = CLUTTER_FEATURE_STAGE_CURSOR;
 
   flags |= CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->get_features (backend);
 
diff --git a/clutter/clutter/x11/clutter-stage-x11.c b/clutter/clutter/x11/clutter-stage-x11.c
index d043bcf31..7c51b2791 100644
--- a/clutter/clutter/x11/clutter-stage-x11.c
+++ b/clutter/clutter/x11/clutter-stage-x11.c
@@ -153,9 +153,6 @@ clutter_stage_x11_fix_window_size (ClutterStageX11 *stage_x11,
     {
       guint min_width, min_height;
       XSizeHints *size_hints;
-      gboolean resize;
-
-      resize = clutter_stage_get_user_resizable (stage_cogl->wrapper);
 
       size_hints = XAllocSizeHints();
 
@@ -175,20 +172,11 @@ clutter_stage_x11_fix_window_size (ClutterStageX11 *stage_x11,
          restrictions on the window size */
       if (!stage_x11->fullscreening)
         {
-          if (resize)
-            {
-              size_hints->min_width = min_width;
-              size_hints->min_height = min_height;
-              size_hints->flags = PMinSize;
-            }
-          else
-            {
-              size_hints->min_width = new_width;
-              size_hints->min_height = new_height;
-              size_hints->max_width = new_width;
-              size_hints->max_height = new_height;
-              size_hints->flags = PMinSize | PMaxSize;
-            }
+          size_hints->min_width = new_width;
+          size_hints->min_height = new_height;
+          size_hints->max_width = new_width;
+          size_hints->max_height = new_height;
+          size_hints->flags = PMinSize | PMaxSize;
         }
 
       XSetWMNormalHints (backend_x11->xdpy, stage_x11->xwin, size_hints);
@@ -755,17 +743,6 @@ clutter_stage_x11_set_title (ClutterStageWindow *stage_window,
   set_wm_title (stage_x11);
 }
 
-static void
-clutter_stage_x11_set_user_resizable (ClutterStageWindow *stage_window,
-                                      gboolean            is_resizable)
-{
-  ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
-
-  clutter_stage_x11_fix_window_size (stage_x11,
-                                     stage_x11->xwin_width,
-                                     stage_x11->xwin_height);
-}
-
 static inline void
 update_wm_hints (ClutterStageX11 *stage_x11)
 {
@@ -981,7 +958,6 @@ clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
   iface->set_title = clutter_stage_x11_set_title;
   iface->set_fullscreen = clutter_stage_x11_set_fullscreen;
   iface->set_cursor_visible = clutter_stage_x11_set_cursor_visible;
-  iface->set_user_resizable = clutter_stage_x11_set_user_resizable;
   iface->set_accept_focus = clutter_stage_x11_set_accept_focus;
   iface->show = clutter_stage_x11_show;
   iface->hide = clutter_stage_x11_hide;
diff --git a/clutter/tests/interactive/test-actors.c b/clutter/tests/interactive/test-actors.c
index b27ee3e3d..ae12d7a08 100644
--- a/clutter/tests/interactive/test-actors.c
+++ b/clutter/tests/interactive/test-actors.c
@@ -199,7 +199,6 @@ test_actors_main (int argc, char *argv[])
   g_signal_connect (oh->stage, "destroy", G_CALLBACK (stop_and_quit), oh);
 
   clutter_stage_set_title (CLUTTER_STAGE (oh->stage), "Actors");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (oh->stage), TRUE);
 
   /* Create a timeline to manage animation */
   oh->timeline = clutter_timeline_new (6000);
diff --git a/clutter/tests/interactive/test-bind-constraint.c 
b/clutter/tests/interactive/test-bind-constraint.c
index 4308799ed..f8df31b02 100644
--- a/clutter/tests/interactive/test-bind-constraint.c
+++ b/clutter/tests/interactive/test-bind-constraint.c
@@ -181,7 +181,6 @@ test_bind_constraint_main (int argc, char *argv[])
   stage = clutter_stage_new ();
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Constraints");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   clutter_actor_set_size (stage, 800, 600);
 
   /* main rectangle */
diff --git a/clutter/tests/interactive/test-cairo-clock.c b/clutter/tests/interactive/test-cairo-clock.c
index 8ef4bd934..931282b02 100644
--- a/clutter/tests/interactive/test-cairo-clock.c
+++ b/clutter/tests/interactive/test-cairo-clock.c
@@ -91,7 +91,6 @@ test_cairo_clock_main (int argc, char *argv[])
   /* create a resizable stage */
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "2D Clock");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue);
   clutter_actor_set_size (stage, 300, 300);
   clutter_actor_show (stage);
diff --git a/clutter/tests/interactive/test-content.c b/clutter/tests/interactive/test-content.c
index 5f84c9218..fa0ac3a2f 100644
--- a/clutter/tests/interactive/test-content.c
+++ b/clutter/tests/interactive/test-content.c
@@ -181,7 +181,6 @@ test_content_main (int argc, char *argv[])
   stage = clutter_stage_new ();
   clutter_actor_set_name (stage, "Stage");
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Content");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
   clutter_actor_show (stage);
 
diff --git a/clutter/tests/interactive/test-image.c b/clutter/tests/interactive/test-image.c
index c565dd1fb..a3dc28c26 100644
--- a/clutter/tests/interactive/test-image.c
+++ b/clutter/tests/interactive/test-image.c
@@ -189,7 +189,6 @@ test_image_main (int argc, char *argv[])
   stage = clutter_stage_new ();
   clutter_actor_set_name (stage, "Stage");
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Content");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
   clutter_actor_show (stage);
 
diff --git a/clutter/tests/interactive/test-rotate-zoom.c b/clutter/tests/interactive/test-rotate-zoom.c
index 64ae6fce2..071e454b3 100644
--- a/clutter/tests/interactive/test-rotate-zoom.c
+++ b/clutter/tests/interactive/test-rotate-zoom.c
@@ -73,7 +73,6 @@ test_rotate_zoom_main (int argc, char *argv[])
   stage = clutter_stage_new ();
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Rotate and Zoom actions");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
   clutter_actor_set_reactive (stage, FALSE);
   clutter_actor_show (stage);
diff --git a/clutter/tests/interactive/test-stage-sizing.c b/clutter/tests/interactive/test-stage-sizing.c
index 6c2cce9ef..f739fa4d8 100644
--- a/clutter/tests/interactive/test-stage-sizing.c
+++ b/clutter/tests/interactive/test-stage-sizing.c
@@ -15,14 +15,6 @@ fullscreen_clicked_cb (ClutterStage *stage)
   return CLUTTER_EVENT_STOP;
 }
 
-static gboolean
-resize_clicked_cb (ClutterStage *stage)
-{
-  clutter_stage_set_user_resizable (stage,
-                                    !clutter_stage_get_user_resizable (stage));
-  return CLUTTER_EVENT_STOP;
-}
-
 static gboolean
 shrink_clicked_cb (ClutterActor *stage)
 {
@@ -90,19 +82,6 @@ test_stage_sizing_main (int argc, char *argv[])
   clutter_actor_add_child (rect, label);
   clutter_actor_add_child (box, rect);
 
-  rect = clutter_actor_new ();
-  clutter_actor_set_layout_manager (rect,
-                                    clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
-                                                            CLUTTER_BIN_ALIGNMENT_CENTER));
-  clutter_actor_set_background_color (rect, CLUTTER_COLOR_Chameleon);
-  clutter_actor_set_reactive (rect, TRUE);
-  g_signal_connect_swapped (rect, "button-press-event",
-                            G_CALLBACK (resize_clicked_cb), stage);
-  label = clutter_text_new_with_text ("Sans 16", "Toggle resizable");
-  clutter_actor_set_margin (label, &margin);
-  clutter_actor_add_child (rect, label);
-  clutter_actor_add_child (box, rect);
-
   rect = clutter_actor_new ();
   clutter_actor_set_layout_manager (rect,
                                     clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
diff --git a/clutter/tests/interactive/test-state-script.c b/clutter/tests/interactive/test-state-script.c
index bc29b3c4a..66b54b092 100644
--- a/clutter/tests/interactive/test-state-script.c
+++ b/clutter/tests/interactive/test-state-script.c
@@ -28,7 +28,6 @@ test_state_script_main (int argc, char *argv[])
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "State Script");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
   clutter_actor_show (stage);
 
diff --git a/clutter/tests/interactive/test-table-layout.c b/clutter/tests/interactive/test-table-layout.c
index b791a97d6..355944b06 100644
--- a/clutter/tests/interactive/test-table-layout.c
+++ b/clutter/tests/interactive/test-table-layout.c
@@ -179,7 +179,6 @@ test_table_layout_main (int argc, char *argv[])
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Table Layout");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   clutter_actor_set_size (stage, 640, 480);
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
 
diff --git a/clutter/tests/interactive/test-touch-events.c b/clutter/tests/interactive/test-touch-events.c
index 55c112540..fd23838ca 100644
--- a/clutter/tests/interactive/test-touch-events.c
+++ b/clutter/tests/interactive/test-touch-events.c
@@ -146,7 +146,6 @@ test_touch_events_main (int argc, char *argv[])
   stage = clutter_stage_new ();
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Touch events");
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
   clutter_actor_set_reactive (stage, TRUE);
   clutter_actor_show (stage);
diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c
index 47a00e51a..a98cbc7e2 100644
--- a/src/backends/meta-stage.c
+++ b/src/backends/meta-stage.c
@@ -214,7 +214,6 @@ meta_stage_class_init (MetaStageClass *klass)
 static void
 meta_stage_init (MetaStage *stage)
 {
-  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), FALSE);
 }
 
 ClutterActor *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]