Merge lp:~mc-return/compiz/compiz.merge-grid-small-cleanup into lp:compiz/0.9.10

Proposed by MC Return
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3701
Merged at revision: 3690
Proposed branch: lp:~mc-return/compiz/compiz.merge-grid-small-cleanup
Merge into: lp:compiz/0.9.10
Diff against target: 1901 lines (+691/-678)
5 files modified
debian/patches/100_workaround_virtualbox_hang.patch (+14/-22)
debian/patches/ubuntu-config.patch (+31/-43)
plugins/grid/grid.xml.in (+459/-455)
plugins/grid/src/grid.cpp (+99/-98)
plugins/grid/src/grid.h (+88/-60)
To merge this branch: bzr merge lp:~mc-return/compiz/compiz.merge-grid-small-cleanup
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sam Spilsbury Approve
MC Return Needs Resubmitting
Review via email: mp+161330@code.launchpad.net

Commit message

*Grid, code changes and fixes:

Fixed segfault in Compiz when unchecking
"Snap windows back to original size".
This option now fully works and will snap
back windows to current size, if they are
dragged off via mouse.

Fixed segfault in Compiz when unchecking
"Snapoff Maximized/Semi-maximized Windows" -
this option is now removed as this setting is
configurable via "Move" plugin already.

The snapoff threshold global setting is now
configurable instead of hardcoded.

Fixed broken cursor y-coordinate calculation.
Fixed window placement cursor calculation
for non-original-size-restored windows.

Make sure grid-maximizing will never overwrite
the windows' original size.

Removed useless code until someone can
convince me that we need it (LP: #1020857).
This fixes the weird positioning (50, 50) when
restoring mouse-grid-maximized windows via
keyboard.

Added missing ABI checks of OpenGL and Composite.

*Grid, xml changes and fixes:

Put Corners/Edges setting into own tab.
New tab named "Resize Actions".
Removed hardcoded SNAPOFF_THRESHOLD and made it
configurable.
Improved tooltips.
Re-applied the quilt patch to the changed grid.xml.in.
Changed the put_restore_key to "Ctrl+Super+Down" to fix
restoring of grid-maximized windows for Ubuntu as well.
(LP: #1172641)

*Grid, minor code cleanup:

Removed redundant (int) casts.
Improved readability for the if condition checks.
Added and removed newlines, if appropriate.
Added comments.
Indentation fixes.

(LP: #745159, LP: #1020857, LP: #1172641)

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

the xml cleanup is fine.

957 - ${GMOCK_LIBRARY}
958 - ${GMOCK_MAIN_LIBRARY})
959 + ${GMOCK_LIBRARY})

GMOCK_MAIN_LIBRARY is necessary here.

1019 +/*
1020 if (cw == mGrabWindow)
1021 {
1022 - /* TODO: Remove these magic numbers */
1023 - xwc.x = workarea.x () + 50;
1024 - xwc.y = workarea.y () + 50;
1025 + int snapoffThreshold = optionGetSnapoffThreshold ();
1026 +
1027 + xwc.x = workarea.x () + snapoffThreshold;
1028 + xwc.y = workarea.y () + snapoffThreshold;
1029 xwc.width = workarea.width ();
1030 xwc.height = workarea.height ();
1031 cw->configureXWindow (CWX | CWY, &xwc);
1032 }
1033 +*/

I think this ensures the window is moved back on-screen. Not sure though.

Gotta run, will do the rest of the review later.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

So I think the intention of that code was to ensure that the window maximizes on the same monitor that the pointer is on. In order to do that correctly, the best way is really to just move it to 0,0 on that output, eg:

if (cw == mGrabWindow)
{
    xwc.x = workarea.x ();
    xwc.y = workarea.y ();
    cw->configureXWindow (CWX | CWY, &xwc);
}

Though, this behavior feels a bit strange - If you want to change it so that keybinding triggers always maximize the window on its current monitor then this should be done in a separate branch. Nevertheless, commenting out the code is incorrect in its current state.

1009 - if ((cw->state () & MAXIMIZE_STATE) &&
1010 - (resize || optionGetSnapoffMaximized ()))
1011 - /* maximized state interferes with us, clear it */
1012 + if ((cw->state () & MAXIMIZE_STATE) && resize)

...

1298 - xwc.x = pointerX - (gw->originalSize.width () / 2);
1299 - xwc.y = pointerY + (cw->border ().top / 2);
1300 + /* The windows x-center is different in this case. */
1301 + if (optionGetSnapbackWindows ())
1302 + {
1303 + xwc.x = pointerX - (gw->originalSize.width () / 2);
1304 + xwc.y = pointerY + (cw->border ().top / 2);
1305 + }
1306 + else /* the user does not want the original size back */
1307 + {
1308 + /* this one is quite tricky to get right */
1309 + xwc.x = pointerX - gw->pointerBufDx - gw->currentSize.width () / 2;
1310 + xwc.y = pointerY - gw->pointerBufDy + cw->border ().top / 2;
1311 + }

No need to change it here, but please do substantive changes separately to cleanups.

1259 + else if (!gw->isGridResized &&
1260 + gw->isGridHorzMaximized &&

These are not aligned.

403 - if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
1404 - return false;
1405 + if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
1406 + return true;
1407
1408 - return true;
1409 + return false;

This is not consistent with the rest of the style of ABI checks and is wrong anyways.

The ABI checks always go like this:

/* Something bad happened */
if (!checkPluginABI ("foo", FOO_ABI) ||
    !checkPluginABI ("bar", BAR_ABI))
    return false;

return true;

For consistency's sake it should also be the same with just the single check.

That being said, this plugins also links in composite and opengl and should check the ABI of those too.

This is going to cranky, but please do not mix any further substantive and formal changes. They make reviewing more time-consuming than it needs to be and unnecessarily causes proposals to be blocked on unrelated items.

review: Needs Fixing
Revision history for this message
MC Return (mc-return) wrote :
Download full text (3.7 KiB)

> So I think the intention of that code was to ensure that the window maximizes
> on the same monitor that the pointer is on. In order to do that correctly, the
> best way is really to just move it to 0,0 on that output, eg:
>
> if (cw == mGrabWindow)
> {
> xwc.x = workarea.x ();
> xwc.y = workarea.y ();
> cw->configureXWindow (CWX | CWY, &xwc);
> }
>
> Though, this behavior feels a bit strange - If you want to change it so that
> keybinding triggers always maximize the window on its current monitor then
> this should be done in a separate branch. Nevertheless, commenting out the
> code is incorrect in its current state.
>
The problem here is IMHO bug #776435.
It should be changed to maximize windows on the monitor the mousepointer is on.

Restoring Grid windows without the commented code is fine and feels correct, maybe we should restore windows below the unity-panel, which currently is not happening, but the x-coordinate of the window is much better now.
Moving to 50, 50 feels completely off.

> 1009 - if ((cw->state () & MAXIMIZE_STATE) &&
> 1010 - (resize || optionGetSnapoffMaximized ()))
> 1011 - /* maximized state interferes with us, clear it */
> 1012 + if ((cw->state () & MAXIMIZE_STATE) && resize)
>
> ...
>
> 1298 - xwc.x = pointerX - (gw->originalSize.width () / 2);
> 1299 - xwc.y = pointerY + (cw->border ().top / 2);
> 1300 + /* The windows x-center is different in this case. */
> 1301 + if (optionGetSnapbackWindows ())
> 1302 + {
> 1303 + xwc.x = pointerX - (gw->originalSize.width () / 2);
> 1304 + xwc.y = pointerY + (cw->border ().top / 2);
> 1305 + }
> 1306 + else /* the user does not want the original size back */
> 1307 + {
> 1308 + /* this one is quite tricky to get right */
> 1309 + xwc.x = pointerX - gw->pointerBufDx -
> gw->currentSize.width () / 2;
> 1310 + xwc.y = pointerY - gw->pointerBufDy + cw->border ().top /
> 2;
> 1311 + }
>
> No need to change it here, but please do substantive changes separately to
> cleanups.
>
The problem is that I do not have space for 20 compiled Compiz branches on my SSD, so I have one work branch I backport from...

> 1259 + else if (!gw->isGridResized &&
> 1260 + gw->isGridHorzMaximized &&
>
> These are not aligned.
>
I'll look into that.

> 403 - if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
> 1404 - return false;
> 1405 + if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
> 1406 + return true;
> 1407
> 1408 - return true;
> 1409 + return false;
>
> This is not consistent with the rest of the style of ABI checks and is wrong
> anyways.
>
> The ABI checks always go like this:
>
> /* Something bad happened */
> if (!checkPluginABI ("foo", FOO_ABI) ||
> !checkPluginABI ("bar", BAR_ABI))
> return false;
>
> return true;
>
> For consistency's sake it should also be the same with just the single check.
>
> That being said, this plugins also links in composite and opengl and ...

Read more...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :
Download full text (6.4 KiB)

> > So I think the intention of that code was to ensure that the window
> maximizes
> > on the same monitor that the pointer is on. In order to do that correctly,
> the
> > best way is really to just move it to 0,0 on that output, eg:
> >
> > if (cw == mGrabWindow)
> > {
> > xwc.x = workarea.x ();
> > xwc.y = workarea.y ();
> > cw->configureXWindow (CWX | CWY, &xwc);
> > }
> >
> > Though, this behavior feels a bit strange - If you want to change it so that
> > keybinding triggers always maximize the window on its current monitor then
> > this should be done in a separate branch. Nevertheless, commenting out the
> > code is incorrect in its current state.
> >
> The problem here is IMHO bug #776435.
> It should be changed to maximize windows on the monitor the mousepointer is
> on.
>
> Restoring Grid windows without the commented code is fine and feels correct,
> maybe we should restore windows below the unity-panel, which currently is not
> happening, but the x-coordinate of the window is much better now.
> Moving to 50, 50 feels completely off.
>
> > 1009 - if ((cw->state () & MAXIMIZE_STATE) &&
> > 1010 - (resize || optionGetSnapoffMaximized ()))
> > 1011 - /* maximized state interferes with us, clear it */
> > 1012 + if ((cw->state () & MAXIMIZE_STATE) && resize)
> >
> > ...
> >
> > 1298 - xwc.x = pointerX - (gw->originalSize.width () / 2);
> > 1299 - xwc.y = pointerY + (cw->border ().top / 2);
> > 1300 + /* The windows x-center is different in this case. */
> > 1301 + if (optionGetSnapbackWindows ())
> > 1302 + {
> > 1303 + xwc.x = pointerX - (gw->originalSize.width () / 2);
> > 1304 + xwc.y = pointerY + (cw->border ().top / 2);
> > 1305 + }
> > 1306 + else /* the user does not want the original size back */
> > 1307 + {
> > 1308 + /* this one is quite tricky to get right */
> > 1309 + xwc.x = pointerX - gw->pointerBufDx -
> > gw->currentSize.width () / 2;
> > 1310 + xwc.y = pointerY - gw->pointerBufDy + cw->border ().top
> /
> > 2;
> > 1311 + }
> >
> > No need to change it here, but please do substantive changes separately to
> > cleanups.
> >
> The problem is that I do not have space for 20 compiled Compiz branches on my
> SSD, so I have one work branch I backport from...
>
> > 1259 + else if (!gw->isGridResized &&
> > 1260 + gw->isGridHorzMaximized &&
> >
> > These are not aligned.
> >
> I'll look into that.
>
> > 403 - if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
> > 1404 - return false;
> > 1405 + if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
> > 1406 + return true;
> > 1407
> > 1408 - return true;
> > 1409 + return false;
> >
> > This is not consistent with the rest of the style of ABI checks and is wrong
> > anyways.
> >
> > The ABI checks always go like this:
> >
> > /* Something bad happened */
> > if (!checkPluginABI ("foo", FOO_ABI) ||
> > !checkPluginABI ("bar", BAR_ABI))
> > return false;
> >
> > return true;
> ...

Read more...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

> > So I think the intention of that code was to ensure that the window
> maximizes
> > on the same monitor that the pointer is on. In order to do that correctly,
> the
> > best way is really to just move it to 0,0 on that output, eg:
> >
> > if (cw == mGrabWindow)
> > {
> > xwc.x = workarea.x ();
> > xwc.y = workarea.y ();
> > cw->configureXWindow (CWX | CWY, &xwc);
> > }
> >
> > Though, this behavior feels a bit strange - If you want to change it so that
> > keybinding triggers always maximize the window on its current monitor then
> > this should be done in a separate branch. Nevertheless, commenting out the
> > code is incorrect in its current state.
> >
> The problem here is IMHO bug #776435.
> It should be changed to maximize windows on the monitor the mousepointer is
> on.
>
> Restoring Grid windows without the commented code is fine and feels correct,
> maybe we should restore windows below the unity-panel, which currently is not
> happening, but the x-coordinate of the window is much better now.
> Moving to 50, 50 feels completely off.
>

I meant to reply to this bit :)

If you think it makes sense to remove the commented code, then just remove it rather than leaving it commented out.

Revision history for this message
MC Return (mc-return) wrote :

>
> Test program:
>
> int main ()
> {
> bool a = true;
> bool b = true;
> bool c = true;
>
> if (!a || !b || !c)
> return 1;
>
> return 0;
> }
>
> g++ -O0 assembly:
>
> 4004fc: 0f b6 45 fd movzbl -0x3(%rbp),%eax
> 400500: 83 f0 01 xor $0x1,%eax
> 400503: 84 c0 test %al,%al
> 400505: 75 16 jne 40051d <main+0x31>
> 400507: 0f b6 45 fe movzbl -0x2(%rbp),%eax
> 40050b: 83 f0 01 xor $0x1,%eax
> 40050e: 84 c0 test %al,%al
> 400510: 75 0b jne 40051d <main+0x31>
> 400512: 0f b6 45 ff movzbl -0x1(%rbp),%eax
> 400516: 83 f0 01 xor $0x1,%eax
> 400519: 84 c0 test %al,%al
> 40051b: 74 07 je 400524 <main+0x38>
>
> int main ()
> {
> bool a = false;
> bool b = false;
> bool c = false;
>
> if (a && b && c)
> return 1;
>
> return 0;
> }
>
> Assembly:
>
> 4004fc: 80 7d fd 00 cmpb $0x0,-0x3(%rbp)
> 400500: 74 13 je 400515 <main+0x29>
> 400502: 80 7d fe 00 cmpb $0x0,-0x2(%rbp)
> 400506: 74 0d je 400515 <main+0x29>
> 400508: 80 7d ff 00 cmpb $0x0,-0x1(%rbp)
> 40050c: 74 07 je 400515 <main+0x29>
>
> The latter version is technically faster, because you can directly compare the
> booleans without negating them.
>
Do not forget that we expect almost always true, in fact it will be true in 100% of cases if
the plugin is okay, which it normally should be.

> However, this is a micro-optimization really. It saves 6 instructions and for
> 50 plugins would save 300 instructions total, which would make for a
> theoretical 4 one-hundred-millionths of a second optimization on a Pentium 4
> system (at 6500 MIPS).
>
If I do one such optimization per week, in a year it is 15000 instructions less to
execute, times say 5 million computers running Compiz will save a lot of energy ;)

> It probably makes more sense to keep it consistent with the other code. Though
> that's not to say that I wouldn't accept a best-case 4 one-hundred-millionth
> of a second optimization.

Yes, I agree 100%. It should be consistent in all cases. We also should report
to the console in the case something goes wrong, which just a few of the plugins
currently do.
Also water will currently not correctly execute without FBOs being enabled, but
there is not even a log message about it...

> I just don't think its worth the one hour of effort
> spent to write it.
It took about 30 minutes to fix it for all of the plugins here locally.
The improved error reporting will take another while of course and also to check that all ABI dependencies,
that each plugin has, get checked...

Revision history for this message
MC Return (mc-return) wrote :

>
> If you think it makes sense to remove the commented code, then just remove it
> rather than leaving it commented out.

I did not remove it yet, because the problem is not 100% fixed - it should remind me that there is a TODO there...
The y-restore postion could be better, namely below the unity/gnome/whatever-panel...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

>
> >
> > If you think it makes sense to remove the commented code, then just remove
> it
> > rather than leaving it commented out.
>
> I did not remove it yet, because the problem is not 100% fixed - it should
> remind me that there is a TODO there...
> The y-restore postion could be better, namely below the unity/gnome/whatever-
> panel...

In that case, it should either be fixed here or replaced with a TODO note in the source code.

If you want to place a window below the panel, the correct way to do it is to place it at the x position of the current output work-area plus the left and right window borders, for example:

CompOutput *currentOutput = &screen->outputDevs ()[screen->outputForGeometry (w->geometry ())];
const CompRect &workArea (currentOutput->workArea ());

int x = workArea.x () + w->border.left
int y = workArea.y () + w->border.top

Revision history for this message
MC Return (mc-return) wrote :

> the xml cleanup is fine.
>
> 957 - ${GMOCK_LIBRARY}
> 958 - ${GMOCK_MAIN_LIBRARY})
> 959 + ${GMOCK_LIBRARY})
>
> GMOCK_MAIN_LIBRARY is necessary here.
>

