clutter/stage: Remove 'alpha' property

Was unused except for in a test, lets remove it. Half transparent
monitors will probably have to be dealt with some other way anyway.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1175
This commit is contained in:
Jonas Ådahl 2020-04-03 13:54:54 +02:00 committed by Georges Basile Stavracas Neto
parent 1551b6d386
commit 1301770dcb
3 changed files with 1 additions and 98 deletions

View File

@ -3866,14 +3866,7 @@ clutter_actor_paint_node (ClutterActor *actor,
fb = clutter_paint_context_get_base_framebuffer (paint_context);
if (clutter_stage_get_use_alpha (CLUTTER_STAGE (actor)))
{
bg_color.alpha = priv->opacity
* priv->bg_color.alpha
/ 255;
}
else
bg_color.alpha = 255;
bg_color.alpha = 255;
CLUTTER_NOTE (PAINT, "Stage clear color: (%d, %d, %d, %d)",
bg_color.red,

View File

@ -148,7 +148,6 @@ struct _ClutterStagePrivate
guint redraw_pending : 1;
guint is_cursor_visible : 1;
guint throttle_motion_events : 1;
guint use_alpha : 1;
guint min_size_changed : 1;
guint accept_focus : 1;
guint motion_events_enabled : 1;
@ -164,7 +163,6 @@ enum
PROP_CURSOR_VISIBLE,
PROP_PERSPECTIVE,
PROP_TITLE,
PROP_USE_ALPHA,
PROP_KEY_FOCUS,
PROP_ACCEPT_FOCUS,
PROP_LAST
@ -1867,10 +1865,6 @@ clutter_stage_set_property (GObject *object,
clutter_stage_set_title (stage, g_value_get_string (value));
break;
case PROP_USE_ALPHA:
clutter_stage_set_use_alpha (stage, g_value_get_boolean (value));
break;
case PROP_KEY_FOCUS:
clutter_stage_set_key_focus (stage, g_value_get_object (value));
break;
@ -1917,10 +1911,6 @@ clutter_stage_get_property (GObject *gobject,
g_value_set_string (value, priv->title);
break;
case PROP_USE_ALPHA:
g_value_set_boolean (value, priv->use_alpha);
break;
case PROP_KEY_FOCUS:
g_value_set_object (value, priv->key_focused_actor);
break;
@ -2093,23 +2083,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
NULL,
CLUTTER_PARAM_READWRITE);
/**
* ClutterStage:use-alpha:
*
* Whether the #ClutterStage should honour the alpha component of the
* #ClutterStage:color property when painting. If Clutter is run under
* a compositing manager this will result in the stage being blended
* with the underlying window(s)
*
* Since: 1.2
*/
obj_props[PROP_USE_ALPHA] =
g_param_spec_boolean ("use-alpha",
P_("Use Alpha"),
P_("Whether to honour the alpha component of the stage color"),
FALSE,
CLUTTER_PARAM_READWRITE);
/**
* ClutterStage:key-focus:
*
@ -3554,56 +3527,6 @@ clutter_stage_get_throttle_motion_events (ClutterStage *stage)
return stage->priv->throttle_motion_events;
}
/**
* clutter_stage_set_use_alpha:
* @stage: a #ClutterStage
* @use_alpha: whether the stage should honour the opacity or the
* alpha channel of the stage color
*
* Sets whether the @stage should honour the #ClutterActor:opacity and
* the alpha channel of the #ClutterStage:color
*
* Since: 1.2
*/
void
clutter_stage_set_use_alpha (ClutterStage *stage,
gboolean use_alpha)
{
ClutterStagePrivate *priv;
g_return_if_fail (CLUTTER_IS_STAGE (stage));
priv = stage->priv;
if (priv->use_alpha != use_alpha)
{
priv->use_alpha = use_alpha;
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
g_object_notify_by_pspec (G_OBJECT (stage), obj_props[PROP_USE_ALPHA]);
}
}
/**
* clutter_stage_get_use_alpha:
* @stage: a #ClutterStage
*
* Retrieves the value set using clutter_stage_set_use_alpha()
*
* Return value: %TRUE if the stage should honour the opacity and the
* alpha channel of the stage color
*
* Since: 1.2
*/
gboolean
clutter_stage_get_use_alpha (ClutterStage *stage)
{
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
return stage->priv->use_alpha;
}
/**
* clutter_stage_set_minimum_size:
* @stage: a #ClutterStage

View File

@ -38,7 +38,6 @@ typedef struct SuperOH
} SuperOH;
static gint n_hands = NHANDS;
static gint use_alpha = 255;
static GOptionEntry super_oh_entries[] = {
{
@ -47,12 +46,6 @@ static GOptionEntry super_oh_entries[] = {
G_OPTION_ARG_INT, &n_hands,
"Number of hands", "HANDS"
},
{
"use-alpha", 'a',
0,
G_OPTION_ARG_INT, &use_alpha,
"Stage opacity", "VALUE"
},
{ NULL }
};
@ -245,12 +238,6 @@ test_paint_wrapper_main (int argc, char *argv[])
stage = clutter_stage_new ();
clutter_actor_set_size (stage, 800, 600);
if (use_alpha != 255)
{
clutter_stage_set_use_alpha (CLUTTER_STAGE (stage), TRUE);
clutter_actor_set_opacity (stage, use_alpha);
}
clutter_stage_set_title (CLUTTER_STAGE (stage), "Paint Test");
clutter_actor_set_background_color (stage, &stage_color);
g_signal_connect (stage, "destroy", G_CALLBACK (stop_and_quit), oh);