From eb3c640069b220dae259aefab6739859ac10d7a6 Mon Sep 17 00:00:00 2001 From: Marco Wang Date: Mon, 11 Feb 2019 14:22:19 +0800 Subject: [PATCH] wm: added support for switching workspaces with client message --- src/wm.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wm.cpp b/src/wm.cpp index c1476d6..f48fd4b 100644 --- a/src/wm.cpp +++ b/src/wm.cpp @@ -399,7 +399,11 @@ void WindowManager::OnMotionNotify(const XButtonEvent& e) { } void WindowManager::OnClientMessage(const XClientMessageEvent& e) { - + if (e.message_type == prop_->net[atom::NET_CURRENT_DESKTOP]) { + if (e.data.l[0] >= 0 && e.data.l[0] < WORKSPACE_COUNT) { + GotoWorkspace(e.data.l[0]); + } + } } int WindowManager::OnXError(Display* dpy, XErrorEvent* e) {