aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-05-19 22:59:02 (GMT)
committermarkt <markt>2007-05-19 22:59:02 (GMT)
commit22944ec775b5c5de0f29d0ee05f4ed303235519c (patch)
tree22a42005339e71e055d73ee34b710e1d6db4d68a
parenta33188b2a844832a0a3267f1ebf0883b3205614e (diff)
downloadfluxbox-22944ec775b5c5de0f29d0ee05f4ed303235519c.zip
fluxbox-22944ec775b5c5de0f29d0ee05f4ed303235519c.tar.bz2
added back limited behavior for session.screen0.followModel
-rw-r--r--ChangeLog6
-rw-r--r--doc/asciidoc/fluxbox.txt5
-rw-r--r--src/Ewmh.cc4
-rw-r--r--src/Screen.cc1
-rw-r--r--src/Screen.hh3
-rw-r--r--src/Window.cc38
-rw-r--r--src/Window.hh3
7 files changed, 39 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index c50450a..db79872 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1: 2Changes for 1.1:
3*07/05/19: 3*07/05/19:
4 * Changed behavior of resource session.screen<N>.followModel (Mark)
5 - now only options are Ignore and Follow, the latter using the setting in
6 session.screen<N>.userFollowModel
7 Window.cc/hh Ewmh.cc Screen.cc/hh
4 * Fixed bug #1718112, memory leak in FbWindow::textProperty ( Henrik ) 8 * Fixed bug #1718112, memory leak in FbWindow::textProperty ( Henrik )
5 FbTk/FbWindow.cc 9 FbTk/FbWindow.cc
6*07/05/17: 10*07/05/17:
@@ -54,8 +58,6 @@ Changes for 1.1:
54 Keys.cc/hh Toolbar.cc/hh Screen.cc/hh IconbarTool.cc fluxbox.cc 58 Keys.cc/hh Toolbar.cc/hh Screen.cc/hh IconbarTool.cc fluxbox.cc
55 * Menu when clicking workspacename in toolbar wasn't getting focused (Mark) 59 * Menu when clicking workspacename in toolbar wasn't getting focused (Mark)
56 ToolFactory.cc 60 ToolFactory.cc
57 * Removed followModel, since userFollowModel covers almost all cases (Mark)
58 IconbarTool.cc ClientMenu.cc Screen.cc/hh Ewmh.cc Window.cc
59 * Buttons with different textures when pressed weren't getting reset 61 * Buttons with different textures when pressed weren't getting reset
60 properly (Mark) 62 properly (Mark)
61 FbTk/Button.cc 63 FbTk/Button.cc
diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
index 9feb7bc..6878235 100644
--- a/doc/asciidoc/fluxbox.txt
+++ b/doc/asciidoc/fluxbox.txt
@@ -843,6 +843,11 @@ session.screen0.userFollowModel: <model>
843 `SemiFollow' acts like `Current' for minimized windows and like `Follow' 843 `SemiFollow' acts like `Current' for minimized windows and like `Follow'
844 otherwise. Default: Follow 844 otherwise. Default: Follow
845 845
846session.screen0.followModel: <model>
847 This specifies the behavior when a window on another workspace requests to
848 be focused. `Ignore' does nothing, and `Follow' uses the setting in
849 session.screen0.userFollowModel. Default: Ignore
850
846session.screen0.resizeMode: Bottom|Quadrant|Center 851session.screen0.resizeMode: Bottom|Quadrant|Center
847 Setting this resource to `Quadrant' makes resizing by using the modkey 852 Setting this resource to `Quadrant' makes resizing by using the modkey
848 grab the corner closest to the mouse pointer instead of the bottom right 853 grab the corner closest to the mouse pointer instead of the bottom right
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 019751f..b0269ec 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -782,7 +782,9 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
782 return true; 782 return true;
783 // ce.window = window to focus 783 // ce.window = window to focus
784 784
785 if (winclient->fbwindow()) { 785 // ce.data.l[0] == 2 means the request came from a pager
786 if (winclient->fbwindow() && (ce.data.l[0] == 2 ||
787 winclient->fbwindow()->allowsFocusFromClient())) {
786 winclient->focus(); 788 winclient->focus();
787 winclient->fbwindow()->raise(); 789 winclient->fbwindow()->raise();
788 } 790 }
diff --git a/src/Screen.cc b/src/Screen.cc
index 2c24157..7f44e42 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -294,6 +294,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
294 tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"), 294 tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"),
295 windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"), 295 windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"),
296 typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay", altscrname+".NoFocusWhileTypingDelay"), 296 typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay", altscrname+".NoFocusWhileTypingDelay"),
297 follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"),
297 user_follow_model(rm, FOLLOW_ACTIVE_WINDOW, scrname+".userFollowModel", altscrname+".UserFollowModel"), 298 user_follow_model(rm, FOLLOW_ACTIVE_WINDOW, scrname+".userFollowModel", altscrname+".UserFollowModel"),
298 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), 299 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
299 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), 300 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
diff --git a/src/Screen.hh b/src/Screen.hh
index 2d1c31d..eb67067 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -144,6 +144,7 @@ public:
144 ResizeModel getResizeModel() const { return *resource.resize_model; } 144 ResizeModel getResizeModel() const { return *resource.resize_model; }
145 145
146 inline unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; } 146 inline unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; }
147 inline FollowModel getFollowModel() const { return *resource.follow_model; }
147 inline FollowModel getUserFollowModel() const { return *resource.user_follow_model; } 148 inline FollowModel getUserFollowModel() const { return *resource.user_follow_model; }
148 149
149 inline const std::string &getScrollAction() const { return *resource.scroll_action; } 150 inline const std::string &getScrollAction() const { return *resource.scroll_action; }
@@ -569,7 +570,7 @@ private:
569 FbTk::Resource<FbWinFrame::TabPlacement> tab_placement; 570 FbTk::Resource<FbWinFrame::TabPlacement> tab_placement;
570 FbTk::Resource<std::string> windowmenufile; 571 FbTk::Resource<std::string> windowmenufile;
571 FbTk::Resource<unsigned int> typing_delay; 572 FbTk::Resource<unsigned int> typing_delay;
572 FbTk::Resource<FollowModel> user_follow_model; 573 FbTk::Resource<FollowModel> follow_model, user_follow_model;
573 bool ordered_dither; 574 bool ordered_dither;
574 FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha, 575 FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha,
575 unfocused_alpha, menu_alpha, menu_delay, menu_delay_close, tab_width; 576 unfocused_alpha, menu_alpha, menu_delay, menu_delay_close, tab_width;
diff --git a/src/Window.cc b/src/Window.cc
index 41cc07d..4801f12 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1376,9 +1376,8 @@ bool FluxboxWindow::focus() {
1376 1376
1377 FluxboxWindow *cur = FocusControl::focusedFbWindow(); 1377 FluxboxWindow *cur = FocusControl::focusedFbWindow();
1378 WinClient *client = FocusControl::focusedWindow(); 1378 WinClient *client = FocusControl::focusedWindow();
1379 if (cur && client && cur != this && 1379 if (cur && client && cur != this && cur->isFullscreen() &&
1380 getRootTransientFor(m_client) != getRootTransientFor(client) && 1380 getRootTransientFor(m_client) != getRootTransientFor(client))
1381 (cur->isFullscreen() || cur->isTyping()))
1382 return false; 1381 return false;
1383 1382
1384 if (isIconic()) { 1383 if (isIconic()) {
@@ -2315,26 +2314,33 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) {
2315 // Note: this function never gets called from WithdrawnState 2314 // Note: this function never gets called from WithdrawnState
2316 // initial state is handled in restoreAttributes() and init() 2315 // initial state is handled in restoreAttributes() and init()
2317 2316
2317 // if the user doesn't want the window, then ignore request
2318 if (!allowsFocusFromClient())
2319 return;
2320
2321 setCurrentClient(*client, false); // focus handled on MapNotify
2322 deiconify(false);
2323
2324}
2325
2326bool FluxboxWindow::allowsFocusFromClient() {
2327
2318 // check what to do if window is on another workspace 2328 // check what to do if window is on another workspace
2319 if (screen().currentWorkspaceID() != workspaceNumber() && !isStuck()) { 2329 if (screen().currentWorkspaceID() != workspaceNumber() && !isStuck()) {
2320 menu().hide(); 2330 BScreen::FollowModel model = screen().getFollowModel();
2321 BScreen::FollowModel model = screen().getUserFollowModel();
2322 if (model == BScreen::IGNORE_OTHER_WORKSPACES) 2331 if (model == BScreen::IGNORE_OTHER_WORKSPACES)
2323 return; 2332 return false;
2324 // fetch the window to the current workspace
2325 if (model == BScreen::FETCH_ACTIVE_WINDOW ||
2326 (isIconic() && model == BScreen::SEMIFOLLOW_ACTIVE_WINDOW))
2327 screen().sendToWorkspace(screen().currentWorkspaceID(), this, true);
2328 // warp to the workspace of the window
2329 else
2330 screen().changeWorkspaceID(workspaceNumber());
2331 } 2333 }
2332 2334
2333 setCurrentClient(*client, false); // focus handled on MapNotify 2335 FluxboxWindow *cur = FocusControl::focusedFbWindow();
2334 deiconify(false); 2336 WinClient *client = FocusControl::focusedWindow();
2337 if (cur && client && cur->isTyping() &&
2338 getRootTransientFor(m_client) != getRootTransientFor(client))
2339 return false;
2335 2340
2336} 2341 return true;
2337 2342
2343}
2338 2344
2339void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) { 2345void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) {
2340 WinClient *client = findClient(ne.window); 2346 WinClient *client = findClient(ne.window);
diff --git a/src/Window.hh b/src/Window.hh
index 82a5f3f..8a4866e 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -231,7 +231,8 @@ public:
231 * @return true if it took focus. 231 * @return true if it took focus.
232 */ 232 */
233 bool focus(); 233 bool focus();
234 234 bool allowsFocusFromClient();
235
235 /// Raises the window and takes focus (if possible). 236 /// Raises the window and takes focus (if possible).
236 void raiseAndFocus() { raise(); focus(); } 237 void raiseAndFocus() { raise(); focus(); }
237 /// sets the internal focus flag 238 /// sets the internal focus flag