~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174

« back to all changes in this revision

Viewing changes to src/window.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-04-15 17:08:40 UTC
  • mfrom: (0.168.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20110415170840-x56m5m6qs4b7n8rb
Tags: 1:0.9.4+bzr20110415-0ubuntu1
* New upstream snapshot
  - Focus problem with Thunderbird (LP: #753951)
  - Chromium fullscreen + Alt-TAB confuses the launcher (LP: #757434)
  - compiz hangs randomly several times per day (LP: #740126)
* debian/patches/00_*:
  - removed as part of upstream tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1226
1226
        }
1227
1227
 
1228
1228
        XUngrabServer (screen->dpy ());
 
1229
        XSync (screen->dpy (), false);
1229
1230
    }
1230
1231
    else
1231
1232
    {
2034
2035
        {
2035
2036
            ancestor = screen->findWindow (priv->transientFor);
2036
2037
            if (ancestor &&
 
2038
                ancestor->focus () &&
2037
2039
                !(ancestor->priv->type & (CompWindowTypeDesktopMask |
2038
2040
                                          CompWindowTypeDockMask)))
2039
2041
            {
2188
2190
            break;
2189
2191
        default:
2190
2192
            /* fullscreen and normal layer */
2191
 
            if (!(below->priv->type & belowMask))
2192
 
            {
 
2193
            if (!(below->priv->type & belowMask))
2193
2194
                if (stackLayerCheck (w, clientLeader, below))
2194
 
                    return below;
2195
 
            }
 
2195
                    return below;
2196
2196
            break;
2197
2197
        }
2198
2198
    }
2561
2561
    {
2562
2562
        CompWindowList transients;
2563
2563
        CompWindowList ancestors;
 
2564
        CompWindow     *siblingToThisWindow;
 
2565
        unsigned int   stackMode;
2564
2566
 
2565
2567
        /* Since the window list is being reordered in reconfigureXWindow
2566
2568
           the list of windows which need to be restacked must be stored
2582
2584
                xwc->sibling = ROOTPARENT (*w);
2583
2585
            }
2584
2586
 
 
2587
            /* First restack this window */
2585
2588
            this->priv->reconfigureXWindow (valueMask, xwc);
 
2589
            siblingToThisWindow = screen->findTopLevelWindow (xwc->sibling);
 
2590
            stackMode           = xwc->stack_mode;
 
2591
 
2586
2592
            xwc->sibling = ROOTPARENT (this);
2587
2593
 
 
2594
            /* Now restack the transient children above */
2588
2595
            for (CompWindowList::reverse_iterator w = transients.rbegin ();
2589
2596
                 w != transients.rend (); w++)
2590
2597
            {
2591
2598
                (*w)->priv->reconfigureXWindow (CWSibling | CWStackMode, xwc);
2592
2599
                xwc->sibling = ROOTPARENT (*w);
2593
2600
            }
 
2601
 
 
2602
            if (siblingToThisWindow && stackMode == Above)
 
2603
            {
 
2604
                /* a normal window can be stacked above fullscreen windows but we
 
2605
                   don't want normal windows to be stacked above dock window so if
 
2606
                   the sibling we're stacking above is a fullscreen window we also
 
2607
                   update all dock windows. */
 
2608
                if ((siblingToThisWindow->priv->type & CompWindowTypeFullscreenMask) &&
 
2609
                    (!(this->priv-> type & (CompWindowTypeFullscreenMask |
 
2610
                                            CompWindowTypeDockMask))) &&
 
2611
                     !PrivateWindow::isAncestorTo (this, siblingToThisWindow))
 
2612
                {
 
2613
                    XWindowChanges dxwc;
 
2614
                    unsigned int   dmask = CWSibling | CWStackMode;
 
2615
                    CompWindow     *dw;
 
2616
 
 
2617
                    /* Find the sibling fullscreen window */
 
2618
                    for (dw = screen->windows ().back (); dw; dw = dw->prev)
 
2619
                        if (dw == siblingToThisWindow)
 
2620
                            break;
 
2621
 
 
2622
                    /* Collect all dock windows first */
 
2623
                    CompWindowList dockWindows;
 
2624
                    for (; dw; dw = dw->prev)
 
2625
                        if (dw->priv->type & CompWindowTypeDockMask)
 
2626
                            dockWindows.push_back (dw);
 
2627
 
 
2628
                    /* Then update the dock windows */
 
2629
                    foreach (CompWindow *dw, dockWindows)
 
2630
                    {
 
2631
                        /* Stack above the window being stacked above the docks */
 
2632
                        dxwc.stack_mode = Above;
 
2633
                        dxwc.sibling = ROOTPARENT (this);
 
2634
 
 
2635
                        dw->configureXWindow (dmask, &dxwc);
 
2636
                    }
 
2637
                }
 
2638
            }
2594
2639
        }
2595
2640
    }
2596
2641
    else
3059
3104
        }
3060
3105
    }
3061
3106
 
3062
 
    if (sibling && mask)
3063
 
    {
3064
 
        /* a normal window can be stacked above fullscreen windows but we
3065
 
           don't want normal windows to be stacked above dock window so if
3066
 
           the sibling we're stacking above is a fullscreen window we also
3067
 
           update all dock windows. */
3068
 
        if ((sibling->priv->type & CompWindowTypeFullscreenMask) &&
3069
 
            (!(type & (CompWindowTypeFullscreenMask |
3070
 
                          CompWindowTypeDockMask))) &&
3071
 
            !isAncestorTo (window, sibling))
3072
 
        {
3073
 
            CompWindow *dw;
3074
 
 
3075
 
            for (dw = screen->windows ().back (); dw; dw = dw->prev)
3076
 
                if (dw == sibling)
3077
 
                    break;
3078
 
 
3079
 
            /* Collect all dock windows first */
3080
 
            CompWindowList dockWindows;
3081
 
            for (; dw; dw = dw->prev)
3082
 
                if (dw->priv->type & CompWindowTypeDockMask)
3083
 
                    dockWindows.push_back (dw);
3084
 
 
3085
 
            /* Then update the dock windows */
3086
 
            foreach (CompWindow *dw, dockWindows)
3087
 
                dw->configureXWindow (mask, xwc);
3088
 
        }
3089
 
    }
3090
 
 
3091
3107
    return mask;
3092
3108
}
3093
3109
 
5814
5830
                  ExposureMask);
5815
5831
 
5816
5832
    XUngrabServer (dpy);
 
5833
    XSync (dpy, false);
5817
5834
 
5818
5835
    XMoveResizeWindow (dpy, frame, sg.x (), sg.y (), sg.width (), sg.height ());
5819
5836
 
5884
5901
                  ExposureMask);
5885
5902
 
5886
5903
        XUngrabServer (dpy);
 
5904
        XSync (dpy, false);
5887
5905
 
5888
5906
        XMoveWindow (dpy, id, serverGeometry.x (), serverGeometry.y ());
5889
5907
    }