Good catch. Committed accidentially, because my work branch has yet to be rebased on trunk. Fixed in r3693.

Revision history for this message
MC Return (mc-return) wrote :

Ok, all fixed now.
Also made sure grid-maximizing will never overwrite the windows' original size.

The good news:
Recent testing shows the window restores below the panel anyway in all cases, except when a window was first grid-maximized, then grid-resized via keyboard and then restored, because the original size was stored when the window was maximized in this special case.
I have fixed this also now, so a maximized window will never overwrite the original size...

review: Needs Resubmitting
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

The other changes are good. Can you please revert this one?

1394 - if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
1395 - return false;
1396 + if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
1397 + return true;
1398
1399 - return true;
1400 + return false;

As mentioned before, I'd far prefer that the ABI check logic be kept consistent with the other plugins. If you think it would be worthwhile to change it, then it should be changed all at once in all the plugins in a separate MP.

Revision history for this message
MC Return (mc-return) wrote :

> The other changes are good. Can you please revert this one?
>
TBH, I would rather like to invest my time in adding composite and opengl here, which you correctly identified as missing...

> 1394 - if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
> 1395 - return false;
> 1396 + if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
> 1397 + return true;
> 1398
> 1399 - return true;
> 1400 + return false;
>
> As mentioned before, I'd far prefer that the ABI check logic be kept
> consistent with the other plugins.

I am for consistency also.

> If you think it would be worthwhile to
> change it, then it should be changed all at once in all the plugins in a
> separate MP.

Hmm, would mean 30 minutes of additional work - most probably this costs less time than the discussions necessary to get those changes in on a per-plugin basis...

Revision history for this message
MC Return (mc-return) :
review: Needs Resubmitting
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Looks great now, thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
MC Return (mc-return) wrote :

Ah - nice, another quilt patch I forgot:

Hunk #1 FAILED at 23.
Hunk #2 FAILED at 68.
2 out of 2 hunks FAILED -- rejects in file plugins/grid/grid.xml.in

:(

Revision history for this message
MC Return (mc-return) wrote :

I will quilt-fix this one, because here it is inevitable...
- but I want to note that I hate it -> the steps needed would be many:

1. First I have to install quilt, then setup the quilt environment variables in .quiltrc or .bashrc.
2. Then I have to throw away this branch and check out a new lp:compiz branch, because I have to know in advance of hacking if the quilt patching will fail - there is no way I can go from here...
3. Next I have to "quilt push -a" in my fresh lp:compiz branch to apply the patches, while doing that I read things like "Hunk #1 succeeded at 557 with fuzz 1 (offset 95 lines).", which help a lot to increase my confidence in quilt.
4. Now I would have to revert the grid change, refresh the patch and "quilt pop -a".
5. Then is the time to copy the new version over.
6. Later I can "quilt push -a" again.
7. Afterwards I have to search the stuff the quilt patch changed in the first place to mimic this behaviour manually, which means I have to add/remove the stuff quilt should remove, just that I have to do that manually... I am happy I know what exactly has been changed by quilt, because "patching file plugins/ezoom/ezoom.xml.in" is all the info quilt dared to gave me before. Thanks, such log messages make me a lot wiser.
8. To make sure what has been changed by quilt, ubuntu-config.patch (the old version) has to be checked in a editor.
9. I am now sure what has been changed and can edit plugins/grid/grid.xml.in.
10. After I have done all that I can now try to "quilt refresh", which I can do "as often as I like" \o/ HURRA !!!
11. As last step I can now do a "qilt pop -a" to update my patch and hopefully finish this nightmarish patching experience...

Less than 12 steps -> Easy, isn't it ?

I guess I will hack ubuntu-config.patch manually instead, should be much easier...
Or is there some quilt magic I do not know about ?

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

The problems you've mentioned are pretty easy to deal with:

0. export QUILT_PATCHES=debian/patches
1. You don't need to check out a new branch. If a patch fails to apply
it will create .rej and .orig files, but those aren't checked in
2. I'm not sure what you mean by "revert the grid change". The correct
approach to deal with a failing quilt patch is to look at the .rej
file and apply the changes there by-hand. Once that's done you run
quilt refresh

Also - I'd place a bit more confidence in quilt. Its like any other
merge tool - it just looks for a block of text surrounded by a certain
amount of context in a file and then applies a change to that block.
It either works or it doesn't - if it can't find the exact bit that
you want it to change, it will create patch reject files and you just
need to apply the change by hand.

On Fri, May 10, 2013 at 10:15 PM, MC Return <email address hidden> wrote:
> I will quilt-fix this one, because here it is inevitable...
> - but I want to note that I hate it -> the steps needed would be many:
>
> 1. First I have to install quilt, then setup the quilt environment variables in .quiltrc or .bashrc.
> 2. Then I have to throw away this branch and check out a new lp:compiz branch, because I have to know in advance of hacking if the quilt patching will fail - there is no way I can go from here...
> 3. Next I have to "quilt push -a" in my fresh lp:compiz branch to apply the patches, while doing that I read things like "Hunk #1 succeeded at 557 with fuzz 1 (offset 95 lines).", which help a lot to increase my confidence in quilt.
> 4. Now I would have to revert the grid change, refresh the patch and "quilt pop -a".
> 5. Then is the time to copy the new version over.
> 6. Later I can "quilt push -a" again.
> 7. Afterwards I have to search the stuff the quilt patch changed in the first place to mimic this behaviour manually, which means I have to add/remove the stuff quilt should remove, just that I have to do that manually... I am happy I know what exactly has been changed by quilt, because "patching file plugins/ezoom/ezoom.xml.in" is all the info quilt dared to gave me before. Thanks, such log messages make me a lot wiser.
> 8. To make sure what has been changed by quilt, ubuntu-config.patch (the old version) has to be checked in a editor.
> 9. I am now sure what has been changed and can edit plugins/grid/grid.xml.in.
> 10. After I have done all that I can now try to "quilt refresh", which I can do "as often as I like" \o/ HURRA !!!
> 11. As last step I can now do a "qilt pop -a" to update my patch and hopefully finish this nightmarish patching experience...
>
> Less than 12 steps -> Easy, isn't it ?
>
> I guess I will hack ubuntu-config.patch manually instead, should be much easier...
> Or is there some quilt magic I do not know about ?
> --
> https://code.launchpad.net/~mc-return/compiz/compiz.merge-grid-small-cleanup/+merge/161330
> You are reviewing the proposed merge of lp:~mc-return/compiz/compiz.merge-grid-small-cleanup into lp:compiz.

--
Sam Spilsbury

Revision history for this message
MC Return (mc-return) wrote :

> The problems you've mentioned are pretty easy to deal with:
>
> 0. export QUILT_PATCHES=debian/patches
> 1. You don't need to check out a new branch. If a patch fails to apply
> it will create .rej and .orig files, but those aren't checked in

Okay, so by "quilt push -a -f" I can enforce the patching and get the file
plugins/grid/grid.xml.in, with this content then:

--- plugins/grid/grid.xml.in
+++ plugins/grid/grid.xml.in
@@ -23,17 +23,16 @@
   <option name="put_center_key" type="key">
       <_short>Put Center</_short>
       <_long>Move window to the center</_long>
- <default>&lt;Control&gt;&lt;Alt&gt;KP_5</default>
   </option>
   <option name="put_left_key" type="key">
       <_short>Put Left</_short>
       <_long>Move window to the left edge</_long>
- <default>&lt;Control&gt;&lt;Alt&gt;KP_4</default>
+ <default>&lt;Control&gt;&lt;Super&gt;Left</default>
   </option>
   <option name="put_right_key" type="key">
       <_short>Put Right</_short>
       <_long>Move window to the right edge</_long>
- <default>&lt;Control&gt;&lt;Alt&gt;KP_6</default>
+ <default>&lt;Control&gt;&lt;Super&gt;Right</default>
   </option>
   <option name="put_top_key" type="key">
       <_short>Put Top</_short>
@@ -68,7 +67,6 @@
   <option name="put_maximize_key" type="key">
       <_short>Maximize</_short>
       <_long>Maximize window</_long>
- <default>&lt;Control&gt;&lt;Alt&gt;KP_0</default>
   </option>
   <option name="put_restore_key" type="key">
       <_short>Restore</_short>

> 2. I'm not sure what you mean by "revert the grid change". The correct
> approach to deal with a failing quilt patch is to look at the .rej
> file and apply the changes there by-hand. Once that's done you run
> quilt refresh
>
How can I easily change this "by hand" or how do I have to change it in
this case ?
All this steps are not necessary -> I could manipulate the ubuntu-config.patch
itself from the beginning if I have to do it manually anyway...

> Also - I'd place a bit more confidence in quilt. Its like any other
> merge tool - it just looks for a block of text surrounded by a certain
> amount of context in a file and then applies a change to that block.
> It either works or it doesn't - if it can't find the exact bit that
> you want it to change, it will create patch reject files and you just
> need to apply the change by hand.
>
Well, most of the quilt patches just change some shortcuts for the Ubuntu
Compiz version - it is not exactly the best and easiest way to do that.
I could think of several better solutions to change default shortcuts
for Ubuntu, like a separated config file with separated defaults that get
imported for Ubuntu for example...

Revision history for this message
MC Return (mc-return) wrote :

*the file is of course called plugins/grid/grid.xml.in.rej

Revision history for this message
MC Return (mc-return) :
review: Needs Information
Revision history for this message
Sam Spilsbury (smspillaz) wrote :
Download full text (3.4 KiB)

On Fri, May 10, 2013 at 11:06 PM, MC Return <email address hidden> wrote:
>> The problems you've mentioned are pretty easy to deal with:
>>
>> 0. export QUILT_PATCHES=debian/patches
>> 1. You don't need to check out a new branch. If a patch fails to apply
>> it will create .rej and .orig files, but those aren't checked in
>
> Okay, so by "quilt push -a -f" I can enforce the patching and get the file
> plugins/grid/grid.xml.in, with this content then:
>
> --- plugins/grid/grid.xml.in
> +++ plugins/grid/grid.xml.in
> @@ -23,17 +23,16 @@
> <option name="put_center_key" type="key">
> <_short>Put Center</_short>
> <_long>Move window to the center</_long>
> - <default>&lt;Control&gt;&lt;Alt&gt;KP_5</default>
> </option>
> <option name="put_left_key" type="key">
> <_short>Put Left</_short>
> <_long>Move window to the left edge</_long>
> - <default>&lt;Control&gt;&lt;Alt&gt;KP_4</default>
> + <default>&lt;Control&gt;&lt;Super&gt;Left</default>
> </option>
> <option name="put_right_key" type="key">
> <_short>Put Right</_short>
> <_long>Move window to the right edge</_long>
> - <default>&lt;Control&gt;&lt;Alt&gt;KP_6</default>
> + <default>&lt;Control&gt;&lt;Super&gt;Right</default>
> </option>
> <option name="put_top_key" type="key">
> <_short>Put Top</_short>
> @@ -68,7 +67,6 @@
> <option name="put_maximize_key" type="key">
> <_short>Maximize</_short>
> <_long>Maximize window</_long>
> - <default>&lt;Control&gt;&lt;Alt&gt;KP_0</default>
> </option>
> <option name="put_restore_key" type="key">
> <_short>Restore</_short>
>
>> 2. I'm not sure what you mean by "revert the grid change". The correct
>> approach to deal with a failing quilt patch is to look at the .rej
>> file and apply the changes there by-hand. Once that's done you run
>> quilt refresh
>>
> How can I easily change this "by hand" or how do I have to change it in
> this case ?
> All this steps are not necessary -> I could manipulate the ubuntu-config.patch
> itself from the beginning if I have to do it manually anyway...

So, the idea is that you apply the patch, and then edit the files to
which the patch applies should a part of the patch fail. For example:

x.patch patches foo.c and bar.c. A hunk on foo.c fails. This generates
foo.c.orig, a partially patched foo.c and foo.c.rej . Quilt is
"tracking" changes to foo.c at this point, so you examine foo.c.rej
and apply the remaining changes to foo.c manually. Once quilt refresh
is run, this will regenerate x.patch based on the correct data.

>>
> Well, most of the quilt patches just change some shortcuts for the Ubuntu
> Compiz version - it is not exactly the best and easiest way to do that.
> I could think of several better solutions to change default shortcuts
> for Ubuntu, like a sep...

Read more...

Revision history for this message
MC Return (mc-return) wrote :

>
> So, the idea is that you apply the patch, and then edit the files to
> which the patch applies should a part of the patch fail. For example:
>
> x.patch patches foo.c and bar.c. A hunk on foo.c fails. This generates
> foo.c.orig, a partially patched foo.c and foo.c.rej . Quilt is
> "tracking" changes to foo.c at this point, so you examine foo.c.rej
> and apply the remaining changes to foo.c manually. Once quilt refresh
> is run, this will regenerate x.patch based on the correct data.
>
Okay, I get the idea ;) - but the correct version to do it would nevertheless
need the 11-step plan...
I will do a partially hacked version now - I think it will be the easiest way:

1. I will first remove grid from ubuntu-config.patch completely so the hunk won't fail.
2. Then I'll "quilt push -a" to apply the rest of the patch to the source
3. Now I'll do the changes to grid.xml.in.
4. Refresh
5. "qilt pop -a"

This should save me the complicated step of manual patch adjustment...

Revision history for this message
MC Return (mc-return) wrote :

Just a note to myself:

quilt push -a
quilt add -P debian/patches/ubuntu-config.patch plugins/grid/grid.xml.in
make changes...
quilt refresh debian/patches/ubuntu-config.patch

Revision history for this message
MC Return (mc-return) wrote :

Take care, cause this branch could explode your computer ;)

Just joking - all done. I'll closed my eyes and put my trust in quilt ;)

review: Needs Resubmitting
Revision history for this message
MC Return (mc-return) wrote :

quilt and me are very good friends now :)

Revision history for this message
MC Return (mc-return) wrote :

Note: I also fixed bug #1172641, which needed quilt involvement on the way...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Thanks for refreshing the patches.

1653 +<<<<<<< TREE
1654 if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
1655 return true;
1656 +=======
1657 + if (!CompPlugin::checkPluginABI ("composite", CORE_ABIVERSION) ||
1658 + !CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) ||
1659 + !CompPlugin::checkPluginABI ("opengl", CORE_ABIVERSION))
1660 + return false;
1661 +>>>>>>> MERGE-SOURCE

Merge conflict.

   <option name="snapback_windows" type="bool">
    <_short>Snap Windows Back To Original Size</_short>
    <_long>Snaps windows back to their original size if dragged away from their gridded position.</_long>
    <default>true</default>
   </option>
   <option name="cycle_sizes" type="bool">
    <_short>Cycle Through Multiple Sizes</_short>
    <_long>Cycle through multiple different sizes by using the same keyboard shortcut multiple times in a row.</_long>
    <default>false</default>
   </option>
  <subgroup>

On lines 492-503 of grid.xml.in, if the subgroup tag has been removed then the options also need to be unindented

Revision history for this message
MC Return (mc-return) wrote :

> Thanks for refreshing the patches.
>
> 1653 +<<<<<<< TREE
> 1654 if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
> 1655 return true;
> 1656 +=======
> 1657 + if (!CompPlugin::checkPluginABI ("composite", CORE_ABIVERSION)
> ||
> 1658 + !CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) ||
> 1659 + !CompPlugin::checkPluginABI ("opengl", CORE_ABIVERSION))
> 1660 + return false;
> 1661 +>>>>>>> MERGE-SOURCE
>
> Merge conflict.
>
Noooooooooooooooooooooooooooo
Didn't I look at the diff ???
Looking now how to best fix that mess...

> <option name="snapback_windows" type="bool">
> <_short>Snap Windows Back To Original
> Size</_short>
> <_long>Snaps windows back to their original
> size if dragged away from their gridded position.</_long>
> <default>true</default>
> </option>
> <option name="cycle_sizes" type="bool">
> <_short>Cycle Through Multiple Sizes</_short>
> <_long>Cycle through multiple different sizes
> by using the same keyboard shortcut multiple times in a row.</_long>
> <default>false</default>
> </option>
> <subgroup>
>
> On lines 492-503 of grid.xml.in, if the subgroup tag has been removed then the
> options also need to be unindented

I have to investigate what happened here...

Revision history for this message
MC Return (mc-return) wrote :

/offtopic on

Regarding correct indentation of the .xml files -> they are all pretty messed up -> could vera++ help us here also ?

/offtopic off

Revision history for this message
MC Return (mc-return) wrote :

I did not see the merge conflict, because I had to merge lp:compiz for it to appear...

review: Needs Resubmitting
Revision history for this message
MC Return (mc-return) wrote :

Note:
Please let us fix the .xml indentation issue in some follow-up... it is really time for this to land now.

3701. By MC Return

Fixed indentation in grid.xml.in (lines 492-503)

Revision history for this message
MC Return (mc-return) wrote :

> >
> > On lines 492-503 of grid.xml.in, if the subgroup tag has been removed then
> the
> > options also need to be unindented

F*ck it. Fixed

Revision history for this message
MC Return (mc-return) :
review: Needs Resubmitting
Revision history for this message
MC Return (mc-return) wrote :

Note:
The known Grid bugs left (after this MP has landed):

Bug #1115341 - Grid resize: Placing maximized windows on the top edge using shortcuts does not take the panel into account

Bug #1172923 - Grid: Window movement animations missing, when grid-keyboard-resizing from a non-semi-maximized state

Sam, if you have any ideas on how to fix those 2 bugs, please give me a hint ;)
Especially getting the missing animations one would be a "nice to have" ;)

Revision history for this message
MC Return (mc-return) wrote :

Additional note:
Bug #776435 - Window maximizes and semi-maximizes on the wrong workspace

can also be triggered by Grid and needs to be finally fixed in 0.9.10.
Unfortunately this involves manipulating the core, which makes testing the fix properly a bit harder without fully installing the self-compiled Compiz...
Nevertheless the fix itself should not be hard to implement -> the logic just needs to be changed to always semi-maximize/maximize on the output device containing the pointer, not the output device, on which the biggest part of the window resides when it is semi-maximized/maximized.
For plugins using this function this change could be problematic, maybe the best solution would be to create a new function with the old behaviour and make all plugins call that instead, so the behaviour for them won't change, while maximizing and semimaximizing would use the new function...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

> Additional note:
> Bug #776435 - Window maximizes and semi-maximizes on the wrong workspace
>
> can also be triggered by Grid and needs to be finally fixed in 0.9.10.
> Unfortunately this involves manipulating the core, which makes testing the fix
> properly a bit harder without fully installing the self-compiled Compiz...

If you are still having trouble with this I'd suggest poking me on IRC about it, I should be able to help you out.

> Nevertheless the fix itself should not be hard to implement -> the logic just
> needs to be changed to always semi-maximize/maximize on the output device
> containing the pointer, not the output device, on which the biggest part of
> the window resides when it is semi-maximized/maximized.

This can be easily worked around from within the grid plugin - just move the window so that it is on the monitor completely before it is maximized. I'd rather not have that behavioural change in core, because it creates a strong disconnect between the window location and the monitor that the window is maximized on - especially for windows may request to maximize themselves or triggering a maximize by keybinding.

