mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
clutter/stage: Remove 'accept-focus' property
Also unused, only valid on X11. Meant for applications. Lets drop it. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1175
This commit is contained in:
parent
fe27a6ea3b
commit
6f0e5b0b56
@ -168,19 +168,6 @@ _clutter_stage_window_clear_update_time (ClutterStageWindow *window)
|
|||||||
iface->clear_update_time (window);
|
iface->clear_update_time (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
|
||||||
gboolean accept_focus)
|
|
||||||
{
|
|
||||||
ClutterStageWindowInterface *iface;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
|
|
||||||
|
|
||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
|
|
||||||
if (iface->set_accept_focus)
|
|
||||||
iface->set_accept_focus (window, accept_focus);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_stage_window_redraw (ClutterStageWindow *window)
|
_clutter_stage_window_redraw (ClutterStageWindow *window)
|
||||||
{
|
{
|
||||||
|
@ -49,9 +49,6 @@ struct _ClutterStageWindowInterface
|
|||||||
gint64 (* get_update_time) (ClutterStageWindow *stage_window);
|
gint64 (* get_update_time) (ClutterStageWindow *stage_window);
|
||||||
void (* clear_update_time) (ClutterStageWindow *stage_window);
|
void (* clear_update_time) (ClutterStageWindow *stage_window);
|
||||||
|
|
||||||
void (* set_accept_focus) (ClutterStageWindow *stage_window,
|
|
||||||
gboolean accept_focus);
|
|
||||||
|
|
||||||
void (* redraw) (ClutterStageWindow *stage_window);
|
void (* redraw) (ClutterStageWindow *stage_window);
|
||||||
|
|
||||||
gboolean (* can_clip_redraws) (ClutterStageWindow *stage_window);
|
gboolean (* can_clip_redraws) (ClutterStageWindow *stage_window);
|
||||||
|
@ -148,7 +148,6 @@ struct _ClutterStagePrivate
|
|||||||
guint redraw_pending : 1;
|
guint redraw_pending : 1;
|
||||||
guint throttle_motion_events : 1;
|
guint throttle_motion_events : 1;
|
||||||
guint min_size_changed : 1;
|
guint min_size_changed : 1;
|
||||||
guint accept_focus : 1;
|
|
||||||
guint motion_events_enabled : 1;
|
guint motion_events_enabled : 1;
|
||||||
guint has_custom_perspective : 1;
|
guint has_custom_perspective : 1;
|
||||||
guint stage_was_relayout : 1;
|
guint stage_was_relayout : 1;
|
||||||
@ -162,7 +161,6 @@ enum
|
|||||||
PROP_PERSPECTIVE,
|
PROP_PERSPECTIVE,
|
||||||
PROP_TITLE,
|
PROP_TITLE,
|
||||||
PROP_KEY_FOCUS,
|
PROP_KEY_FOCUS,
|
||||||
PROP_ACCEPT_FOCUS,
|
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1860,10 +1858,6 @@ clutter_stage_set_property (GObject *object,
|
|||||||
clutter_stage_set_key_focus (stage, g_value_get_object (value));
|
clutter_stage_set_key_focus (stage, g_value_get_object (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ACCEPT_FOCUS:
|
|
||||||
clutter_stage_set_accept_focus (stage, g_value_get_boolean (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -1902,10 +1896,6 @@ clutter_stage_get_property (GObject *gobject,
|
|||||||
g_value_set_object (value, priv->key_focused_actor);
|
g_value_set_object (value, priv->key_focused_actor);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ACCEPT_FOCUS:
|
|
||||||
g_value_set_boolean (value, priv->accept_focus);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -2075,20 +2065,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
|||||||
CLUTTER_TYPE_ACTOR,
|
CLUTTER_TYPE_ACTOR,
|
||||||
CLUTTER_PARAM_READWRITE);
|
CLUTTER_PARAM_READWRITE);
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterStage:accept-focus:
|
|
||||||
*
|
|
||||||
* Whether the #ClutterStage should accept key focus when shown.
|
|
||||||
*
|
|
||||||
* Since: 1.6
|
|
||||||
*/
|
|
||||||
obj_props[PROP_ACCEPT_FOCUS] =
|
|
||||||
g_param_spec_boolean ("accept-focus",
|
|
||||||
P_("Accept Focus"),
|
|
||||||
P_("Whether the stage should accept focus on show"),
|
|
||||||
TRUE,
|
|
||||||
CLUTTER_PARAM_READWRITE);
|
|
||||||
|
|
||||||
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
|
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3781,56 +3757,6 @@ clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_stage_set_accept_focus:
|
|
||||||
* @stage: a #ClutterStage
|
|
||||||
* @accept_focus: %TRUE to accept focus on show
|
|
||||||
*
|
|
||||||
* Sets whether the @stage should accept the key focus when shown.
|
|
||||||
*
|
|
||||||
* This function should be called before showing @stage using
|
|
||||||
* clutter_actor_show().
|
|
||||||
*
|
|
||||||
* Since: 1.6
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_stage_set_accept_focus (ClutterStage *stage,
|
|
||||||
gboolean accept_focus)
|
|
||||||
{
|
|
||||||
ClutterStagePrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
||||||
|
|
||||||
accept_focus = !!accept_focus;
|
|
||||||
|
|
||||||
priv = stage->priv;
|
|
||||||
|
|
||||||
if (priv->accept_focus != accept_focus)
|
|
||||||
{
|
|
||||||
_clutter_stage_window_set_accept_focus (priv->impl, accept_focus);
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (stage), obj_props[PROP_ACCEPT_FOCUS]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_stage_get_accept_focus:
|
|
||||||
* @stage: a #ClutterStage
|
|
||||||
*
|
|
||||||
* Retrieves the value set with clutter_stage_set_accept_focus().
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if the #ClutterStage should accept focus, and %FALSE
|
|
||||||
* otherwise
|
|
||||||
*
|
|
||||||
* Since: 1.6
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_stage_get_accept_focus (ClutterStage *stage)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), TRUE);
|
|
||||||
|
|
||||||
return stage->priv->accept_focus;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_stage_set_motion_events_enabled:
|
* clutter_stage_set_motion_events_enabled:
|
||||||
* @stage: a #ClutterStage
|
* @stage: a #ClutterStage
|
||||||
|
@ -182,11 +182,6 @@ void clutter_stage_set_motion_events_enabled (ClutterStage
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_stage_get_motion_events_enabled (ClutterStage *stage);
|
gboolean clutter_stage_get_motion_events_enabled (ClutterStage *stage);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_stage_set_accept_focus (ClutterStage *stage,
|
|
||||||
gboolean accept_focus);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_stage_get_accept_focus (ClutterStage *stage);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_stage_event (ClutterStage *stage,
|
gboolean clutter_stage_event (ClutterStage *stage,
|
||||||
ClutterEvent *event);
|
ClutterEvent *event);
|
||||||
|
|
||||||
|
@ -381,21 +381,11 @@ update_wm_hints (MetaStageX11 *stage_x11)
|
|||||||
|
|
||||||
wm_hints.flags = StateHint | InputHint;
|
wm_hints.flags = StateHint | InputHint;
|
||||||
wm_hints.initial_state = NormalState;
|
wm_hints.initial_state = NormalState;
|
||||||
wm_hints.input = stage_x11->accept_focus ? True : False;
|
wm_hints.input = True;
|
||||||
|
|
||||||
XSetWMHints (xdisplay, stage_x11->xwin, &wm_hints);
|
XSetWMHints (xdisplay, stage_x11->xwin, &wm_hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
meta_stage_x11_set_accept_focus (ClutterStageWindow *stage_window,
|
|
||||||
gboolean accept_focus)
|
|
||||||
{
|
|
||||||
MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
|
|
||||||
|
|
||||||
stage_x11->accept_focus = !!accept_focus;
|
|
||||||
update_wm_hints (stage_x11);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_stage_x11_state (MetaStageX11 *stage_x11,
|
set_stage_x11_state (MetaStageX11 *stage_x11,
|
||||||
MetaStageX11State unset_flags,
|
MetaStageX11State unset_flags,
|
||||||
@ -543,8 +533,6 @@ meta_stage_x11_init (MetaStageX11 *stage)
|
|||||||
|
|
||||||
stage->wm_state = STAGE_X11_WITHDRAWN;
|
stage->wm_state = STAGE_X11_WITHDRAWN;
|
||||||
|
|
||||||
stage->accept_focus = TRUE;
|
|
||||||
|
|
||||||
stage->title = NULL;
|
stage->title = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,7 +542,6 @@ clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
|
|||||||
clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface);
|
clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface);
|
||||||
|
|
||||||
iface->set_title = meta_stage_x11_set_title;
|
iface->set_title = meta_stage_x11_set_title;
|
||||||
iface->set_accept_focus = meta_stage_x11_set_accept_focus;
|
|
||||||
iface->show = meta_stage_x11_show;
|
iface->show = meta_stage_x11_show;
|
||||||
iface->hide = meta_stage_x11_hide;
|
iface->hide = meta_stage_x11_hide;
|
||||||
iface->resize = meta_stage_x11_resize;
|
iface->resize = meta_stage_x11_resize;
|
||||||
|
@ -68,7 +68,6 @@ struct _MetaStageX11
|
|||||||
MetaStageX11State wm_state;
|
MetaStageX11State wm_state;
|
||||||
|
|
||||||
guint viewport_initialized : 1;
|
guint viewport_initialized : 1;
|
||||||
guint accept_focus : 1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MetaStageX11Class
|
struct _MetaStageX11Class
|
||||||
|
Loading…
Reference in New Issue
Block a user