summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathias <mathias>2005-07-20 18:29:01 (GMT)
committermathias <mathias>2005-07-20 18:29:01 (GMT)
commit460dffdcc1f2de5463225feedd7d02f6f27958c2 (patch)
tree2e76bc31a08544a423e018c94ac9b06f7965684e /src
parent3e16ad8cf8be40a1868b6c133649d6549a755761 (diff)
downloadfluxbox_lack-460dffdcc1f2de5463225feedd7d02f6f27958c2.zip
fluxbox_lack-460dffdcc1f2de5463225feedd7d02f6f27958c2.tar.bz2
Changed some *Focus options, just to make some things a bit more clear.
the "Sloppy" was always a bit .. unprecise. removed SloppyFocus, SemiSloppyFocus and ClickToFocus options added MouseFocus, ClickFocus, MouseTabFocus, ClickTabFocus - MouseFocus - change the focus to the window under the mouse (almost similar to the 'old' SloppyFocus) - ClickFocus - change the focus to the window the user clicks - MouseTabFocus - change active tabclient to the one under the mouse in titlebar, does NOT change the focus - ClickTabFocus - change active tabclient when clicked onto a tabbutton to achieve former SemiSloppyFocus behavior one needs MouseFocus and ClickTabFocus
Diffstat (limited to 'src')
-rw-r--r--src/FocusModelMenuItem.hh20
-rw-r--r--src/Screen.cc20
-rw-r--r--src/Screen.hh100
-rw-r--r--src/ScreenResources.cc49
-rw-r--r--src/Window.cc28
-rw-r--r--src/fluxbox.cc5
6 files changed, 131 insertions, 91 deletions
diff --git a/src/FocusModelMenuItem.hh b/src/FocusModelMenuItem.hh
index a48d0b4..3c7dd89 100644
--- a/src/FocusModelMenuItem.hh
+++ b/src/FocusModelMenuItem.hh
@@ -50,4 +50,24 @@ private:
50 BScreen::FocusModel m_focusmodel; 50 BScreen::FocusModel m_focusmodel;
51}; 51};
52 52
53class TabFocusModelMenuItem : public FbTk::MenuItem {
54public:
55 TabFocusModelMenuItem(const char *label, BScreen &screen,
56 BScreen::TabFocusModel model,
57 FbTk::RefCount<FbTk::Command> &cmd):
58 FbTk::MenuItem(label, cmd), m_screen(screen), m_tabfocusmodel(model) {
59 }
60 bool isEnabled() const { return m_screen.getTabFocusModel() != m_tabfocusmodel; }
61
62 void click(int button, int time) {
63 m_screen.saveTabFocusModel(m_tabfocusmodel);
64 FbTk::MenuItem::click(button, time);
65 }
66
67private:
68 BScreen &m_screen;
69 BScreen::TabFocusModel m_tabfocusmodel;
70};
71
72
53#endif // FOCUSMODELMENUITEM_HH 73#endif // FOCUSMODELMENUITEM_HH
diff --git a/src/Screen.cc b/src/Screen.cc
index 3df9266..6d30cef 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -176,7 +176,8 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
176 rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), 176 rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
177 resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"), 177 resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"),
178 windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"), 178 windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"),
179 focus_model(rm, CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), 179 focus_model(rm, CLICKFOCUS, scrname+".focusModel", altscrname+".FocusModel"),
180 tabfocus_model(rm, CLICKTABFOCUS, scrname+".tabFocusModel", altscrname+".TabFocusModel"),
180 follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"), 181 follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"),
181 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), 182 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
182 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), 183 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
@@ -1771,15 +1772,16 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1771 1772
1772#define _FOCUSITEM(a, b, c, d, e) focus_menu->insert(new FocusModelMenuItem(_FBTEXT(a, b, c, d), *this, e, save_and_reconfigure)) 1773#define _FOCUSITEM(a, b, c, d, e) focus_menu->insert(new FocusModelMenuItem(_FBTEXT(a, b, c, d), *this, e, save_and_reconfigure))
1773 1774
1774 _FOCUSITEM(Configmenu, ClickToFocus, 1775 _FOCUSITEM(Configmenu, ClickFocus,
1775 "Click To Focus", "Click to focus", 1776 "Click To Focus", "Click to focus",
1776 CLICKTOFOCUS); 1777 CLICKFOCUS);
1777 _FOCUSITEM(Configmenu, SloppyFocus, 1778 _FOCUSITEM(Configmenu, MouseFocus,
1778 "Sloppy Focus", "Sloppy Focus", 1779 "Mouse Focus", "Mouse Focus",
1779 SLOPPYFOCUS); 1780 MOUSEFOCUS);
1780 _FOCUSITEM(Configmenu, SemiSloppyFocus, 1781
1781 "Semi Sloppy Focus", "Semi Sloppy Focus", 1782 focus_menu->insert(new TabFocusModelMenuItem("ClickTabFocus", *this, CLICKTABFOCUS, save_and_reconfigure));
1782 SEMISLOPPYFOCUS); 1783 focus_menu->insert(new TabFocusModelMenuItem("MouseTabFocus", *this, MOUSETABFOCUS, save_and_reconfigure));
1784
1783#undef _FOCUSITEM 1785#undef _FOCUSITEM
1784 1786
1785 focus_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu, 1787 focus_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu,
diff --git a/src/Screen.hh b/src/Screen.hh
index d5de5bc..3316fab 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -78,7 +78,8 @@ class Subject;
78class BScreen : public FbTk::Observer, private FbTk::NotCopyable { 78class BScreen : public FbTk::Observer, private FbTk::NotCopyable {
79public: 79public:
80 enum ResizeModel { BOTTOMRESIZE = 0, QUADRANTRESIZE, DEFAULTRESIZE = BOTTOMRESIZE }; 80 enum ResizeModel { BOTTOMRESIZE = 0, QUADRANTRESIZE, DEFAULTRESIZE = BOTTOMRESIZE };
81 enum FocusModel { SLOPPYFOCUS = 0, SEMISLOPPYFOCUS, CLICKTOFOCUS }; 81 enum FocusModel { MOUSEFOCUS = 0, CLICKFOCUS };
82 enum TabFocusModel { MOUSETABFOCUS = 0, CLICKTABFOCUS };
82 enum FollowModel { ///< a window becomes active / focussed on a different workspace 83 enum FollowModel { ///< a window becomes active / focussed on a different workspace
83 IGNORE_OTHER_WORKSPACES = 0, ///< who cares? 84 IGNORE_OTHER_WORKSPACES = 0, ///< who cares?
84 FOLLOW_ACTIVE_WINDOW, ///< go to that workspace 85 FOLLOW_ACTIVE_WINDOW, ///< go to that workspace
@@ -106,24 +107,24 @@ public:
106 107
107 void initWindows(); 108 void initWindows();
108 void initMenus(); 109 void initMenus();
109 inline bool isSloppyFocus() const { return (*resource.focus_model == SLOPPYFOCUS); } 110 bool isMouseFocus() const { return (*resource.focus_model == MOUSEFOCUS); }
110 inline bool isSemiSloppyFocus() const { return (*resource.focus_model == SEMISLOPPYFOCUS); } 111 bool isMouseTabFocus() const { return (*resource.tabfocus_model == MOUSETABFOCUS); }
111 inline bool isRootColormapInstalled() const { return root_colormap_installed; } 112 bool isRootColormapInstalled() const { return root_colormap_installed; }
112 inline bool isScreenManaged() const { return managed; } 113 bool isScreenManaged() const { return managed; }
113 inline bool isSloppyWindowGrouping() const { return *resource.sloppy_window_grouping; } 114 bool isSloppyWindowGrouping() const { return *resource.sloppy_window_grouping; }
114 inline bool isWorkspaceWarping() const { return *resource.workspace_warping; } 115 bool isWorkspaceWarping() const { return *resource.workspace_warping; }
115 inline bool isDesktopWheeling() const { return *resource.desktop_wheeling; } 116 bool isDesktopWheeling() const { return *resource.desktop_wheeling; }
116 inline bool doAutoRaise() const { return *resource.auto_raise; } 117 bool doAutoRaise() const { return *resource.auto_raise; }
117 inline bool clickRaises() const { return *resource.click_raises; } 118 bool clickRaises() const { return *resource.click_raises; }
118 inline bool doOpaqueMove() const { return *resource.opaque_move; } 119 bool doOpaqueMove() const { return *resource.opaque_move; }
119 inline bool doFullMax() const { return *resource.full_max; } 120 bool doFullMax() const { return *resource.full_max; }
120 inline bool doFocusNew() const { return *resource.focus_new; } 121 bool doFocusNew() const { return *resource.focus_new; }
121 inline bool doFocusLast() const { return *resource.focus_last; } 122 bool doFocusLast() const { return *resource.focus_last; }
122 inline bool doShowWindowPos() const { return *resource.show_window_pos; } 123 bool doShowWindowPos() const { return *resource.show_window_pos; }
123 inline bool antialias() const { return *resource.antialias; } 124 bool antialias() const { return *resource.antialias; }
124 inline bool decorateTransient() const { return *resource.decorate_transient; } 125 bool decorateTransient() const { return *resource.decorate_transient; }
125 inline const std::string &windowMenuFilename() const { return *resource.windowmenufile; } 126 const std::string &windowMenuFilename() const { return *resource.windowmenufile; }
126 inline FbTk::ImageControl &imageControl() { return *m_image_control.get(); } 127 FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
127 // menus 128 // menus
128 const FbTk::Menu &rootMenu() const { return *m_rootmenu.get(); } 129 const FbTk::Menu &rootMenu() const { return *m_rootmenu.get(); }
129 FbTk::Menu &rootMenu() { return *m_rootmenu.get(); } 130 FbTk::Menu &rootMenu() { return *m_rootmenu.get(); }
@@ -134,8 +135,10 @@ public:
134 ExtraMenus &extraWindowMenus() { return m_extramenus; } 135 ExtraMenus &extraWindowMenus() { return m_extramenus; }
135 const ExtraMenus &extraWindowMenus() const { return m_extramenus; } 136 const ExtraMenus &extraWindowMenus() const { return m_extramenus; }
136 137
137 inline ResizeModel getResizeModel() const { return *resource.resize_model; } 138 ResizeModel getResizeModel() const { return *resource.resize_model; }
138 inline FocusModel getFocusModel() const { return *resource.focus_model; } 139 FocusModel getFocusModel() const { return *resource.focus_model; }
140 TabFocusModel getTabFocusModel() const { return *resource.tabfocus_model; }
141
139 inline FollowModel getFollowModel() const { return *resource.follow_model; } 142 inline FollowModel getFollowModel() const { return *resource.follow_model; }
140 143
141 inline Slit *slit() { return m_slit.get(); } 144 inline Slit *slit() { return m_slit.get(); }
@@ -217,38 +220,40 @@ public:
217 inline RowDirection getRowPlacementDirection() const { return *resource.row_direction; } 220 inline RowDirection getRowPlacementDirection() const { return *resource.row_direction; }
218 inline ColumnDirection getColPlacementDirection() const { return *resource.col_direction; } 221 inline ColumnDirection getColPlacementDirection() const { return *resource.col_direction; }
219 222
220 inline void setRootColormapInstalled(bool r) { root_colormap_installed = r; } 223 void setRootColormapInstalled(bool r) { root_colormap_installed = r; }
221 inline void saveRootCommand(std::string rootcmd) { *resource.rootcommand = rootcmd; } 224 void saveRootCommand(std::string rootcmd) { *resource.rootcommand = rootcmd; }
222 inline void saveFocusModel(FocusModel model) { resource.focus_model = model; } 225 void saveFocusModel(FocusModel model) { resource.focus_model = model; }
223 inline void saveWorkspaces(int w) { *resource.workspaces = w; } 226 void saveTabFocusModel(TabFocusModel model) { resource.tabfocus_model = model; }
227
228 void saveWorkspaces(int w) { *resource.workspaces = w; }
224 229
225 void saveMenu(FbTk::Menu &menu) { m_rootmenu_list.push_back(&menu); } 230 void saveMenu(FbTk::Menu &menu) { m_rootmenu_list.push_back(&menu); }
226 231
227 inline FbWinFrameTheme &winFrameTheme() { return *m_windowtheme.get(); } 232 FbWinFrameTheme &winFrameTheme() { return *m_windowtheme.get(); }
228 inline const FbWinFrameTheme &winFrameTheme() const { return *m_windowtheme.get(); } 233 const FbWinFrameTheme &winFrameTheme() const { return *m_windowtheme.get(); }
229 inline MenuTheme &menuTheme() { return *m_menutheme.get(); } 234 MenuTheme &menuTheme() { return *m_menutheme.get(); }
230 inline const MenuTheme &menuTheme() const { return *m_menutheme.get(); } 235 const MenuTheme &menuTheme() const { return *m_menutheme.get(); }
231 inline const RootTheme &rootTheme() const { return *m_root_theme.get(); } 236 const RootTheme &rootTheme() const { return *m_root_theme.get(); }
232 inline WinButtonTheme &winButtonTheme() { return *m_winbutton_theme.get(); } 237 WinButtonTheme &winButtonTheme() { return *m_winbutton_theme.get(); }
233 inline const WinButtonTheme &winButtonTheme() const { return *m_winbutton_theme.get(); } 238 const WinButtonTheme &winButtonTheme() const { return *m_winbutton_theme.get(); }
234 239
235 inline FbRootWindow &rootWindow() { return m_root_window; } 240 FbRootWindow &rootWindow() { return m_root_window; }
236 inline const FbRootWindow &rootWindow() const { return m_root_window; } 241 const FbRootWindow &rootWindow() const { return m_root_window; }
237 242
238 inline FbTk::MultLayers &layerManager() { return m_layermanager; } 243 FbTk::MultLayers &layerManager() { return m_layermanager; }
239 inline const FbTk::MultLayers &layerManager() const { return m_layermanager; } 244 const FbTk::MultLayers &layerManager() const { return m_layermanager; }
240 inline FbTk::ResourceManager &resourceManager() { return m_resource_manager; } 245 FbTk::ResourceManager &resourceManager() { return m_resource_manager; }
241 inline const FbTk::ResourceManager &resourceManager() const { return m_resource_manager; } 246 const FbTk::ResourceManager &resourceManager() const { return m_resource_manager; }
242 inline const std::string &name() const { return m_name; } 247 const std::string &name() const { return m_name; }
243 inline const std::string &altName() const { return m_altname; } 248 const std::string &altName() const { return m_altname; }
244 inline bool isShuttingdown() const { return m_shutdown; } 249 bool isShuttingdown() const { return m_shutdown; }
245 250
246 251
247 int addWorkspace(); 252 int addWorkspace();
248 int removeLastWorkspace(); 253 int removeLastWorkspace();
249 // scroll workspaces 254 // scroll workspaces
250 inline void nextWorkspace() { nextWorkspace(1); } 255 void nextWorkspace() { nextWorkspace(1); }
251 inline void prevWorkspace() { prevWorkspace(1); } 256 void prevWorkspace() { prevWorkspace(1); }
252 void nextWorkspace(int delta); 257 void nextWorkspace(int delta);
253 void prevWorkspace(int delta); 258 void prevWorkspace(int delta);
254 void rightWorkspace(int delta); 259 void rightWorkspace(int delta);
@@ -272,8 +277,8 @@ public:
272 bool changeworkspace=true); 277 bool changeworkspace=true);
273 void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id, 278 void reassociateWindow(FluxboxWindow *window, unsigned int workspace_id,
274 bool ignore_sticky); 279 bool ignore_sticky);
275 inline void prevFocus() { prevFocus(0); } 280 void prevFocus() { prevFocus(0); }
276 inline void nextFocus() { nextFocus(0); } 281 void nextFocus() { nextFocus(0); }
277 void prevFocus(int options); 282 void prevFocus(int options);
278 void nextFocus(int options); 283 void nextFocus(int options);
279 void raiseFocus(); 284 void raiseFocus();
@@ -303,8 +308,8 @@ public:
303 void updateSize(); 308 void updateSize();
304 309
305 // Xinerama-related functions 310 // Xinerama-related functions
306 inline bool hasXinerama() const { return m_xinerama_avail; } 311 bool hasXinerama() const { return m_xinerama_avail; }
307 inline int numHeads() const { return m_xinerama_num_heads; } 312 int numHeads() const { return m_xinerama_num_heads; }
308 313
309 void initXinerama(); 314 void initXinerama();
310 315
@@ -447,6 +452,7 @@ private:
447 FbTk::Resource<ResizeModel> resize_model; 452 FbTk::Resource<ResizeModel> resize_model;
448 FbTk::Resource<std::string> windowmenufile; 453 FbTk::Resource<std::string> windowmenufile;
449 FbTk::Resource<FocusModel> focus_model; 454 FbTk::Resource<FocusModel> focus_model;
455 FbTk::Resource<TabFocusModel> tabfocus_model;
450 FbTk::Resource<FollowModel> follow_model; 456 FbTk::Resource<FollowModel> follow_model;
451 bool ordered_dither; 457 bool ordered_dither;
452 FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha, 458 FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha,
diff --git a/src/ScreenResources.cc b/src/ScreenResources.cc
index dd42b18..db92b19 100644
--- a/src/ScreenResources.cc
+++ b/src/ScreenResources.cc
@@ -176,31 +176,46 @@ template<>
176std::string FbTk::Resource<BScreen::FocusModel>:: 176std::string FbTk::Resource<BScreen::FocusModel>::
177getString() { 177getString() {
178 switch (m_value) { 178 switch (m_value) {
179 case BScreen::SLOPPYFOCUS: 179 case BScreen::MOUSEFOCUS:
180 return string("SloppyFocus"); 180 return string("MouseFocus");
181 case BScreen::SEMISLOPPYFOCUS: 181 case BScreen::CLICKFOCUS:
182 return string("SemiSloppyFocus"); 182 return string("ClickFocus");
183 case BScreen::CLICKTOFOCUS:
184 return string("ClickToFocus");
185 } 183 }
186 // default string 184 // default string
187 return string("ClickToFocus"); 185 return string("ClickFocus");
188} 186}
189 187
190template<> 188template<>
191void FbTk::Resource<BScreen::FocusModel>:: 189void FbTk::Resource<BScreen::FocusModel>::
192setFromString(char const *strval) { 190setFromString(char const *strval) {
193 // auto raise options here for backwards read compatibility 191 if (strcasecmp(strval, "MouseFocus") == 0)
194 // they are not supported for saving purposes. Nor does the "AutoRaise" 192 m_value = BScreen::MOUSEFOCUS;
195 // part actually do anything
196 if (strcasecmp(strval, "SloppyFocus") == 0
197 || strcasecmp(strval, "AutoRaiseSloppyFocus") == 0)
198 m_value = BScreen::SLOPPYFOCUS;
199 else if (strcasecmp(strval, "SemiSloppyFocus") == 0
200 || strcasecmp(strval, "AutoRaiseSemiSloppyFocus") == 0)
201 m_value = BScreen::SEMISLOPPYFOCUS;
202 else if (strcasecmp(strval, "ClickToFocus") == 0) 193 else if (strcasecmp(strval, "ClickToFocus") == 0)
203 m_value = BScreen::CLICKTOFOCUS; 194 m_value = BScreen::CLICKFOCUS;
195 else
196 setDefaultValue();
197}
198
199template<>
200std::string FbTk::Resource<BScreen::TabFocusModel>::
201getString() {
202 switch (m_value) {
203 case BScreen::MOUSETABFOCUS:
204 return string("SloppyTabFocus");
205 case BScreen::CLICKTABFOCUS:
206 return string("ClickToTabFocus");
207 }
208 // default string
209 return string("ClickToTabFocus");
210}
211
212template<>
213void FbTk::Resource<BScreen::TabFocusModel>::
214setFromString(char const *strval) {
215 if (strcasecmp(strval, "SloppyTabFocus") == 0 )
216 m_value = BScreen::MOUSETABFOCUS;
217 else if (strcasecmp(strval, "ClickToTabFocus") == 0)
218 m_value = BScreen::CLICKTABFOCUS;
204 else 219 else
205 setDefaultValue(); 220 setDefaultValue();
206} 221}
diff --git a/src/Window.cc b/src/Window.cc
index 71f597e..88690ce 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1070,7 +1070,7 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
1070 if (setinput && setInputFocus()) { 1070 if (setinput && setInputFocus()) {
1071 return true; 1071 return true;
1072 } 1072 }
1073 1073
1074 return false; 1074 return false;
1075} 1075}
1076 1076
@@ -2033,7 +2033,7 @@ void FluxboxWindow::setFocusFlag(bool focus) {
2033 if (focus != frame().focused()) 2033 if (focus != frame().focused())
2034 frame().setFocus(focus); 2034 frame().setFocus(focus);
2035 2035
2036 if ((screen().isSloppyFocus() || screen().isSemiSloppyFocus()) 2036 if ((screen().isMouseFocus())
2037 && screen().doAutoRaise()) { 2037 && screen().doAutoRaise()) {
2038 if (focused) 2038 if (focused)
2039 m_timer.start(); 2039 m_timer.start();
@@ -2637,7 +2637,7 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
2637 frame().buttonPressEvent(be); 2637 frame().buttonPressEvent(be);
2638 2638
2639 if (be.button == 1 || (be.button == 3 && be.state == Mod1Mask)) { 2639 if (be.button == 1 || (be.button == 3 && be.state == Mod1Mask)) {
2640 if ((! focused) && (! screen().isSloppyFocus())) { //check focus 2640 if ((! focused) && (! screen().isMouseFocus())) { //check focus
2641 setInputFocus(); 2641 setInputFocus();
2642 } 2642 }
2643 2643
@@ -2916,8 +2916,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2916 } 2916 }
2917 2917
2918 WinClient *client = 0; 2918 WinClient *client = 0;
2919 // don't waste our time scanning if we aren't real sloppy focus 2919 if (screen().isMouseTabFocus()) {
2920 if (screen().isSloppyFocus()) {
2921 // determine if we're in a label button (tab) 2920 // determine if we're in a label button (tab)
2922 Client2ButtonMap::iterator it = 2921 Client2ButtonMap::iterator it =
2923 find_if(m_labelbuttons.begin(), 2922 find_if(m_labelbuttons.begin(),
@@ -2929,13 +2928,12 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2929 client = (*it).first; 2928 client = (*it).first;
2930 2929
2931 } 2930 }
2931
2932 if (ev.window == frame().window() || 2932 if (ev.window == frame().window() ||
2933 ev.window == m_client->window() || 2933 ev.window == m_client->window() ||
2934 client) { 2934 client) {
2935 if ((screen().isSloppyFocus() || screen().isSemiSloppyFocus()) 2935
2936 && !isFocused() || 2936 if (screen().isMouseFocus() && !isFocused()) {
2937 // or, we are focused, but it isn't the one we want
2938 client && screen().isSloppyFocus() && (m_client != client)) {
2939 2937
2940 // check that there aren't any subsequent leave notify events in the 2938 // check that there aren't any subsequent leave notify events in the
2941 // X event queue 2939 // X event queue
@@ -2945,16 +2943,16 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2945 sa.enter = sa.leave = False; 2943 sa.enter = sa.leave = False;
2946 XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa); 2944 XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa);
2947 2945
2948 // if client is set, use setCurrent client, otherwise just setInputFocus
2949 if ((!sa.leave || sa.inferior)) { 2946 if ((!sa.leave || sa.inferior)) {
2950 if (client) 2947 setInputFocus();
2951 setCurrentClient(*client, true);
2952 else
2953 setInputFocus();
2954 } 2948 }
2955
2956 } 2949 }
2957 } 2950 }
2951
2952 if (screen().isMouseTabFocus() && client && client != m_client) {
2953 setCurrentClient(*client, isFocused());
2954 }
2955
2958} 2956}
2959 2957
2960void FluxboxWindow::leaveNotifyEvent(XCrossingEvent &ev) { 2958void FluxboxWindow::leaveNotifyEvent(XCrossingEvent &ev) {
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 732e8a6..ef90d4e 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -1892,12 +1892,11 @@ void Fluxbox::revertFocus(BScreen &screen) {
1892 next_focus->fbwindow()->setCurrentClient(*next_focus, true))) { 1892 next_focus->fbwindow()->setCurrentClient(*next_focus, true))) {
1893 setFocusedWindow(0); // so we don't get dangling m_focused_window pointer 1893 setFocusedWindow(0); // so we don't get dangling m_focused_window pointer
1894 switch (screen.getFocusModel()) { 1894 switch (screen.getFocusModel()) {
1895 case BScreen::SLOPPYFOCUS: 1895 case BScreen::MOUSEFOCUS:
1896 case BScreen::SEMISLOPPYFOCUS:
1897 XSetInputFocus(FbTk::App::instance()->display(), 1896 XSetInputFocus(FbTk::App::instance()->display(),
1898 PointerRoot, None, CurrentTime); 1897 PointerRoot, None, CurrentTime);
1899 break; 1898 break;
1900 case BScreen::CLICKTOFOCUS: 1899 case BScreen::CLICKFOCUS:
1901 screen.rootWindow().setInputFocus(RevertToPointerRoot, CurrentTime); 1900 screen.rootWindow().setInputFocus(RevertToPointerRoot, CurrentTime);
1902 break; 1901 break;
1903 } 1902 }