remove reassoc argument from FluxboxWindow::deiconify

This commit is contained in:
Mark Tiefenbruck 2007-12-18 23:08:17 -08:00
parent a21572f1b1
commit c381a130eb
4 changed files with 26 additions and 43 deletions

View file

@ -534,7 +534,7 @@ void DeiconifyCmd::execute() {
(*it)->isStuck()) { (*it)->isStuck()) {
if (m_dest == ORIGIN || m_dest == ORIGINQUIET) if (m_dest == ORIGIN || m_dest == ORIGINQUIET)
screen->sendToWorkspace(old_workspace_num, (*it), change_ws); screen->sendToWorkspace(old_workspace_num, (*it), change_ws);
(*it)->deiconify(false); (*it)->deiconify();
} }
} }
break; break;
@ -550,7 +550,7 @@ void DeiconifyCmd::execute() {
m_mode != LASTWORKSPACE) m_mode != LASTWORKSPACE)
screen->sendToWorkspace(old_workspace_num, (*it), change_ws); screen->sendToWorkspace(old_workspace_num, (*it), change_ws);
else else
(*it)->deiconify(false); (*it)->deiconify();
break; break;
} }
} }

View file

@ -396,7 +396,7 @@ void Gnome::setState(FluxboxWindow *win, int state) {
if (win->isIconic()) if (win->isIconic())
win->iconify(); win->iconify();
} else if (win->isIconic()) } else if (win->isIconic())
win->deiconify(true, true); win->deiconify(true);
if (state & WIN_STATE_SHADED) { if (state & WIN_STATE_SHADED) {
#ifdef DEBUG #ifdef DEBUG

View file

@ -545,7 +545,7 @@ void FluxboxWindow::init() {
iconify(); iconify();
} else if (m_workspace_number == screen().currentWorkspaceID()) { } else if (m_workspace_number == screen().currentWorkspaceID()) {
iconic = true; iconic = true;
deiconify(false); deiconify();
// check if we should prevent this window from gaining focus // check if we should prevent this window from gaining focus
if (!allowsFocusFromClient() || Fluxbox::instance()->isStartup()) if (!allowsFocusFromClient() || Fluxbox::instance()->isStartup())
m_focused = false; m_focused = false;
@ -1416,57 +1416,41 @@ void FluxboxWindow::iconify() {
// focus revert is done elsewhere (based on signal) // focus revert is done elsewhere (based on signal)
} }
void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { void FluxboxWindow::deiconify(bool do_raise) {
if (numClients() == 0) if (numClients() == 0 || !iconic || oplock)
return; return;
if (oplock) return;
oplock = true; oplock = true;
if (iconic && // reassociate first, so it gets removed from screen's icon list
m_workspace_number != screen().currentWorkspace()->workspaceID()) { screen().reassociateWindow(this, m_workspace_number, false);
// reassociate first, so it gets removed from screen's icon list
screen().reassociateWindow(this, m_workspace_number, false);
iconic = false;
return;
}
if (iconic || reassoc)
screen().reassociateWindow(this, screen().currentWorkspaceID(), false);
else if (moving || m_workspace_number != screen().currentWorkspaceID()) {
oplock = false;
return;
}
bool was_iconic = iconic;
iconic = false; iconic = false;
m_statesig.notify(); m_statesig.notify();
if (reassoc && !m_client->transients.empty()) { // deiconify all transients
// deiconify all transients ClientList::iterator client_it = clientList().begin();
ClientList::iterator client_it = clientList().begin(); ClientList::iterator client_it_end = clientList().end();
ClientList::iterator client_it_end = clientList().end(); for (; client_it != client_it_end; ++client_it) {
for (; client_it != client_it_end; ++client_it) { WinClient::TransientList::iterator trans_it =
//TODO: Can this get stuck in a loop? (*client_it)->transientList().begin();
WinClient::TransientList::iterator trans_it = WinClient::TransientList::iterator trans_it_end =
(*client_it)->transientList().begin(); (*client_it)->transientList().end();
WinClient::TransientList::iterator trans_it_end = for (; trans_it != trans_it_end; ++trans_it) {
(*client_it)->transientList().end(); if ((*trans_it)->fbwindow())
for (; trans_it != trans_it_end; ++trans_it) { (*trans_it)->fbwindow()->deiconify(false);
if ((*trans_it)->fbwindow())
(*trans_it)->fbwindow()->deiconify(true, false);
}
} }
} }
if (m_workspace_number != screen().currentWorkspaceID())
return;
show(); show();
// focus new, OR if it's the only window on the workspace // focus new, OR if it's the only window on the workspace
// but not on startup: focus will be handled after creating everything // but not on startup: focus will be handled after creating everything
// we use m_focused as a signal to focus the window when mapped // we use m_focused as a signal to focus the window when mapped
if (was_iconic && (screen().currentWorkspace()->numberOfWindows() == 1 || if (screen().currentWorkspace()->numberOfWindows() == 1 ||
screen().focusControl().focusNew() || m_client->isTransient())) screen().focusControl().focusNew() || m_client->isTransient())
m_focused = true; m_focused = true;
oplock = false; oplock = false;
@ -2231,7 +2215,7 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) {
return; return;
setCurrentClient(*client, false); // focus handled on MapNotify setCurrentClient(*client, false); // focus handled on MapNotify
deiconify(false); deiconify();
} }

View file

@ -256,10 +256,9 @@ public:
void iconify(); void iconify();
/** /**
* Deiconify window * Deiconify window
* @param reassoc reassociate the window to the current workspace
* @param do_raise raise the window when its been deiconfied * @param do_raise raise the window when its been deiconfied
*/ */
void deiconify(bool reassoc = true, bool do_raise = true); void deiconify(bool do_raise = true);
// ------------------ // ------------------
// Per window transparency addons // Per window transparency addons