[mutter/wayland] window: Enable pinging on Wayland windows



commit e62fe956fdd450fed6d39fef443958cc57133cd5
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Feb 18 20:28:23 2014 -0500

    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.

 src/core/display.c        |    2 +-
 src/core/window-private.h |    2 +-
 src/core/window-props.c   |    4 ++--
 src/core/window.c         |    3 ++-
 4 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 34c66ef..749938f 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -4980,7 +4980,7 @@ meta_display_ping_window (MetaWindow        *window,
       return;
     }
 
-  if (!window->net_wm_ping)
+  if (!window->can_ping)
     {
       if (ping_reply_func)
         (* ping_reply_func) (window, timestamp, user_data);
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 92c7bf6..f931eac 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -238,7 +238,7 @@ struct _MetaWindow
   /* These are the flags from WM_PROTOCOLS */
   guint take_focus : 1;
   guint delete_window : 1;
-  guint net_wm_ping : 1;
+  guint can_ping : 1;
   /* Globally active / No input */
   guint input : 1;
   
diff --git a/src/core/window-props.c b/src/core/window-props.c
index eabdcfa..cb6e381 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -1407,7 +1407,7 @@ reload_wm_protocols (MetaWindow    *window,
   
   window->take_focus = FALSE;
   window->delete_window = FALSE;
-  window->net_wm_ping = FALSE;
+  window->can_ping = FALSE;
   
   if (value->type == META_PROP_VALUE_INVALID)    
     return;
@@ -1423,7 +1423,7 @@ reload_wm_protocols (MetaWindow    *window,
         window->delete_window = TRUE;
       else if (value->v.atom_list.atoms[i] ==
                window->display->atom__NET_WM_PING)
-        window->net_wm_ping = TRUE;
+        window->can_ping = TRUE;
       ++i;
     }
   
diff --git a/src/core/window.c b/src/core/window.c
index 79b7cb3..5c57d3c 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -874,7 +874,7 @@ _meta_window_shared_new (MetaDisplay         *display,
   window->user_time_window = None;
   window->take_focus = FALSE;
   window->delete_window = FALSE;
-  window->net_wm_ping = FALSE;
+  window->can_ping = FALSE;
   window->input = TRUE;
   window->calc_placement = FALSE;
   window->shaken_loose = FALSE;
@@ -1320,6 +1320,7 @@ meta_window_wayland_new (MetaDisplay        *display,
                                     WithdrawnState,
                                     META_COMP_EFFECT_CREATE,
                                     &attrs);
+  window->can_ping = TRUE;
 
   meta_error_trap_pop (display); /* pop the XSync()-reducing trap */
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]