aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-08-11 12:51:07 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-08-26 06:34:00 (GMT)
commitf176c108819be611371cf740663dec4f6352c8e8 (patch)
tree2b966d846055037bf40b4b0f8f2fdc0571a77e8d
parent9613d2cd83ce8a38f532246e432e01eec062bc13 (diff)
downloadfluxbox-f176c108819be611371cf740663dec4f6352c8e8.zip
fluxbox-f176c108819be611371cf740663dec4f6352c8e8.tar.bz2
Grab Server when showing or switching desktop
Should reduce exposure events, notably since the windows are not in stack order.
-rw-r--r--src/Screen.cc2
-rw-r--r--src/WorkspaceCmd.cc2
2 files changed, 4 insertions, 0 deletions
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) {
953 this->focusControl().ignoreAtPointer(); 953 this->focusControl().ignoreAtPointer();
954 954
955 FbTk::App::instance()->sync(false); 955 FbTk::App::instance()->sync(false);
956 XGrabServer(Fluxbox::instance()->display());
956 957
957 FluxboxWindow *focused = FocusControl::focusedFbWindow(); 958 FluxboxWindow *focused = FocusControl::focusedFbWindow();
958 959
@@ -990,6 +991,7 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
990 991
991 old->hideAll(false); 992 old->hideAll(false);
992 993
994 XUngrabServer(Fluxbox::instance()->display());
993 FbTk::App::instance()->sync(false); 995 FbTk::App::instance()->sync(false);
994 996
995 m_currentworkspace_sig.emit(*this); 997 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() {
602 it_end = wins.end(); 602 it_end = wins.end();
603 unsigned int space = screen->currentWorkspaceID(); 603 unsigned int space = screen->currentWorkspaceID();
604 unsigned int count = 0; 604 unsigned int count = 0;
605 XGrabServer(Fluxbox::instance()->display());
605 for (; it != it_end; ++it) { 606 for (; it != it_end; ++it) {
606 if (!(*it)->fbwindow()->isIconic() && ((*it)->fbwindow()->isStuck() || 607 if (!(*it)->fbwindow()->isIconic() && ((*it)->fbwindow()->isStuck() ||
607 (*it)->fbwindow()->workspaceNumber() == space) && 608 (*it)->fbwindow()->workspaceNumber() == space) &&
@@ -621,6 +622,7 @@ void ShowDesktopCmd::execute() {
621 } 622 }
622 } else 623 } else
623 FocusControl::revertFocus(*screen); 624 FocusControl::revertFocus(*screen);
625 XUngrabServer(Fluxbox::instance()->display());
624 626
625} 627}
626 628