diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Window.cc | 68 |
1 files changed, 50 insertions, 18 deletions
diff --git a/src/Window.cc b/src/Window.cc index 3104847..741892a 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.73 2002/08/30 14:06:40 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.74 2002/08/30 16:07:17 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -380,10 +380,15 @@ FluxboxWindow::~FluxboxWindow() { | |||
380 | if (client.transient_for == this) { | 380 | if (client.transient_for == this) { |
381 | #ifdef DEBUG | 381 | #ifdef DEBUG |
382 | cerr<<__FILE__<<"("<<__LINE__<<"): WARNING! client.transient_for == this WARNING!"<<endl; | 382 | cerr<<__FILE__<<"("<<__LINE__<<"): WARNING! client.transient_for == this WARNING!"<<endl; |
383 | assert(0); | ||
383 | #endif //DEBUG | 384 | #endif //DEBUG |
384 | client.transient_for = 0; | 385 | client.transient_for = 0; |
386 | |||
387 | } | ||
388 | if (client.transient == this) { | ||
389 | client.transient = 0; | ||
390 | assert(0); | ||
385 | } | 391 | } |
386 | |||
387 | fluxbox->setFocusedWindow(client.transient_for); | 392 | fluxbox->setFocusedWindow(client.transient_for); |
388 | } | 393 | } |
389 | 394 | ||
@@ -3746,6 +3751,10 @@ void FluxboxWindow::destroyHandle() { | |||
3746 | } | 3751 | } |
3747 | 3752 | ||
3748 | void FluxboxWindow::checkTransient() { | 3753 | void FluxboxWindow::checkTransient() { |
3754 | // default values | ||
3755 | client.transient_for = 0; | ||
3756 | client.transient = 0; | ||
3757 | |||
3749 | Fluxbox *fluxbox = Fluxbox::instance(); | 3758 | Fluxbox *fluxbox = Fluxbox::instance(); |
3750 | // determine if this is a transient window | 3759 | // determine if this is a transient window |
3751 | Window win; | 3760 | Window win; |
@@ -3753,36 +3762,59 @@ void FluxboxWindow::checkTransient() { | |||
3753 | client.transient_for = 0; | 3762 | client.transient_for = 0; |
3754 | return; | 3763 | return; |
3755 | } | 3764 | } |
3765 | |||
3766 | if (win == client.window) | ||
3767 | return; | ||
3768 | |||
3756 | if (win && (win != client.window)) { | 3769 | if (win && (win != client.window)) { |
3757 | FluxboxWindow *tr; | 3770 | FluxboxWindow *tr = fluxbox->searchWindow(win); |
3758 | if ((tr = fluxbox->searchWindow(win))) { | 3771 | if (tr != 0) { |
3759 | 3772 | ||
3760 | while (tr->client.transient) { | 3773 | while (tr->client.transient != 0) { |
3761 | tr = tr->client.transient; | 3774 | tr = tr->client.transient; |
3762 | if (tr && tr == tr->client.transient) { //ops! something is wrong with transient | 3775 | if (tr == tr->client.transient) { //ops! something is wrong with transient |
3763 | tr->client.transient = 0; | 3776 | tr->client.transient = 0; |
3777 | if (tr->client.transient_for == tr) | ||
3778 | tr->client.transient_for = 0; | ||
3779 | break; | ||
3764 | } | 3780 | } |
3765 | } | 3781 | } |
3766 | 3782 | ||
3767 | 3783 | if (tr != this) { | |
3768 | client.transient_for = tr; | 3784 | client.transient_for = tr; |
3769 | tr->client.transient = this; | 3785 | tr->client.transient = this; |
3770 | stuck = client.transient_for->stuck; | 3786 | transient = true; |
3771 | transient = true; | 3787 | } else { |
3788 | client.transient_for = 0; | ||
3789 | client.transient = 0; | ||
3790 | } | ||
3791 | if (client.transient_for != 0) { | ||
3792 | stuck = client.transient_for->stuck; | ||
3793 | } | ||
3794 | |||
3772 | } else if (win == client.window_group) { | 3795 | } else if (win == client.window_group) { |
3773 | if ((tr = fluxbox->searchGroup(win, this))) { | 3796 | if ((tr = fluxbox->searchGroup(win, this))) { |
3774 | 3797 | ||
3775 | while (tr->client.transient) { | 3798 | while (tr->client.transient != 0) { |
3776 | tr = tr->client.transient; | 3799 | tr = tr->client.transient; |
3777 | if (tr && tr == tr->client.transient) { //ops! somehtin is wrong with transient | 3800 | if (tr && tr == tr->client.transient) { //ops! somehtin is wrong with transient |
3778 | tr->client.transient = 0; | 3801 | tr->client.transient = 0; |
3779 | } | 3802 | } |
3780 | } | 3803 | } |
3781 | 3804 | ||
3782 | client.transient_for = tr; | 3805 | if (tr != this) { |
3783 | tr->client.transient = this; | 3806 | client.transient_for = tr; |
3784 | stuck = client.transient_for->stuck; | 3807 | tr->client.transient = this; |
3785 | transient = true; | 3808 | transient = true; |
3809 | } else { | ||
3810 | client.transient_for = 0; | ||
3811 | client.transient = 0; | ||
3812 | } | ||
3813 | |||
3814 | if (client.transient_for != 0) { | ||
3815 | stuck = client.transient_for->stuck; | ||
3816 | } | ||
3817 | |||
3786 | } | 3818 | } |
3787 | } | 3819 | } |
3788 | } | 3820 | } |