aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2006-02-18 11:39:38 (GMT)
committerfluxgen <fluxgen>2006-02-18 11:39:38 (GMT)
commit4d52797b955b8e38b9e49802981e69fb34a734bc (patch)
treed541712bb9720c47fa58fda7476528649c32fbca /src/fluxbox.cc
parentd23eeeaa4e1ed5adb76d97eb47dd0b88b6dfed3f (diff)
downloadfluxbox-4d52797b955b8e38b9e49802981e69fb34a734bc.zip
fluxbox-4d52797b955b8e38b9e49802981e69fb34a734bc.tar.bz2
moved all focus handling to class FocusControl
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index e69b519..cc9bbb2 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -34,6 +34,8 @@
34#include "WinClient.hh" 34#include "WinClient.hh"
35#include "Keys.hh" 35#include "Keys.hh"
36#include "FbAtoms.hh" 36#include "FbAtoms.hh"
37#include "FocusControl.hh"
38
37#include "defaults.hh" 39#include "defaults.hh"
38 40
39#include "FbTk/I18n.hh" 41#include "FbTk/I18n.hh"
@@ -1050,9 +1052,9 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) {
1050 1052
1051 if (screen) { 1053 if (screen) {
1052 if (! ce.data.l[0]) 1054 if (! ce.data.l[0])
1053 screen->prevFocus(); 1055 screen->focusControl().prevFocus();
1054 else 1056 else
1055 screen->nextFocus(); 1057 screen->focusControl().nextFocus();
1056 } 1058 }
1057 } else if (ce.message_type == m_fbatoms->getFluxboxChangeAttributesAtom()) { 1059 } else if (ce.message_type == m_fbatoms->getFluxboxChangeAttributesAtom()) {
1058 WinClient *winclient = searchWindow(ce.window); 1060 WinClient *winclient = searchWindow(ce.window);
@@ -1887,18 +1889,18 @@ void Fluxbox::revertFocus(BScreen &screen) {
1887 // Relevant resources: 1889 // Relevant resources:
1888 // resource.focus_last = whether we focus last focused when changing workspace 1890 // resource.focus_last = whether we focus last focused when changing workspace
1889 // BScreen::FocusModel = sloppy, click, whatever 1891 // BScreen::FocusModel = sloppy, click, whatever
1890 WinClient *next_focus = screen.getLastFocusedWindow(screen.currentWorkspaceID()); 1892 WinClient *next_focus = screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID());
1891 1893
1892 // if setting focus fails, or isn't possible, fallback correctly 1894 // if setting focus fails, or isn't possible, fallback correctly
1893 if (!(next_focus && next_focus->fbwindow() && 1895 if (!(next_focus && next_focus->fbwindow() &&
1894 next_focus->fbwindow()->setCurrentClient(*next_focus, true))) { 1896 next_focus->fbwindow()->setCurrentClient(*next_focus, true))) {
1895 setFocusedWindow(0); // so we don't get dangling m_focused_window pointer 1897 setFocusedWindow(0); // so we don't get dangling m_focused_window pointer
1896 switch (screen.getFocusModel()) { 1898 switch (screen.focusControl().focusModel()) {
1897 case BScreen::MOUSEFOCUS: 1899 case FocusControl::MOUSEFOCUS:
1898 XSetInputFocus(FbTk::App::instance()->display(), 1900 XSetInputFocus(FbTk::App::instance()->display(),
1899 PointerRoot, None, CurrentTime); 1901 PointerRoot, None, CurrentTime);
1900 break; 1902 break;
1901 case BScreen::CLICKFOCUS: 1903 case FocusControl::CLICKFOCUS:
1902 screen.rootWindow().setInputFocus(RevertToPointerRoot, CurrentTime); 1904 screen.rootWindow().setInputFocus(RevertToPointerRoot, CurrentTime);
1903 break; 1905 break;
1904 } 1906 }
@@ -1942,7 +1944,7 @@ void Fluxbox::unfocusWindow(WinClient &client, bool full_revert, bool unfocus_fr
1942 BScreen &screen = fbwin->screen(); 1944 BScreen &screen = fbwin->screen();
1943 1945
1944 if (!unfocus_frame) { 1946 if (!unfocus_frame) {
1945 WinClient *last_focus = screen.getLastFocusedWindow(*fbwin, &client); 1947 WinClient *last_focus = screen.focusControl().lastFocusedWindow(*fbwin, &client);
1946 if (last_focus != 0 && 1948 if (last_focus != 0 &&
1947 fbwin->setCurrentClient(*last_focus, m_focused_window == &client)) { 1949 fbwin->setCurrentClient(*last_focus, m_focused_window == &client)) {
1948 return; 1950 return;