summaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-23 16:17:28 +0000
committerDana Jansens <danakj@orodu.net>2002-07-23 16:17:28 +0000
commit5cb2020b9b9cd146d7a5dffa47b44110d8d963ff (patch)
treeb8fded84f9521671f571e2727077df728b91392c /src/Screen.cc
parent733b4f4a3366eca53dc68fd40069b673b0261c96 (diff)
make modal dialogs unmodal before reassigning focus when they are unmanaged
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 6970fdf6..eee7db10 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1257,6 +1257,15 @@ void BScreen::manageWindow(Window w) {
void BScreen::unmanageWindow(BlackboxWindow *w, bool 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()) {
// we don't list non-normal windows as managed windows
windowList.remove(w);
@@ -1272,6 +1281,9 @@ void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
assert(it != end); // the window wasnt a desktop window?
}
+ if (blackbox->getFocusedWindow() == w)
+ blackbox->setFocusedWindow((BlackboxWindow *) 0);
+
removeNetizen(w->getClientWindow());
/*