rename session.screen*.iconbar.deiconifyMode to session.screen0.userFollowModel
@@ -1,6 +1,20 @@
(Format: Year/Month/Day) Changes for 1.0rc3: *06/08/02: + * Rename session.screen*.iconbar.deiconifyMode to + session.screen*.userFollowModel (Mark) + This resource is used for: + - clicking a window on a different workspace in the iconbar + - _NET_ACTIVE_WINDOW messages where the source is a pager + - clicking a client in the workspace menu (and the opposite is used for + right clicks) + Possible values are: + - Follow: go to the workspace of the selected window + - Current: bring the window to the current workspace + - SemiFollow: act like Current for iconified windows, else Follow + - Ignore: leave it alone + Screen.cc/hh ScreenResources.cc/hh IconbarTool.cc/hh IconButton.cc Ewmh.cc + Workspace.cc * Update _NET_WORKAREA on screen dimension change (Mark) Screen.cc * Fix ClickTabFocus and MouseTabFocus in nls (Thanks Antonio Gomes)
@@ -766,23 +766,31 @@ if (winclient == 0)
return true; // ce.window = window to focus - winclient->focus(); 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) { + BScreen::FollowModel model = (ce.data.l[0] == 2) ? + fbwin->screen().getUserFollowModel() : + fbwin->screen().getFollowModel(); + if (model == BScreen::FOLLOW_ACTIVE_WINDOW) { fbwin->screen().changeWorkspaceID(fbwin->workspaceNumber()); - } else if (fbwin->screen().getFollowModel() == BScreen::FETCH_ACTIVE_WINDOW) { + } else if (model == BScreen::FETCH_ACTIVE_WINDOW) { fbwin->screen().sendToWorkspace(fbwin->screen().currentWorkspaceID(), fbwin); + } else if (model == BScreen::SEMIFOLLOW_ACTIVE_WINDOW) { + if (fbwin->isIconic()) + fbwin->screen().sendToWorkspace(fbwin->screen().currentWorkspaceID(), fbwin); + else + fbwin->screen().changeWorkspaceID(fbwin->workspaceNumber()); } // else we ignore it. my favourite mode :) } + fbwin->raise(); } + winclient->focus(); return true; } else if (ce.message_type == m_net_close_window) { if (winclient == 0)
@@ -77,21 +77,21 @@ // this needs to be a local variable, as this object could be destroyed
// if the workspace is changed. FluxboxWindow &win = m_win; if(win.isIconic() || !win.isFocused()) { - switch(m_tool.deiconifyMode()) { - case IconbarTool::SEMIFOLLOW: + switch(win.screen().getUserFollowModel()) { + case BScreen::SEMIFOLLOW_ACTIVE_WINDOW: if (win.isIconic()) { win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win); } else { win.screen().changeWorkspaceID(win.workspaceNumber()); } break; - case IconbarTool::CURRENT: + case BScreen::FETCH_ACTIVE_WINDOW: win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win); break; - case IconbarTool::FOLLOW: - default: + case BScreen::FOLLOW_ACTIVE_WINDOW: if (!win.isStuck()) win.screen().changeWorkspaceID(win.workspaceNumber()); + default: break; }; win.raiseAndFocus();
@@ -74,39 +74,6 @@ setDefaultValue();
} template<> -void FbTk::Resource<IconbarTool::DeiconifyMode>::setDefaultValue() { - m_value = IconbarTool::FOLLOW; -} - -template<> -void FbTk::Resource<IconbarTool::DeiconifyMode>::setFromString(const char* strval) { - if (strncasecmp(strval, "Current", strlen("Current")) == 0) - m_value = IconbarTool::CURRENT; - else if (strncasecmp(strval, "Follow", strlen("Follow")) == 0) - m_value = IconbarTool::FOLLOW; - else if (strncasecmp(strval, "SemiFollow", strlen("SemiFollow")) == 0) - m_value = IconbarTool::SEMIFOLLOW; - else - setDefaultValue(); -} - -template<> -std::string FbTk::Resource<IconbarTool::DeiconifyMode>::getString() const { - switch (m_value) { - case IconbarTool::SEMIFOLLOW: - return std::string("SemiFollow"); - break; - case IconbarTool::CURRENT: - return std::string("Current"); - break; - case IconbarTool::FOLLOW: - default: - return std::string("Follow"); - break; - }; -} - -template<> void FbTk::Resource<IconbarTool::WheelMode>::setDefaultValue() { m_value = IconbarTool::SCREEN; }@@ -373,9 +340,6 @@ m_unfocused_err_pm(0),
m_empty_pm(0), m_rc_mode(screen.resourceManager(), WORKSPACE, screen.name() + ".iconbar.mode", screen.altName() + ".Iconbar.Mode"), - m_deiconify_mode(screen.resourceManager(), FOLLOW, - screen.name() + ".iconbar.deiconifyMode", - screen.name() + ".iconbar.DeiconifyMode"), m_wheel_mode(screen.resourceManager(), OFF, screen.name() + ".iconbar.wheelMode", screen.name() + ".iconbar.WheelMode"),
@@ -56,13 +56,6 @@ WORKSPACE, ///< all windows and all icons on current workspace
ALLWINDOWS ///< all windows and all icons from all workspaces }; - /// deiconfiy mode for iconbuttons - enum DeiconifyMode { - CURRENT, ///< raise the window on the current workspace - FOLLOW, ///< raise the window on the workspace it was iconified from - SEMIFOLLOW, ///< like current for iconified windows, and like follow for others - }; - /// wheeling on iconbutton enum WheelMode { OFF, ///< no wheeling, default mode@@ -91,7 +84,6 @@ unsigned int height() const;
unsigned int borderWidth() const; Mode mode() const { return *m_rc_mode; } - DeiconifyMode deiconifyMode() const { return *m_deiconify_mode; } WheelMode wheelMode() const { return *m_wheel_mode; } void setOrientation(FbTk::Orientation orient);@@ -138,7 +130,6 @@
IconList m_icon_list; FbTk::Resource<Mode> m_rc_mode; - FbTk::Resource<DeiconifyMode> m_deiconify_mode; FbTk::Resource<WheelMode> m_wheel_mode; FbTk::Resource<Container::Alignment> m_rc_alignment; ///< alignment of buttons FbTk::Resource<int> m_rc_client_width; ///< size of client button in LEFT/RIGHT mode
@@ -262,6 +262,7 @@ resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"),
tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"), windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"), follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"), + user_follow_model(rm, FOLLOW_ACTIVE_WINDOW, scrname+".userFollowModel", altscrname+".UserFollowModel"), workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), focused_alpha(rm, 255, scrname+".window.focus.alpha", altscrname+".Window.Focus.Alpha"),
@@ -84,6 +84,7 @@ /// a window becomes active / focussed on a different workspace
enum FollowModel { IGNORE_OTHER_WORKSPACES = 0, ///< who cares? FOLLOW_ACTIVE_WINDOW, ///< go to that workspace + SEMIFOLLOW_ACTIVE_WINDOW, ///< fetch iconified windows, else follow FETCH_ACTIVE_WINDOW ///< put that window to the current workspace };@@ -136,6 +137,7 @@
ResizeModel getResizeModel() const { return *resource.resize_model; } inline FollowModel getFollowModel() const { return *resource.follow_model; } + inline FollowModel getUserFollowModel() const { return *resource.user_follow_model; } inline const std::string &getScrollAction() const { return *resource.scroll_action; } inline const bool getScrollReverse() const { return *resource.scroll_reverse; }@@ -441,7 +443,7 @@ FbTk::Resource<std::string> rootcommand;
FbTk::Resource<ResizeModel> resize_model; FbTk::Resource<FbWinFrame::TabPlacement> tab_placement; FbTk::Resource<std::string> windowmenufile; - FbTk::Resource<FollowModel> follow_model; + FbTk::Resource<FollowModel> follow_model, user_follow_model; bool ordered_dither; FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha, unfocused_alpha, menu_alpha, menu_delay, menu_delay_close, tab_width;
@@ -88,6 +88,9 @@ break;
case BScreen::FETCH_ACTIVE_WINDOW: return std::string("Current"); break; + case BScreen::SEMIFOLLOW_ACTIVE_WINDOW: + return std::string("SemiFollow"); + break; case BScreen::IGNORE_OTHER_WORKSPACES: default: return std::string("Ignore");@@ -105,6 +108,8 @@ else if (strcasecmp(strval, "Current") == 0 ||
strcasecmp(strval, "CurrentWorkspace") == 0 || strcasecmp(strval, "Fetch") == 0) m_value = BScreen::FETCH_ACTIVE_WINDOW; + else if (strcasecmp(strval, "SemiFollow") == 0) + m_value = BScreen::SEMIFOLLOW_ACTIVE_WINDOW; else setDefaultValue(); }
@@ -104,15 +104,22 @@ if (m_client.fbwindow() == 0)
return; FluxboxWindow &win = *m_client.fbwindow(); - // fetch the window to the current workspace - if (button == 2 && win.screen().currentWorkspaceID() != win.workspaceNumber()) { + if (win.screen().currentWorkspaceID() != win.workspaceNumber()) { win.menu().hide(); - win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win, true); - } else { // warp to the workspace of the window - win.screen().changeWorkspaceID(win.workspaceNumber()); - win.setCurrentClient(m_client); - win.raiseAndFocus(); + BScreen::FollowModel model = win.screen().getUserFollowModel(); + if (model == BScreen::IGNORE_OTHER_WORKSPACES) + return; + // fetch the window to the current workspace + else if ((button == 3) ^ (model == BScreen::FETCH_ACTIVE_WINDOW || + win.isIconic() && model == BScreen::SEMIFOLLOW_ACTIVE_WINDOW)) { + win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win, true); + return; + } + // warp to the workspace of the window + win.screen().changeWorkspaceID(win.workspaceNumber()); } + win.setCurrentClient(m_client); + win.raiseAndFocus(); } const std::string &label() const { return m_client.title(); }