From 2a71cab8c47cb1fa8730cf33a076888020631521 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 15 Apr 2002 22:14:06 +0000 Subject: [PATCH] reply immediately for windows that don't support _NET_WM_PING 2002-04-15 Havoc Pennington * src/display.c (meta_display_ping_window): reply immediately for windows that don't support _NET_WM_PING * src/window.c (update_protocols): check whether windows support _NET_WM_PING --- ChangeLog | 8 ++++++++ src/display.c | 8 ++++++++ src/window.c | 8 ++++++-- src/window.h | 3 ++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e37661e75..244581e11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-04-15 Havoc Pennington + + * src/display.c (meta_display_ping_window): reply immediately for + windows that don't support _NET_WM_PING + + * src/window.c (update_protocols): check whether windows + support _NET_WM_PING + 2002-04-13 Havoc Pennington * src/ui.c (get_cmap): same fix as libwnck, avoid using cmap diff --git a/src/display.c b/src/display.c index f8400d9ae..f1a9c646a 100644 --- a/src/display.c +++ b/src/display.c @@ -2450,6 +2450,14 @@ meta_display_ping_window (MetaDisplay *display, meta_warning ("Tried to ping a window with CurrentTime! Not allowed.\n"); return; } + + if (!window->net_wm_ping) + { + if (ping_reply_func) + (* ping_reply_func) (display, window->xwindow, user_data); + + return; + } ping_data = g_new (MetaPingData, 1); ping_data->display = display; diff --git a/src/window.c b/src/window.c index dc80b94bd..dd516e956 100644 --- a/src/window.c +++ b/src/window.c @@ -3760,6 +3760,7 @@ update_protocols (MetaWindow *window) window->take_focus = FALSE; window->delete_window = FALSE; + window->net_wm_ping = FALSE; meta_error_trap_push (window->display); @@ -3775,14 +3776,17 @@ update_protocols (MetaWindow *window) window->take_focus = TRUE; else if (protocols[i] == window->display->atom_wm_delete_window) window->delete_window = TRUE; + else if (protocols[i] == window->display->atom_net_wm_ping) + window->net_wm_ping = TRUE; ++i; } meta_XFree (protocols); } - meta_verbose ("Window %s has take_focus = %d delete_window = %d\n", - window->desc, window->take_focus, window->delete_window); + meta_verbose ("Window %s has take_focus = %d delete_window = %d net_wm_ping = %d\n", + window->desc, window->take_focus, window->delete_window, + window->net_wm_ping); return meta_error_trap_pop (window->display); } diff --git a/src/window.h b/src/window.h index 019a4af96..873d97ed5 100644 --- a/src/window.h +++ b/src/window.h @@ -119,9 +119,10 @@ struct _MetaWindow /* whether an initial workspace was explicitly set */ guint initial_workspace_set : 1; - /* These are the two flags from WM_PROTOCOLS */ + /* These are the flags from WM_PROTOCOLS */ guint take_focus : 1; guint delete_window : 1; + guint net_wm_ping : 1; /* Globally active / No input */ guint input : 1;