diff options
author | fluxgen <fluxgen> | 2002-09-10 10:55:34 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-09-10 10:55:34 (GMT) |
commit | 51ce17d9fe75ee5828cfca144e43548cfa3d2da6 (patch) | |
tree | 4107ac411c1ee1b5018578fe8003efce7443ad77 /src | |
parent | 92fbd4b4c5404c0d8c62e9778327f8ddde78052d (diff) | |
download | fluxbox_lack-51ce17d9fe75ee5828cfca144e43548cfa3d2da6.zip fluxbox_lack-51ce17d9fe75ee5828cfca144e43548cfa3d2da6.tar.bz2 |
transient fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/Window.cc | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/Window.cc b/src/Window.cc index aeaad5e..34eee3d 100644 --- a/src/Window.cc +++ b/src/Window.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: Window.cc,v 1.82 2002/09/08 23:47:03 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.83 2002/09/10 10:55:34 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -301,7 +301,7 @@ tab(0) { | |||
301 | XMapSubwindows(display, frame.window); | 301 | XMapSubwindows(display, frame.window); |
302 | 302 | ||
303 | if (decorations.menu) | 303 | if (decorations.menu) |
304 | windowmenu = new Windowmenu(this); | 304 | windowmenu = new Windowmenu(*this); |
305 | 305 | ||
306 | if (workspace_number < 0 || workspace_number >= screen->getCount()) | 306 | if (workspace_number < 0 || workspace_number >= screen->getCount()) |
307 | screen->getCurrentWorkspace()->addWindow(this, place_window); | 307 | screen->getCurrentWorkspace()->addWindow(this, place_window); |
@@ -373,9 +373,15 @@ FluxboxWindow::~FluxboxWindow() { | |||
373 | 373 | ||
374 | 374 | ||
375 | if (client.transient_for != 0) { | 375 | if (client.transient_for != 0) { |
376 | if (client.transient_for == this) { | ||
377 | client.transient_for = 0; | ||
378 | } | ||
379 | |||
376 | fluxbox->setFocusedWindow(client.transient_for); | 380 | fluxbox->setFocusedWindow(client.transient_for); |
377 | client.transient_for->client.transients.remove(this); | 381 | if (client.transient_for) { |
378 | client.transient_for = 0; | 382 | client.transient_for->client.transients.remove(this); |
383 | client.transient_for = 0; | ||
384 | } | ||
379 | } | 385 | } |
380 | 386 | ||
381 | while (!client.transients.empty()) { | 387 | while (!client.transients.empty()) { |
@@ -1598,7 +1604,7 @@ void FluxboxWindow::iconify() { | |||
1598 | 1604 | ||
1599 | screen->getWorkspace(workspace_number)->removeWindow(this); | 1605 | screen->getWorkspace(workspace_number)->removeWindow(this); |
1600 | 1606 | ||
1601 | if (transient && client.transient_for) { | 1607 | if (client.transient_for) { |
1602 | if (! client.transient_for->iconic) | 1608 | if (! client.transient_for->iconic) |
1603 | client.transient_for->iconify(); | 1609 | client.transient_for->iconify(); |
1604 | } | 1610 | } |
@@ -2373,9 +2379,9 @@ void FluxboxWindow::restoreAttributes() { | |||
2373 | void FluxboxWindow::showMenu(int mx, int my) { | 2379 | void FluxboxWindow::showMenu(int mx, int my) { |
2374 | windowmenu->move(mx, my); | 2380 | windowmenu->move(mx, my); |
2375 | windowmenu->show(); | 2381 | windowmenu->show(); |
2376 | XRaiseWindow(display, windowmenu->windowID()); | 2382 | windowmenu->raise(); |
2377 | XRaiseWindow(display, windowmenu->getSendToMenu()->windowID()); | 2383 | windowmenu->getSendToMenu().raise(); |
2378 | XRaiseWindow(display, windowmenu->getSendGroupToMenu()->windowID()); | 2384 | windowmenu->getSendGroupToMenu().raise(); |
2379 | } | 2385 | } |
2380 | 2386 | ||
2381 | void FluxboxWindow::restoreGravity() { | 2387 | void FluxboxWindow::restoreGravity() { |
@@ -3489,32 +3495,31 @@ void FluxboxWindow::checkTransient() { | |||
3489 | 3495 | ||
3490 | // determine if this is a transient window | 3496 | // determine if this is a transient window |
3491 | Window win; | 3497 | Window win; |
3492 | if (!XGetTransientForHint(display, client.window, &win)) { | 3498 | if (!XGetTransientForHint(display, client.window, &win)) |
3493 | client.transient_for = 0; | ||
3494 | return; | 3499 | return; |
3495 | } | ||
3496 | |||
3497 | 3500 | ||
3498 | if (win == client.window) | 3501 | if (win == client.window) |
3499 | return; | 3502 | return; |
3500 | 3503 | ||
3501 | if (win == screen->getRootWindow()) | 3504 | if (win == screen->getRootWindow() && win != 0) { |
3502 | modal = true; | 3505 | modal = true; |
3506 | return; | ||
3507 | } | ||
3503 | 3508 | ||
3504 | client.transient_for = Fluxbox::instance()->searchWindow(win); | 3509 | client.transient_for = Fluxbox::instance()->searchWindow(win); |
3505 | if (client.transient_for != 0 && | 3510 | if (client.transient_for != 0 && |
3506 | client.window_group != None && win == client.window_group) { | 3511 | client.window_group != None && win == client.window_group) { |
3507 | 3512 | client.transient_for = Fluxbox::instance()->searchGroup(win, this); | |
3508 | FluxboxWindow *leader = Fluxbox::instance()->searchGroup(win, this); | ||
3509 | if (leader != 0) | ||
3510 | client.transient_for = leader; | ||
3511 | return; | ||
3512 | } | 3513 | } |
3513 | 3514 | ||
3514 | // make sure we don't have deadlock loop in transient chain | 3515 | // make sure we don't have deadlock loop in transient chain |
3515 | for (FluxboxWindow *w = this; w != 0; w = w->client.transient_for) { | 3516 | for (FluxboxWindow *w = this; w != 0; w = w->client.transient_for) { |
3516 | if (w == w->client.transient_for) { | 3517 | if (w == w->client.transient_for) { |
3517 | w->client.transient_for = 0; | 3518 | w->client.transient_for = 0; |
3519 | #ifdef DEBUG | ||
3520 | cerr<<"w = client.transient_for"; | ||
3521 | #endif // DEBUG | ||
3522 | break; | ||
3518 | } | 3523 | } |
3519 | } | 3524 | } |
3520 | 3525 | ||
@@ -3524,6 +3529,7 @@ void FluxboxWindow::checkTransient() { | |||
3524 | client.transient_for->client.transients.unique(); | 3529 | client.transient_for->client.transients.unique(); |
3525 | stuck = client.transient_for->stuck; | 3530 | stuck = client.transient_for->stuck; |
3526 | } | 3531 | } |
3532 | |||
3527 | } | 3533 | } |
3528 | 3534 | ||
3529 | void FluxboxWindow::restore(bool remap) { | 3535 | void FluxboxWindow::restore(bool remap) { |