From 9a56a3cf1aba1a7a98b3bc8450c03a4a2a261933 Mon Sep 17 00:00:00 2001 From: akir Date: Sat, 16 Oct 2004 22:20:05 +0000 Subject: respect the users wish (followModel) to what happens if a window gets focus which is not on the current workspace --- src/Ewmh.cc | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index e5bf6b5..ce0afb5 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.51 2004/09/11 13:34:36 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.52 2004/10/16 22:20:05 akir Exp $ #include "Ewmh.hh" @@ -617,9 +617,22 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, // ce.window = window to focus winclient->focus(); - if (winclient->fbwindow()) - winclient->fbwindow()->raise(); - + if (winclient->fbwindow()) { + + FluxboxWindow* fbwin = winclient->fbwindow(); + fbwin->raise(); + + // if the raised window is on a different workspace + // we do what the user wish: + // either ignore|go to that workspace|get the window + if (fbwin->screen().currentWorkspaceID() != fbwin->workspaceNumber()) { + if (fbwin->screen().getFollowModel() == BScreen::FOLLOW_ACTIVE_WINDOW) { + fbwin->screen().changeWorkspaceID(fbwin->workspaceNumber()); + } else if (fbwin->screen().getFollowModel() == BScreen::FETCH_ACTIVE_WINDOW) { + fbwin->screen().sendToWorkspace(fbwin->screen().currentWorkspaceID(), fbwin); + } // else we ignore it. my favourite mode :) + } + } return true; } else if (ce.message_type == m_net_close_window) { if (winclient == 0) -- cgit v0.11.2