window: Enable pinging on Wayland windows

I implemented pinging, but never actually enabled the feature
properly on Wayland surfaces by setting the net_wm_ping hint to
TRUE, causing the fallback path to always be hit.

Rename net_wm_ping to can_ping so it doesn't take on an
implementation-specific meaning, and set it for all Wayland windows.
This commit is contained in:
Jasper St. Pierre 2014-02-18 20:28:23 -05:00
parent 24c5290d7f
commit e62fe956fd
4 changed files with 6 additions and 5 deletions

View File

@ -4980,7 +4980,7 @@ meta_display_ping_window (MetaWindow *window,
return; return;
} }
if (!window->net_wm_ping) if (!window->can_ping)
{ {
if (ping_reply_func) if (ping_reply_func)
(* ping_reply_func) (window, timestamp, user_data); (* ping_reply_func) (window, timestamp, user_data);

View File

@ -238,7 +238,7 @@ struct _MetaWindow
/* These are the flags from WM_PROTOCOLS */ /* These are the flags from WM_PROTOCOLS */
guint take_focus : 1; guint take_focus : 1;
guint delete_window : 1; guint delete_window : 1;
guint net_wm_ping : 1; guint can_ping : 1;
/* Globally active / No input */ /* Globally active / No input */
guint input : 1; guint input : 1;

View File

@ -1407,7 +1407,7 @@ reload_wm_protocols (MetaWindow *window,
window->take_focus = FALSE; window->take_focus = FALSE;
window->delete_window = FALSE; window->delete_window = FALSE;
window->net_wm_ping = FALSE; window->can_ping = FALSE;
if (value->type == META_PROP_VALUE_INVALID) if (value->type == META_PROP_VALUE_INVALID)
return; return;
@ -1423,7 +1423,7 @@ reload_wm_protocols (MetaWindow *window,
window->delete_window = TRUE; window->delete_window = TRUE;
else if (value->v.atom_list.atoms[i] == else if (value->v.atom_list.atoms[i] ==
window->display->atom__NET_WM_PING) window->display->atom__NET_WM_PING)
window->net_wm_ping = TRUE; window->can_ping = TRUE;
++i; ++i;
} }

View File

@ -874,7 +874,7 @@ _meta_window_shared_new (MetaDisplay *display,
window->user_time_window = None; window->user_time_window = None;
window->take_focus = FALSE; window->take_focus = FALSE;
window->delete_window = FALSE; window->delete_window = FALSE;
window->net_wm_ping = FALSE; window->can_ping = FALSE;
window->input = TRUE; window->input = TRUE;
window->calc_placement = FALSE; window->calc_placement = FALSE;
window->shaken_loose = FALSE; window->shaken_loose = FALSE;
@ -1320,6 +1320,7 @@ meta_window_wayland_new (MetaDisplay *display,
WithdrawnState, WithdrawnState,
META_COMP_EFFECT_CREATE, META_COMP_EFFECT_CREATE,
&attrs); &attrs);
window->can_ping = TRUE;
meta_error_trap_pop (display); /* pop the XSync()-reducing trap */ meta_error_trap_pop (display); /* pop the XSync()-reducing trap */