diff options
author | markt <markt> | 2007-05-19 22:59:02 (GMT) |
---|---|---|
committer | markt <markt> | 2007-05-19 22:59:02 (GMT) |
commit | 22944ec775b5c5de0f29d0ee05f4ed303235519c (patch) | |
tree | 22a42005339e71e055d73ee34b710e1d6db4d68a /src | |
parent | a33188b2a844832a0a3267f1ebf0883b3205614e (diff) | |
download | fluxbox-22944ec775b5c5de0f29d0ee05f4ed303235519c.zip fluxbox-22944ec775b5c5de0f29d0ee05f4ed303235519c.tar.bz2 |
added back limited behavior for session.screen0.followModel
Diffstat (limited to 'src')
-rw-r--r-- | src/Ewmh.cc | 4 | ||||
-rw-r--r-- | src/Screen.cc | 1 | ||||
-rw-r--r-- | src/Screen.hh | 3 | ||||
-rw-r--r-- | src/Window.cc | 38 | ||||
-rw-r--r-- | src/Window.hh | 3 |
5 files changed, 30 insertions, 19 deletions
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 | |||
2326 | bool 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 | ||
2339 | void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) { | 2345 | void 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 |