mirror of
https://github.com/brl/mutter.git
synced 2025-01-10 19:52:25 +00:00
window: Move urgency to a setter
This commit is contained in:
parent
d6a27195d3
commit
6efcf2526d
@ -726,4 +726,7 @@ gboolean meta_window_is_client_decorated (MetaWindow *window);
|
|||||||
|
|
||||||
void meta_window_update_monitor (MetaWindow *window);
|
void meta_window_update_monitor (MetaWindow *window);
|
||||||
|
|
||||||
|
void meta_window_set_urgent (MetaWindow *window,
|
||||||
|
gboolean urgent);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1269,9 +1269,6 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
if (window->wm_state_demands_attention)
|
if (window->wm_state_demands_attention)
|
||||||
g_signal_emit_by_name (window->display, "window-demands-attention", window);
|
g_signal_emit_by_name (window->display, "window-demands-attention", window);
|
||||||
|
|
||||||
if (window->wm_hints_urgent)
|
|
||||||
g_signal_emit_by_name (window->display, "window-marked-urgent", window);
|
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10376,3 +10373,17 @@ meta_window_allows_resize (MetaWindow *window)
|
|||||||
{
|
{
|
||||||
return META_WINDOW_ALLOWS_RESIZE (window);
|
return META_WINDOW_ALLOWS_RESIZE (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_window_set_urgent (MetaWindow *window,
|
||||||
|
gboolean urgent)
|
||||||
|
{
|
||||||
|
if (window->wm_hints_urgent == urgent)
|
||||||
|
return;
|
||||||
|
|
||||||
|
window->wm_hints_urgent = urgent;
|
||||||
|
g_object_notify_by_pspec (window, props[PROP_URGENT]);
|
||||||
|
|
||||||
|
if (urgent)
|
||||||
|
g_signal_emit_by_name (window->display, "window-marked-urgent", window);
|
||||||
|
}
|
||||||
|
@ -1460,10 +1460,9 @@ reload_wm_hints (MetaWindow *window,
|
|||||||
gboolean initial)
|
gboolean initial)
|
||||||
{
|
{
|
||||||
Window old_group_leader;
|
Window old_group_leader;
|
||||||
gboolean old_urgent;
|
gboolean 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;
|
||||||
@ -1471,7 +1470,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;
|
urgent = FALSE;
|
||||||
|
|
||||||
if (value->type != META_PROP_VALUE_INVALID)
|
if (value->type != META_PROP_VALUE_INVALID)
|
||||||
{
|
{
|
||||||
@ -1493,7 +1492,7 @@ reload_wm_hints (MetaWindow *window,
|
|||||||
window->wm_hints_mask = hints->icon_mask;
|
window->wm_hints_mask = hints->icon_mask;
|
||||||
|
|
||||||
if (hints->flags & XUrgencyHint)
|
if (hints->flags & XUrgencyHint)
|
||||||
window->wm_hints_urgent = TRUE;
|
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,
|
||||||
@ -1510,20 +1509,7 @@ reload_wm_hints (MetaWindow *window,
|
|||||||
meta_window_group_leader_changed (window);
|
meta_window_group_leader_changed (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
meta_window_set_urgent (window, urgent);
|
||||||
* 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");
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Do not emit signal for the initial property load, let the constructor to
|
|
||||||
* take care of it once the MetaWindow is fully constructed.
|
|
||||||
*
|
|
||||||
* Only emit if the property is both changed and set.
|
|
||||||
*/
|
|
||||||
if (!initial && window->wm_hints_urgent && !old_urgent)
|
|
||||||
g_signal_emit_by_name (window->display, "window-marked-urgent", window);
|
|
||||||
|
|
||||||
meta_icon_cache_property_changed (&window->icon_cache,
|
meta_icon_cache_property_changed (&window->icon_cache,
|
||||||
window->display,
|
window->display,
|
||||||
|
Loading…
Reference in New Issue
Block a user