little cleanup
This commit is contained in:
parent
9cace1f2cb
commit
09cc0bf6af
5 changed files with 6 additions and 21 deletions
|
@ -93,7 +93,7 @@ void GoToTabCmd::real_execute() {
|
|||
|
||||
while (--num > 0) ++it;
|
||||
|
||||
fbwindow().setCurrentClient(**it, true);
|
||||
(*it)->focus();
|
||||
}
|
||||
|
||||
void WindowHelperCmd::execute() {
|
||||
|
|
|
@ -50,9 +50,6 @@ FocusControl::FocusControl(BScreen &screen):
|
|||
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:
|
||||
|
|
|
@ -89,7 +89,6 @@ public:
|
|||
|
||||
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 @@ private:
|
|||
|
||||
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.
|
||||
|
|
|
@ -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;
|
||||
|
@ -440,8 +439,6 @@ void FluxboxWindow::init() {
|
|||
|
||||
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();
|
||||
|
||||
m_blackbox_attrib.flags = m_blackbox_attrib.attrib = m_blackbox_attrib.stack = 0;
|
||||
|
@ -1453,7 +1450,7 @@ bool FluxboxWindow::setInputFocus() {
|
|||
cerr<<__FUNCTION__<<": transient 0x"<<(*it)<<endl;
|
||||
#endif // DEBUG
|
||||
if ((*it)->isModal())
|
||||
return (*it)->fbwindow()->setCurrentClient(**it, true);
|
||||
return (*it)->focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2129,7 +2126,6 @@ void FluxboxWindow::setFocusFlag(bool focus) {
|
|||
#endif // DEBUG
|
||||
// Record focus timestamp for window cycling enhancements
|
||||
if (focused) {
|
||||
gettimeofday(&m_last_focus_time, 0);
|
||||
screen().focusControl().setScreenFocusedWindow(*m_client);
|
||||
}
|
||||
|
||||
|
|
|
@ -426,8 +426,6 @@ public:
|
|||
|
||||
void reconfigTheme();
|
||||
|
||||
const timeval &lastFocusTime() const { return m_last_focus_time;}
|
||||
|
||||
//@}
|
||||
|
||||
class WinSubject: public FbTk::Subject {
|
||||
|
@ -521,8 +519,6 @@ private:
|
|||
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
|
||||
int m_last_move_x, m_last_move_y; // handles last pos for non opaque moving
|
||||
|
|
Loading…
Reference in a new issue