diff options
author | fluxgen <fluxgen> | 2002-08-16 11:02:41 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-08-16 11:02:41 (GMT) |
commit | 78a5efdae49a942a995bc21d172abd5cc364fd91 (patch) | |
tree | 2271acb8ec4b9dfa3fea696f27c37bd40232af62 /src | |
parent | 471785b9d8a77bb3e483a6cac10ea64e8019cd12 (diff) | |
download | fluxbox_pavel-78a5efdae49a942a995bc21d172abd5cc364fd91.zip fluxbox_pavel-78a5efdae49a942a995bc21d172abd5cc364fd91.tar.bz2 |
restore with remap and some extra checking
Diffstat (limited to 'src')
-rw-r--r-- | src/Workspace.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc index 6218a69..ad67c8b 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Workspace.cc,v 1.23 2002/08/11 22:35:40 fluxgen Exp $ | 25 | // $Id: Workspace.cc,v 1.24 2002/08/16 11:02:41 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Workspace.hh" | 27 | #include "Workspace.hh" |
28 | 28 | ||
@@ -135,18 +135,20 @@ int Workspace::removeWindow(FluxboxWindow *w) { | |||
135 | stackingList.remove(w); | 135 | stackingList.remove(w); |
136 | 136 | ||
137 | if (w->isFocused()) { | 137 | if (w->isFocused()) { |
138 | if (screen->isSloppyFocus()) | 138 | if (screen->isSloppyFocus()) { |
139 | Fluxbox::instance()->setFocusedWindow((FluxboxWindow *) 0); | 139 | Fluxbox::instance()->setFocusedWindow(0); // set focused window to none |
140 | else if (w->isTransient() && w->getTransientFor() && | 140 | } else if (w->isTransient() && w->getTransientFor() && |
141 | w->getTransientFor()->isVisible()) | 141 | w->getTransientFor()->isVisible()) { |
142 | if (w->getTransientFor() == w) // FATAL ERROR, this should not happend | ||
143 | abort(); | ||
142 | w->getTransientFor()->setInputFocus(); | 144 | w->getTransientFor()->setInputFocus(); |
143 | else { | 145 | } else { |
144 | FluxboxWindow *top = 0; | 146 | FluxboxWindow *top = 0; |
145 | if (stackingList.size()!=0) | 147 | if (stackingList.size()!=0) |
146 | top = stackingList.front(); | 148 | top = stackingList.front(); |
147 | 149 | ||
148 | if (!top || !top->setInputFocus()) { | 150 | if (!top || !top->setInputFocus()) { |
149 | Fluxbox::instance()->setFocusedWindow((FluxboxWindow *) 0); | 151 | Fluxbox::instance()->setFocusedWindow(0); // set focused window to none |
150 | XSetInputFocus(Fluxbox::instance()->getXDisplay(), | 152 | XSetInputFocus(Fluxbox::instance()->getXDisplay(), |
151 | screen->getToolbar()->getWindowID(), | 153 | screen->getToolbar()->getWindowID(), |
152 | RevertToParent, CurrentTime); | 154 | RevertToParent, CurrentTime); |
@@ -155,7 +157,7 @@ int Workspace::removeWindow(FluxboxWindow *w) { | |||
155 | } | 157 | } |
156 | 158 | ||
157 | if (lastfocus == w) | 159 | if (lastfocus == w) |
158 | lastfocus = (FluxboxWindow *) 0; | 160 | lastfocus = 0; |
159 | 161 | ||
160 | //could be faster? | 162 | //could be faster? |
161 | Windows::iterator it = windowList.begin(); | 163 | Windows::iterator it = windowList.begin(); |
@@ -447,10 +449,10 @@ void Workspace::setName(const std::string &name) { | |||
447 | // on the workspace and then | 449 | // on the workspace and then |
448 | // clears the windowList | 450 | // clears the windowList |
449 | //------------------------------- | 451 | //------------------------------- |
450 | void Workspace::shutdown(void) { | 452 | void Workspace::shutdown() { |
451 | 453 | // note: when the window dies it'll remove it self from the list | |
452 | while (!windowList.empty()) { | 454 | while (!windowList.empty()) { |
453 | windowList.back()->restore(); | 455 | windowList.back()->restore(true); // restore with remap |
454 | delete windowList.back(); //delete window (the window removes it self from windowList) | 456 | delete windowList.back(); //delete window (the window removes it self from windowList) |
455 | } | 457 | } |
456 | } | 458 | } |