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

View file

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

View file

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

View file

@ -256,10 +256,9 @@ public:
void iconify();
/**
* Deiconify window
* @param reassoc reassociate the window to the current workspace
* @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