aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-12-21 15:24:28 (GMT)
committerrathnor <rathnor>2003-12-21 15:24:28 (GMT)
commitdfdb8219fa74defd4608f3574128f95eb9fcde64 (patch)
tree02825d7e3375ebb94daf50015928669764c45cb7 /src
parent8192e8bc2a34d55adae71322362890bace43de72 (diff)
downloadfluxbox_pavel-dfdb8219fa74defd4608f3574128f95eb9fcde64.zip
fluxbox_pavel-dfdb8219fa74defd4608f3574128f95eb9fcde64.tar.bz2
more sloppy focus fixing
Diffstat (limited to 'src')
-rw-r--r--src/WinClient.cc6
-rw-r--r--src/Window.cc24
-rw-r--r--src/fluxbox.cc8
3 files changed, 23 insertions, 15 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index a3761f4..111e51d 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: WinClient.cc,v 1.35 2003/12/21 13:57:38 fluxgen Exp $ 22// $Id: WinClient.cc,v 1.36 2003/12/21 15:24:28 rathnor Exp $
23 23
24#include "WinClient.hh" 24#include "WinClient.hh"
25 25
@@ -118,8 +118,10 @@ WinClient::~WinClient() {
118 if (m_blackbox_hint != 0) 118 if (m_blackbox_hint != 0)
119 XFree(m_blackbox_hint); 119 XFree(m_blackbox_hint);
120 120
121 if (window()) 121 if (window()) {
122 fluxbox->removeWindowSearch(window()); 122 fluxbox->removeWindowSearch(window());
123 fluxbox->removeRedirectEvent(None, window());
124 }
123 125
124 m_win = 0; 126 m_win = 0;
125} 127}
diff --git a/src/Window.cc b/src/Window.cc
index edf88fc..4d407ad 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.254 2003/12/18 18:03:21 fluxgen Exp $ 25// $Id: Window.cc,v 1.255 2003/12/21 15:24:28 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -1190,23 +1190,27 @@ bool FluxboxWindow::setInputFocus(long ignore_event) {
1190 } 1190 }
1191 } 1191 }
1192 1192
1193 bool ret = false;
1194
1193 if (m_client->getFocusMode() == WinClient::F_LOCALLYACTIVE || 1195 if (m_client->getFocusMode() == WinClient::F_LOCALLYACTIVE ||
1194 m_client->getFocusMode() == WinClient::F_PASSIVE) { 1196 m_client->getFocusMode() == WinClient::F_PASSIVE) {
1195 m_client->setInputFocus(RevertToPointerRoot, CurrentTime); 1197 m_client->setInputFocus(RevertToPointerRoot, CurrentTime);
1196 1198
1197 // People can ignore an event until the focus comes through
1198 // this is most likely to be an EnterNotify for sloppy focus
1199 if (ignore_event)
1200 Fluxbox::instance()->addRedirectEvent(
1201 &screen(), ignore_event, None,
1202 FocusIn, m_client->window(), None);
1203
1204 // this may or may not send, but we've setInputFocus already, so return true 1199 // this may or may not send, but we've setInputFocus already, so return true
1205 m_client->sendFocus(); 1200 m_client->sendFocus();
1206 return true; 1201 ret = true;
1207 } else { 1202 } else {
1208 return m_client->sendFocus(); // checks if it should send or not 1203 ret = m_client->sendFocus(); // checks if it should send or not
1209 } 1204 }
1205
1206 // People can ignore an event until the focus comes through
1207 // this is most likely to be an EnterNotify for sloppy focus
1208 if (ret && m_client->getFocusMode() != WinClient::F_NOINPUT && ignore_event != None)
1209 Fluxbox::instance()->addRedirectEvent(
1210 &screen(), ignore_event, None,
1211 FocusIn, m_client->window(), None);
1212
1213 return ret;
1210} 1214}
1211 1215
1212void FluxboxWindow::hide() { 1216void FluxboxWindow::hide() {
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 3808893..3330c8c 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.211 2003/12/21 15:13:00 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.212 2003/12/21 15:24:28 rathnor Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -1946,7 +1946,8 @@ void Fluxbox::revertFocus(BScreen &screen, bool wait_for_end) {
1946 // when doFocusLast is set, we don't do exact sloppy focus - we 1946 // when doFocusLast is set, we don't do exact sloppy focus - we
1947 // go to the last focused window, rather than the pointer window 1947 // go to the last focused window, rather than the pointer window
1948 // i.e. we ignore any EnterNotify events until the focus sending arrives 1948 // i.e. we ignore any EnterNotify events until the focus sending arrives
1949 ignore_event = EnterNotify; 1949 if (screen.getFocusModel() != BScreen::CLICKTOFOCUS)
1950 ignore_event = EnterNotify;
1950 } 1951 }
1951 1952
1952 // if setting focus fails, or isn't possible, fallback correctly 1953 // if setting focus fails, or isn't possible, fallback correctly
@@ -2004,13 +2005,14 @@ void Fluxbox::addRedirectEvent(BScreen *screen,
2004} 2005}
2005 2006
2006// So that an object may remove the ignore on its own 2007// So that an object may remove the ignore on its own
2008// stop_type of None means remove all redirects for this window
2007void Fluxbox::removeRedirectEvent(long stop_type, Window stop_win) { 2009void Fluxbox::removeRedirectEvent(long stop_type, Window stop_win) {
2008 RedirectEvents::iterator it = m_redirect_events.begin(); 2010 RedirectEvents::iterator it = m_redirect_events.begin();
2009 RedirectEvents::iterator it_end = m_redirect_events.end(); 2011 RedirectEvents::iterator it_end = m_redirect_events.end();
2010 RedirectEvent *re = 0; 2012 RedirectEvent *re = 0;
2011 for (; it != it_end; ++it) { 2013 for (; it != it_end; ++it) {
2012 re = *it; 2014 re = *it;
2013 if (re->stop_type == re->stop_type && re->stop_win == stop_win) { 2015 if (re->stop_win == stop_win && (stop_type == None || stop_type == re->stop_type)) {
2014 m_redirect_events.erase(it); 2016 m_redirect_events.erase(it);
2015 delete re; 2017 delete re;
2016 return; 2018 return;