all repos — fluxbox @ 09cc0bf6afa51466fd863b1e2f32ad5f5dd84bae

custom fork of the fluxbox windowmanager

little cleanup
markt markt
commit

09cc0bf6afa51466fd863b1e2f32ad5f5dd84bae

parent

9cace1f2cb9a082408e49e668bd02a16a016cd6e

5 files changed, 6 insertions(+), 21 deletions(-)

jump to
M src/CurrentWindowCmd.ccsrc/CurrentWindowCmd.cc

@@ -93,7 +93,7 @@ FluxboxWindow::ClientList::iterator it = fbwindow().clientList().begin();

while (--num > 0) ++it; - fbwindow().setCurrentClient(**it, true); + (*it)->focus(); } void WindowHelperCmd::execute() {
M src/FocusControl.ccsrc/FocusControl.cc

@@ -50,9 +50,6 @@ m_tab_focus_model(screen.resourceManager(),

CLICKTABFOCUS, screen.name()+".tabFocusModel", screen.altName()+".TabFocusModel"), - m_focus_last(screen.resourceManager(), true, - screen.name()+".focusLastWindow", - screen.altName()+".FocusLastWindow"), m_focus_new(screen.resourceManager(), true, screen.name()+".focusNewWindows", screen.altName()+".FocusNewWindows"),

@@ -398,15 +395,12 @@ void FocusControl::revertFocus(BScreen &screen) {

if (screen.focusControl().isCycling()) return; - // Relevant resources: - // resource.focus_last = whether we focus last focused when changing workspace - // BScreen::FocusModel = sloppy, click, whatever + WinClient *next_focus = screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID()); // if setting focus fails, or isn't possible, fallback correctly - if (!(next_focus && next_focus->fbwindow() && - next_focus->fbwindow()->setCurrentClient(*next_focus, true))) { + if (!(next_focus && next_focus->focus())) { setFocusedWindow(0); // so we don't get dangling m_focused_window pointer switch (screen.focusControl().focusModel()) { case FocusControl::MOUSEFOCUS:
M src/FocusControl.hhsrc/FocusControl.hh

@@ -89,7 +89,6 @@ void setFocusBack(FluxboxWindow *fbwin);

FocusModel focusModel() const { return *m_focus_model; } TabFocusModel tabFocusModel() const { return *m_tab_focus_model; } - bool focusLast() const { return *m_focus_last; } bool focusNew() const { return *m_focus_new; } WinClient *lastFocusedWindow(int workspace);

@@ -114,7 +113,7 @@ BScreen &m_screen;

FbTk::Resource<FocusModel> m_focus_model; FbTk::Resource<TabFocusModel> m_tab_focus_model; - FbTk::Resource<bool> m_focus_last, m_focus_new; + FbTk::Resource<bool> m_focus_new; // This list keeps the order of window focusing for this screen // Screen global so it works for sticky windows too.
M src/Window.ccsrc/Window.cc

@@ -284,8 +284,7 @@ public:

explicit SetClientCmd(WinClient &client):m_client(client) { } void execute() { - if (m_client.fbwindow() != 0) - m_client.fbwindow()->setCurrentClient(m_client); + m_client.focus(); } private: WinClient &m_client;

@@ -439,8 +438,6 @@ // redirect events from frame to us

frame().setEventHandler(*this); frame().resize(m_client->width(), m_client->height()); - - m_last_focus_time.tv_sec = m_last_focus_time.tv_usec = 0; m_blackbox_attrib.workspace = m_workspace_number = m_screen.currentWorkspaceID();

@@ -1453,7 +1450,7 @@ #ifdef DEBUG

cerr<<__FUNCTION__<<": transient 0x"<<(*it)<<endl; #endif // DEBUG if ((*it)->isModal()) - return (*it)->fbwindow()->setCurrentClient(**it, true); + return (*it)->focus(); } }

@@ -2129,7 +2126,6 @@ cerr<<"FluxboxWindow("<<title()<<")::setFocusFlag("<<focus<<")"<<endl;

#endif // DEBUG // Record focus timestamp for window cycling enhancements if (focused) { - gettimeofday(&m_last_focus_time, 0); screen().focusControl().setScreenFocusedWindow(*m_client); }
M src/Window.hhsrc/Window.hh

@@ -426,8 +426,6 @@ /** @} */ // end group signals

void reconfigTheme(); - const timeval &lastFocusTime() const { return m_last_focus_time;} - //@} class WinSubject: public FbTk::Subject {

@@ -520,8 +518,6 @@ BScreen &m_screen; /// screen on which this window exist

FbTk::Timer m_timer; Display *display; /// display connection BlackboxAttributes m_blackbox_attrib; - - timeval m_last_focus_time; int m_button_grab_x, m_button_grab_y; // handles last button press event for move int m_last_resize_x, m_last_resize_y; // handles last button press event for resize