Grab Server when showing or switching desktop

Should reduce exposure events, notably since the
windows are not in stack order.
This commit is contained in:
Thomas Lübking 2016-08-11 14:51:07 +02:00 committed by Mathias Gumz
parent 9613d2cd83
commit f176c10881
2 changed files with 4 additions and 0 deletions

View file

@ -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);

View file

@ -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());
}