In any case this branch is good for now.

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 'debian/patches/100_workaround_virtualbox_hang.patch'
--- debian/patches/100_workaround_virtualbox_hang.patch 2013-02-17 07:28:12 +0000
+++ debian/patches/100_workaround_virtualbox_hang.patch 2013-05-11 08:07:29 +0000
@@ -1,8 +1,6 @@
1Index: compiz/plugins/opengl/include/opengl/opengl.h1--- a/plugins/opengl/include/opengl/opengl.h
2===================================================================2+++ b/plugins/opengl/include/opengl/opengl.h
3--- compiz.orig/plugins/opengl/include/opengl/opengl.h 2013-02-17 10:22:08.012876000 +08003@@ -582,6 +582,17 @@
4+++ compiz/plugins/opengl/include/opengl/opengl.h 2013-02-17 10:23:36.643958000 +0800
5@@ -578,6 +578,17 @@
6 4
7 extern GLScreenPaintAttrib defaultScreenPaintAttrib;5 extern GLScreenPaintAttrib defaultScreenPaintAttrib;
8 6
@@ -20,7 +18,7 @@
20 class GLScreen;18 class GLScreen;
21 class GLFramebufferObject;19 class GLFramebufferObject;
22 class GLScreenInterface;20 class GLScreenInterface;
23@@ -770,6 +781,13 @@21@@ -774,6 +785,13 @@
24 22
25 bool glInitContext (XVisualInfo *);23 bool glInitContext (XVisualInfo *);
26 24
@@ -34,11 +32,9 @@
34 WRAPABLE_HND (0, GLScreenInterface, bool, glPaintOutput,32 WRAPABLE_HND (0, GLScreenInterface, bool, glPaintOutput,
35 const GLScreenPaintAttrib &, const GLMatrix &,33 const GLScreenPaintAttrib &, const GLMatrix &,
36 const CompRegion &, CompOutput *, unsigned int);34 const CompRegion &, CompOutput *, unsigned int);
37Index: compiz/plugins/opengl/src/privates.h35--- a/plugins/opengl/src/privates.h
38===================================================================36+++ b/plugins/opengl/src/privates.h
39--- compiz.orig/plugins/opengl/src/privates.h 2013-02-17 10:22:08.012876000 +080037@@ -47,6 +47,24 @@
40+++ compiz/plugins/opengl/src/privates.h 2013-02-17 10:23:36.643958000 +0800
41@@ -46,6 +46,24 @@
42 38
43 extern CompOutput *targetOutput;39 extern CompOutput *targetOutput;
44 40
@@ -63,7 +59,7 @@
63 class GLDoubleBuffer :59 class GLDoubleBuffer :
64 public compiz::opengl::DoubleBuffer60 public compiz::opengl::DoubleBuffer
65 {61 {
66@@ -122,6 +140,7 @@62@@ -123,6 +141,7 @@
67 class PrivateGLScreen :63 class PrivateGLScreen :
68 public ScreenInterface,64 public ScreenInterface,
69 public compiz::composite::PaintHandler,65 public compiz::composite::PaintHandler,
@@ -71,7 +67,7 @@
71 public OpenglOptions67 public OpenglOptions
72 {68 {
73 public:69 public:
74@@ -206,6 +225,7 @@70@@ -207,6 +226,7 @@
75 std::vector<GLTexture::BindPixmapProc> bindPixmap;71 std::vector<GLTexture::BindPixmapProc> bindPixmap;
76 bool hasCompositing;72 bool hasCompositing;
77 bool commonFrontbuffer;73 bool commonFrontbuffer;
@@ -79,7 +75,7 @@
79 bool incorrectRefreshRate; // hack for NVIDIA specifying an incorrect75 bool incorrectRefreshRate; // hack for NVIDIA specifying an incorrect
80 // refresh rate, causing us to miss vblanks76 // refresh rate, causing us to miss vblanks
81 77
82@@ -225,6 +245,10 @@78@@ -226,6 +246,10 @@
83 79
84 mutable CompString prevRegex;80 mutable CompString prevRegex;
85 mutable bool prevBlacklisted;81 mutable bool prevBlacklisted;
@@ -90,10 +86,8 @@
90 };86 };
91 87
92 class PrivateGLWindow :88 class PrivateGLWindow :
93Index: compiz/plugins/opengl/src/screen.cpp89--- a/plugins/opengl/src/screen.cpp
94===================================================================90+++ b/plugins/opengl/src/screen.cpp
95--- compiz.orig/plugins/opengl/src/screen.cpp 2013-02-17 10:22:08.012876000 +0800
96+++ compiz/plugins/opengl/src/screen.cpp 2013-02-17 10:23:36.643958000 +0800
97@@ -67,6 +67,7 @@91@@ -67,6 +67,7 @@
98 92
99 93
@@ -148,10 +142,8 @@
148 if (strstr (glExtensions, "GL_ARB_texture_non_power_of_two"))142 if (strstr (glExtensions, "GL_ARB_texture_non_power_of_two"))
149 GL::textureNonPowerOfTwo = true;143 GL::textureNonPowerOfTwo = true;
150 GL::textureNonPowerOfTwoMipmap = GL::textureNonPowerOfTwo;144 GL::textureNonPowerOfTwoMipmap = GL::textureNonPowerOfTwo;
151Index: compiz/plugins/opengl/src/texture.cpp145--- a/plugins/opengl/src/texture.cpp
152===================================================================146+++ b/plugins/opengl/src/texture.cpp
153--- compiz.orig/plugins/opengl/src/texture.cpp 2013-02-17 10:22:08.012876000 +0800
154+++ compiz/plugins/opengl/src/texture.cpp 2013-02-17 10:23:36.643958000 +0800
155@@ -41,6 +41,7 @@147@@ -41,6 +41,7 @@
156 #include "glx-tfp-bind.h"148 #include "glx-tfp-bind.h"
157 149
158150
=== modified file 'debian/patches/ubuntu-config.patch'
--- debian/patches/ubuntu-config.patch 2013-02-14 05:47:11 +0000
+++ debian/patches/ubuntu-config.patch 2013-05-11 08:07:29 +0000
@@ -204,7 +204,6 @@
204 <min>0</min>204 <min>0</min>
205 <max>1</max>205 <max>1</max>
206 <precision>0.01</precision>206 <precision>0.01</precision>
207
208--- a/plugins/decor/decor.xml.in207--- a/plugins/decor/decor.xml.in
209+++ b/plugins/decor/decor.xml.in208+++ b/plugins/decor/decor.xml.in
210@@ -31,7 +31,7 @@209@@ -31,7 +31,7 @@
@@ -243,7 +242,6 @@
243 </option>242 </option>
244 <option name="mipmap" type="bool">243 <option name="mipmap" type="bool">
245 <_short>Mipmap</_short>244 <_short>Mipmap</_short>
246
247--- a/plugins/expo/expo.xml.in245--- a/plugins/expo/expo.xml.in
248+++ b/plugins/expo/expo.xml.in246+++ b/plugins/expo/expo.xml.in
249@@ -17,6 +17,7 @@247@@ -17,6 +17,7 @@
@@ -357,7 +355,6 @@
357 <min>0.0</min>355 <min>0.0</min>
358 <max>2.0</max>356 <max>2.0</max>
359 <precision>0.01</precision>357 <precision>0.01</precision>
360
361--- a/plugins/ezoom/ezoom.xml.in358--- a/plugins/ezoom/ezoom.xml.in
362+++ b/plugins/ezoom/ezoom.xml.in359+++ b/plugins/ezoom/ezoom.xml.in
363@@ -29,7 +29,6 @@360@@ -29,7 +29,6 @@
@@ -393,7 +390,6 @@
393 </option>390 </option>
394 </subgroup>391 </subgroup>
395 </group>392 </group>
396
397--- a/plugins/fade/fade.xml.in393--- a/plugins/fade/fade.xml.in
398+++ b/plugins/fade/fade.xml.in394+++ b/plugins/fade/fade.xml.in
399@@ -10,6 +10,7 @@395@@ -10,6 +10,7 @@
@@ -413,7 +409,6 @@
413 </option>409 </option>
414 <option name="visual_bell" type="bell">410 <option name="visual_bell" type="bell">
415 <_short>Visual Bell</_short>411 <_short>Visual Bell</_short>
416
417--- a/plugins/gnomecompat/gnomecompat.xml.in412--- a/plugins/gnomecompat/gnomecompat.xml.in
418+++ b/plugins/gnomecompat/gnomecompat.xml.in413+++ b/plugins/gnomecompat/gnomecompat.xml.in
419@@ -53,6 +53,7 @@414@@ -53,6 +53,7 @@
@@ -424,38 +419,6 @@
424 </option>419 </option>
425 </group>420 </group>
426 </options>421 </options>
427
428--- a/plugins/grid/grid.xml.in
429+++ b/plugins/grid/grid.xml.in
430@@ -23,17 +23,16 @@
431 <option name="put_center_key" type="key">
432 <_short>Put Center</_short>
433 <_long>Move window to the center</_long>
434- <default>&lt;Control&gt;&lt;Alt&gt;KP_5</default>
435 </option>
436 <option name="put_left_key" type="key">
437 <_short>Put Left</_short>
438 <_long>Move window to the left edge</_long>
439- <default>&lt;Control&gt;&lt;Alt&gt;KP_4</default>
440+ <default>&lt;Control&gt;&lt;Super&gt;Left</default>
441 </option>
442 <option name="put_right_key" type="key">
443 <_short>Put Right</_short>
444 <_long>Move window to the right edge</_long>
445- <default>&lt;Control&gt;&lt;Alt&gt;KP_6</default>
446+ <default>&lt;Control&gt;&lt;Super&gt;Right</default>
447 </option>
448 <option name="put_top_key" type="key">
449 <_short>Put Top</_short>
450@@ -68,7 +67,6 @@
451 <option name="put_maximize_key" type="key">
452 <_short>Maximize</_short>
453 <_long>Maximize window</_long>
454- <default>&lt;Control&gt;&lt;Alt&gt;KP_0</default>
455 </option>
456 <option name="put_restore_key" type="key">
457 <_short>Restore</_short>
458
459--- a/plugins/place/place.xml.in422--- a/plugins/place/place.xml.in
460+++ b/plugins/place/place.xml.in423+++ b/plugins/place/place.xml.in
461@@ -20,8 +20,8 @@424@@ -20,8 +20,8 @@
@@ -469,7 +432,6 @@
469 <max>5</max>432 <max>5</max>
470 <desc>433 <desc>
471 <value>0</value>434 <value>0</value>
472
473--- a/plugins/resize/resize.xml.in435--- a/plugins/resize/resize.xml.in
474+++ b/plugins/resize/resize.xml.in436+++ b/plugins/resize/resize.xml.in
475@@ -28,7 +28,7 @@437@@ -28,7 +28,7 @@
@@ -516,7 +478,6 @@
516 </default>478 </default>
517 </option>479 </option>
518 <subgroup>480 <subgroup>
519
520--- a/plugins/scale/scale.xml.in481--- a/plugins/scale/scale.xml.in
521+++ b/plugins/scale/scale.xml.in482+++ b/plugins/scale/scale.xml.in
522@@ -19,14 +19,14 @@483@@ -19,14 +19,14 @@
@@ -607,7 +568,6 @@
607 </option>568 </option>
608 </group>569 </group>
609 </options>570 </options>
610
611--- a/plugins/staticswitcher/staticswitcher.xml.in571--- a/plugins/staticswitcher/staticswitcher.xml.in
612+++ b/plugins/staticswitcher/staticswitcher.xml.in572+++ b/plugins/staticswitcher/staticswitcher.xml.in
613@@ -11,7 +11,6 @@573@@ -11,7 +11,6 @@
@@ -686,7 +646,6 @@
686 <desc>646 <desc>
687 <value>0</value>647 <value>0</value>
688 <_name>None</_name>648 <_name>None</_name>
689
690--- a/plugins/vpswitch/vpswitch.xml.in649--- a/plugins/vpswitch/vpswitch.xml.in
691+++ b/plugins/vpswitch/vpswitch.xml.in650+++ b/plugins/vpswitch/vpswitch.xml.in
692@@ -95,13 +95,11 @@651@@ -95,13 +95,11 @@
@@ -703,7 +662,6 @@
703 <internal/>662 <internal/>
704 </option>663 </option>
705 <option name="initiate_button" type="button">664 <option name="initiate_button" type="button">
706
707--- a/plugins/wall/wall.xml.in665--- a/plugins/wall/wall.xml.in
708+++ b/plugins/wall/wall.xml.in666+++ b/plugins/wall/wall.xml.in
709@@ -31,12 +31,12 @@667@@ -31,12 +31,12 @@
@@ -853,7 +811,6 @@
853 </option>811 </option>
854 <option name="edgeflip_dnd" type="bool">812 <option name="edgeflip_dnd" type="bool">
855 <_short>Edge Flip DnD</_short>813 <_short>Edge Flip DnD</_short>
856
857--- a/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp814--- a/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
858+++ b/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp815+++ b/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
859@@ -46,7 +46,7 @@816@@ -46,7 +46,7 @@
@@ -865,3 +822,34 @@
865 unsigned int DEFAULT_VIEWPORT_HEIGHT = 1;822 unsigned int DEFAULT_VIEWPORT_HEIGHT = 1;
866 823
867 bool Advance (Display *d, bool r)824 bool Advance (Display *d, bool r)
825--- a/plugins/grid/grid.xml.in
826+++ b/plugins/grid/grid.xml.in
827@@ -23,17 +23,16 @@
828 <option name="put_center_key" type="key">
829 <_short>Put Center Key</_short>
830 <_long>Move window to the center.</_long>
831- <default>&lt;Control&gt;&lt;Alt&gt;KP_5</default>
832 </option>
833 <option name="put_left_key" type="key">
834 <_short>Put Left Key</_short>
835 <_long>Move window to the left edge.</_long>
836- <default>&lt;Control&gt;&lt;Alt&gt;KP_4</default>
837+ <default>&lt;Control&gt;&lt;Super&gt;Left</default>
838 </option>
839 <option name="put_right_key" type="key">
840 <_short>Put Right Key</_short>
841 <_long>Move window to the right edge.</_long>
842- <default>&lt;Control&gt;&lt;Alt&gt;KP_6</default>
843+ <default>&lt;Control&gt;&lt;Super&gt;Right</default>
844 </option>
845 <option name="put_top_key" type="key">
846 <_short>Put Top Key</_short>
847@@ -73,7 +72,7 @@
848 <option name="put_restore_key" type="key">
849 <_short>Restore</_short>
850 <_long>Restore window to it's original size. Note: Use the same shortcut you are using to unmaximize a window to be able to restore grid-maximized windows.</_long>
851- <default>&lt;Alt&gt;F5</default>
852+ <default>&lt;Control&gt;&lt;Super&gt;Down</default>
853 </option>
854 </group>
855 <group>
868856
=== modified file 'plugins/grid/grid.xml.in'
--- plugins/grid/grid.xml.in 2013-04-25 10:11:04 +0000
+++ plugins/grid/grid.xml.in 2013-05-11 08:07:29 +0000
@@ -21,492 +21,486 @@
21 <group>21 <group>
22 <_short>Bindings</_short>22 <_short>Bindings</_short>
23 <option name="put_center_key" type="key">23 <option name="put_center_key" type="key">
24 <_short>Put Center</_short>24 <_short>Put Center Key</_short>
25 <_long>Move window to the center</_long>25 <_long>Move window to the center.</_long>
26 <default>&lt;Control&gt;&lt;Alt&gt;KP_5</default>26 <default>&lt;Control&gt;&lt;Alt&gt;KP_5</default>
27 </option>27 </option>
28 <option name="put_left_key" type="key">28 <option name="put_left_key" type="key">
29 <_short>Put Left</_short>29 <_short>Put Left Key</_short>
30 <_long>Move window to the left edge</_long>30 <_long>Move window to the left edge.</_long>
31 <default>&lt;Control&gt;&lt;Alt&gt;KP_4</default>31 <default>&lt;Control&gt;&lt;Alt&gt;KP_4</default>
32 </option>32 </option>
33 <option name="put_right_key" type="key">33 <option name="put_right_key" type="key">
34 <_short>Put Right</_short>34 <_short>Put Right Key</_short>
35 <_long>Move window to the right edge</_long>35 <_long>Move window to the right edge.</_long>
36 <default>&lt;Control&gt;&lt;Alt&gt;KP_6</default>36 <default>&lt;Control&gt;&lt;Alt&gt;KP_6</default>
37 </option>37 </option>
38 <option name="put_top_key" type="key">38 <option name="put_top_key" type="key">
39 <_short>Put Top</_short>39 <_short>Put Top Key</_short>
40 <_long>Move window to the top edge</_long>40 <_long>Move window to the top edge.</_long>
41 <default>&lt;Control&gt;&lt;Alt&gt;KP_8</default>41 <default>&lt;Control&gt;&lt;Alt&gt;KP_8</default>
42 </option>42 </option>
43 <option name="put_bottom_key" type="key">43 <option name="put_bottom_key" type="key">
44 <_short>Put Bottom</_short>44 <_short>Put Bottom Key</_short>
45 <_long>Move window to the bottom edge</_long>45 <_long>Move window to the bottom edge.</_long>
46 <default>&lt;Control&gt;&lt;Alt&gt;KP_2</default>46 <default>&lt;Control&gt;&lt;Alt&gt;KP_2</default>
47 </option>47 </option>
48 <option name="put_topleft_key" type="key">48 <option name="put_topleft_key" type="key">
49 <_short>Put Top Left</_short>49 <_short>Put Top Left Key</_short>
50 <_long>Move window to the top left corner</_long>50 <_long>Move window to the top left corner.</_long>
51 <default>&lt;Control&gt;&lt;Alt&gt;KP_7</default>51 <default>&lt;Control&gt;&lt;Alt&gt;KP_7</default>
52 </option>52 </option>
53 <option name="put_topright_key" type="key">53 <option name="put_topright_key" type="key">
54 <_short>Put Top Right</_short>54 <_short>Put Top Right Key</_short>
55 <_long>Move window to the top right corner</_long>55 <_long>Move window to the top right corner.</_long>
56 <default>&lt;Control&gt;&lt;Alt&gt;KP_9</default>56 <default>&lt;Control&gt;&lt;Alt&gt;KP_9</default>
57 </option>57 </option>
58 <option name="put_bottomleft_key" type="key">58 <option name="put_bottomleft_key" type="key">
59 <_short>Put Bottom Left</_short>59 <_short>Put Bottom Left Key</_short>
60 <_long>Move window to the bottom left corner</_long>60 <_long>Move window to the bottom left corner.</_long>
61 <default>&lt;Control&gt;&lt;Alt&gt;KP_1</default>61 <default>&lt;Control&gt;&lt;Alt&gt;KP_1</default>
62 </option>62 </option>
63 <option name="put_bottomright_key" type="key">63 <option name="put_bottomright_key" type="key">
64 <_short>Put Bottom Right</_short>64 <_short>Put Bottom Right Key</_short>
65 <_long>Move window to the bottom right corner</_long>65 <_long>Move window to the bottom right corner.</_long>
66 <default>&lt;Control&gt;&lt;Alt&gt;KP_3</default>66 <default>&lt;Control&gt;&lt;Alt&gt;KP_3</default>
67 </option>67 </option>
68 <option name="put_maximize_key" type="key">68 <option name="put_maximize_key" type="key">
69 <_short>Maximize</_short>69 <_short>Maximize Key</_short>
70 <_long>Maximize window</_long>70 <_long>Maximize window.</_long>
71 <default>&lt;Control&gt;&lt;Alt&gt;KP_0</default>71 <default>&lt;Control&gt;&lt;Alt&gt;KP_0</default>
72 </option>72 </option>
73 <option name="put_restore_key" type="key">73 <option name="put_restore_key" type="key">
74 <_short>Restore</_short>74 <_short>Restore</_short>
75 <_long>Restores grid-resized, semi-maximized and maximized windows to their original size and position.</_long>75 <_long>Restore window to it's original size. Note: Use the same shortcut you are using to unmaximize a window to be able to restore grid-maximized windows.</_long>
76 <default>&lt;Control&gt;&lt;Alt&gt;r</default>76 <default>&lt;Alt&gt;F5</default>
77 </option>77 </option>
78 </group>78 </group>
79 <group>79 <group>
80 <_short>Edges</_short>80 <_short>Corners / Edges</_short>
81 <subgroup>81 <option name="top_left_corner_action" type="int">
82 <_short>Resize Actions</_short>82 <_short>Upper Left Corner</_short>
83 <_long>Window resize action</_long>83 <_long>Action to be performed when window is dropped on the top left corner.</_long>
84 <option name="top_left_corner_action" type="int">84 <default>4</default>
85 <_short>Upper Left Corner</_short>85 <min>0</min>
86 <_long>Action to be performed when window is dropped on the top left corner.</_long>86 <max>10</max>
87 <default>4</default>87 <desc>
88 <min>0</min>88 <value>0</value>
89 <max>10</max>89 <_name>None</_name>
90 <desc>90 </desc>
91 <value>0</value>91 <desc>
92 <_name>None</_name>92 <value>1</value>
93 </desc>93 <_name>Bottom Left Corner</_name>
94 <desc>94 </desc>
95 <value>1</value>95 <desc>
96 <_name>Bottom Left Corner</_name>96 <value>2</value>
97 </desc>97 <_name>Bottom Half</_name>
98 <desc>98 </desc>
99 <value>2</value>99 <desc>
100 <_name>Bottom Half</_name>100 <value>3</value>
101 </desc>101 <_name>Bottom Right Corner</_name>
102 <desc>102 </desc>
103 <value>3</value>103 <desc>
104 <_name>Bottom Right Corner</_name>104 <value>4</value>
105 </desc>105 <_name>Left Half</_name>
106 <desc>106 </desc>
107 <value>4</value>107 <desc>
108 <_name>Left Half</_name>108 <value>5</value>
109 </desc>109 <_name>Fill Screen</_name>
110 <desc>110 </desc>
111 <value>5</value>111 <desc>
112 <_name>Fill Screen</_name>112 <value>6</value>
113 </desc>113 <_name>Right Half</_name>
114 <desc>114 </desc>
115 <value>6</value>115 <desc>
116 <_name>Right Half</_name>116 <value>7</value>
117 </desc>117 <_name>Top Left Corner</_name>
118 <desc>118 </desc>
119 <value>7</value>119 <desc>
120 <_name>Top Left Corner</_name>120 <value>8</value>
121 </desc>121 <_name>Top Half</_name>
122 <desc>122 </desc>
123 <value>8</value>123 <desc>
124 <_name>Top Half</_name>124 <value>9</value>
125 </desc>125 <_name>Top Right Corner</_name>
126 <desc>126 </desc>
127 <value>9</value>127 <desc>
128 <_name>Top Right Corner</_name>128 <value>10</value>
129 </desc>129 <_name>Maximize</_name>
130 <desc>130 </desc>
131 <value>10</value>131 </option>
132 <_name>Maximize</_name>132 <option name="top_edge_action" type="int">
133 </desc>133 <_short>Top Edge</_short>
134 </option>134 <_long>Action to be performed when window is dropped on the top edge.</_long>
135 <option name="top_edge_action" type="int">135 <default>10</default>
136 <_short>Top Edge</_short>136 <min>0</min>
137 <_long>Action to be performed when window is dropped on the top edge.</_long>137 <max>10</max>
138 <default>10</default>138 <desc>
139 <min>0</min>139 <value>0</value>
140 <max>10</max>140 <_name>None</_name>
141 <desc>141 </desc>
142 <value>0</value>142 <desc>
143 <_name>None</_name>143 <value>1</value>
144 </desc>144 <_name>Bottom Left Corner</_name>
145 <desc>145 </desc>
146 <value>1</value>146 <desc>
147 <_name>Bottom Left Corner</_name>147 <value>2</value>
148 </desc>148 <_name>Bottom Half</_name>
149 <desc>149 </desc>
150 <value>2</value>150 <desc>
151 <_name>Bottom Half</_name>151 <value>3</value>
152 </desc>152 <_name>Bottom Right Corner</_name>
153 <desc>153 </desc>
154 <value>3</value>154 <desc>
155 <_name>Bottom Right Corner</_name>155 <value>4</value>
156 </desc>156 <_name>Left Half</_name>
157 <desc>157 </desc>
158 <value>4</value>158 <desc>
159 <_name>Left Half</_name>159 <value>5</value>
160 </desc>160 <_name>Fill Screen</_name>
161 <desc>161 </desc>
162 <value>5</value>162 <desc>
163 <_name>Fill Screen</_name>163 <value>6</value>
164 </desc>164 <_name>Right Half</_name>
165 <desc>165 </desc>
166 <value>6</value>166 <desc>
167 <_name>Right Half</_name>167 <value>7</value>
168 </desc>168 <_name>Top Left Corner</_name>
169 <desc>169 </desc>
170 <value>7</value>170 <desc>
171 <_name>Top Left Corner</_name>171 <value>8</value>
172 </desc>172 <_name>Top Half</_name>
173 <desc>173 </desc>
174 <value>8</value>174 <desc>
175 <_name>Top Half</_name>175 <value>9</value>
176 </desc>176 <_name>Top Right Corner</_name>
177 <desc>177 </desc>
178 <value>9</value>178 <desc>
179 <_name>Top Right Corner</_name>179 <value>10</value>
180 </desc>180 <_name>Maximize</_name>
181 <desc>181 </desc>
182 <value>10</value>182 </option>
183 <_name>Maximize</_name>183 <option name="top_right_corner_action" type="int">
184 </desc>184 <_short>Upper Right Corner</_short>
185 </option>185 <_long>Action to be performed when window is dropped on the top right corner.</_long>
186 <option name="top_right_corner_action" type="int">186 <default>6</default>
187 <_short>Upper Right Corner</_short>187 <min>0</min>
188 <_long>Action to be performed when window is dropped on the top right corner.</_long>188 <max>10</max>
189 <default>6</default>189 <desc>
190 <min>0</min>190 <value>0</value>
191 <max>10</max>191 <_name>None</_name>
192 <desc>192 </desc>
193 <value>0</value>193 <desc>
194 <_name>None</_name>194 <value>1</value>
195 </desc>195 <_name>Bottom Left Corner</_name>
196 <desc>196 </desc>
197 <value>1</value>197 <desc>
198 <_name>Bottom Left Corner</_name>198 <value>2</value>
199 </desc>199 <_name>Bottom Half</_name>
200 <desc>200 </desc>
201 <value>2</value>201 <desc>
202 <_name>Bottom Half</_name>202 <value>3</value>
203 </desc>203 <_name>Bottom Right Corner</_name>
204 <desc>204 </desc>
205 <value>3</value>205 <desc>
206 <_name>Bottom Right Corner</_name>206 <value>4</value>
207 </desc>207 <_name>Left Half</_name>
208 <desc>208 </desc>
209 <value>4</value>209 <desc>
210 <_name>Left Half</_name>210 <value>5</value>
211 </desc>211 <_name>Fill Screen</_name>
212 <desc>212 </desc>
213 <value>5</value>213 <desc>
214 <_name>Fill Screen</_name>214 <value>6</value>
215 </desc>215 <_name>Right Half</_name>
216 <desc>216 </desc>
217 <value>6</value>217 <desc>
218 <_name>Right Half</_name>218 <value>7</value>
219 </desc>219 <_name>Top Left Corner</_name>
220 <desc>220 </desc>
221 <value>7</value>221 <desc>
222 <_name>Top Left Corner</_name>222 <value>8</value>
223 </desc>223 <_name>Top Half</_name>
224 <desc>224 </desc>
225 <value>8</value>225 <desc>
226 <_name>Top Half</_name>226 <value>9</value>
227 </desc>227 <_name>Top Right Corner</_name>
228 <desc>228 </desc>
229 <value>9</value>229 <desc>
230 <_name>Top Right Corner</_name>230 <value>10</value>
231 </desc>231 <_name>Maximize</_name>
232 <desc>232 </desc>
233 <value>10</value>233 </option>
234 <_name>Maximize</_name>234 <option name="left_edge_action" type="int">
235 </desc>235 <_short>Left Edge</_short>
236 </option>236 <_long>Action to be performed when window is dropped on the left edge.</_long>
237 <option name="left_edge_action" type="int">237 <default>4</default>
238 <_short>Left Edge</_short>238 <min>0</min>
239 <_long>Action to be performed when window is dropped on the left edge.</_long>239 <max>10</max>
240 <default>4</default>240 <desc>
241 <min>0</min>241 <value>0</value>
242 <max>10</max>242 <_name>None</_name>
243 <desc>243 </desc>
244 <value>0</value>244 <desc>
245 <_name>None</_name>245 <value>1</value>
246 </desc>246 <_name>Bottom Left Corner</_name>
247 <desc>247 </desc>
248 <value>1</value>248 <desc>
249 <_name>Bottom Left Corner</_name>249 <value>2</value>
250 </desc>250 <_name>Bottom Half</_name>
251 <desc>251 </desc>
252 <value>2</value>252 <desc>
253 <_name>Bottom Half</_name>253 <value>3</value>
254 </desc>254 <_name>Bottom Right Corner</_name>
255 <desc>255 </desc>
256 <value>3</value>256 <desc>
257 <_name>Bottom Right Corner</_name>257 <value>4</value>
258 </desc>258 <_name>Left Half</_name>
259 <desc>259 </desc>
260 <value>4</value>260 <desc>
261 <_name>Left Half</_name>261 <value>5</value>
262 </desc>262 <_name>Fill Screen</_name>
263 <desc>263 </desc>
264 <value>5</value>264 <desc>
265 <_name>Fill Screen</_name>265 <value>6</value>
266 </desc>266 <_name>Right Half</_name>
267 <desc>267 </desc>
268 <value>6</value>268 <desc>
269 <_name>Right Half</_name>269 <value>7</value>
270 </desc>270 <_name>Top Left Corner</_name>
271 <desc>271 </desc>
272 <value>7</value>272 <desc>
273 <_name>Top Left Corner</_name>273 <value>8</value>
274 </desc>274 <_name>Top Half</_name>
275 <desc>275 </desc>
276 <value>8</value>276 <desc>
277 <_name>Top Half</_name>277 <value>9</value>
278 </desc>278 <_name>Top Right Corner</_name>
279 <desc>279 </desc>
280 <value>9</value>280 <desc>
281 <_name>Top Right Corner</_name>281 <value>10</value>
282 </desc>282 <_name>Maximize</_name>
283 <desc>283 </desc>
284 <value>10</value>284 </option>
285 <_name>Maximize</_name>285 <option name="right_edge_action" type="int">
286 </desc>286 <_short>Right Edge</_short>
287 </option>287 <_long>Action to be performed when window is dropped on the right edge.</_long>
288 <option name="right_edge_action" type="int">288 <default>6</default>
289 <_short>Right Edge</_short>289 <min>0</min>
290 <_long>Action to be performed when window is dropped on the right edge.</_long>290 <max>10</max>
291 <default>6</default>291 <desc>
292 <min>0</min>292 <value>0</value>
293 <max>10</max>293 <_name>None</_name>
294 <desc>294 </desc>
295 <value>0</value>295 <desc>
296 <_name>None</_name>296 <value>1</value>
297 </desc>297 <_name>Bottom Left Corner</_name>
298 <desc>298 </desc>
299 <value>1</value>299 <desc>
300 <_name>Bottom Left Corner</_name>300 <value>2</value>
301 </desc>301 <_name>Bottom Half</_name>
302 <desc>302 </desc>
303 <value>2</value>303 <desc>
304 <_name>Bottom Half</_name>304 <value>3</value>
305 </desc>305 <_name>Bottom Right Corner</_name>
306 <desc>306 </desc>
307 <value>3</value>307 <desc>
308 <_name>Bottom Right Corner</_name>308 <value>4</value>
309 </desc>309 <_name>Left Half</_name>
310 <desc>310 </desc>
311 <value>4</value>311 <desc>
312 <_name>Left Half</_name>312 <value>5</value>
313 </desc>313 <_name>Fill Screen</_name>
314 <desc>314 </desc>
315 <value>5</value>315 <desc>
316 <_name>Fill Screen</_name>316 <value>6</value>
317 </desc>317 <_name>Right Half</_name>
318 <desc>318 </desc>
319 <value>6</value>319 <desc>
320 <_name>Right Half</_name>320 <value>7</value>
321 </desc>321 <_name>Top Left Corner</_name>
322 <desc>322 </desc>
323 <value>7</value>323 <desc>
324 <_name>Top Left Corner</_name>324 <value>8</value>
325 </desc>325 <_name>Top Half</_name>
326 <desc>326 </desc>
327 <value>8</value>327 <desc>
328 <_name>Top Half</_name>328 <value>9</value>
329 </desc>329 <_name>Top Right Corner</_name>
330 <desc>330 </desc>
331 <value>9</value>331 <desc>
332 <_name>Top Right Corner</_name>332 <value>10</value>
333 </desc>333 <_name>Maximize</_name>
334 <desc>334 </desc>
335 <value>10</value>335 </option>
336 <_name>Maximize</_name>336 <option name="bottom_left_corner_action" type="int">
337 </desc>337 <_short>Bottom Left Corner</_short>
338 </option>338 <_long>Action to be performed when window is dropped on the bottom left corner.</_long>
339 <option name="bottom_left_corner_action" type="int">339 <default>4</default>
340 <_short>Bottom Left Corner</_short>340 <min>0</min>
341 <_long>Action to be performed when window is dropped on the bottom left corner.</_long>341 <max>10</max>
342 <default>4</default>342 <desc>
343 <min>0</min>343 <value>0</value>
344 <max>10</max>344 <_name>None</_name>
345 <desc>345 </desc>
346 <value>0</value>346 <desc>
347 <_name>None</_name>347 <value>1</value>
348 </desc>348 <_name>Bottom Left Corner</_name>
349 <desc>349 </desc>
350 <value>1</value>350 <desc>
351 <_name>Bottom Left Corner</_name>351 <value>2</value>
352 </desc>352 <_name>Bottom Half</_name>
353 <desc>353 </desc>
354 <value>2</value>354 <desc>
355 <_name>Bottom Half</_name>355 <value>3</value>
356 </desc>356 <_name>Bottom Right Corner</_name>
357 <desc>357 </desc>
358 <value>3</value>358 <desc>
359 <_name>Bottom Right Corner</_name>359 <value>4</value>
360 </desc>360 <_name>Left Half</_name>
361 <desc>361 </desc>
362 <value>4</value>362 <desc>
363 <_name>Left Half</_name>363 <value>5</value>
364 </desc>364 <_name>Fill Screen</_name>
365 <desc>365 </desc>
366 <value>5</value>366 <desc>
367 <_name>Fill Screen</_name>367 <value>6</value>
368 </desc>368 <_name>Right Half</_name>
369 <desc>369 </desc>
370 <value>6</value>370 <desc>
371 <_name>Right Half</_name>371 <value>7</value>
372 </desc>372 <_name>Top Left Corner</_name>
373 <desc>373 </desc>
374 <value>7</value>374 <desc>
375 <_name>Top Left Corner</_name>375 <value>8</value>
376 </desc>376 <_name>Top Half</_name>
377 <desc>377 </desc>
378 <value>8</value>378 <desc>
379 <_name>Top Half</_name>379 <value>9</value>
380 </desc>380 <_name>Top Right Corner</_name>
381 <desc>381 </desc>
382 <value>9</value>382 <desc>
383 <_name>Top Right Corner</_name>383 <value>10</value>
384 </desc>384 <_name>Maximize</_name>
385 <desc>385 </desc>
386 <value>10</value>386 </option>
387 <_name>Maximize</_name>387 <option name="bottom_edge_action" type="int">
388 </desc>388 <_short>Bottom Edge</_short>
389 </option>389 <_long>Action to be performed when window is dropped on the bottom edge.</_long>
390 <option name="bottom_edge_action" type="int">390 <default>0</default>
391 <_short>Bottom Edge</_short>391 <min>0</min>
392 <_long>Action to be performed when window is dropped on the bottom edge.</_long>392 <max>10</max>
393 <default>0</default>393 <desc>
394 <min>0</min>394 <value>0</value>
395 <max>10</max>395 <_name>None</_name>
396 <desc>396 </desc>
397 <value>0</value>397 <desc>
398 <_name>None</_name>398 <value>1</value>
399 </desc>399 <_name>Bottom Left Corner</_name>
400 <desc>400 </desc>
401 <value>1</value>401 <desc>
402 <_name>Bottom Left Corner</_name>402 <value>2</value>
403 </desc>403 <_name>Bottom Half</_name>
404 <desc>404 </desc>
405 <value>2</value>405 <desc>
406 <_name>Bottom Half</_name>406 <value>3</value>
407 </desc>407 <_name>Bottom Right Corner</_name>
408 <desc>408 </desc>
409 <value>3</value>409 <desc>
410 <_name>Bottom Right Corner</_name>410 <value>4</value>
411 </desc>411 <_name>Left Half</_name>
412 <desc>412 </desc>
413 <value>4</value>413 <desc>
414 <_name>Left Half</_name>414 <value>5</value>
415 </desc>415 <_name>Fill Screen</_name>
416 <desc>416 </desc>
417 <value>5</value>417 <desc>
418 <_name>Fill Screen</_name>418 <value>6</value>
419 </desc>419 <_name>Right Half</_name>
420 <desc>420 </desc>
421 <value>6</value>421 <desc>
422 <_name>Right Half</_name>422 <value>7</value>
423 </desc>423 <_name>Top Left Corner</_name>
424 <desc>424 </desc>
425 <value>7</value>425 <desc>
426 <_name>Top Left Corner</_name>426 <value>8</value>
427 </desc>427 <_name>Top Half</_name>
428 <desc>428 </desc>
429 <value>8</value>429 <desc>
430 <_name>Top Half</_name>430 <value>9</value>
431 </desc>431 <_name>Top Right Corner</_name>
432 <desc>432 </desc>
433 <value>9</value>433 <desc>
434 <_name>Top Right Corner</_name>434 <value>10</value>
435 </desc>435 <_name>Maximize</_name>
436 <desc>436 </desc>
437 <value>10</value>437 </option>
438 <_name>Maximize</_name>438 <option name="bottom_right_corner_action" type="int">
439 </desc>439 <_short>Bottom Right Corner</_short>
440 </option>440 <_long>Action to be performed when window is dropped on the bottom right corner.</_long>
441 <option name="bottom_right_corner_action" type="int">441 <default>6</default>
442 <_short>Bottom Right Corner</_short>442 <min>0</min>
443 <_long>Action to be performed when window is dropped on the bottom right corner.</_long>443 <max>10</max>
444 <default>6</default>444 <desc>
445 <min>0</min>445 <value>0</value>
446 <max>10</max>446 <_name>None</_name>
447 <desc>447 </desc>
448 <value>0</value>448 <desc>
449 <_name>None</_name>449 <value>1</value>
450 </desc>450 <_name>Bottom Left Corner</_name>
451 <desc>451 </desc>
452 <value>1</value>452 <desc>
453 <_name>Bottom Left Corner</_name>453 <value>2</value>
454 </desc>454 <_name>Bottom Half</_name>
455 <desc>455 </desc>
456 <value>2</value>456 <desc>
457 <_name>Bottom Half</_name>457 <value>3</value>
458 </desc>458 <_name>Bottom Right Corner</_name>
459 <desc>459 </desc>
460 <value>3</value>460 <desc>
461 <_name>Bottom Right Corner</_name>461 <value>4</value>
462 </desc>462 <_name>Left Half</_name>
463 <desc>463 </desc>
464 <value>4</value>464 <desc>
465 <_name>Left Half</_name>465 <value>5</value>
466 </desc>466 <_name>Fill Screen</_name>
467 <desc>467 </desc>
468 <value>5</value>468 <desc>
469 <_name>Fill Screen</_name>469 <value>6</value>
470 </desc>470 <_name>Right Half</_name>
471 <desc>471 </desc>
472 <value>6</value>472 <desc>
473 <_name>Right Half</_name>473 <value>7</value>
474 </desc>474 <_name>Top Left Corner</_name>
475 <desc>475 </desc>
476 <value>7</value>476 <desc>
477 <_name>Top Left Corner</_name>477 <value>8</value>
478 </desc>478 <_name>Top Half</_name>
479 <desc>479 </desc>
480 <value>8</value>480 <desc>
481 <_name>Top Half</_name>481 <value>9</value>
482 </desc>482 <_name>Top Right Corner</_name>
483 <desc>483 </desc>
484 <value>9</value>484 <desc>
485 <_name>Top Right Corner</_name>485 <value>10</value>
486 </desc>486 <_name>Maximize</_name>
487 <desc>487 </desc>
488 <value>10</value>488 </option>
489 <_name>Maximize</_name>489 </group>
490 </desc>490 <group>
491 </option>491 <_short>Resize Actions</_short>
492 <option name="snapoff_maximized" type="bool">492 <option name="snapback_windows" type="bool">
493 <_short>Snapoff Maximized/Semi-maximized Windows</_short>493 <_short>Snap Windows Back To Original Size</_short>
494 <_long>Snapoff maximized and vertically maximized windows by dragging them up or down and horizontally maximized ones by dragging them left or right.</_long>494 <_long>Snaps windows back to their original size if dragged away from their gridded position.</_long>
495 <default>false</default>495 <default>true</default>
496 </option>496 </option>
497 <option name="snapback_windows" type="bool">497 <option name="cycle_sizes" type="bool">
498 <_short>Snap Windows Back To Original Size</_short>498 <_short>Cycle Through Multiple Sizes</_short>
499 <_long>Snaps windows back to their original size if dragged away from their gridded position.</_long>499 <_long>Cycle through multiple different sizes by using the same keyboard shortcut multiple times in a row.</_long>
500 <default>true</default>500 <default>false</default>
501 </option>501 </option>
502 <option name="cycle_sizes" type="bool">502 <subgroup>
503 <_short>Cycle Through Multiple Sizes</_short>503 <_short>Grid Snapback Thresholds</_short>
504 <_long>Cycle through multiple different sizes by using the same keyboard shortcut multiple times in a row.</_long>
505 <default>false</default>
506 </option>
507 </subgroup>
508 <subgroup>
509 <_short>Thresholds</_short>
510 <option name="left_edge_threshold" type="int">504 <option name="left_edge_threshold" type="int">
511 <_short>Left Edge</_short>505 <_short>Left Edge</_short>
512 <_long>Maximum number of pixels from the left edge a window can be dropped.</_long>506 <_long>Maximum number of pixels from the left edge a window can be dropped.</_long>
@@ -536,6 +530,16 @@
536 <max>500</max>530 <max>500</max>
537 </option>531 </option>
538 </subgroup>532 </subgroup>
533 <subgroup>
534 <_short>Grid Snapoff Threshold</_short>
535 <option name="snapoff_threshold" type="int">
536 <_short>General Size</_short>
537 <_long>The pixels to drag until a grid-resized window snaps off.</_long>
538 <default>50</default>
539 <min>0</min>
540 <max>500</max>
541 </option>
542 </subgroup>
539 </group>543 </group>
540 <group>544 <group>
541 <_short>Appearance</_short>545 <_short>Appearance</_short>
542546
=== modified file 'plugins/grid/src/grid.cpp'
--- plugins/grid/src/grid.cpp 2013-05-09 13:43:07 +0000
+++ plugins/grid/src/grid.cpp 2013-05-11 08:07:29 +0000
@@ -36,8 +36,8 @@
36static int const CURVE_ANIMATION = 35;36static int const CURVE_ANIMATION = 35;
3737
38void38void
39GridScreen::handleCompizEvent(const char* plugin,39GridScreen::handleCompizEvent(const char *plugin,
40 const char* event,40 const char *event,
41 CompOption::Vector& o)41 CompOption::Vector& o)
42{42{
43 if (strcmp(event, "start_viewport_switch") == 0)43 if (strcmp(event, "start_viewport_switch") == 0)
@@ -118,12 +118,12 @@
118}118}
119119
120bool120bool
121GridScreen::initiateCommon (CompAction *action,121GridScreen::initiateCommon (CompAction *action,
122 CompAction::State state,122 CompAction::State state,
123 CompOption::Vector &option,123 CompOption::Vector &option,
124 unsigned int where,124 unsigned int where,
125 bool resize,125 bool resize,
126 bool key)126 bool key)
127{127{
128 CompWindow *cw = 0;128 CompWindow *cw = 0;
129129
@@ -142,7 +142,7 @@
142 vertMaximizedGridPosition ||142 vertMaximizedGridPosition ||
143 where & GridMaximize;143 where & GridMaximize;
144144
145 if (!(cw->actions () & CompWindowActionResizeMask) ||145 if (!(cw->actions () & CompWindowActionResizeMask) ||
146 (maximizeH && !(cw->actions () & CompWindowActionMaximizeHorzMask)) ||146 (maximizeH && !(cw->actions () & CompWindowActionMaximizeHorzMask)) ||
147 (maximizeV && !(cw->actions () & CompWindowActionMaximizeVertMask)) ||147 (maximizeV && !(cw->actions () & CompWindowActionMaximizeVertMask)) ||
148 where & GridUnknown)148 where & GridUnknown)
@@ -168,29 +168,20 @@
168 if (props.numCellsX == 1)168 if (props.numCellsX == 1)
169 centerCheck = true;169 centerCheck = true;
170170
171 /* Do not overwrite the original size if we already have been gridded */171 /* Do not overwrite the original size if we already have been gridded or
172 if (!gw->isGridResized && !gw->isGridHorzMaximized && !gw->isGridVertMaximized)172 * have been grid-maximized */
173 if (!gw->isGridResized && !gw->isGridHorzMaximized && !gw->isGridVertMaximized &&
174 !(cw->state () & MAXIMIZE_STATE))
173 /* Store size not including borders when using a keybinding */175 /* Store size not including borders when using a keybinding */
174 gw->originalSize = slotToRect(cw, cw->serverBorderRect ());176 gw->originalSize = slotToRect(cw, cw->serverBorderRect ());
175 }177 }
176178
177 if ((cw->state () & MAXIMIZE_STATE) &&179 if ((cw->state () & MAXIMIZE_STATE) && resize)
178 (resize || optionGetSnapoffMaximized ()))180 // maximized state interferes with us, clear it
179 /* maximized state interferes with us, clear it */
180 cw->maximize (0);181 cw->maximize (0);
181182
182 if ((where & GridMaximize) && resize)183 if ((where & GridMaximize) && resize)
183 {184 {
184 /* move the window to the correct output */
185 if (cw == mGrabWindow)
186 {
187 /* TODO: Remove these magic numbers */
188 xwc.x = workarea.x () + 50;
189 xwc.y = workarea.y () + 50;
190 xwc.width = workarea.width ();
191 xwc.height = workarea.height ();
192 cw->configureXWindow (CWX | CWY, &xwc);
193 }
194 cw->maximize (MAXIMIZE_STATE);185 cw->maximize (MAXIMIZE_STATE);
195 /* Core can handle fully maximized windows so we don't186 /* Core can handle fully maximized windows so we don't
196 * have to worry about them. Don't mark the window as a187 * have to worry about them. Don't mark the window as a
@@ -202,6 +193,7 @@
202193
203 for (unsigned int i = 0; i < animations.size (); ++i)194 for (unsigned int i = 0; i < animations.size (); ++i)
204 animations.at (i).fadingOut = true;195 animations.at (i).fadingOut = true;
196
205 return true;197 return true;
206 }198 }
207199
@@ -246,12 +238,12 @@
246 * unless the user explicitely specified that in CCSM238 * unless the user explicitely specified that in CCSM
247 */239 */
248 if (gw->lastTarget == where &&240 if (gw->lastTarget == where &&
249 gw->isGridResized &&241 gw->isGridResized &&
250 !optionGetCycleSizes ())242 !optionGetCycleSizes ())
251 return false;243 return false;
252244
253 /* !(Grid Left/Right/Top/Bottom) are only valid here, if245 /* !(Grid Left/Right/Top/Bottom) are only valid here,
254 * cycling through sizes is disabled also246 * if cycling through sizes is disabled also
255 */247 */
256 if ((where & ~(GridMaximize) ||248 if ((where & ~(GridMaximize) ||
257 ((!horzMaximizedGridPosition || !vertMaximizedGridPosition) &&249 ((!horzMaximizedGridPosition || !vertMaximizedGridPosition) &&
@@ -398,7 +390,7 @@
398390
399 rwc.x = gw->originalSize.x ();391 rwc.x = gw->originalSize.x ();
400 rwc.y = gw->originalSize.y ();392 rwc.y = gw->originalSize.y ();
401 rwc.width = gw->originalSize.width ();393 rwc.width = gw->originalSize.width ();
402 rwc.height = gw->originalSize.height ();394 rwc.height = gw->originalSize.height ();
403395
404 cw->configureXWindow (CWX | CWY | CWWidth | CWHeight, &rwc);396 cw->configureXWindow (CWX | CWY | CWWidth | CWHeight, &rwc);
@@ -469,10 +461,8 @@
469 */461 */
470 if (centerCheck)462 if (centerCheck)
471 {463 {
472 if ((cw->serverBorderRect ().width () >464 if (cw->serverBorderRect ().width () > desiredSlot.width () ||
473 desiredSlot.width ()) ||465 cw->serverBorderRect ().width () < desiredSlot.width ())
474 cw->serverBorderRect ().width () <
475 desiredSlot.width ())
476 {466 {
477 wc.x = (workarea.width () >> 1) -467 wc.x = (workarea.width () >> 1) -
478 ((cw->serverBorderRect ().width () >> 1) -468 ((cw->serverBorderRect ().width () >> 1) -
@@ -492,13 +482,13 @@
492 const GLMatrix &transform,482 const GLMatrix &transform,
493 CompOutput *output)483 CompOutput *output)
494{484{
495 CompRect rect;485 CompRect rect;
496 GLMatrix sTransform (transform);486 GLMatrix sTransform (transform);
497 std::vector<Animation>::iterator iter;487 std::vector<Animation>::iterator iter;
498 GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();488 GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
499 GLfloat vertexData[12];489 GLfloat vertexData[12];
500 GLushort colorData[4];490 GLushort colorData[4];
501 GLushort *color;491 GLushort *color;
502 GLboolean isBlendingEnabled;492 GLboolean isBlendingEnabled;
503493
504 const float MaxUShortFloat = std::numeric_limits <unsigned short>::max ();494 const float MaxUShortFloat = std::numeric_limits <unsigned short>::max ();
@@ -702,10 +692,10 @@
702 type.push_back (GridTypeMask (GridWindowType::GridTopRight, 9));692 type.push_back (GridTypeMask (GridWindowType::GridTopRight, 9));
703 type.push_back (GridTypeMask (GridWindowType::GridMaximize, 10));693 type.push_back (GridTypeMask (GridWindowType::GridMaximize, 10));
704694
705
706 for (unsigned int i = 0; i < type.size (); ++i)695 for (unsigned int i = 0; i < type.size (); ++i)
707 {696 {
708 GridTypeMask &tm = type[i];697 GridTypeMask &tm = type[i];
698
709 if (tm.type == t)699 if (tm.type == t)
710 return tm.mask;700 return tm.mask;
711 }701 }
@@ -721,35 +711,35 @@
721 switch (edge)711 switch (edge)
722 {712 {
723 case Left:713 case Left:
724 ret = (int) optionGetLeftEdgeAction ();714 ret = optionGetLeftEdgeAction ();
725 break;715 break;
726716
727 case Right:717 case Right:
728 ret = (int) optionGetRightEdgeAction ();718 ret = optionGetRightEdgeAction ();
729 break;719 break;
730720
731 case Top:721 case Top:
732 ret = (int) optionGetTopEdgeAction ();722 ret = optionGetTopEdgeAction ();
733 break;723 break;
734724
735 case Bottom:725 case Bottom:
736 ret = (int) optionGetBottomEdgeAction ();726 ret = optionGetBottomEdgeAction ();
737 break;727 break;
738728
739 case TopLeft:729 case TopLeft:
740 ret = (int) optionGetTopLeftCornerAction ();730 ret = optionGetTopLeftCornerAction ();
741 break;731 break;
742732
743 case TopRight:733 case TopRight:
744 ret = (int) optionGetTopRightCornerAction ();734 ret = optionGetTopRightCornerAction ();
745 break;735 break;
746736
747 case BottomLeft:737 case BottomLeft:
748 ret = (int) optionGetBottomLeftCornerAction ();738 ret = optionGetBottomLeftCornerAction ();
749 break;739 break;
750740
751 case BottomRight:741 case BottomRight:
752 ret = (int) optionGetBottomRightCornerAction ();742 ret = optionGetBottomRightCornerAction ();
753 break;743 break;
754744
755 case NoEdge:745 case NoEdge:
@@ -862,6 +852,7 @@
862 if (edge != NoEdge && check)852 if (edge != NoEdge && check)
863 {853 {
864 CompWindow *cw = screen->findWindow (screen->activeWindow ());854 CompWindow *cw = screen->findWindow (screen->activeWindow ());
855
865 if (cw)856 if (cw)
866 {857 {
867 animations.push_back (Animation ());858 animations.push_back (Animation ());
@@ -894,12 +885,14 @@
894 {885 {
895 GRID_WINDOW (w);886 GRID_WINDOW (w);
896887
897 if ((gw->pointerBufDx > SNAPOFF_THRESHOLD ||888 int snapoffThreshold = optionGetSnapoffThreshold ();
898 gw->pointerBufDy > SNAPOFF_THRESHOLD ||889
899 gw->pointerBufDx < -SNAPOFF_THRESHOLD ||890 /* we just care about snapping of grid-resized windows */
900 gw->pointerBufDy < -SNAPOFF_THRESHOLD) &&891 if ((gw->pointerBufDx > snapoffThreshold ||
901 gw->isGridResized &&892 gw->pointerBufDy > snapoffThreshold ||
902 optionGetSnapbackWindows ())893 gw->pointerBufDx < -snapoffThreshold ||
894 gw->pointerBufDy < -snapoffThreshold) &&
895 gw->isGridResized)
903 restoreWindow (0, 0, o);896 restoreWindow (0, 0, o);
904 }897 }
905}898}
@@ -938,13 +931,11 @@
938 pointerBufDx = pointerBufDy = 0;931 pointerBufDx = pointerBufDy = 0;
939 grabMask = mask;932 grabMask = mask;
940933
941 if (!isGridResized &&934 if (!isGridResized &&
942 !isGridHorzMaximized &&935 !isGridHorzMaximized &&
943 !isGridVertMaximized &&936 !isGridVertMaximized)
944 gScreen->optionGetSnapbackWindows ())
945 /* Store size not including borders when grabbing with cursor */937 /* Store size not including borders when grabbing with cursor */
946 originalSize = gScreen->slotToRect(window,938 originalSize = gScreen->slotToRect (window, window->serverBorderRect ());
947 window->serverBorderRect ());
948 }939 }
949 else if (gwHandler.resetResize ())940 else if (gwHandler.resetResize ())
950 {941 {
@@ -982,9 +973,9 @@
982{973{
983 window->moveNotify (dx, dy, immediate);974 window->moveNotify (dx, dy, immediate);
984975
985 if (isGridResized &&976 if (isGridResized &&
986 !isGridHorzMaximized &&977 !isGridHorzMaximized &&
987 !isGridVertMaximized &&978 !isGridVertMaximized &&
988 !GridScreen::get (screen)->mSwitchingVp)979 !GridScreen::get (screen)->mSwitchingVp)
989 {980 {
990 if (window->grabbed () && screen->grabExist ("expo"))981 if (window->grabbed () && screen->grabExist ("expo"))
@@ -996,6 +987,7 @@
996 gScreen->restoreWindow (0, 0, gScreen->o);987 gScreen->restoreWindow (0, 0, gScreen->o);
997 return;988 return;
998 }989 }
990
999 if (window->grabbed () && (grabMask & CompWindowGrabMoveMask))991 if (window->grabbed () && (grabMask & CompWindowGrabMoveMask))
1000 {992 {
1001 pointerBufDx += dx;993 pointerBufDx += dx;
@@ -1036,8 +1028,7 @@
1036 lastTarget = GridMaximize;1028 lastTarget = GridMaximize;
10371029
1038 if (window->grabbed ())1030 if (window->grabbed ())
1039 originalSize = gScreen->slotToRect (window,1031 originalSize = gScreen->slotToRect (window, window->serverBorderRect ());
1040 window->serverBorderRect ());
1041 }1032 }
10421033
1043 window->stateChangeNotify (lastState);1034 window->stateChangeNotify (lastState);
@@ -1049,8 +1040,8 @@
1049 CompOption::Vector &option)1040 CompOption::Vector &option)
1050{1041{
1051 XWindowChanges xwc;1042 XWindowChanges xwc;
1052 int xwcm = 0;1043 int xwcm = 0;
1053 CompWindow *cw = screen->findWindow (screen->activeWindow ());1044 CompWindow *cw = screen->findWindow (screen->activeWindow ());
10541045
1055 if (!cw)1046 if (!cw)
1056 return false;1047 return false;
@@ -1058,13 +1049,13 @@
1058 GRID_WINDOW (cw);1049 GRID_WINDOW (cw);
10591050
1060 /* We have nothing to do here */1051 /* We have nothing to do here */
1061 if (!gw->isGridResized &&1052 if (!gw->isGridResized &&
1062 !gw->isGridVertMaximized &&1053 !gw->isGridVertMaximized &&
1063 !gw->isGridHorzMaximized)1054 !gw->isGridHorzMaximized)
1064 return false;1055 return false;
10651056
1066 else if (!gw->isGridResized &&1057 else if (!gw->isGridResized &&
1067 gw->isGridHorzMaximized &&1058 gw->isGridHorzMaximized &&
1068 !gw->isGridVertMaximized)1059 !gw->isGridVertMaximized)
1069 {1060 {
1070 /* Window has been horizontally maximized by grid. We only need1061 /* Window has been horizontally maximized by grid. We only need
@@ -1073,8 +1064,8 @@
1073 gw->window->sizeHints ().flags |= gw->sizeHintsFlags;1064 gw->window->sizeHints ().flags |= gw->sizeHintsFlags;
1074 xwcm |= CWY | CWHeight;1065 xwcm |= CWY | CWHeight;
1075 }1066 }
1076 else if (!gw->isGridResized &&1067 else if (!gw->isGridResized &&
1077 !gw->isGridHorzMaximized &&1068 !gw->isGridHorzMaximized &&
1078 gw->isGridVertMaximized)1069 gw->isGridVertMaximized)
1079 {1070 {
1080 /* Window has been vertically maximized by grid. We only need1071 /* Window has been vertically maximized by grid. We only need
@@ -1083,8 +1074,8 @@
1083 gw->window->sizeHints ().flags |= gw->sizeHintsFlags;1074 gw->window->sizeHints ().flags |= gw->sizeHintsFlags;
1084 xwcm |= CWX | CWWidth;1075 xwcm |= CWX | CWWidth;
1085 }1076 }
1086 else if (gw->isGridResized &&1077 else if (gw->isGridResized &&
1087 !gw->isGridHorzMaximized &&1078 !gw->isGridHorzMaximized &&
1088 !gw->isGridVertMaximized)1079 !gw->isGridVertMaximized)
1089 /* Window is just gridded (center, corners).1080 /* Window is just gridded (center, corners).
1090 * We need to handle everything. */1081 * We need to handle everything. */
@@ -1093,15 +1084,25 @@
1093 {1084 {
1094 /* This should never happen. But if it does, just bail out1085 /* This should never happen. But if it does, just bail out
1095 * gracefully. */1086 * gracefully. */
1096 assert (gw->isGridResized &&1087 assert (gw->isGridResized &&
1097 (gw->isGridHorzMaximized || gw->isGridVertMaximized));1088 (gw->isGridHorzMaximized || gw->isGridVertMaximized));
1098 return false;1089 return false;
1099 }1090 }
11001091
1101 if (cw == mGrabWindow)1092 if (cw == mGrabWindow)
1102 {1093 {
1103 xwc.x = pointerX - (gw->originalSize.width () / 2);1094 /* The windows x-center is different in this case. */
1104 xwc.y = pointerY + (cw->border ().top / 2);1095 if (optionGetSnapbackWindows ())
1096 {
1097 xwc.x = pointerX - (gw->originalSize.width () / 2);
1098 xwc.y = pointerY + (cw->border ().top / 2);
1099 }
1100 else /* the user does not want the original size back */
1101 {
1102 /* this one is quite tricky to get right */
1103 xwc.x = pointerX - gw->pointerBufDx - gw->currentSize.width () / 2;
1104 xwc.y = pointerY - gw->pointerBufDy + cw->border ().top / 2;
1105 }
1105 }1106 }
1106 else if (cw->grabbed () && screen->grabExist ("expo"))1107 else if (cw->grabbed () && screen->grabExist ("expo"))
1107 {1108 {
@@ -1119,19 +1120,32 @@
1119 xwc.y = gw->originalSize.y ();1120 xwc.y = gw->originalSize.y ();
1120 }1121 }
11211122
1122 xwc.width = gw->originalSize.width ();1123 /* We just need the original size, if
1123 xwc.height = gw->originalSize.height ();1124 * this option is enabled or we are not grabbed */
1125 if (optionGetSnapbackWindows () ||
1126 !(cw == mGrabWindow))
1127 {
1128 xwc.width = gw->originalSize.width ();
1129 xwc.height = gw->originalSize.height ();
1130 }
1131 else
1132 {
1133 /* the current size is also our new size */
1134 xwc.width = gw->currentSize.width ();
1135 xwc.height = gw->currentSize.height ();
1136 }
11241137
1125 if (cw->mapNum() && xwcm)1138 if (cw->mapNum() && xwcm)
1126 cw->sendSyncRequest();1139 cw->sendSyncRequest();
11271140
1128 cw->configureXWindow (xwcm, &xwc);1141 cw->configureXWindow (xwcm, &xwc);
1129 gw->currentSize = CompRect ();1142
1130 gw->pointerBufDx = 0;1143 gw->currentSize = CompRect ();
1131 gw->pointerBufDy = 0;1144 gw->pointerBufDx = 0;
1145 gw->pointerBufDy = 0;
1132 gw->isGridHorzMaximized = false;1146 gw->isGridHorzMaximized = false;
1133 gw->isGridVertMaximized = false;1147 gw->isGridVertMaximized = false;
1134 gw->isGridResized = false;1148 gw->isGridResized = false;
11351149
1136 if (cw->state () & MAXIMIZE_STATE)1150 if (cw->state () & MAXIMIZE_STATE)
1137 cw->maximize(0);1151 cw->maximize(0);
@@ -1143,18 +1157,6 @@
1143}1157}
11441158
1145void1159void
1146GridScreen::snapbackOptionChanged (CompOption *option,
1147 Options num)
1148{
1149 GRID_WINDOW (screen->findWindow
1150 (CompOption::getIntOptionNamed (o, "window")));
1151 gw->isGridResized = false;
1152 gw->isGridHorzMaximized = false;
1153 gw->isGridVertMaximized = false;
1154 gw->resizeCount = 0;
1155}
1156
1157void
1158GridScreen::preparePaint (int msSinceLastPaint)1160GridScreen::preparePaint (int msSinceLastPaint)
1159{1161{
1160 std::vector<Animation>::iterator iter;1162 std::vector<Animation>::iterator iter;
@@ -1270,6 +1272,7 @@
1270 edge = lastEdge = lastResizeEdge = NoEdge;1272 edge = lastEdge = lastResizeEdge = NoEdge;
1271 currentWorkarea = lastWorkarea = screen->getWorkareaForOutput1273 currentWorkarea = lastWorkarea = screen->getWorkareaForOutput
1272 (screen->outputDeviceForPoint (pointerX, pointerY));1274 (screen->outputDeviceForPoint (pointerX, pointerY));
1275
1273 gridProps[GridUnknown] = GridProps (0,1, 1,1);1276 gridProps[GridUnknown] = GridProps (0,1, 1,1);
1274 gridProps[GridBottomLeft] = GridProps (0,1, 2,2);1277 gridProps[GridBottomLeft] = GridProps (0,1, 2,2);
1275 gridProps[GridBottom] = GridProps (0,1, 1,2);1278 gridProps[GridBottom] = GridProps (0,1, 1,2);
@@ -1301,9 +1304,6 @@
13011304
1302#undef GRIDSET1305#undef GRIDSET
13031306
1304 optionSetSnapbackWindowsNotify (boost::bind (&GridScreen::
1305 snapbackOptionChanged, this, _1, _2));
1306
1307 optionSetPutRestoreKeyInitiate (boost::bind (&GridScreen::1307 optionSetPutRestoreKeyInitiate (boost::bind (&GridScreen::
1308 restoreWindow, this, _1, _2, _3));1308 restoreWindow, this, _1, _2, _3));
1309}1309}
@@ -1380,7 +1380,6 @@
1380 wTransform.translate (translateX / scaleX - window->x (),1380 wTransform.translate (translateX / scaleX - window->x (),
1381 translateY / scaleY - window->y (), 0.0f);1381 translateY / scaleY - window->y (), 0.0f);
13821382
1383
1384 gWindow->glPaint (wAttrib, wTransform, region, wMask);1383 gWindow->glPaint (wAttrib, wTransform, region, wMask);
1385 }1384 }
1386 }1385 }
@@ -1394,7 +1393,9 @@
1394bool1393bool
1395GridPluginVTable::init ()1394GridPluginVTable::init ()
1396{1395{
1397 if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))1396 if (CompPlugin::checkPluginABI ("composite", CORE_ABIVERSION) &&
1397 CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
1398 CompPlugin::checkPluginABI ("opengl", CORE_ABIVERSION))
1398 return true;1399 return true;
13991400
1400 return false;1401 return false;
14011402
=== modified file 'plugins/grid/src/grid.h'
--- plugins/grid/src/grid.h 2013-04-02 18:22:48 +0000
+++ plugins/grid/src/grid.h 2013-05-11 08:07:29 +0000
@@ -30,21 +30,19 @@
3030
31#include "grid_options.h"31#include "grid_options.h"
3232
33static const unsigned short SNAPOFF_THRESHOLD = 50;
34
35namespace GridWindowType33namespace GridWindowType
36{34{
37 static const unsigned int GridUnknown = (1 << 0);35 static const unsigned int GridUnknown = (1 << 0);
38 static const unsigned int GridBottomLeft = (1 << 1);36 static const unsigned int GridBottomLeft = (1 << 1);
39 static const unsigned int GridBottom = (1 << 2);37 static const unsigned int GridBottom = (1 << 2);
40 static const unsigned int GridBottomRight = (1 << 3);38 static const unsigned int GridBottomRight = (1 << 3);
41 static const unsigned int GridLeft = (1 << 4);39 static const unsigned int GridLeft = (1 << 4);
42 static const unsigned int GridCenter = (1 << 5);40 static const unsigned int GridCenter = (1 << 5);
43 static const unsigned int GridRight = (1 << 6);41 static const unsigned int GridRight = (1 << 6);
44 static const unsigned int GridTopLeft = (1 << 7);42 static const unsigned int GridTopLeft = (1 << 7);
45 static const unsigned int GridTop = (1 << 8);43 static const unsigned int GridTop = (1 << 8);
46 static const unsigned int GridTopRight = (1 << 9);44 static const unsigned int GridTopRight = (1 << 9);
47 static const unsigned int GridMaximize = (1 << 10);45 static const unsigned int GridMaximize = (1 << 10);
48};46};
4947
50typedef unsigned int GridType;48typedef unsigned int GridType;
@@ -93,16 +91,16 @@
9391
94 Animation ();92 Animation ();
9593
96 GLfloat progress;94 GLfloat progress;
97 CompRect fromRect;95 CompRect fromRect;
98 CompRect targetRect;96 CompRect targetRect;
99 CompRect currentRect;97 CompRect currentRect;
100 GLfloat opacity;98 GLfloat opacity;
101 GLfloat timer;99 GLfloat timer;
102 Window window;100 Window window;
103 int duration;101 int duration;
104 bool complete;102 bool complete;
105 bool fadingOut;103 bool fadingOut;
106};104};
107105
108class GridScreen :106class GridScreen :
@@ -115,56 +113,80 @@
115 public:113 public:
116114
117 GridScreen (CompScreen *);115 GridScreen (CompScreen *);
118 CompositeScreen *cScreen;116
119 GLScreen *glScreen;117 CompositeScreen *cScreen;
120118 GLScreen *glScreen;
121 CompRect workarea, currentRect, desiredSlot, lastSlot,119
122 desiredRect, lastWorkarea, currentWorkarea;120 CompRect workarea;
123 GridProps props;121 CompRect currentRect;
124 Edges edge, lastEdge, lastResizeEdge;122 CompRect desiredSlot;
123 CompRect lastSlot;
124 CompRect desiredRect;
125 CompRect lastWorkarea;
126 CompRect currentWorkarea;
127
128 GridProps props;
129
130 Edges edge;
131 Edges lastEdge;
132 Edges lastResizeEdge;
133
125 CompOption::Vector o;134 CompOption::Vector o;
126 bool centerCheck;135 bool centerCheck;
127 CompWindow *mGrabWindow;136 CompWindow *mGrabWindow;
128 bool animating;137 bool animating;
129 bool mSwitchingVp;138 bool mSwitchingVp;
130139
131 void getPaintRectangle (CompRect&);140 void getPaintRectangle (CompRect&);
132 void setCurrentRect (Animation&);141 void setCurrentRect (Animation&);
133142
134 bool initiateCommon (CompAction*, CompAction::State,143 bool initiateCommon (CompAction *,
135 CompOption::Vector&, unsigned int, bool, bool);144 CompAction::State ,
145 CompOption::Vector &,
146 unsigned int ,
147 bool ,
148 bool );
136149
137 void glPaintRectangle (const GLScreenPaintAttrib&,150 void glPaintRectangle (const GLScreenPaintAttrib &,
138 const GLMatrix&, CompOutput *);151 const GLMatrix &,
152 CompOutput *);
139153
140 bool glPaintOutput (const GLScreenPaintAttrib &,154 bool glPaintOutput (const GLScreenPaintAttrib &,
141 const GLMatrix &, const CompRegion &,155 const GLMatrix &,
142 CompOutput *, unsigned int);156 const CompRegion &,
157 CompOutput *,
158 unsigned int );
143159
144 void preparePaint (int msSinceLastPaint);160 void preparePaint (int msSinceLastPaint);
161
145 void donePaint ();162 void donePaint ();
146163
147 std::vector <Animation> animations;164 std::vector <Animation> animations;
148165
149 int edgeToGridType ();166 int edgeToGridType ();
167
150 unsigned int typeToMask (int);168 unsigned int typeToMask (int);
151169
152 void handleEvent (XEvent *event);170 void handleEvent (XEvent *event);
153 void handleCompizEvent (const char *plugin, const char *event, CompOption::Vector &options);171
154172 void handleCompizEvent (const char *plugin,
155 bool restoreWindow (CompAction*,173 const char *event,
156 CompAction::State,174 CompOption::Vector &options);
157 CompOption::Vector&);175
176 bool restoreWindow (CompAction *,
177 CompAction::State ,
178 CompOption::Vector &);
158179
159 void180 void
160 snapbackOptionChanged (CompOption *option,181 snapbackOptionChanged (CompOption *option,
161 Options num);182 Options num);
162183
163 CompRect184 CompRect
164 slotToRect (CompWindow *w,185 slotToRect (CompWindow *w,
165 const CompRect& slot);186 const CompRect& slot);
187
166 CompRect188 CompRect
167 constrainSize (CompWindow *w,189 constrainSize (CompWindow *w,
168 const CompRect& slot);190 const CompRect& slot);
169};191};
170192
@@ -177,24 +199,30 @@
177199
178 GridWindow (CompWindow *);200 GridWindow (CompWindow *);
179 ~GridWindow ();201 ~GridWindow ();
180 CompWindow *window;202
181 GLWindow *gWindow;203 CompWindow *window;
182 GridScreen *gScreen;204 GLWindow *gWindow;
183205 GridScreen *gScreen;
184 bool isGridResized;206
185 bool isGridHorzMaximized;207 bool isGridResized;
186 bool isGridVertMaximized;208 bool isGridHorzMaximized;
209 bool isGridVertMaximized;
210
187 unsigned int grabMask;211 unsigned int grabMask;
188 int pointerBufDx;212
189 int pointerBufDy;213 int pointerBufDx;
190 int resizeCount;214 int pointerBufDy;
191 CompRect currentSize;215
192 CompRect originalSize;216 int resizeCount;
193 GridType lastTarget;217 CompRect currentSize;
218 CompRect originalSize;
219 GridType lastTarget;
194 unsigned int sizeHintsFlags;220 unsigned int sizeHintsFlags;
195221
196 bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&,222 bool glPaint (const GLWindowPaintAttrib &,
197 const CompRegion&, unsigned int);223 const GLMatrix &,
224 const CompRegion &,
225 unsigned int );
198226
199 void grabNotify (int, int, unsigned int, unsigned int);227 void grabNotify (int, int, unsigned int, unsigned int);
200228
@@ -203,9 +231,10 @@
203 void moveNotify (int, int, bool);231 void moveNotify (int, int, bool);
204232
205 void stateChangeNotify (unsigned int);233 void stateChangeNotify (unsigned int);
206 void validateResizeRequest (unsigned int &valueMask,234
235 void validateResizeRequest (unsigned int &valueMask,
207 XWindowChanges *xwc,236 XWindowChanges *xwc,
208 unsigned int source);237 unsigned int source);
209};238};
210239
211#define GRID_WINDOW(w) \240#define GRID_WINDOW(w) \
@@ -220,4 +249,3 @@
220};249};
221250
222COMPIZ_PLUGIN_20090315 (grid, GridPluginVTable);251COMPIZ_PLUGIN_20090315 (grid, GridPluginVTable);
223

Subscribers

People subscribed via source and target branches

to all changes: