little cleanup

This commit is contained in:
markt 2007-01-13 18:59:49 +00:00
parent 9cace1f2cb
commit 09cc0bf6af
5 changed files with 6 additions and 21 deletions

View file

@ -93,7 +93,7 @@ void GoToTabCmd::real_execute() {
while (--num > 0) ++it; while (--num > 0) ++it;
fbwindow().setCurrentClient(**it, true); (*it)->focus();
} }
void WindowHelperCmd::execute() { void WindowHelperCmd::execute() {

View file

@ -50,9 +50,6 @@ FocusControl::FocusControl(BScreen &screen):
CLICKTABFOCUS, CLICKTABFOCUS,
screen.name()+".tabFocusModel", screen.name()+".tabFocusModel",
screen.altName()+".TabFocusModel"), screen.altName()+".TabFocusModel"),
m_focus_last(screen.resourceManager(), true,
screen.name()+".focusLastWindow",
screen.altName()+".FocusLastWindow"),
m_focus_new(screen.resourceManager(), true, m_focus_new(screen.resourceManager(), true,
screen.name()+".focusNewWindows", screen.name()+".focusNewWindows",
screen.altName()+".FocusNewWindows"), screen.altName()+".FocusNewWindows"),
@ -398,15 +395,12 @@ void FocusControl::revertFocus(BScreen &screen) {
if (screen.focusControl().isCycling()) if (screen.focusControl().isCycling())
return; return;
// Relevant resources:
// resource.focus_last = whether we focus last focused when changing workspace
// BScreen::FocusModel = sloppy, click, whatever
WinClient *next_focus = WinClient *next_focus =
screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID()); screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID());
// if setting focus fails, or isn't possible, fallback correctly // if setting focus fails, or isn't possible, fallback correctly
if (!(next_focus && next_focus->fbwindow() && if (!(next_focus && next_focus->focus())) {
next_focus->fbwindow()->setCurrentClient(*next_focus, true))) {
setFocusedWindow(0); // so we don't get dangling m_focused_window pointer setFocusedWindow(0); // so we don't get dangling m_focused_window pointer
switch (screen.focusControl().focusModel()) { switch (screen.focusControl().focusModel()) {
case FocusControl::MOUSEFOCUS: case FocusControl::MOUSEFOCUS:

View file

@ -89,7 +89,6 @@ public:
FocusModel focusModel() const { return *m_focus_model; } FocusModel focusModel() const { return *m_focus_model; }
TabFocusModel tabFocusModel() const { return *m_tab_focus_model; } TabFocusModel tabFocusModel() const { return *m_tab_focus_model; }
bool focusLast() const { return *m_focus_last; }
bool focusNew() const { return *m_focus_new; } bool focusNew() const { return *m_focus_new; }
WinClient *lastFocusedWindow(int workspace); WinClient *lastFocusedWindow(int workspace);
@ -114,7 +113,7 @@ private:
FbTk::Resource<FocusModel> m_focus_model; FbTk::Resource<FocusModel> m_focus_model;
FbTk::Resource<TabFocusModel> m_tab_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 // This list keeps the order of window focusing for this screen
// Screen global so it works for sticky windows too. // Screen global so it works for sticky windows too.

View file

@ -284,8 +284,7 @@ public:
explicit SetClientCmd(WinClient &client):m_client(client) { explicit SetClientCmd(WinClient &client):m_client(client) {
} }
void execute() { void execute() {
if (m_client.fbwindow() != 0) m_client.focus();
m_client.fbwindow()->setCurrentClient(m_client);
} }
private: private:
WinClient &m_client; WinClient &m_client;
@ -440,8 +439,6 @@ void FluxboxWindow::init() {
frame().resize(m_client->width(), m_client->height()); 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.workspace = m_workspace_number = m_screen.currentWorkspaceID();
m_blackbox_attrib.flags = m_blackbox_attrib.attrib = m_blackbox_attrib.stack = 0; 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; cerr<<__FUNCTION__<<": transient 0x"<<(*it)<<endl;
#endif // DEBUG #endif // DEBUG
if ((*it)->isModal()) if ((*it)->isModal())
return (*it)->fbwindow()->setCurrentClient(**it, true); return (*it)->focus();
} }
} }
@ -2129,7 +2126,6 @@ void FluxboxWindow::setFocusFlag(bool focus) {
#endif // DEBUG #endif // DEBUG
// Record focus timestamp for window cycling enhancements // Record focus timestamp for window cycling enhancements
if (focused) { if (focused) {
gettimeofday(&m_last_focus_time, 0);
screen().focusControl().setScreenFocusedWindow(*m_client); screen().focusControl().setScreenFocusedWindow(*m_client);
} }

View file

@ -426,8 +426,6 @@ public:
void reconfigTheme(); void reconfigTheme();
const timeval &lastFocusTime() const { return m_last_focus_time;}
//@} //@}
class WinSubject: public FbTk::Subject { class WinSubject: public FbTk::Subject {
@ -521,8 +519,6 @@ private:
Display *display; /// display connection Display *display; /// display connection
BlackboxAttributes m_blackbox_attrib; 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_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_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 int m_last_move_x, m_last_move_y; // handles last pos for non opaque moving