~townsend/compiz/fix-lp1244754-0.9.10

« back to all changes in this revision

Viewing changes to src/window.cpp

Adjust acceptance tests for the fix to LP: #1198000

  1. Always set frame extents before updating the frame
  2. Added COMPIZ_NO_CONFIGURE_BUFFER_LOCKS so that we don't have to deal
     with the delayed configure requests logic in the tests where it
     does not help
  3. Split restoredDecorationSize in to restoredDecorationBorderSize
     and restoredDecorationInputSize so that we can measure the size of
     the decoration both in terms of its visible and invisible border
  4. Wait for the default decoration properly
  5. Capture the initial geometry of the window with and without decorations
     when the window gets its first decoration. Use these values to calculate
     the size changes in the window from then on instead of its creation
     values
  6. Just flag when the window was first decorated in setWindowFrameExtents
     rather than checking if it is mapped. We only want to not resize
     the window once.

Approved by PS Jenkins bot, Sam Spilsbury, Andrea Azzarone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6273
6273
 
6274
6274
namespace
6275
6275
{
 
6276
class NullConfigureBufferLock :
 
6277
    public crb::BufferLock
 
6278
{
 
6279
    public:
 
6280
 
 
6281
        NullConfigureBufferLock (crb::CountedFreeze *cf) {}
 
6282
 
 
6283
        void lock () {}
 
6284
        void release () {}
 
6285
};
 
6286
 
6276
6287
crb::BufferLock::Ptr
6277
6288
createConfigureBufferLock (crb::CountedFreeze *cf)
6278
6289
{
 
6290
    /* Return an implementation that does nothing if the user explicitly
 
6291
     * disabled buffer locks for this running instance */
 
6292
    if (getenv ("COMPIZ_NO_CONFIGURE_BUFFER_LOCKS"))
 
6293
        return boost::make_shared <NullConfigureBufferLock> (cf);
 
6294
 
6279
6295
    return boost::make_shared <crb::ConfigureBufferLock> (cf);
6280
6296
}
6281
6297
}
6322
6338
    shaded (false),
6323
6339
    hidden (false),
6324
6340
    grabbed (false),
 
6341
    alreadyDecorated (false),
6325
6342
 
6326
6343
    desktop (0),
6327
6344
 
6568
6585
 
6569
6586
        CompSize sizeDelta;
6570
6587
 
6571
 
        if (isMapped())
6572
 
            sizeDelta = CompSize (-((b->left + b->right) -
6573
 
                                     (priv->border.left + priv->border.right)),
6574
 
                                  -((b->top + b->bottom) -
6575
 
                                     (priv->border.top + priv->border.bottom)));
 
6588
        /* We don't want to change the size of the window the first time we
 
6589
         * decorate it, but we do thereafter */
 
6590
        if (priv->alreadyDecorated)
 
6591
        {
 
6592
            sizeDelta.setWidth (-((b->left + b->right) -
 
6593
                                  (priv->border.left + priv->border.right)));
 
6594
            sizeDelta.setHeight (-((b->top + b->bottom) -
 
6595
                                   (priv->border.top + priv->border.bottom)));
 
6596
        }
 
6597
        else
 
6598
            priv->alreadyDecorated = true;
6576
6599
 
6577
6600
        priv->serverInput = *i;
6578
6601
        priv->border      = *b;