From e9cc220c8e0fd6843d2e775d981d1b73322f2c30 Mon Sep 17 00:00:00 2001 From: Mark Blakeney Date: Thu, 4 Jul 2019 10:50:44 +1000 Subject: [PATCH] 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 | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 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) - { - 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); - } - if (workspace) - meta_workspace_activate (workspace, time); + { + /* Handle clients using the older version of the spec... */ + if (time == 0) + time = meta_x11_display_get_current_time_roundtrip (x11_display); + + 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)