diff options
author | markt <markt> | 2007-01-13 18:59:49 (GMT) |
---|---|---|
committer | markt <markt> | 2007-01-13 18:59:49 (GMT) |
commit | 09cc0bf6afa51466fd863b1e2f32ad5f5dd84bae (patch) | |
tree | 1f0418e17d8a543dd281df3c0599aaff4b3c8aa5 | |
parent | 9cace1f2cb9a082408e49e668bd02a16a016cd6e (diff) | |
download | fluxbox_lack-09cc0bf6afa51466fd863b1e2f32ad5f5dd84bae.zip fluxbox_lack-09cc0bf6afa51466fd863b1e2f32ad5f5dd84bae.tar.bz2 |
little cleanup
-rw-r--r-- | src/CurrentWindowCmd.cc | 2 | ||||
-rw-r--r-- | src/FocusControl.cc | 10 | ||||
-rw-r--r-- | src/FocusControl.hh | 3 | ||||
-rw-r--r-- | src/Window.cc | 8 | ||||
-rw-r--r-- | src/Window.hh | 4 |
5 files changed, 6 insertions, 21 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index e4de9a4..a975bdd 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc | |||
@@ -93,7 +93,7 @@ void GoToTabCmd::real_execute() { | |||
93 | 93 | ||
94 | while (--num > 0) ++it; | 94 | while (--num > 0) ++it; |
95 | 95 | ||
96 | fbwindow().setCurrentClient(**it, true); | 96 | (*it)->focus(); |
97 | } | 97 | } |
98 | 98 | ||
99 | void WindowHelperCmd::execute() { | 99 | void WindowHelperCmd::execute() { |
diff --git a/src/FocusControl.cc b/src/FocusControl.cc index e0bb886..c5441dd 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc | |||
@@ -50,9 +50,6 @@ FocusControl::FocusControl(BScreen &screen): | |||
50 | CLICKTABFOCUS, | 50 | CLICKTABFOCUS, |
51 | screen.name()+".tabFocusModel", | 51 | screen.name()+".tabFocusModel", |
52 | screen.altName()+".TabFocusModel"), | 52 | screen.altName()+".TabFocusModel"), |
53 | m_focus_last(screen.resourceManager(), true, | ||
54 | screen.name()+".focusLastWindow", | ||
55 | screen.altName()+".FocusLastWindow"), | ||
56 | m_focus_new(screen.resourceManager(), true, | 53 | m_focus_new(screen.resourceManager(), true, |
57 | screen.name()+".focusNewWindows", | 54 | screen.name()+".focusNewWindows", |
58 | screen.altName()+".FocusNewWindows"), | 55 | screen.altName()+".FocusNewWindows"), |
@@ -398,15 +395,12 @@ void FocusControl::revertFocus(BScreen &screen) { | |||
398 | 395 | ||
399 | if (screen.focusControl().isCycling()) | 396 | if (screen.focusControl().isCycling()) |
400 | return; | 397 | return; |
401 | // Relevant resources: | 398 | |
402 | // resource.focus_last = whether we focus last focused when changing workspace | ||
403 | // BScreen::FocusModel = sloppy, click, whatever | ||
404 | WinClient *next_focus = | 399 | WinClient *next_focus = |
405 | screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID()); | 400 | screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID()); |
406 | 401 | ||
407 | // if setting focus fails, or isn't possible, fallback correctly | 402 | // if setting focus fails, or isn't possible, fallback correctly |
408 | if (!(next_focus && next_focus->fbwindow() && | 403 | if (!(next_focus && next_focus->focus())) { |
409 | next_focus->fbwindow()->setCurrentClient(*next_focus, true))) { | ||
410 | setFocusedWindow(0); // so we don't get dangling m_focused_window pointer | 404 | setFocusedWindow(0); // so we don't get dangling m_focused_window pointer |
411 | switch (screen.focusControl().focusModel()) { | 405 | switch (screen.focusControl().focusModel()) { |
412 | case FocusControl::MOUSEFOCUS: | 406 | case FocusControl::MOUSEFOCUS: |
diff --git a/src/FocusControl.hh b/src/FocusControl.hh index df7922b..708b960 100644 --- a/src/FocusControl.hh +++ b/src/FocusControl.hh | |||
@@ -89,7 +89,6 @@ public: | |||
89 | 89 | ||
90 | FocusModel focusModel() const { return *m_focus_model; } | 90 | FocusModel focusModel() const { return *m_focus_model; } |
91 | TabFocusModel tabFocusModel() const { return *m_tab_focus_model; } | 91 | TabFocusModel tabFocusModel() const { return *m_tab_focus_model; } |
92 | bool focusLast() const { return *m_focus_last; } | ||
93 | bool focusNew() const { return *m_focus_new; } | 92 | bool focusNew() const { return *m_focus_new; } |
94 | 93 | ||
95 | WinClient *lastFocusedWindow(int workspace); | 94 | WinClient *lastFocusedWindow(int workspace); |
@@ -114,7 +113,7 @@ private: | |||
114 | 113 | ||
115 | FbTk::Resource<FocusModel> m_focus_model; | 114 | FbTk::Resource<FocusModel> m_focus_model; |
116 | FbTk::Resource<TabFocusModel> m_tab_focus_model; | 115 | FbTk::Resource<TabFocusModel> m_tab_focus_model; |
117 | FbTk::Resource<bool> m_focus_last, m_focus_new; | 116 | FbTk::Resource<bool> m_focus_new; |
118 | 117 | ||
119 | // This list keeps the order of window focusing for this screen | 118 | // This list keeps the order of window focusing for this screen |
120 | // Screen global so it works for sticky windows too. | 119 | // Screen global so it works for sticky windows too. |
diff --git a/src/Window.cc b/src/Window.cc index fe4cf4a..ff005c3 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -284,8 +284,7 @@ public: | |||
284 | explicit SetClientCmd(WinClient &client):m_client(client) { | 284 | explicit SetClientCmd(WinClient &client):m_client(client) { |
285 | } | 285 | } |
286 | void execute() { | 286 | void execute() { |
287 | if (m_client.fbwindow() != 0) | 287 | m_client.focus(); |
288 | m_client.fbwindow()->setCurrentClient(m_client); | ||
289 | } | 288 | } |
290 | private: | 289 | private: |
291 | WinClient &m_client; | 290 | WinClient &m_client; |
@@ -440,8 +439,6 @@ void FluxboxWindow::init() { | |||
440 | 439 | ||
441 | frame().resize(m_client->width(), m_client->height()); | 440 | frame().resize(m_client->width(), m_client->height()); |
442 | 441 | ||
443 | m_last_focus_time.tv_sec = m_last_focus_time.tv_usec = 0; | ||
444 | |||
445 | m_blackbox_attrib.workspace = m_workspace_number = m_screen.currentWorkspaceID(); | 442 | m_blackbox_attrib.workspace = m_workspace_number = m_screen.currentWorkspaceID(); |
446 | 443 | ||
447 | m_blackbox_attrib.flags = m_blackbox_attrib.attrib = m_blackbox_attrib.stack = 0; | 444 | m_blackbox_attrib.flags = m_blackbox_attrib.attrib = m_blackbox_attrib.stack = 0; |
@@ -1453,7 +1450,7 @@ bool FluxboxWindow::setInputFocus() { | |||
1453 | cerr<<__FUNCTION__<<": transient 0x"<<(*it)<<endl; | 1450 | cerr<<__FUNCTION__<<": transient 0x"<<(*it)<<endl; |
1454 | #endif // DEBUG | 1451 | #endif // DEBUG |
1455 | if ((*it)->isModal()) | 1452 | if ((*it)->isModal()) |
1456 | return (*it)->fbwindow()->setCurrentClient(**it, true); | 1453 | return (*it)->focus(); |
1457 | } | 1454 | } |
1458 | } | 1455 | } |
1459 | 1456 | ||
@@ -2129,7 +2126,6 @@ void FluxboxWindow::setFocusFlag(bool focus) { | |||
2129 | #endif // DEBUG | 2126 | #endif // DEBUG |
2130 | // Record focus timestamp for window cycling enhancements | 2127 | // Record focus timestamp for window cycling enhancements |
2131 | if (focused) { | 2128 | if (focused) { |
2132 | gettimeofday(&m_last_focus_time, 0); | ||
2133 | screen().focusControl().setScreenFocusedWindow(*m_client); | 2129 | screen().focusControl().setScreenFocusedWindow(*m_client); |
2134 | } | 2130 | } |
2135 | 2131 | ||
diff --git a/src/Window.hh b/src/Window.hh index 429747f..50f756d 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -426,8 +426,6 @@ public: | |||
426 | 426 | ||
427 | void reconfigTheme(); | 427 | void reconfigTheme(); |
428 | 428 | ||
429 | const timeval &lastFocusTime() const { return m_last_focus_time;} | ||
430 | |||
431 | //@} | 429 | //@} |
432 | 430 | ||
433 | class WinSubject: public FbTk::Subject { | 431 | class WinSubject: public FbTk::Subject { |
@@ -521,8 +519,6 @@ private: | |||
521 | Display *display; /// display connection | 519 | Display *display; /// display connection |
522 | BlackboxAttributes m_blackbox_attrib; | 520 | BlackboxAttributes m_blackbox_attrib; |
523 | 521 | ||
524 | timeval m_last_focus_time; | ||
525 | |||
526 | int m_button_grab_x, m_button_grab_y; // handles last button press event for move | 522 | int m_button_grab_x, m_button_grab_y; // handles last button press event for move |
527 | int m_last_resize_x, m_last_resize_y; // handles last button press event for resize | 523 | int m_last_resize_x, m_last_resize_y; // handles last button press event for resize |
528 | int m_last_move_x, m_last_move_y; // handles last pos for non opaque moving | 524 | int m_last_move_x, m_last_move_y; // handles last pos for non opaque moving |