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
This commit is contained in:
Jonas Ådahl 2019-06-08 16:32:44 +02:00 committed by Georges Basile Stavracas Neto
parent 8a06cfdd81
commit 4064d9a7a7
18 changed files with 6 additions and 163 deletions

View File

@ -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),

View File

@ -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)
{

View File

@ -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);

View File

@ -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

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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 */

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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 *