aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-06-19 15:45:41 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-06-26 14:35:16 (GMT)
commit1a61881ec34a5f3691df1159f63a4b5afb1f53c4 (patch)
tree8ab844e8790c75a0e9dcc2ea44143dea47649758 /src/FocusControl.cc
parent69b0f0fa97f53f601a250dc1b5a6876f64796a91 (diff)
downloadfluxbox-1a61881ec34a5f3691df1159f63a4b5afb1f53c4.zip
fluxbox-1a61881ec34a5f3691df1159f63a4b5afb1f53c4.tar.bz2
Add FocusProtection features
The apps file gets a new key FocusProtection supporting a comma separated list. * None : regular behavior * Lock : If this window has the focus, no other may claim it * Deny : This window is not allowed to focus itself I addition there's preparation for a follow-up patch to incorporate and substitute the present FocusNewWindow feature: * Gain : Pass focus to new window * Refuse : Do not pass focus to new window rationale: clients stealing the focus sucks badly and while there's an input driven timeout, that only protects actual typing flow, but if eg. vlc proceeds on the playlist, you'll suddenly control vlc instead of your browser (ie. typing ctrl+w doesn't close the tab, but the playlist ...)
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r--src/FocusControl.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 3be7937..f59b5ff 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -588,6 +588,13 @@ void FocusControl::setFocusedWindow(WinClient *client) {
588 } 588 }
589 } 589 }
590 590
591 if (client != expectingFocus() && s_focused_window &&
592 ((s_focused_fbwindow->focusProtection() & Focus::Lock) ||
593 (client && client->fbwindow() && (client->fbwindow()->focusProtection() & Focus::Deny)))) {
594 s_focused_window->focus();
595 return;
596 }
597
591 BScreen *old_screen = 598 BScreen *old_screen =
592 FocusControl::focusedWindow() ? 599 FocusControl::focusedWindow() ?
593 &FocusControl::focusedWindow()->screen() : 0; 600 &FocusControl::focusedWindow()->screen() : 0;