make modal dialogs unmodal before reassigning focus when they are unmanaged
This commit is contained in:
parent
733b4f4a33
commit
5cb2020b9b
2 changed files with 17 additions and 14 deletions
|
@ -1257,6 +1257,15 @@ void BScreen::manageWindow(Window w) {
|
||||||
void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
|
void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
|
||||||
w->restore(remap);
|
w->restore(remap);
|
||||||
|
|
||||||
|
// Remove the modality so that its parent won't try to re-focus the window
|
||||||
|
if (w->isModal()) w->setModal(False);
|
||||||
|
|
||||||
|
if (w->getWorkspaceNumber() != BSENTINEL &&
|
||||||
|
w->getWindowNumber() != BSENTINEL)
|
||||||
|
getWorkspace(w->getWorkspaceNumber())->removeWindow(w);
|
||||||
|
else if (w->isIconic())
|
||||||
|
removeIcon(w);
|
||||||
|
|
||||||
if (w->isNormal()) {
|
if (w->isNormal()) {
|
||||||
// we don't list non-normal windows as managed windows
|
// we don't list non-normal windows as managed windows
|
||||||
windowList.remove(w);
|
windowList.remove(w);
|
||||||
|
@ -1272,6 +1281,9 @@ void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
|
||||||
assert(it != end); // the window wasnt a desktop window?
|
assert(it != end); // the window wasnt a desktop window?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blackbox->getFocusedWindow() == w)
|
||||||
|
blackbox->setFocusedWindow((BlackboxWindow *) 0);
|
||||||
|
|
||||||
removeNetizen(w->getClientWindow());
|
removeNetizen(w->getClientWindow());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -347,6 +347,10 @@ BlackboxWindow::~BlackboxWindow(void) {
|
||||||
if (flags.moving)
|
if (flags.moving)
|
||||||
endMove();
|
endMove();
|
||||||
|
|
||||||
|
delete timer;
|
||||||
|
|
||||||
|
delete windowmenu;
|
||||||
|
|
||||||
if (client.window_group) {
|
if (client.window_group) {
|
||||||
BWindowGroup *group = blackbox->searchGroup(client.window_group);
|
BWindowGroup *group = blackbox->searchGroup(client.window_group);
|
||||||
if (group) group->removeWindow(this);
|
if (group) group->removeWindow(this);
|
||||||
|
@ -357,18 +361,9 @@ BlackboxWindow::~BlackboxWindow(void) {
|
||||||
if (client.transient_for != (BlackboxWindow *) ~0ul) {
|
if (client.transient_for != (BlackboxWindow *) ~0ul) {
|
||||||
client.transient_for->client.transientList.remove(this);
|
client.transient_for->client.transientList.remove(this);
|
||||||
}
|
}
|
||||||
// we save our transient_for though because the workspace will use it
|
client.transient_for = (BlackboxWindow*) 0;
|
||||||
// when determining the next window to get focus
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blackbox_attrib.workspace != BSENTINEL &&
|
|
||||||
window_number != BSENTINEL)
|
|
||||||
screen->getWorkspace(blackbox_attrib.workspace)->removeWindow(this);
|
|
||||||
else if (flags.iconic)
|
|
||||||
screen->removeIcon(this);
|
|
||||||
|
|
||||||
client.transient_for = (BlackboxWindow*) 0;
|
|
||||||
|
|
||||||
if (client.transientList.size() > 0) {
|
if (client.transientList.size() > 0) {
|
||||||
// reset transient_for for all transients
|
// reset transient_for for all transients
|
||||||
BlackboxWindowList::iterator it, end = client.transientList.end();
|
BlackboxWindowList::iterator it, end = client.transientList.end();
|
||||||
|
@ -377,10 +372,6 @@ BlackboxWindow::~BlackboxWindow(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete timer;
|
|
||||||
|
|
||||||
delete windowmenu;
|
|
||||||
|
|
||||||
if (frame.title)
|
if (frame.title)
|
||||||
destroyTitlebar();
|
destroyTitlebar();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue