Merge lp:~compiz-team/compiz/compiz.fix_1067246 into lp:compiz/0.9.10

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1067246
Merge into: lp:compiz/0.9.10
Diff against target: 816 lines (+336/-138)
7 files modified
include/core/CMakeLists.txt (+1/-0)
plugins/decor/src/decor.cpp (+6/-4)
plugins/decor/tests/acceptance/xorg-gtest/compiz_decor_acceptance_tests.cpp (+297/-66)
src/logmessage/CMakeLists.txt (+0/-13)
src/logmessage/include/core/logmessage.h (+0/-51)
src/privatewindow.h (+1/-0)
src/window.cpp (+31/-4)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1067246
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+174863@code.launchpad.net

This proposal supersedes a proposal from 2013-05-20.

This proposal has been superseded by a proposal from 2013-07-15.

Commit message

Remove redundant src/logmessage/include/core/logmessage.h

(LP: #1067246)

Description of the change

Remove redundant src/logmessage/include/core/logmessage.h

(LP: #1067246)

To post a comment you must log in.
Revision history for this message
Micheal Hsu (mkhu) wrote : Posted in a previous version of this proposal

there is a lot of inconsistency in src/:

1. headers. where should we put public headers?
   some headers are in $(top_srcdir)/include, : e.g. plugin.h, point.h
   some are in $(top_srcdir)/src/<sub_directory>/include/: e.g. string.h
   my proposal: put all public headers in $(top_srcdir)/include
2. .cpp files. where should we put source files?
   some .cpp files are in $(top_srcdir)/src : e.g. plugin.cpp
   some .cpp files are in $(top_srcdir)/<sub_directory>/src/: e.g. point.cpp
   my proposal: put all .cpp files in $(top_srcdir)/src/
3. tests. where should we put tests?
   some tests are in $(top_srcdir)/src/<sub_directory>/tests: e.g. plugin, point
   some tests are in $(top_srcdir)/tests/
   my proposal: put all tests in $(top_srcdir)/src/tests
4. tests naming inconsistency:
   e.g. compiz_option_test, option.cpp for option/tests
        compiz_plugin_test, test-plugin.cpp for plugin/tests
        compiz_test_outputdevices, test_outputdevices.cpp for tests/
   my proposal: all test executables should be "compiz_test_xxxx"
                all test files should be "test-xxxx"

Revision history for this message
Micheal Hsu (mkhu) wrote : Posted in a previous version of this proposal

I' like to know your opinion

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

On Mon, May 20, 2013 at 11:16 AM, Hu Kang <email address hidden> wrote:
> there is a lot of inconsistency in src/:

You'd be right. There was a half-finished effort to split the compiz
core code into "modules" - although these days that model doesn't
really make sense.

>
> 1. headers. where should we put public headers?
> some headers are in $(top_srcdir)/include, : e.g. plugin.h, point.h
> some are in $(top_srcdir)/src/<sub_directory>/include/: e.g. string.h
> my proposal: put all public headers in $(top_srcdir)/include

Lets put all the public headers in include/.

> 2. .cpp files. where should we put source files?
> some .cpp files are in $(top_srcdir)/src : e.g. plugin.cpp
> some .cpp files are in $(top_srcdir)/<sub_directory>/src/: e.g. point.cpp
> my proposal: put all .cpp files in $(top_srcdir)/src/

They can probably all go in src/ - as long as they are still compiled
into independent static libraries.

> 3. tests. where should we put tests?
> some tests are in $(top_srcdir)/src/<sub_directory>/tests: e.g. plugin, point
> some tests are in $(top_srcdir)/tests/
> my proposal: put all tests in $(top_srcdir)/src/tests

Likewise.

The only places where (2) and (3) cannot apply is in the plugins,
because CompizPlugin.cmake will take all the files in src/*.cpp and
compile that into the plugin, which isn't really what we want for
testing purposes.

> 4. tests naming inconsistency:
> e.g. compiz_option_test, option.cpp for option/tests
> compiz_plugin_test, test-plugin.cpp for plugin/tests
> compiz_test_outputdevices, test_outputdevices.cpp for tests/
> my proposal: all test executables should be "compiz_test_xxxx"
> all test files should be "test-xxxx"
>

I think compiz_test_xxx for executables and compiz_test_xxx.cpp for
the test files really.

> --
> https://code.launchpad.net/~stevenhooke11/compiz/compiz.fix_1067246/+merge/164665
> Your team Compiz Maintainers is requested to review the proposed merge of lp:~stevenhooke11/compiz/compiz.fix_1067246 into lp:compiz.

--
Sam Spilsbury

Revision history for this message
Micheal Hsu (mkhu) wrote : Posted in a previous version of this proposal

Sam. thanks for your comment

some corrections for my previous comment:
(I am talking about files in $(top_srcdir)/src/)
////////////////////
2. .cpp files. where should we put source files?
   some .cpp files are in $(top_srcdir)/src : e.g. plugin.cpp
   some .cpp files are in $(top_srcdir)/src/<sub_directory>/src/: e.g. point.cpp
   my proposal: put all .cpp files in $(top_srcdir)/src/
3. tests. where should we put tests?
   some tests are in $(top_srcdir)/src/<sub_directory>/tests: e.g. point
   some tests are in $(top_srcdir)/src/tests/
   my proposal: put all tests in $(top_srcdir)/src/tests/
////////////////////

I'll push a new branch with 1, 2, 3, 4, applied to $(top_srcdir)/src/.

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

Hu, great to see that you are helping with the cleanup/inconsistency-elimination !
This was one point on my TODO list. :) Thanks for taking care of it...

+1

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

Just before this can be merged in, the install () command which installs whatever is in PUBLIC_HEADERS needs to be removed to (and that would effectively make the SET_TARGET_PROPERTIES call setting PUBLIC_HEADERS redundant in that directory too).

Right now, there are two install () statements that cover the same file.

(Sorry for the late review on that one, today's been kind of hectic, and the next week is going to be a bit all over the place too).

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

Hey Hu.

Were you going to get to this? I should be able to make the required changes myself - I just don't want to accidentally step on you! :)

Revision history for this message
Micheal Hsu (mkhu) wrote : Posted in a previous version of this proposal

sorry, i've been a little busy recently. i do have a branch, but haven't tested throughly.
so i guess i won't have time to do that.

Revision history for this message
MC Return (mc-return) wrote : Posted in a previous version of this proposal

> sorry, i've been a little busy recently. i do have a branch, but haven't
> tested throughly.
> so i guess i won't have time to do that.

Please take your time, but do not throw away work you've already done...
We will simply wait :)

3759. By Sam Spilsbury

Fixes LP: #1067246

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve

Unmerged revisions

3759. By Sam Spilsbury

Fixes LP: #1067246

3758. By Sam Spilsbury

Install logmessage.h

3757. By Sam Spilsbury

Don't install files twice

3756. By Sam Spilsbury

lp:~stevenhooke11/compiz/compiz.fix_1067246

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/core/CMakeLists.txt'
--- include/core/CMakeLists.txt 2013-01-03 16:05:26 +0000
+++ include/core/CMakeLists.txt 2013-07-15 21:00:34 +0000
@@ -6,6 +6,7 @@
6 countedlist.h6 countedlist.h
7 global.h7 global.h
8 icon.h8 icon.h
9 logmessage.h
9 match.h10 match.h
10 modifierhandler.h11 modifierhandler.h
11 option.h12 option.h
1213
=== 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-15 21:00:34 +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/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-15 21:00:34 +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/logmessage/CMakeLists.txt'
--- src/logmessage/CMakeLists.txt 2012-01-23 17:46:28 +0000
+++ src/logmessage/CMakeLists.txt 2013-07-15 21:00:34 +0000
@@ -1,15 +1,9 @@
1
2INCLUDE_DIRECTORIES( 1INCLUDE_DIRECTORIES(
3 ${CMAKE_CURRENT_SOURCE_DIR}/include
4
5 ${compiz_SOURCE_DIR}/include2 ${compiz_SOURCE_DIR}/include
6 3
7 ${Boost_INCLUDE_DIRS}4 ${Boost_INCLUDE_DIRS}
8)5)
96
10SET( PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/core/logmessage.h )
11SET( PRIVATE_HEADERS )
12
13SET( SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/logmessage.cpp )7SET( SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/logmessage.cpp )
148
15ADD_LIBRARY( 9ADD_LIBRARY(
@@ -24,10 +18,3 @@
24IF (COMPIZ_BUILD_TESTING)18IF (COMPIZ_BUILD_TESTING)
25ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )19ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
26ENDIF (COMPIZ_BUILD_TESTING)20ENDIF (COMPIZ_BUILD_TESTING)
27
28SET_TARGET_PROPERTIES(
29 compiz_logmessage PROPERTIES
30 PUBLIC_HEADER "${PUBLIC_HEADERS}"
31)
32
33install (FILES ${PUBLIC_HEADERS} DESTINATION ${COMPIZ_CORE_INCLUDE_DIR})
3421
=== removed directory 'src/logmessage/include'
=== removed directory 'src/logmessage/include/core'
=== removed file 'src/logmessage/include/core/logmessage.h'
--- src/logmessage/include/core/logmessage.h 2011-10-31 13:51:00 +0000
+++ src/logmessage/include/core/logmessage.h 1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
1/*
2 * Copyright © 2007 Novell, Inc.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Novell, Inc. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Novell, Inc. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Author: David Reveman <davidr@novell.com>
24 */
25
26#ifndef _COMPIZ_LOGMESSAGE_H
27#define _COMPIZ_LOGMESSAGE_H
28
29typedef enum {
30 CompLogLevelFatal = 0,
31 CompLogLevelError,
32 CompLogLevelWarn,
33 CompLogLevelInfo,
34 CompLogLevelDebug
35} CompLogLevel;
36
37void
38logMessage (const char *componentName,
39 CompLogLevel level,
40 const char *message);
41
42void
43compLogMessage (const char *componentName,
44 CompLogLevel level,
45 const char *format,
46 ...);
47
48const char *
49logLevelToString (CompLogLevel level);
50
51#endif
520
=== modified file 'src/privatewindow.h'
--- src/privatewindow.h 2013-03-06 12:31:24 +0000
+++ src/privatewindow.h 2013-07-15 21:00:34 +0000
@@ -400,6 +400,7 @@
400 bool shaded;400 bool shaded;
401 bool hidden;401 bool hidden;
402 bool grabbed;402 bool grabbed;
403 bool alreadyDecorated;
403404
404 unsigned int desktop;405 unsigned int desktop;
405406
406407
=== modified file 'src/window.cpp'
--- src/window.cpp 2013-06-28 01:10:57 +0000
+++ src/window.cpp 2013-07-15 21:00:34 +0000
@@ -6299,9 +6299,25 @@
62996299
6300namespace6300namespace
6301{6301{
6302class NullConfigureBufferLock :
6303 public crb::BufferLock
6304{
6305 public:
6306
6307 NullConfigureBufferLock (crb::CountedFreeze *cf) {}
6308
6309 void lock () {}
6310 void release () {}
6311};
6312
6302crb::BufferLock::Ptr6313crb::BufferLock::Ptr
6303createConfigureBufferLock (crb::CountedFreeze *cf)6314createConfigureBufferLock (crb::CountedFreeze *cf)
6304{6315{
6316 /* Return an implementation that does nothing if the user explicitly
6317 * disabled buffer locks for this running instance */
6318 if (getenv ("COMPIZ_NO_CONFIGURE_BUFFER_LOCKS"))
6319 return boost::make_shared <NullConfigureBufferLock> (cf);
6320
6305 return boost::make_shared <crb::ConfigureBufferLock> (cf);6321 return boost::make_shared <crb::ConfigureBufferLock> (cf);
6306}6322}
6307}6323}
@@ -6348,6 +6364,7 @@
6348 shaded (false),6364 shaded (false),
6349 hidden (false),6365 hidden (false),
6350 grabbed (false),6366 grabbed (false),
6367 alreadyDecorated (false),
63516368
6352 desktop (0),6369 desktop (0),
63536370
@@ -6591,10 +6608,20 @@
6591 priv->sizeHints.win_gravity) -6608 priv->sizeHints.win_gravity) -
6592 compiz::window::extents::shift (priv->border,6609 compiz::window::extents::shift (priv->border,
6593 priv->sizeHints.win_gravity);6610 priv->sizeHints.win_gravity);
6594 CompSize sizeDelta = CompSize (-((b->left + b->right) -6611
6595 (priv->border.left + priv->border.right)),6612 CompSize sizeDelta;
6596 -((b->top + b->bottom) -6613
6597 (priv->border.top + priv->border.bottom)));6614 /* We don't want to change the size of the window the first time we
6615 * decorate it, but we do thereafter */
6616 if (priv->alreadyDecorated)
6617 {
6618 sizeDelta.setWidth (-((b->left + b->right) -
6619 (priv->border.left + priv->border.right)));
6620 sizeDelta.setHeight (-((b->top + b->bottom) -
6621 (priv->border.top + priv->border.bottom)));
6622 }
6623 else
6624 priv->alreadyDecorated = true;
65986625
6599 priv->serverInput = *i;6626 priv->serverInput = *i;
6600 priv->border = *b;6627 priv->border = *b;

Subscribers

People subscribed via source and target branches

to all changes: