From f176c108819be611371cf740663dec4f6352c8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 11 Aug 2016 14:51:07 +0200 Subject: Grab Server when showing or switching desktop Should reduce exposure events, notably since the windows are not in stack order. --- src/Screen.cc | 2 ++ src/WorkspaceCmd.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Screen.cc b/src/Screen.cc index 83a864b..013b6c6 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -953,6 +953,7 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) { this->focusControl().ignoreAtPointer(); FbTk::App::instance()->sync(false); + XGrabServer(Fluxbox::instance()->display()); FluxboxWindow *focused = FocusControl::focusedFbWindow(); @@ -990,6 +991,7 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) { old->hideAll(false); + XUngrabServer(Fluxbox::instance()->display()); FbTk::App::instance()->sync(false); m_currentworkspace_sig.emit(*this); diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index a642008..6422c3f 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -602,6 +602,7 @@ void ShowDesktopCmd::execute() { it_end = wins.end(); unsigned int space = screen->currentWorkspaceID(); unsigned int count = 0; + XGrabServer(Fluxbox::instance()->display()); for (; it != it_end; ++it) { if (!(*it)->fbwindow()->isIconic() && ((*it)->fbwindow()->isStuck() || (*it)->fbwindow()->workspaceNumber() == space) && @@ -621,6 +622,7 @@ void ShowDesktopCmd::execute() { } } else FocusControl::revertFocus(*screen); + XUngrabServer(Fluxbox::instance()->display()); } -- cgit v0.11.2