[MetaWindow] added urgent property
Property tracking ICCCM urgency hint https://bugzilla.gnome.org/show_bug.cgi?id=600068
This commit is contained in:
parent
01ce961c00
commit
0ccfb0d781
@ -130,6 +130,9 @@ struct _MetaWindow
|
|||||||
/* Whether we're fullscreen */
|
/* Whether we're fullscreen */
|
||||||
guint fullscreen : 1;
|
guint fullscreen : 1;
|
||||||
|
|
||||||
|
/* Whether the urgent flag of WM_HINTS is set */
|
||||||
|
guint wm_hints_urgent : 1;
|
||||||
|
|
||||||
/* Area to cover when in fullscreen mode. If _NET_WM_FULLSCREEN_MONITORS has
|
/* Area to cover when in fullscreen mode. If _NET_WM_FULLSCREEN_MONITORS has
|
||||||
* been overridden (via a client message), the window will cover the union of
|
* been overridden (via a client message), the window will cover the union of
|
||||||
* these monitors. If not, this is the single monitor which the window's
|
* these monitors. If not, this is the single monitor which the window's
|
||||||
|
@ -1350,8 +1350,10 @@ reload_wm_hints (MetaWindow *window,
|
|||||||
gboolean initial)
|
gboolean initial)
|
||||||
{
|
{
|
||||||
Window old_group_leader;
|
Window old_group_leader;
|
||||||
|
gboolean old_urgent;
|
||||||
|
|
||||||
old_group_leader = window->xgroup_leader;
|
old_group_leader = window->xgroup_leader;
|
||||||
|
old_urgent = window->wm_hints_urgent;
|
||||||
|
|
||||||
/* Fill in defaults */
|
/* Fill in defaults */
|
||||||
window->input = TRUE;
|
window->input = TRUE;
|
||||||
@ -1359,6 +1361,7 @@ reload_wm_hints (MetaWindow *window,
|
|||||||
window->xgroup_leader = None;
|
window->xgroup_leader = None;
|
||||||
window->wm_hints_pixmap = None;
|
window->wm_hints_pixmap = None;
|
||||||
window->wm_hints_mask = None;
|
window->wm_hints_mask = None;
|
||||||
|
window->wm_hints_urgent = FALSE;
|
||||||
|
|
||||||
if (value->type != META_PROP_VALUE_INVALID)
|
if (value->type != META_PROP_VALUE_INVALID)
|
||||||
{
|
{
|
||||||
@ -1379,6 +1382,9 @@ reload_wm_hints (MetaWindow *window,
|
|||||||
if (hints->flags & IconMaskHint)
|
if (hints->flags & IconMaskHint)
|
||||||
window->wm_hints_mask = hints->icon_mask;
|
window->wm_hints_mask = hints->icon_mask;
|
||||||
|
|
||||||
|
if (hints->flags & XUrgencyHint)
|
||||||
|
window->wm_hints_urgent = TRUE;
|
||||||
|
|
||||||
meta_verbose ("Read WM_HINTS input: %d iconic: %d group leader: 0x%lx pixmap: 0x%lx mask: 0x%lx\n",
|
meta_verbose ("Read WM_HINTS input: %d iconic: %d group leader: 0x%lx pixmap: 0x%lx mask: 0x%lx\n",
|
||||||
window->input, window->initially_iconic,
|
window->input, window->initially_iconic,
|
||||||
window->xgroup_leader,
|
window->xgroup_leader,
|
||||||
@ -1394,6 +1400,12 @@ reload_wm_hints (MetaWindow *window,
|
|||||||
meta_window_group_leader_changed (window);
|
meta_window_group_leader_changed (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Do not emit urgency notification on the inital property load
|
||||||
|
*/
|
||||||
|
if (!initial && (window->wm_hints_urgent != old_urgent))
|
||||||
|
g_object_notify (G_OBJECT (window), "urgent");
|
||||||
|
|
||||||
meta_icon_cache_property_changed (&window->icon_cache,
|
meta_icon_cache_property_changed (&window->icon_cache,
|
||||||
window->display,
|
window->display,
|
||||||
XA_WM_HINTS);
|
XA_WM_HINTS);
|
||||||
|
@ -139,7 +139,8 @@ enum {
|
|||||||
PROP_FULLSCREEN,
|
PROP_FULLSCREEN,
|
||||||
PROP_WINDOW_TYPE,
|
PROP_WINDOW_TYPE,
|
||||||
PROP_USER_TIME,
|
PROP_USER_TIME,
|
||||||
PROP_DEMANDS_ATTENTION
|
PROP_DEMANDS_ATTENTION,
|
||||||
|
PROP_URGENT
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -212,6 +213,9 @@ meta_window_get_property(GObject *object,
|
|||||||
case PROP_DEMANDS_ATTENTION:
|
case PROP_DEMANDS_ATTENTION:
|
||||||
g_value_set_boolean (value, win->wm_state_demands_attention);
|
g_value_set_boolean (value, win->wm_state_demands_attention);
|
||||||
break;
|
break;
|
||||||
|
case PROP_URGENT:
|
||||||
|
g_value_set_boolean (value, win->wm_hints_urgent);
|
||||||
|
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;
|
||||||
@ -308,6 +312,14 @@ meta_window_class_init (MetaWindowClass *klass)
|
|||||||
FALSE,
|
FALSE,
|
||||||
G_PARAM_READABLE));
|
G_PARAM_READABLE));
|
||||||
|
|
||||||
|
g_object_class_install_property (object_class,
|
||||||
|
PROP_URGENT,
|
||||||
|
g_param_spec_boolean ("urgent",
|
||||||
|
"Urgent",
|
||||||
|
"Whether the urgent flag of WM_HINTS is set",
|
||||||
|
FALSE,
|
||||||
|
G_PARAM_READABLE));
|
||||||
|
|
||||||
window_signals[WORKSPACE_CHANGED] =
|
window_signals[WORKSPACE_CHANGED] =
|
||||||
g_signal_new ("workspace-changed",
|
g_signal_new ("workspace-changed",
|
||||||
G_TYPE_FROM_CLASS (object_class),
|
G_TYPE_FROM_CLASS (object_class),
|
||||||
@ -700,6 +712,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
|
|||||||
meta_icon_cache_init (&window->icon_cache);
|
meta_icon_cache_init (&window->icon_cache);
|
||||||
window->wm_hints_pixmap = None;
|
window->wm_hints_pixmap = None;
|
||||||
window->wm_hints_mask = None;
|
window->wm_hints_mask = None;
|
||||||
|
window->wm_hints_urgent = FALSE;
|
||||||
|
|
||||||
window->frame = NULL;
|
window->frame = NULL;
|
||||||
window->has_focus = FALSE;
|
window->has_focus = FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user