aboutsummaryrefslogtreecommitdiff
path: root/src/Window.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/Window.cc
parentd23eeeaa4e1ed5adb76d97eb47dd0b88b6dfed3f (diff)
downloadfluxbox_pavel-4d52797b955b8e38b9e49802981e69fb34a734bc.zip
fluxbox_pavel-4d52797b955b8e38b9e49802981e69fb34a734bc.tar.bz2
moved all focus handling to class FocusControl
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 27884a0..ef56e6e 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -40,6 +40,7 @@
40#include "Remember.hh" 40#include "Remember.hh"
41#include "MenuCreator.hh" 41#include "MenuCreator.hh"
42#include "StringUtil.hh" 42#include "StringUtil.hh"
43#include "FocusControl.hh"
43 44
44#include "FbTk/TextButton.hh" 45#include "FbTk/TextButton.hh"
45#include "FbTk/Compose.hh" 46#include "FbTk/Compose.hh"
@@ -775,7 +776,7 @@ bool FluxboxWindow::removeClient(WinClient &client) {
775 776
776 // if it is our active client, deal with it... 777 // if it is our active client, deal with it...
777 if (m_client == &client) { 778 if (m_client == &client) {
778 WinClient *next_client = screen().getLastFocusedWindow(*this, m_client); 779 WinClient *next_client = screen().focusControl().lastFocusedWindow(*this, m_client);
779 if (next_client != 0) 780 if (next_client != 0)
780 setCurrentClient(*next_client, false); 781 setCurrentClient(*next_client, false);
781 } 782 }
@@ -1540,7 +1541,7 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) {
1540 1541
1541 show(); 1542 show();
1542 1543
1543 if (was_iconic && screen().doFocusNew()) 1544 if (was_iconic && screen().focusControl().focusNew())
1544 setInputFocus(); 1545 setInputFocus();
1545 1546
1546 1547
@@ -2032,7 +2033,7 @@ void FluxboxWindow::setFocusFlag(bool focus) {
2032 // Record focus timestamp for window cycling enhancements 2033 // Record focus timestamp for window cycling enhancements
2033 if (focused) { 2034 if (focused) {
2034 gettimeofday(&m_last_focus_time, 0); 2035 gettimeofday(&m_last_focus_time, 0);
2035 screen().setFocusedWindow(*m_client); 2036 screen().focusControl().setScreenFocusedWindow(*m_client);
2036 } 2037 }
2037 2038
2038 installColormap(focus); 2039 installColormap(focus);
@@ -2040,7 +2041,7 @@ void FluxboxWindow::setFocusFlag(bool focus) {
2040 if (focus != frame().focused()) 2041 if (focus != frame().focused())
2041 frame().setFocus(focus); 2042 frame().setFocus(focus);
2042 2043
2043 if ((screen().isMouseFocus()) 2044 if ((screen().focusControl().isMouseFocus())
2044 && screen().doAutoRaise()) { 2045 && screen().doAutoRaise()) {
2045 if (focused) 2046 if (focused)
2046 m_timer.start(); 2047 m_timer.start();
@@ -2407,7 +2408,7 @@ void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) {
2407 2408
2408 setState(NormalState, false); 2409 setState(NormalState, false);
2409 2410
2410 if (client->isTransient() || screen().doFocusNew()) 2411 if (client->isTransient() || screen().focusControl().focusNew())
2411 setCurrentClient(*client, true); 2412 setCurrentClient(*client, true);
2412 else 2413 else
2413 setFocusFlag(false); 2414 setFocusFlag(false);
@@ -2644,7 +2645,7 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
2644 frame().buttonPressEvent(be); 2645 frame().buttonPressEvent(be);
2645 2646
2646 if (be.button == 1 || (be.button == 3 && be.state == Mod1Mask)) { 2647 if (be.button == 1 || (be.button == 3 && be.state == Mod1Mask)) {
2647 if ((! focused) && (! screen().isMouseFocus())) { //check focus 2648 if ((! focused) && (! screen().focusControl().isMouseFocus())) { //check focus
2648 setInputFocus(); 2649 setInputFocus();
2649 } 2650 }
2650 2651
@@ -2939,7 +2940,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2939 } 2940 }
2940 2941
2941 WinClient *client = 0; 2942 WinClient *client = 0;
2942 if (screen().isMouseTabFocus()) { 2943 if (screen().focusControl().isMouseTabFocus()) {
2943 // determine if we're in a label button (tab) 2944 // determine if we're in a label button (tab)
2944 Client2ButtonMap::iterator it = 2945 Client2ButtonMap::iterator it =
2945 find_if(m_labelbuttons.begin(), 2946 find_if(m_labelbuttons.begin(),
@@ -2956,7 +2957,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2956 ev.window == m_client->window() || 2957 ev.window == m_client->window() ||
2957 client) { 2958 client) {
2958 2959
2959 if (screen().isMouseFocus() && !isFocused()) { 2960 if (screen().focusControl().isMouseFocus() && !isFocused()) {
2960 2961
2961 // check that there aren't any subsequent leave notify events in the 2962 // check that there aren't any subsequent leave notify events in the
2962 // X event queue 2963 // X event queue
@@ -2972,7 +2973,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2972 } 2973 }
2973 } 2974 }
2974 2975
2975 if (screen().isMouseTabFocus() && client && client != m_client) { 2976 if (screen().focusControl().isMouseTabFocus() && client && client != m_client) {
2976 setCurrentClient(*client, isFocused()); 2977 setCurrentClient(*client, isFocused());
2977 } 2978 }
2978 2979