Merge lp:~compiz-team/compiz/raring.fix_1138517 into lp:compiz/raring

Proposed by Sam Spilsbury
Status: Merged
Approved by: Timo Jyrinki
Approved revision: 3635
Merged at revision: 3635
Proposed branch: lp:~compiz-team/compiz/raring.fix_1138517
Merge into: lp:compiz/raring
Diff against target: 409 lines (+227/-45)
4 files modified
plugins/decor/src/decor.cpp (+38/-22)
src/privatewindow.h (+2/-2)
src/window.cpp (+27/-10)
tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp (+160/-11)
To merge this branch: bzr merge lp:~compiz-team/compiz/raring.fix_1138517
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Timo Jyrinki Approve
Andrea Azzarone Approve
Review via email: mp+152622@code.launchpad.net

This proposal supersedes a proposal from 2013-03-06.

Commit message

Don't set lastFrameExtents unless the window geometry actually changed - as
that variable only exists to track changes in the actual geometry of
the window and not the apparant frame extents.

Added tests to verify that behaviour.

(LP: #1138517)

Description of the change

Don't set lastFrameExtents unless the window geometry actually changed - as
that variable only exists to track changes in the actual geometry of
the window and not the apparant frame extents.

Added tests to verify that behaviour.

(LP: #1138517)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:3633
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~compiz-team/compiz/raring.fix_1138517/+merge/151940/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/compiz-ci/106/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/compiz-gles-ci/./build=pbuilder,distribution=raring,flavor=amd64/143/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/compiz-pbuilder/./build=pbuilder,distribution=raring,flavor=amd64/495/console

Click here to trigger a rebuild:
http://jenkins.qa.ubuntu.com/job/compiz-ci/106//rebuild/?

review: Needs Fixing (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote : Posted in a previous version of this proposal

Not sure what was jenkins' problem, but this branch has the same issue of non-moveable/resizeable Java windows as https://code.launchpad.net/~compiz-team/compiz/compiz.fix_1138517/+merge/151941

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Timo, does it works now?

Revision history for this message
Andrea Azzarone (azzar1) wrote :

*work

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Yes, compiled this one and it works now (tested with jEdit and a hello world app).

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
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-03-06 09:15:38 +0000
+++ plugins/decor/src/decor.cpp 2013-03-11 06:50:39 +0000
@@ -1585,35 +1585,44 @@
1585 */1585 */
1586 if (decoration)1586 if (decoration)
1587 {1587 {
1588 wd = WindowDecoration::create (decoration);
1589 if (!wd)
1590 return false;
1591
1592 /* Set extents based on maximize/unmaximize state1588 /* Set extents based on maximize/unmaximize state
1593 * FIXME: With the new type system, this should be1589 * FIXME: With the new type system, this should be
1594 * removed */1590 * removed */
1595 if ((window->state () & MAXIMIZE_STATE))1591 if ((window->state () & MAXIMIZE_STATE))
1596 window->setWindowFrameExtents (&wd->decor->maxBorder,1592 window->setWindowFrameExtents (&decoration->maxBorder,
1597 &wd->decor->maxInput);1593 &decoration->maxInput);
1598 else if (!window->hasUnmapReference ())1594 else if (!window->hasUnmapReference ())
1599 window->setWindowFrameExtents (&wd->decor->border,1595 window->setWindowFrameExtents (&decoration->border,
1600 &wd->decor->input);1596 &decoration->input);
16011597
1602 movement = compiz::window::extents::shift (window->border (), window->sizeHints ().win_gravity);1598 /* We actually need to decorate this window */
1603 movement -= oldShift;
1604
1605 /* Update the input and output frame */
1606 if (decorate)1599 if (decorate)
1600 {
1601 wd = WindowDecoration::create (decoration);
1602 if (!wd)
1603 {
1604 /* Error condition, reset frame extents */
1605 CompWindowExtents emptyExtents;
1606 memset (&emptyExtents, 0, sizeof (CompWindowExtents));
1607 window->setWindowFrameExtents (&emptyExtents, &emptyExtents);
1608 return false;
1609 }
1610
1611 movement = compiz::window::extents::shift (window->border (), window->sizeHints ().win_gravity);
1612 movement -= oldShift;
1613
1614 /* Update the input and output frame */
1607 updateFrame ();1615 updateFrame ();
1608 window->updateWindowOutputExtents ();1616 window->updateWindowOutputExtents ();
16091617
1610 updateReg = true;1618 updateReg = true;
1611 updateMatrix = true;1619 updateMatrix = true;
1612 mOutputRegion = CompRegion (window->outputRect ());1620 mOutputRegion = CompRegion (window->outputRect ());
1613 updateGroupShadows ();1621 updateGroupShadows ();
1614 if (dScreen->cmActive)1622 if (dScreen->cmActive)
1615 cWindow->damageOutputExtents ();1623 cWindow->damageOutputExtents ();
1616 updateDecorationScale ();1624 updateDecorationScale ();
1625 }
1617 }1626 }
1618 else1627 else
1619 {1628 {
@@ -2418,7 +2427,14 @@
2418 {2427 {
2419 w = screen->findWindow (event->xclient.window);2428 w = screen->findWindow (event->xclient.window);
2420 if (w)2429 if (w)
2421 DecorWindow::get (w)->update (true);2430 {
2431 DecorWindow *dw = DecorWindow::get (w);
2432
2433 /* Set the frameExtentsRequested flag so that we know to
2434 * at least update _NET_WM_FRAME_EXTENTS (LP: #1110138) */
2435 dw->frameExtentsRequested = true;
2436 dw->update (true);
2437 }
2422 }2438 }
24232439
2424 mCommunicator.handleClientMessage (event->xclient);2440 mCommunicator.handleClientMessage (event->xclient);
24252441
=== modified file 'src/privatewindow.h'
--- src/privatewindow.h 2013-02-10 05:01:50 +0000
+++ src/privatewindow.h 2013-03-11 06:50:39 +0000
@@ -155,7 +155,7 @@
155155
156 void recalcNormalHints ();156 void recalcNormalHints ();
157157
158 void updateFrameWindow ();158 bool updateFrameWindow ();
159159
160 void setWindowMatrix ();160 void setWindowMatrix ();
161161
@@ -302,7 +302,7 @@
302 int gravity,302 int gravity,
303 int direction);303 int direction);
304304
305 void updateSize ();305 bool updateSize ();
306306
307 bool getUserTime (Time& time);307 bool getUserTime (Time& time);
308 void setUserTime (Time time);308 void setUserTime (Time time);
309309
=== modified file 'src/window.cpp'
--- src/window.cpp 2013-02-27 03:24:45 +0000
+++ src/window.cpp 2013-03-11 06:50:39 +0000
@@ -807,12 +807,11 @@
807 priv->type = type;807 priv->type = type;
808}808}
809809
810810bool
811void
812PrivateWindow::updateFrameWindow ()811PrivateWindow::updateFrameWindow ()
813{812{
814 if (!serverFrame)813 if (!serverFrame)
815 return;814 return false;
816815
817 XWindowChanges xwc = XWINDOWCHANGES_INIT;816 XWindowChanges xwc = XWINDOWCHANGES_INIT;
818 unsigned int valueMask = CWX | CWY | CWWidth | CWHeight;817 unsigned int valueMask = CWX | CWY | CWWidth | CWHeight;
@@ -826,6 +825,8 @@
826 window->configureXWindow (valueMask, &xwc);825 window->configureXWindow (valueMask, &xwc);
827 window->windowNotify (CompWindowNotifyFrameUpdate);826 window->windowNotify (CompWindowNotifyFrameUpdate);
828 window->recalcActions ();827 window->recalcActions ();
828
829 return true;
829}830}
830831
831832
@@ -4109,11 +4110,11 @@
4109 priv->placed = true;4110 priv->placed = true;
4110}4111}
41114112
4112void4113bool
4113PrivateWindow::updateSize ()4114PrivateWindow::updateSize ()
4114{4115{
4115 if (window->overrideRedirect () || !managed)4116 if (window->overrideRedirect () || !managed)
4116 return;4117 return false;
41174118
4118 XWindowChanges xwc = XWINDOWCHANGES_INIT;4119 XWindowChanges xwc = XWINDOWCHANGES_INIT;
41194120
@@ -4124,7 +4125,10 @@
4124 window->sendSyncRequest ();4125 window->sendSyncRequest ();
41254126
4126 window->configureXWindow (mask, &xwc);4127 window->configureXWindow (mask, &xwc);
4128 return true;
4127 }4129 }
4130
4131 return false;
4128}4132}
41294133
4130int4134int
@@ -6780,8 +6784,10 @@
67806784
6781 recalcActions ();6785 recalcActions ();
67826786
6783 priv->updateSize ();6787 bool sizeUpdated = false;
6784 priv->updateFrameWindow ();6788
6789 sizeUpdated |= priv->updateSize ();
6790 sizeUpdated |= priv->updateFrameWindow ();
67856791
6786 /* Always send a moveNotify6792 /* Always send a moveNotify
6787 * whenever the frame extents update6793 * whenever the frame extents update
@@ -6789,7 +6795,8 @@
6789 moveNotify (0, 0, true);6795 moveNotify (0, 0, true);
67906796
6791 /* Once we have updated everything, re-set lastServerInput */6797 /* Once we have updated everything, re-set lastServerInput */
6792 priv->lastServerInput = priv->serverInput;6798 if (sizeUpdated)
6799 priv->lastServerInput = priv->serverInput;
6793 }6800 }
67946801
6795 /* Use b for _NET_WM_FRAME_EXTENTS here because6802 /* Use b for _NET_WM_FRAME_EXTENTS here because
@@ -6909,6 +6916,9 @@
6909 * but that's all */6916 * but that's all */
6910 XSelectInput (dpy, screen->root (), SubstructureNotifyMask);6917 XSelectInput (dpy, screen->root (), SubstructureNotifyMask);
69116918
6919 /* Gravity here is assumed to be SouthEast, clients can update
6920 * that if need be */
6921
6912 /* Awaiting a new frame to be given to us */6922 /* Awaiting a new frame to be given to us */
6913 frame = None;6923 frame = None;
6914 serverFrame = XCreateWindow (dpy, screen->root (), 0, 0,6924 serverFrame = XCreateWindow (dpy, screen->root (), 0, 0,
@@ -6918,10 +6928,17 @@
6918 /* Do not get any events from here on */6928 /* Do not get any events from here on */
6919 XSelectInput (dpy, screen->root (), NoEventMask);6929 XSelectInput (dpy, screen->root (), NoEventMask);
69206930
6921 wrapper = XCreateWindow (dpy, serverFrame, 0, 0,6931 /* If we have some frame extents, we should apply them here and
6922 wa.width, wa.height, 0, wa.depth,6932 * set lastFrameExtents */
6933 wrapper = XCreateWindow (dpy, serverFrame,
6934 serverInput.left, serverInput.top,
6935 wa.width - (serverInput.left + serverInput.right),
6936 wa.height - (serverInput.top + serverInput.bottom),
6937 0, wa.depth,
6923 InputOutput, visual, mask, &attr);6938 InputOutput, visual, mask, &attr);
69246939
6940 lastServerInput = serverInput;
6941
6925 xwc.stack_mode = Above;6942 xwc.stack_mode = Above;
69266943
6927 /* Look for the client in the current server side stacking6944 /* Look for the client in the current server side stacking
69286945
=== modified file 'tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp'
--- tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-02-26 00:52:32 +0000
+++ tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-03-11 06:50:39 +0000
@@ -55,27 +55,41 @@
55 return ct::AdvanceToNextEventOnSuccess (d, r);55 return ct::AdvanceToNextEventOnSuccess (d, r);
56}56}
5757
58Window GetImmediateParent (Display *display,
59 Window w,
60 Window &rootReturn)
61{
62 Window parentReturn = w;
63 Window *childrenReturn;
64 unsigned int nChildrenReturn;
65
66 XQueryTree (display,
67 w,
68 &rootReturn,
69 &parentReturn,
70 &childrenReturn,
71 &nChildrenReturn);
72 XFree (childrenReturn);
73
74 return parentReturn;
75}
76
77
58Window GetTopParent (Display *display,78Window GetTopParent (Display *display,
59 Window w)79 Window w)
60{80{
61 Window rootReturn;81 Window rootReturn = 0;
62 Window parentReturn = w;82 Window parentReturn = w;
63 Window *childrenReturn;
64 unsigned int nChildrenReturn;
65
66 Window lastParent = 0;83 Window lastParent = 0;
6784
68 do85 do
69 {86 {
70 lastParent = parentReturn;87 lastParent = parentReturn;
7188
72 XQueryTree (display,89 parentReturn = GetImmediateParent (display,
73 lastParent,90 lastParent,
74 &rootReturn,91 rootReturn);
75 &parentReturn,92
76 &childrenReturn,
77 &nChildrenReturn);
78 XFree (childrenReturn);
79 } while (parentReturn != rootReturn);93 } while (parentReturn != rootReturn);
8094
81 return lastParent;95 return lastParent;
@@ -565,3 +579,138 @@
565 currentWidth + (left + right),579 currentWidth + (left + right),
566 currentHeight + (top + bottom)));580 currentHeight + (top + bottom)));
567}581}
582
583TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsUnmapped)
584{
585 ::Display *dpy = Display ();
586
587 Window client = ct::CreateNormalWindow (dpy);
588 WaitForWindowCreation (client);
589
590 /* Set frame extents and get a response */
591 int left = 1;
592 int right = 1;
593 int top = 1;
594 int bottom = 1;
595
596 int currentX, currentY;
597 unsigned int currentWidth, currentHeight;
598 ASSERT_TRUE (QueryGeometry (dpy,
599 client,
600 currentX,
601 currentY,
602 currentWidth,
603 currentHeight));
604
605 /* We should get a response with our frame extents but it shouldn't actually
606 * do anything to the client as it is unmapped */
607 SendSetFrameExtentsRequest (client, left, right, top, bottom);
608 ASSERT_TRUE (VerifySetFrameExtentsResponse (client, left, right, top, bottom));
609
610 ASSERT_TRUE (VerifyWindowSize (client,
611 currentX,
612 currentY,
613 currentWidth,
614 currentHeight));
615}
616
617TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsCorrectMapBehaviour)
618{
619 ::Display *dpy = Display ();
620
621 Window client = ct::CreateNormalWindow (dpy);
622 WaitForWindowCreation (client);
623
624 /* Set frame extents and get a response */
625 int left = 1;
626 int right = 1;
627 int top = 1;
628 int bottom = 1;
629
630 int currentX, currentY;
631 unsigned int currentWidth, currentHeight;
632 ASSERT_TRUE (QueryGeometry (dpy,
633 client,
634 currentX,
635 currentY,
636 currentWidth,
637 currentHeight));
638
639 SendSetFrameExtentsRequest (client, left, right, top, bottom);
640 ASSERT_TRUE (VerifySetFrameExtentsResponse (client, left, right, top, bottom));
641
642 /* Map the window */
643 XMapRaised (dpy, client);
644 WaitForReparentAndMap (dpy, client);
645
646 /* Check the geometry of the frame */
647 Window frame = GetTopParent (dpy, client);
648 ASSERT_TRUE (VerifyWindowSize (frame,
649 currentX,
650 currentY,
651 currentWidth + (left + right),
652 currentHeight + (top + bottom)));
653
654 /* Wrapper geometry is extents.xy, size.wh */
655 Window root;
656 Window wrapper = GetImmediateParent (dpy, client, root);
657 ASSERT_TRUE (VerifyWindowSize (wrapper,
658 left,
659 top,
660 currentWidth,
661 currentHeight));
662}
663
664TEST_F (CompizXorgSystemConfigureWindowTest, SetFrameExtentsConsistentBehaviourAfterMap)
665{
666 ::Display *dpy = Display ();
667
668 Window client = ct::CreateNormalWindow (dpy);
669 WaitForWindowCreation (client);
670
671 /* Set frame extents and get a response */
672 int left = 1;
673 int right = 1;
674 int top = 1;
675 int bottom = 1;
676
677 int currentX, currentY;
678 unsigned int currentWidth, currentHeight;
679 ASSERT_TRUE (QueryGeometry (dpy,
680 client,
681 currentX,
682 currentY,
683 currentWidth,
684 currentHeight));
685
686 SendSetFrameExtentsRequest (client, left, right, top, bottom);
687 ASSERT_TRUE (VerifySetFrameExtentsResponse (client, left, right, top, bottom));
688
689 /* Map the window */
690 XMapRaised (dpy, client);
691 WaitForReparentAndMap (dpy, client);
692
693 /* Send it another frame extents request */
694 right = right + 1;
695 bottom = bottom + 1;
696
697 SendSetFrameExtentsRequest (client, left, right, top, bottom);
698 ASSERT_TRUE (VerifySetFrameExtentsResponse (client, left, right, top, bottom));
699
700 /* Check the geometry of the frame */
701 Window frame = GetTopParent (dpy, client);
702 ASSERT_TRUE (VerifyWindowSize (frame,
703 currentX,
704 currentY,
705 currentWidth + (left + right),
706 currentHeight + (top + bottom)));
707
708 /* Wrapper geometry is extents.xy, size.wh */
709 Window root;
710 Window wrapper = GetImmediateParent (dpy, client, root);
711 ASSERT_TRUE (VerifyWindowSize (wrapper,
712 left,
713 top,
714 currentWidth,
715 currentHeight));
716}

Subscribers

People subscribed via source and target branches

to all changes: