Merge lp:~compiz-team/compiz/compiz.fix_1198000.update-tests.1 into lp:compiz/0.9.10

Proposed by Sam Spilsbury
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3757
Merged at revision: 3765
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1198000.update-tests.1
Merge into: lp:compiz/0.9.10
Prerequisite: lp:~azzar1/compiz/fix-1198000
Diff against target: 725 lines (+333/-75)
5 files modified
plugins/decor/src/decor.cpp (+6/-4)
plugins/decor/tests/acceptance/xorg-gtest/CMakeLists.txt (+1/-0)
plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp (+297/-66)
src/privatewindow.h (+1/-0)
src/window.cpp (+28/-5)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1198000.update-tests.1
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sam Spilsbury Approve
Andrea Azzarone Approve
Review via email: mp+174649@code.launchpad.net

This proposal supersedes a proposal from 2013-07-15.

Commit message

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.

Description of the change

  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.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
3757. By Sam Spilsbury

Merge lp:compiz

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/decor/src/decor.cpp'
--- plugins/decor/src/decor.cpp 2013-06-28 01:10:57 +0000
+++ plugins/decor/src/decor.cpp 2013-07-19 04:17:27 +0000
@@ -1651,14 +1651,16 @@
1651 CompWindowExtents emptyExtents;1651 CompWindowExtents emptyExtents;
1652 wd = NULL;1652 wd = NULL;
16531653
1654 /* _NET_FRAME_EXTENTS should be updated before the frame
1655 * atom is */
1656 memset (&emptyExtents, 0, sizeof (CompWindowExtents));
1657
1658 window->setWindowFrameExtents (&emptyExtents, &emptyExtents);
1659
1654 /* Undecorated windows need to have the1660 /* Undecorated windows need to have the
1655 * input and output frame removed and the1661 * input and output frame removed and the
1656 * frame window geometry reset */1662 * frame window geometry reset */
1657 updateFrame ();1663 updateFrame ();
1658
1659 memset (&emptyExtents, 0, sizeof (CompWindowExtents));
1660
1661 window->setWindowFrameExtents (&emptyExtents, &emptyExtents);
1662 }1664 }
16631665
1664 /* We need to damage the current output extents1666 /* We need to damage the current output extents
16651667
=== modified file 'plugins/decor/tests/acceptance/xorg-gtest/CMakeLists.txt'
--- plugins/decor/tests/acceptance/xorg-gtest/CMakeLists.txt 2013-06-28 21:07:41 +0000
+++ plugins/decor/tests/acceptance/xorg-gtest/CMakeLists.txt 2013-07-19 04:17:27 +0000
@@ -22,6 +22,7 @@
22 decoration22 decoration
23 compiz_point23 compiz_point
24 compiz_size24 compiz_size
25 compiz_rect
25 ${GMOCK_LIBRARY}26 ${GMOCK_LIBRARY}
26 ${GMOCK_MAIN_LIBRARY}27 ${GMOCK_MAIN_LIBRARY}
27 ${GTEST_BOTH_LIBRARIES}28 ${GTEST_BOTH_LIBRARIES}
2829
=== modified file 'plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp'
--- plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp 2013-06-29 07:07:12 +0000
+++ plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp 2013-07-19 04:17:27 +0000
@@ -38,10 +38,13 @@
3838
39#include <core/point.h>39#include <core/point.h>
40#include <core/size.h>40#include <core/size.h>
41#include <core/rect.h>
4142
42#include <xorg/gtest/xorg-gtest.h>43#include <xorg/gtest/xorg-gtest.h>
43#include <compiz-xorg-gtest.h>44#include <compiz-xorg-gtest.h>
4445
46#include <gtest_shared_tmpenv.h>
47
45namespace xt = xorg::testing;48namespace xt = xorg::testing;
46namespace ct = compiz::testing;49namespace ct = compiz::testing;
4750
@@ -83,6 +86,8 @@
83 Atom mDecorationInputFrameAtom;86 Atom mDecorationInputFrameAtom;
84 Atom mDecorationOutputFrameAtom;87 Atom mDecorationOutputFrameAtom;
8588
89 TmpEnv mDisableConfigureBufferLocksEnv;
90
86 private:91 private:
8792
88 int GetEventMask () const;93 int GetEventMask () const;
@@ -96,7 +101,10 @@
96 mDecorationTypePixmap (0),101 mDecorationTypePixmap (0),
97 mDecorationTypeWindow (0),102 mDecorationTypeWindow (0),
98 mDecorationInputFrameAtom (0),103 mDecorationInputFrameAtom (0),
99 mDecorationOutputFrameAtom (0)104 mDecorationOutputFrameAtom (0),
105 /* Disable configure buffer locks as they cause event delivery indeterminacy
106 * that isn't useful for a testing environment */
107 mDisableConfigureBufferLocksEnv ("COMPIZ_NO_CONFIGURE_BUFFER_LOCKS", "1")
100{108{
101}109}
102110
@@ -256,7 +264,8 @@
256 unsigned int actions) const;264 unsigned int actions) const;
257265
258 virtual CompPoint restoredFrameWindowOffset () const = 0;266 virtual CompPoint restoredFrameWindowOffset () const = 0;
259 virtual CompSize restoredDecorationSize () const = 0;267 virtual CompSize restoredDecorationBorderSize () const = 0;
268 virtual CompSize restoredDecorationInputSize () const = 0;
260269
261 protected:270 protected:
262271
@@ -290,7 +299,8 @@
290 size_t propertyDataSize () const;299 size_t propertyDataSize () const;
291 void addPropertyData (std::vector<long> &) const;300 void addPropertyData (std::vector<long> &) const;
292 CompPoint restoredFrameWindowOffset () const;301 CompPoint restoredFrameWindowOffset () const;
293 CompSize restoredDecorationSize () const;302 CompSize restoredDecorationBorderSize () const;
303 CompSize restoredDecorationInputSize () const;
294304
295 static const unsigned int WindowDecorationSize = 8;305 static const unsigned int WindowDecorationSize = 8;
296306
@@ -323,7 +333,8 @@
323 void changeRestoredInput (const decor_extents_t &input);333 void changeRestoredInput (const decor_extents_t &input);
324334
325 CompPoint restoredFrameWindowOffset () const;335 CompPoint restoredFrameWindowOffset () const;
326 CompSize restoredDecorationSize () const;336 CompSize restoredDecorationBorderSize () const;
337 CompSize restoredDecorationInputSize () const;
327338
328 protected:339 protected:
329340
@@ -619,12 +630,18 @@
619}630}
620631
621CompSize632CompSize
622cdt::FakeWindowTypeDecoration::restoredDecorationSize () const633cdt::FakeWindowTypeDecoration::restoredDecorationBorderSize () const
623{634{
624 return CompSize (mRestored.left + mRestored.right,635 return CompSize (mRestored.left + mRestored.right,
625 mRestored.top + mRestored.bottom);636 mRestored.top + mRestored.bottom);
626}637}
627638
639CompSize
640cdt::FakeWindowTypeDecoration::restoredDecorationInputSize () const
641{
642 return restoredDecorationBorderSize ();
643}
644
628cdt::FakePixmapTypeDecoration::FakePixmapTypeDecoration (unsigned int type,645cdt::FakePixmapTypeDecoration::FakePixmapTypeDecoration (unsigned int type,
629 unsigned int state,646 unsigned int state,
630 unsigned int actions,647 unsigned int actions,
@@ -713,7 +730,14 @@
713}730}
714731
715CompSize732CompSize
716cdt::FakePixmapTypeDecoration::restoredDecorationSize () const733cdt::FakePixmapTypeDecoration::restoredDecorationBorderSize () const
734{
735 return CompSize (mRestoredBorder.left + mRestoredBorder.right,
736 mRestoredBorder.top + mRestoredBorder.bottom);
737}
738
739CompSize
740cdt::FakePixmapTypeDecoration::restoredDecorationInputSize () const
717{741{
718 return CompSize (mRestoredInput.left + mRestoredInput.right,742 return CompSize (mRestoredInput.left + mRestoredInput.right,
719 mRestoredInput.top + mRestoredInput.bottom);743 mRestoredInput.top + mRestoredInput.bottom);
@@ -1314,6 +1338,11 @@
13141338
1315 protected:1339 protected:
13161340
1341 cdt::FakeDecoration::Ptr defaultActiveDecoration ();
1342
1343 cdt::FakeDecoration::Ptr rootActiveDecoration;
1344 cdt::FakeDecoration::Ptr rootBareDecoration;
1345
1317 cdt::FakeDecorationList rootActiveDecorationList;1346 cdt::FakeDecorationList rootActiveDecorationList;
1318 cdt::FakeDecorationList rootBareDecorationList;1347 cdt::FakeDecorationList rootBareDecorationList;
13191348
@@ -1484,7 +1513,7 @@
14841513
1485 decor_extents_t emptyExtents (DecorationExtents (0, 0, 0, 0));1514 decor_extents_t emptyExtents (DecorationExtents (0, 0, 0, 0));
14861515
1487 cdt::FakeDecoration::Ptr rootActiveDecoration =1516 rootActiveDecoration =
1488 MakeFakePixmapTypeDecoration (DECOR_WINDOW_TYPE_NORMAL,1517 MakeFakePixmapTypeDecoration (DECOR_WINDOW_TYPE_NORMAL,
1489 0,1518 0,
1490 0,1519 0,
@@ -1495,7 +1524,7 @@
1495 activeInputMaximized,1524 activeInputMaximized,
1496 Display ());1525 Display ());
14971526
1498 cdt::FakeDecoration::Ptr rootBareDecoration =1527 rootBareDecoration =
1499 MakeFakePixmapTypeDecoration (0, 0, 0,1528 MakeFakePixmapTypeDecoration (0, 0, 0,
1500 1, 1,1529 1, 1,
1501 emptyExtents,1530 emptyExtents,
@@ -1519,10 +1548,15 @@
1519DecorWithPixmapDefaultsAcceptance::TearDown ()1548DecorWithPixmapDefaultsAcceptance::TearDown ()
1520{1549{
1521 /* Remove inserted decorations */1550 /* Remove inserted decorations */
1522 rootActiveDecorationList.RemoveDecoration (DECOR_WINDOW_TYPE_NORMAL,1551 rootActiveDecorationList.RemoveAllDecorations ();
1523 0,1552 rootBareDecorationList.RemoveAllDecorations ();
1524 0);1553
1525 rootBareDecorationList.RemoveDecoration (0, 0, 0);1554 /* This is a bit of a kludge, but we also need to reset
1555 * the two decorations manually before TearDown. We can
1556 * probably fix this later by encapsulating it all in one
1557 * class, but that's a bit of an effort */
1558 rootActiveDecoration.reset ();
1559 rootBareDecoration.reset ();
15261560
1527 DecorFakeDecoratorAcceptance::TearDown ();1561 DecorFakeDecoratorAcceptance::TearDown ();
1528}1562}
@@ -1644,6 +1678,8 @@
1644 typedef cdt::FakeDecoration::Ptr FakeDecorPtr;1678 typedef cdt::FakeDecoration::Ptr FakeDecorPtr;
1645 typedef cdt::FakePixmapTypeDecoration::Ptr FakePixDecorPtr;1679 typedef cdt::FakePixmapTypeDecoration::Ptr FakePixDecorPtr;
16461680
1681 virtual void TearDown ();
1682
1647 Window CreateDecoratableWindow (::Display *display);1683 Window CreateDecoratableWindow (::Display *display);
1648 Window MapAndReparent (::Display *display,1684 Window MapAndReparent (::Display *display,
1649 Window window);1685 Window window);
@@ -1654,6 +1690,10 @@
1654 void WaitForDecoration (::Display *display,1690 void WaitForDecoration (::Display *display,
1655 Window window,1691 Window window,
1656 const FakeDecorPtr &decoration);1692 const FakeDecorPtr &decoration);
1693 void WaitForDefaultDecoration (::Display *display,
1694 Window window,
1695 CompRect &testFrameDecorationGeometry,
1696 CompRect &testWindowDecorationGeometry);
1657 void WaitForDecorationUpdate (::Display *display,1697 void WaitForDecorationUpdate (::Display *display,
1658 Window window,1698 Window window,
1659 const FakeDecorPtr &decor);1699 const FakeDecorPtr &decor);
@@ -1678,6 +1718,14 @@
1678 std::map <Window, Window> windowParents;1718 std::map <Window, Window> windowParents;
1679};1719};
16801720
1721void
1722PixmapDecoratorAcceptance::TearDown ()
1723{
1724 windowDecorations.clear ();
1725
1726 DecorWithPixmapDefaultsAcceptance::TearDown ();
1727}
1728
1681Window1729Window
1682PixmapDecoratorAcceptance::CreateDecoratableWindow (::Display *display)1730PixmapDecoratorAcceptance::CreateDecoratableWindow (::Display *display)
1683{1731{
@@ -1734,8 +1782,47 @@
1734 Window window,1782 Window window,
1735 const FakeDecorPtr &decoration)1783 const FakeDecorPtr &decoration)
1736{1784{
1785 WaitForDecorationUpdate (display, window, decoration);
1737 WaitForPropertyNotify (display, window, DECOR_INPUT_FRAME_ATOM_NAME);1786 WaitForPropertyNotify (display, window, DECOR_INPUT_FRAME_ATOM_NAME);
1738 WaitForDecorationUpdate (display, window, decoration);1787}
1788
1789void
1790PixmapDecoratorAcceptance::WaitForDefaultDecoration (::Display *display,
1791 Window window,
1792 CompRect &decoratedWindowGeometry,
1793 CompRect &decoratedFrameGeometry)
1794{
1795 WaitForDecoration (display, window, rootActiveDecoration);
1796
1797 /* Fetch the window's absolute geometry */
1798 int x, y;
1799 unsigned int width, height, border;
1800
1801 ct::AbsoluteWindowGeometry (display, window, x, y, width, height, border);
1802
1803 /* Fetch frame extents */
1804 boost::shared_ptr <unsigned char> data;
1805
1806 FetchAndVerifyProperty (Display (),
1807 window,
1808 NETWMFrameExtentsAtom,
1809 XA_CARDINAL,
1810 32,
1811 4,
1812 0,
1813 data);
1814
1815 unsigned long *frameExtents =
1816 reinterpret_cast <unsigned long *> (data.get ());
1817
1818 decoratedWindowGeometry.setGeometry (x, y, width, height);
1819
1820 /* Adjust for decoration size. This is what future decorations
1821 * will add and subtract from */
1822 decoratedFrameGeometry.setGeometry (x - frameExtents[0],
1823 y - frameExtents[2],
1824 width + (frameExtents[0] + frameExtents[1]),
1825 height + (frameExtents[2] + frameExtents[3]));
1739}1826}
17401827
1741void1828void
@@ -1811,6 +1898,123 @@
1811 return windowDecorations[window];1898 return windowDecorations[window];
1812}1899}
18131900
1901class PixmapInitialDecorationAcceptance :
1902 public PixmapDecoratorAcceptance
1903{
1904 public:
1905
1906 virtual void SetUp ();
1907 virtual void TearDown ();
1908
1909 virtual bool StartDecoratorOnSetUp () const;
1910
1911 Window CreateDecoratedWindow ();
1912
1913 protected:
1914
1915 cdt::FakePixmapTypeDecoration::Ptr mTestWindowDecoration;
1916 CompRect mClientGeometryOnInitialDecoration;
1917 CompRect mBorderGeometryOnInitialDecoration;
1918};
1919
1920void
1921PixmapInitialDecorationAcceptance::SetUp ()
1922{
1923 PixmapDecoratorAcceptance::SetUp ();
1924
1925 unsigned int ResBo = ActiveBorderExtent + 1;
1926 unsigned int ResIn = ActiveInputExtent;
1927 unsigned int MaxEx = MaximizedBorderExtent;
1928
1929 mTestWindowDecoration =
1930 MakeFakePixmapTypeDecoration (DECOR_WINDOW_TYPE_NORMAL,
1931 0,
1932 0,
1933 10,
1934 10,
1935 DecorationExtents (ResBo, ResBo, ResBo, ResBo),
1936 DecorationExtents (ResIn, ResIn, ResIn, ResIn),
1937 DecorationExtents (MaxEx, MaxEx, MaxEx, MaxEx),
1938 DecorationExtents (MaxEx, MaxEx, MaxEx, MaxEx),
1939 Display ());
1940}
1941
1942bool
1943PixmapInitialDecorationAcceptance::StartDecoratorOnSetUp () const
1944{
1945 return false;
1946}
1947
1948void
1949PixmapInitialDecorationAcceptance::TearDown ()
1950{
1951 mTestWindowDecoration.reset ();
1952 PixmapDecoratorAcceptance::TearDown ();
1953}
1954
1955Window
1956PixmapInitialDecorationAcceptance::CreateDecoratedWindow ()
1957{
1958 Window testWindow = CreateDecoratableWindow (Display ());
1959
1960 /* We need to first explicitly recieve PropertyNotify events before
1961 * core starts sending them */
1962 RecievePropertyNotifyEvents (Display (), testWindow);
1963
1964 /* Map and reparent the window so that it gets a decoration */
1965 MapAndReparent (Display (), testWindow);
1966
1967 /* Start the decorator */
1968 SetUpDecorator ();
1969
1970 WaitForDefaultDecoration (Display (),
1971 testWindow,
1972 mClientGeometryOnInitialDecoration,
1973 mBorderGeometryOnInitialDecoration);
1974 DecorateWindow (Display (), testWindow, mTestWindowDecoration);
1975 WaitForDecorationUpdate (Display (), testWindow, mTestWindowDecoration);
1976
1977 return testWindow;
1978}
1979
1980std::ostream &
1981operator<< (std::ostream &os, const CompSize &sz)
1982{
1983 return os << "Size: (width: "
1984 << sz.width ()
1985 << " height: "
1986 << sz.height ()
1987 << ")";
1988}
1989
1990TEST_F (PixmapInitialDecorationAcceptance, NoSizeChangeInitially)
1991{
1992 CreateDecoratedWindow ();
1993 EXPECT_EQ (CompSize (mClientGeometryOnInitialDecoration.width (),
1994 mClientGeometryOnInitialDecoration.height ()),
1995 CompSize (ct::WINDOW_WIDTH,
1996 ct::WINDOW_HEIGHT));
1997}
1998
1999TEST_F (PixmapInitialDecorationAcceptance, SizeChangesApplySubsequently)
2000{
2001 Window testWindow = CreateDecoratedWindow ();
2002
2003 /* Measuring size change from default decoration to real decoration */
2004 const CompSize &size (mTestWindowDecoration->restoredDecorationBorderSize ());
2005
2006 EXPECT_THAT (testWindow,
2007 HasGeometry (Display (),
2008 RelativeWindowGeometry,
2009 _,
2010 _,
2011 mBorderGeometryOnInitialDecoration.width () -
2012 size.width (),
2013 mBorderGeometryOnInitialDecoration.height () -
2014 size.height (),
2015 _));
2016}
2017
1814class PixmapDecoratedWindowAcceptance :2018class PixmapDecoratedWindowAcceptance :
1815 public PixmapDecoratorAcceptance2019 public PixmapDecoratorAcceptance
1816{2020{
@@ -1831,6 +2035,8 @@
1831 Window mTestWindowParent;2035 Window mTestWindowParent;
18322036
1833 cdt::FakePixmapTypeDecoration::Ptr mTestWindowDecoration;2037 cdt::FakePixmapTypeDecoration::Ptr mTestWindowDecoration;
2038 CompRect mClientGeometryOnInitialDecoration;
2039 CompRect mBorderGeometryOnInitialDecoration;
1834};2040};
18352041
1836PixmapDecoratedWindowAcceptance::PixmapDecoratedWindowAcceptance () :2042PixmapDecoratedWindowAcceptance::PixmapDecoratedWindowAcceptance () :
@@ -1851,6 +2057,11 @@
1851 /* Start the decorator */2057 /* Start the decorator */
1852 SetUpDecorator ();2058 SetUpDecorator ();
18532059
2060 WaitForDefaultDecoration (display,
2061 mTestWindow,
2062 mClientGeometryOnInitialDecoration,
2063 mBorderGeometryOnInitialDecoration);
2064
1854 /* We need to change the border extent so that the window2065 /* We need to change the border extent so that the window
1855 * will move from its position in the default decoration */2066 * will move from its position in the default decoration */
1856 unsigned int ResBo = RealDecorationActiveBorderExtent;2067 unsigned int ResBo = RealDecorationActiveBorderExtent;
@@ -1870,15 +2081,16 @@
1870 Display ());2081 Display ());
18712082
1872 DecorateWindow (display, mTestWindow, mTestWindowDecoration);2083 DecorateWindow (display, mTestWindow, mTestWindowDecoration);
1873 WaitForDecoration (display, mTestWindow, mTestWindowDecoration);2084 WaitForDecorationUpdate (display, mTestWindow, mTestWindowDecoration);
1874}2085}
18752086
1876void2087void
1877PixmapDecoratedWindowAcceptance::TearDown ()2088PixmapDecoratedWindowAcceptance::TearDown ()
1878{2089{
2090 mTestWindowDecoration.reset ();
1879 DestroyWindow (Display (), mTestWindow);2091 DestroyWindow (Display (), mTestWindow);
18802092
1881 DecorWithPixmapDefaultsAcceptance::TearDown ();2093 PixmapDecoratorAcceptance::TearDown ();
1882}2094}
18832095
1884bool2096bool
@@ -2196,25 +2408,25 @@
21962408
2197/* Ensure that a window expands to its original size when it is2409/* Ensure that a window expands to its original size when it is
2198 * undecorated */2410 * undecorated */
2199TEST_F (PixmapDecoratedWindowAcceptance, UndecoratedWindowExpandToOrigSize)2411TEST_F (PixmapDecoratedWindowAcceptance, UndecoratedWindowExpandToOrigSizePlusInitialBorder)
2200{2412{
2201 DisallowDecorationsOnWindow (mTestWindow);2413 DisallowDecorationsOnWindow (mTestWindow);
22022414
2203 WaitForConfigureOn (Display (),2415 WaitForConfigureOn (Display (),
2204 mTestWindowParent,2416 mTestWindowParent,
2205 ct::WINDOW_X,2417 mBorderGeometryOnInitialDecoration.x (),
2206 ct::WINDOW_Y,2418 mBorderGeometryOnInitialDecoration.y (),
2207 ct::WINDOW_WIDTH,2419 mBorderGeometryOnInitialDecoration.width (),
2208 ct::WINDOW_HEIGHT,2420 mBorderGeometryOnInitialDecoration.height (),
2209 CWX | CWY | CWWidth | CWHeight);2421 CWX | CWY | CWWidth | CWHeight);
22102422
2211 EXPECT_THAT (mTestWindow,2423 EXPECT_THAT (mTestWindow,
2212 HasGeometry (Display (),2424 HasGeometry (Display (),
2213 AbsoluteWindowGeometry,2425 AbsoluteWindowGeometry,
2214 ct::WINDOW_X,2426 mBorderGeometryOnInitialDecoration.x (),
2215 ct::WINDOW_Y,2427 mBorderGeometryOnInitialDecoration.y (),
2216 ct::WINDOW_WIDTH,2428 mBorderGeometryOnInitialDecoration.width (),
2217 ct::WINDOW_HEIGHT,2429 mBorderGeometryOnInitialDecoration.height (),
2218 _));2430 _));
2219}2431}
22202432
@@ -2230,19 +2442,19 @@
22302442
2231 WaitForConfigureOn (Display (),2443 WaitForConfigureOn (Display (),
2232 mTestWindowParent,2444 mTestWindowParent,
2233 ct::WINDOW_X,2445 mBorderGeometryOnInitialDecoration.x (),
2234 ct::WINDOW_Y,2446 mBorderGeometryOnInitialDecoration.y (),
2235 ct::WINDOW_WIDTH,2447 mBorderGeometryOnInitialDecoration.width (),
2236 ct::WINDOW_HEIGHT,2448 mBorderGeometryOnInitialDecoration.height (),
2237 CWX | CWY | CWWidth | CWHeight);2449 CWX | CWY | CWWidth | CWHeight);
22382450
2239 EXPECT_THAT (mTestWindow,2451 EXPECT_THAT (mTestWindow,
2240 HasGeometry (Display (),2452 HasGeometry (Display (),
2241 AbsoluteWindowGeometry,2453 AbsoluteWindowGeometry,
2242 ct::WINDOW_X,2454 mBorderGeometryOnInitialDecoration.x (),
2243 ct::WINDOW_Y,2455 mBorderGeometryOnInitialDecoration.y (),
2244 ct::WINDOW_WIDTH,2456 mBorderGeometryOnInitialDecoration.width (),
2245 ct::WINDOW_HEIGHT,2457 mBorderGeometryOnInitialDecoration.height (),
2246 _));2458 _));
2247}2459}
22482460
@@ -2324,8 +2536,10 @@
23242536
2325 EXPECT_THAT (mTestWindow, HasGeometry (Display (),2537 EXPECT_THAT (mTestWindow, HasGeometry (Display (),
2326 AbsoluteWindowGeometry,2538 AbsoluteWindowGeometry,
2327 ct::WINDOW_X + GetParam ().left,2539 mBorderGeometryOnInitialDecoration.x () +
2328 ct::WINDOW_Y + GetParam ().top,2540 GetParam ().left,
2541 mBorderGeometryOnInitialDecoration.y () +
2542 GetParam ().top,
2329 _,2543 _,
2330 _,2544 _,
2331 _));2545 _));
@@ -2344,10 +2558,12 @@
2344 AbsoluteWindowGeometry,2558 AbsoluteWindowGeometry,
2345 _,2559 _,
2346 _,2560 _,
2347 ct::WINDOW_WIDTH - (GetParam ().left +2561 mBorderGeometryOnInitialDecoration.width () -
2348 GetParam ().right),2562 (GetParam ().left +
2349 ct::WINDOW_HEIGHT - (GetParam ().top +2563 GetParam ().right),
2350 GetParam ().bottom),2564 mBorderGeometryOnInitialDecoration.height () -
2565 (GetParam ().top +
2566 GetParam ().bottom),
2351 _));2567 _));
2352}2568}
23532569
@@ -2373,10 +2589,12 @@
2373 AbsoluteWindowGeometry,2589 AbsoluteWindowGeometry,
2374 _,2590 _,
2375 _,2591 _,
2376 ct::WINDOW_WIDTH - (newExtents.left +2592 mBorderGeometryOnInitialDecoration.width () -
2377 newExtents.right),2593 (newExtents.left +
2378 ct::WINDOW_HEIGHT - (newExtents.top +2594 newExtents.right),
2379 newExtents.bottom),2595 mBorderGeometryOnInitialDecoration.height () -
2596 (newExtents.top +
2597 newExtents.bottom),
2380 _));2598 _));
2381}2599}
23822600
@@ -2401,7 +2619,7 @@
2401 WindowDecorationAtom);2619 WindowDecorationAtom);
24022620
2403 const CompPoint &off (mTestWindowDecoration->restoredFrameWindowOffset ());2621 const CompPoint &off (mTestWindowDecoration->restoredFrameWindowOffset ());
2404 const CompSize &size (mTestWindowDecoration->restoredDecorationSize ());2622 const CompSize &size (mTestWindowDecoration->restoredDecorationInputSize ());
24052623
2406 /* As the window is shrunk to accomodate the border size, we must subtract2624 /* As the window is shrunk to accomodate the border size, we must subtract
2407 * the border from the original window size */2625 * the border from the original window size */
@@ -2409,19 +2627,26 @@
2409 (newExtents.top + newExtents.bottom));2627 (newExtents.top + newExtents.bottom));
24102628
2411 RestoreWindow (mTestWindow,2629 RestoreWindow (mTestWindow,
2412 ct::WINDOW_X + off.x (),2630 mBorderGeometryOnInitialDecoration.x () + off.x (),
2413 ct::WINDOW_Y + off.y (),2631 mBorderGeometryOnInitialDecoration.y () + off.y (),
2414 ct::WINDOW_WIDTH - shrink.width () + size.width (),2632 mBorderGeometryOnInitialDecoration.width () -
2415 ct::WINDOW_HEIGHT - shrink.height () + size.height ());2633 shrink.width () + size.width (),
2634 mBorderGeometryOnInitialDecoration.height () -
2635 shrink.height () + size.height ());
24162636
2637 /* Subtract the old offset and size and add on the new decoration geometry */
2417 EXPECT_THAT (mTestWindow, HasGeometry (Display (),2638 EXPECT_THAT (mTestWindow, HasGeometry (Display (),
2418 AbsoluteWindowGeometry,2639 AbsoluteWindowGeometry,
2419 ct::WINDOW_X + newExtents.left,2640 mBorderGeometryOnInitialDecoration.x () +
2420 ct::WINDOW_Y + newExtents.top,2641 newExtents.left,
2421 ct::WINDOW_WIDTH - (newExtents.left +2642 mBorderGeometryOnInitialDecoration.y () +
2422 newExtents.right),2643 newExtents.top,
2423 ct::WINDOW_HEIGHT - (newExtents.top +2644 mBorderGeometryOnInitialDecoration.width () -
2424 newExtents.bottom),2645 ((newExtents.left +
2646 newExtents.right)),
2647 mBorderGeometryOnInitialDecoration.height () -
2648 ((newExtents.top +
2649 newExtents.bottom)),
2425 _));2650 _));
2426}2651}
24272652
@@ -2451,7 +2676,7 @@
2451 AllowDecorationsOnWindow (mTestWindow);2676 AllowDecorationsOnWindow (mTestWindow);
24522677
2453 const CompPoint &off (mTestWindowDecoration->restoredFrameWindowOffset ());2678 const CompPoint &off (mTestWindowDecoration->restoredFrameWindowOffset ());
2454 const CompSize &size (mTestWindowDecoration->restoredDecorationSize ());2679 const CompSize &size (mTestWindowDecoration->restoredDecorationInputSize ());
24552680
2456 /* As the window is shrunk to accomadate the border size, we must subtract2681 /* As the window is shrunk to accomadate the border size, we must subtract
2457 * the border from the original window size */2682 * the border from the original window size */
@@ -2460,20 +2685,26 @@
24602685
2461 WaitForConfigureOn (Display (),2686 WaitForConfigureOn (Display (),
2462 mTestWindowParent,2687 mTestWindowParent,
2463 ct::WINDOW_X + off.x (),2688 mBorderGeometryOnInitialDecoration.x () + off.x (),
2464 ct::WINDOW_Y + off.y (),2689 mBorderGeometryOnInitialDecoration.y () + off.y (),
2465 ct::WINDOW_WIDTH - shrink.width () + size.width (),2690 mBorderGeometryOnInitialDecoration.width () -
2466 ct::WINDOW_HEIGHT - shrink.height () + size.height (),2691 shrink.width () + size.width (),
2692 mBorderGeometryOnInitialDecoration.height () -
2693 shrink.height () + size.height (),
2467 CWX | CWY | CWWidth | CWHeight);2694 CWX | CWY | CWWidth | CWHeight);
24682695
2469 EXPECT_THAT (mTestWindow, HasGeometry (Display (),2696 EXPECT_THAT (mTestWindow, HasGeometry (Display (),
2470 AbsoluteWindowGeometry,2697 AbsoluteWindowGeometry,
2471 ct::WINDOW_X + newExtents.left,2698 mBorderGeometryOnInitialDecoration.x () +
2472 ct::WINDOW_Y + newExtents.top,2699 newExtents.left,
2473 ct::WINDOW_WIDTH - (newExtents.left +2700 mBorderGeometryOnInitialDecoration.y () +
2474 newExtents.right),2701 newExtents.top,
2475 ct::WINDOW_HEIGHT - (newExtents.top +2702 mBorderGeometryOnInitialDecoration.width () -
2476 newExtents.bottom),2703 (newExtents.left +
2704 newExtents.right),
2705 mBorderGeometryOnInitialDecoration.height () -
2706 (newExtents.top +
2707 newExtents.bottom),
2477 _));2708 _));
2478}2709}
24792710
@@ -2490,8 +2721,8 @@
24902721
2491 EXPECT_THAT (mTestWindow, HasGeometry (Display (),2722 EXPECT_THAT (mTestWindow, HasGeometry (Display (),
2492 AbsoluteWindowGeometry,2723 AbsoluteWindowGeometry,
2493 ct::WINDOW_X + 1,2724 mBorderGeometryOnInitialDecoration.x () + 1,
2494 ct::WINDOW_Y + 1,2725 mBorderGeometryOnInitialDecoration.y () + 1,
2495 _,2726 _,
2496 _,2727 _,
2497 _));2728 _));
24982729
=== modified file 'src/privatewindow.h'
--- src/privatewindow.h 2013-06-26 10:49:55 +0000
+++ src/privatewindow.h 2013-07-19 04:17:27 +0000
@@ -401,6 +401,7 @@
401 bool shaded;401 bool shaded;
402 bool hidden;402 bool hidden;
403 bool grabbed;403 bool grabbed;
404 bool alreadyDecorated;
404405
405 unsigned int desktop;406 unsigned int desktop;
406407
407408
=== modified file 'src/window.cpp'
--- src/window.cpp 2013-07-18 13:06:24 +0000
+++ src/window.cpp 2013-07-19 04:17:27 +0000
@@ -6273,9 +6273,25 @@
62736273
6274namespace6274namespace
6275{6275{
6276class NullConfigureBufferLock :
6277 public crb::BufferLock
6278{
6279 public:
6280
6281 NullConfigureBufferLock (crb::CountedFreeze *cf) {}
6282
6283 void lock () {}
6284 void release () {}
6285};
6286
6276crb::BufferLock::Ptr6287crb::BufferLock::Ptr
6277createConfigureBufferLock (crb::CountedFreeze *cf)6288createConfigureBufferLock (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 return boost::make_shared <crb::ConfigureBufferLock> (cf);6295 return boost::make_shared <crb::ConfigureBufferLock> (cf);
6280}6296}
6281}6297}
@@ -6322,6 +6338,7 @@
6322 shaded (false),6338 shaded (false),
6323 hidden (false),6339 hidden (false),
6324 grabbed (false),6340 grabbed (false),
6341 alreadyDecorated (false),
63256342
6326 desktop (0),6343 desktop (0),
63276344
@@ -6568,11 +6585,17 @@
65686585
6569 CompSize sizeDelta;6586 CompSize sizeDelta;
65706587
6571 if (isMapped())6588 /* We don't want to change the size of the window the first time we
6572 sizeDelta = CompSize (-((b->left + b->right) -6589 * decorate it, but we do thereafter */
6573 (priv->border.left + priv->border.right)),6590 if (priv->alreadyDecorated)
6574 -((b->top + b->bottom) -6591 {
6575 (priv->border.top + priv->border.bottom)));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;
65766599
6577 priv->serverInput = *i;6600 priv->serverInput = *i;
6578 priv->border = *b;6601 priv->border = *b;

Subscribers

People subscribed via source and target branches

to all changes: