[mutter] x11: Remove benign warning for older X clients



commit e9cc220c8e0fd6843d2e775d981d1b73322f2c30
Author: Mark Blakeney <mark blakeney bullet-systems net>
Date:   Thu Jul 4 10:50:44 2019 +1000

    x11: Remove benign warning for older X clients
    
    The default configuration of libinput-gestures utility invokes wmctrl to
    switch between desktops. It uses wmctrl because this works on both Xorg
    and Wayland (via XWayland). Unfortunately, this generates the following
    warning message every time, in both Xorg and Wayland desktops:
    
    "Received a NET_CURRENT_DESKTOP message from a broken (outdated) client
    who sent a 0 timestamp"
    
    The desktop switch still works fine. The tiny code change here removes
    this specific warning because, as the prefacing code comment originally
    said and still says, older clients can validly pass a 0 time value so
    why complain about that?
    
    I also refactored the "if (workspace)" code slightly to avoid the double
    test of the workspace value.
    
    This is submitted for MR
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/671.

 src/x11/events.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/src/x11/events.c b/src/x11/events.c
index 02c8509dc..cc4bde684 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -1580,19 +1580,18 @@ handle_other_xevent (MetaX11Display *x11_display,
 
                   workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, space);
 
-                  /* Handle clients using the older version of the spec... */
-                  if (time == 0 && workspace)
+                  if (workspace)
                     {
-                      meta_warning ("Received a NET_CURRENT_DESKTOP message "
-                                    "from a broken (outdated) client who sent "
-                                    "a 0 timestamp\n");
-                      time = meta_x11_display_get_current_time_roundtrip (x11_display);
-                    }
+                      /* Handle clients using the older version of the spec... */
+                      if (time == 0)
+                        time = meta_x11_display_get_current_time_roundtrip (x11_display);
 
-                  if (workspace)
-                    meta_workspace_activate (workspace, time);
+                      meta_workspace_activate (workspace, time);
+                    }
                   else
-                    meta_verbose ("Don't know about workspace %d\n", space);
+                    {
+                      meta_verbose ("Don't know about workspace %d\n", space);
+                    }
                 }
               else if (event->xclient.message_type ==
                        x11_display->atom__NET_NUMBER_OF_DESKTOPS)


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