focus fixes
rathnor rathnor
3 files changed,
29 insertions(+),
24 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,6 +1,9 @@
(Format: Year/Month/Day) Changes for 0.9.6: *03/09/14: + * Focus fixes (Simon) + Hopefully fixes mysterious instances of focus not being set right. + Window.cc fluxbox.cc * More optimization to reduce flicker in titlebar Screen.cc, FbWinFrame.cc/hh, TextButton.hh/cc, FbWindow.hh/cc *03/09/13:
M
src/Window.cc
→
src/Window.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.228 2003/09/14 10:13:06 fluxgen Exp $ +// $Id: Window.cc,v 1.229 2003/09/14 11:23:47 rathnor Exp $ #include "Window.hh"@@ -806,19 +806,17 @@ if (numClients() <= 1)
return; ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), m_client); + WinClient *client = 0; if (it == m_clientlist.end()) { - m_client = m_clientlist.front(); - return; + client = m_clientlist.front(); + } else { + it++; + if (it == m_clientlist.end()) + client = m_clientlist.front(); + else + client = *it; } - - it++; - if (it == m_clientlist.end()) - m_client = m_clientlist.front(); - else - m_client = *it; - m_client->raise(); - frame().setLabelButtonFocus(*m_labelbuttons[m_client]); - frame().setFocus(setInputFocus()); + setCurrentClient(*client, true); } void FluxboxWindow::prevClient() {@@ -826,18 +824,17 @@ if (numClients() <= 1)
return; ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), m_client); + WinClient *client = 0; if (it == m_clientlist.end()) { - m_client = m_clientlist.front(); - return; + client = m_clientlist.front(); + } else { + if (it == m_clientlist.begin()) + client = m_clientlist.back(); + else + client = *(--it); } - if (it == m_clientlist.begin()) - m_client = m_clientlist.back(); - else - m_client = *(--it); - m_client->raise(); - frame().setLabelButtonFocus(*m_labelbuttons[m_client]); - frame().setFocus(setInputFocus()); + setCurrentClient(*client, true); }
M
src/fluxbox.cc
→
src/fluxbox.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.190 2003/09/12 22:55:33 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.191 2003/09/14 11:23:48 rathnor Exp $ #include "fluxbox.hh"@@ -852,7 +852,10 @@ ColormapInstalled) ? true : false);
} } break; case FocusIn: { - if (e->xfocus.mode == NotifyUngrab || + + // a grab is something of a pseudo-focus event, so we ignore + // them, here we ignore some window receiving it + if (e->xfocus.mode == NotifyGrab || e->xfocus.detail == NotifyPointer) break;@@ -862,7 +865,7 @@ setFocusedWindow(winclient);
} break; case FocusOut:{ - + // and here we ignore some window losing the special grab focus if (e->xfocus.mode == NotifyUngrab || e->xfocus.detail == NotifyPointer) break;@@ -871,6 +874,8 @@ if (winclient == 0 && FbTk::Menu::focused() == 0) {
#ifdef DEBUG cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"<<endl; #endif // DEBUG + } else if (winclient && winclient == m_focused_window) { + setFocusedWindow(0); } } break;