aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r--src/FocusControl.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 9c82e3e..61d6e87 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -405,14 +405,20 @@ void FocusControl::revertFocus(BScreen &screen) {
405 // if setting focus fails, or isn't possible, fallback correctly 405 // if setting focus fails, or isn't possible, fallback correctly
406 if (!(next_focus && next_focus->focus())) { 406 if (!(next_focus && next_focus->focus())) {
407 setFocusedWindow(0); // so we don't get dangling m_focused_window pointer 407 setFocusedWindow(0); // so we don't get dangling m_focused_window pointer
408 switch (screen.focusControl().focusModel()) { 408 // if there's a menu open, focus it
409 case FocusControl::MOUSEFOCUS: 409 if (FbTk::Menu::shownMenu())
410 XSetInputFocus(screen.rootWindow().display(), 410 FbTk::Menu::shownMenu()->grabInputFocus();
411 PointerRoot, None, CurrentTime); 411 else {
412 break; 412 switch (screen.focusControl().focusModel()) {
413 case FocusControl::CLICKFOCUS: 413 case FocusControl::MOUSEFOCUS:
414 screen.rootWindow().setInputFocus(RevertToPointerRoot, CurrentTime); 414 XSetInputFocus(screen.rootWindow().display(),
415 break; 415 PointerRoot, None, CurrentTime);
416 break;
417 case FocusControl::CLICKFOCUS:
418 screen.rootWindow().setInputFocus(RevertToPointerRoot,
419 CurrentTime);
420 break;
421 }
416 } 422 }
417 } 423 }
418 424