From 9eecd58bf30c8b1c0d72b9070bf91e2c60f32fa5 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Fri, 6 Jul 2012 19:30:39 -0700 Subject: make alt-tab skip modal windows --- src/FocusControl.cc | 2 +- src/Focusable.hh | 4 +++- src/Window.cc | 4 ++++ src/Window.hh | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/FocusControl.cc b/src/FocusControl.cc index 5bf113f..383de61 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -53,7 +53,7 @@ namespace { bool doSkipWindow(const Focusable &win, const ClientPattern *pat) { const FluxboxWindow *fbwin = win.fbwindow(); - if (!fbwin || fbwin->isFocusHidden()) + if (!fbwin || fbwin->isFocusHidden() || fbwin->isModal()) return true; // skip if no fbwindow or if focushidden if (pat && !pat->match(win)) return true; // skip if it doesn't match the pattern diff --git a/src/Focusable.hh b/src/Focusable.hh index 679e00b..fd0705b 100644 --- a/src/Focusable.hh +++ b/src/Focusable.hh @@ -54,8 +54,10 @@ public: /// @return true if the focusable has input focus virtual bool isFocused() const { return m_focused; } - /// @return return true if it can be focused + /// @return true if it can be focused virtual bool acceptsFocus() const { return true; } + /// @return true if temporarily prevented from being focused + virtual bool isModal() const { return false; } /// @return true if icon button should appear focused bool getAttentionState() const { return m_attention_state; } diff --git a/src/Window.cc b/src/Window.cc index f5a2fe2..3c8f87b 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3306,6 +3306,10 @@ bool FluxboxWindow::acceptsFocus() const { return (m_client ? m_client->acceptsFocus() : false); } +bool FluxboxWindow::isModal() const { + return (m_client ? m_client->isModal() : true); +} + const FbTk::PixmapWithMask &FluxboxWindow::icon() const { return (m_client ? m_client->icon() : m_icon); } diff --git a/src/Window.hh b/src/Window.hh index 0d2cadd..8c97c7b 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -414,6 +414,7 @@ public: FbTk::FbWindow &parent() { return m_parent; } bool acceptsFocus() const; + bool isModal() const; const FbTk::PixmapWithMask &icon() const; const FbTk::BiDiString &title() const; const FbTk::FbString &getWMClassName() const; -- cgit v0.11.2