Merge lp:~mc-return/compiz/compiz.merge-grid-small-cleanup into lp:compiz/0.9.10
- compiz.merge-grid-small-cleanup
- Merge into 0.9.10
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 |
Related bugs: |
|
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/
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-
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-
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.
Description of the change
See video of Grid reloaded here:
https:/
Sam Spilsbury (smspillaz) wrote : | # |
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-
}
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 || optionGetSnapof
1011 - /* maximized state interferes with us, clear it */
1012 + if ((cw->state () & MAXIMIZE_STATE) && resize)
...
1298 - xwc.x = pointerX - (gw->originalSi
1299 - xwc.y = pointerY + (cw->border ().top / 2);
1300 + /* The windows x-center is different in this case. */
1301 + if (optionGetSnapb
1302 + {
1303 + xwc.x = pointerX - (gw->originalSi
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
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->isGridHorzM
These are not aligned.
403 - if (!CompPlugin:
1404 - return false;
1405 + if (CompPlugin:
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.
MC Return (mc-return) 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->configureXW
> }
>
> 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 || optionGetSnapof
> 1011 - /* maximized state interferes with us, clear it */
> 1012 + if ((cw->state () & MAXIMIZE_STATE) && resize)
>
> ...
>
> 1298 - xwc.x = pointerX - (gw->originalSi
> 1299 - xwc.y = pointerY + (cw->border ().top / 2);
> 1300 + /* The windows x-center is different in this case. */
> 1301 + if (optionGetSnapb
> 1302 + {
> 1303 + xwc.x = pointerX - (gw->originalSi
> 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
> 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->isGridHorzM
>
> These are not aligned.
>
I'll look into that.
> 403 - if (!CompPlugin:
> 1404 - return false;
> 1405 + if (CompPlugin:
> 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 ...
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->configureXW
> > }
> >
> > 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 || optionGetSnapof
> > 1011 - /* maximized state interferes with us, clear it */
> > 1012 + if ((cw->state () & MAXIMIZE_STATE) && resize)
> >
> > ...
> >
> > 1298 - xwc.x = pointerX - (gw->originalSi
> > 1299 - xwc.y = pointerY + (cw->border ().top / 2);
> > 1300 + /* The windows x-center is different in this case. */
> > 1301 + if (optionGetSnapb
> > 1302 + {
> > 1303 + xwc.x = pointerX - (gw->originalSi
> > 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
> > 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->isGridHorzM
> >
> > These are not aligned.
> >
> I'll look into that.
>
> > 403 - if (!CompPlugin:
> > 1404 - return false;
> > 1405 + if (CompPlugin:
> > 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;
> ...
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->configureXW
> > }
> >
> > 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.
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-
> 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-
> 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...
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/
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/
> 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-
const CompRect &workArea (currentOutput-
int x = workArea.x () + w->border.left
int y = workArea.y () + w->border.top
MC Return (mc-return) wrote : | # |
> the xml cleanup is fine.
>
> 957 - ${GMOCK_LIBRARY}
> 958 - ${GMOCK_
> 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.
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...
Sam Spilsbury (smspillaz) wrote : | # |
The other changes are good. Can you please revert this one?
1394 - if (!CompPlugin:
1395 - return false;
1396 + if (CompPlugin:
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.
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:
> 1395 - return false;
> 1396 + if (CompPlugin:
> 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...
MC Return (mc-return) : | # |
Sam Spilsbury (smspillaz) wrote : | # |
Looks great now, thanks!
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
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/
:(
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/
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/
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 ?
Sam Spilsbury (smspillaz) wrote : | # |
The problems you've mentioned are pretty easy to deal with:
0. export QUILT_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/
> 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/
> 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:/
> You are reviewing the proposed merge of lp:~mc-return/compiz/compiz.merge-grid-small-cleanup into lp:compiz.
--
Sam Spilsbury
MC Return (mc-return) wrote : | # |
> The problems you've mentioned are pretty easy to deal with:
>
> 0. export QUILT_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/
--- plugins/
+++ plugins/
@@ -23,17 +23,16 @@
<option name="put_
<_short>Put Center</_short>
<_long>Move window to the center</_long>
- <default>
</option>
<option name="put_left_key" type="key">
<_short>Put Left</_short>
<_long>Move window to the left edge</_long>
- <default>
+ <default>
</option>
<option name="put_
<_short>Put Right</_short>
<_long>Move window to the right edge</_long>
- <default>
+ <default>
</option>
<option name="put_top_key" type="key">
<_short>Put Top</_short>
@@ -68,7 +67,6 @@
<option name="put_
- <default>
</option>
<option name="put_
> 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...
MC Return (mc-return) wrote : | # |
*the file is of course called plugins/
MC Return (mc-return) : | # |
Sam Spilsbury (smspillaz) wrote : | # |
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=
>> 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/
>
> --- plugins/
> +++ plugins/
> @@ -23,17 +23,16 @@
> <option name="put_
> <_short>Put Center</_short>
> <_long>Move window to the center</_long>
> - <default>
> </option>
> <option name="put_left_key" type="key">
> <_short>Put Left</_short>
> <_long>Move window to the left edge</_long>
> - <default>
> + <default>
> </option>
> <option name="put_
> <_short>Put Right</_short>
> <_long>Move window to the right edge</_long>
> - <default>
> + <default>
> </option>
> <option name="put_top_key" type="key">
> <_short>Put Top</_short>
> @@ -68,7 +67,6 @@
> <option name="put_
> <_short>
> <_long>Maximize window</_long>
> - <default>
> </option>
> <option name="put_
> <_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...
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...
MC Return (mc-return) wrote : | # |
Just a note to myself:
quilt push -a
quilt add -P debian/
make changes...
quilt refresh debian/
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 ;)
MC Return (mc-return) wrote : | # |
quilt and me are very good friends now :)
MC Return (mc-return) wrote : | # |
Note: I also fixed bug #1172641, which needed quilt involvement on the way...
Sam Spilsbury (smspillaz) wrote : | # |
Thanks for refreshing the patches.
1653 +<<<<<<< TREE
1654 if (CompPlugin:
1655 return true;
1656 +=======
1657 + if (!CompPlugin:
1658 + !CompPlugin:
1659 + !CompPlugin:
1660 + return false;
1661 +>>>>>>> MERGE-SOURCE
Merge conflict.
<option name="snapback_
<_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>
</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>
</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
MC Return (mc-return) wrote : | # |
> Thanks for refreshing the patches.
>
> 1653 +<<<<<<< TREE
> 1654 if (CompPlugin:
> 1655 return true;
> 1656 +=======
> 1657 + if (!CompPlugin:
> ||
> 1658 + !CompPlugin:
> 1659 + !CompPlugin:
> 1660 + return false;
> 1661 +>>>>>>> MERGE-SOURCE
>
> Merge conflict.
>
Noooooooooooooo
Didn't I look at the diff ???
Looking now how to best fix that mess...
> <option name="snapback_
> <_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>
> </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>
> </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...
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
MC Return (mc-return) wrote : | # |
I did not see the merge conflict, because I had to merge lp:compiz for it to appear...
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.
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
MC Return (mc-return) : | # |
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-
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" ;)
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/
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...
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/
> containing the pointer, not the output device, on which the biggest part of
> the window resides when it is semi-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.
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'debian/patches/100_workaround_virtualbox_hang.patch' |
2 | --- debian/patches/100_workaround_virtualbox_hang.patch 2013-02-17 07:28:12 +0000 |
3 | +++ debian/patches/100_workaround_virtualbox_hang.patch 2013-05-11 08:07:29 +0000 |
4 | @@ -1,8 +1,6 @@ |
5 | -Index: compiz/plugins/opengl/include/opengl/opengl.h |
6 | -=================================================================== |
7 | ---- compiz.orig/plugins/opengl/include/opengl/opengl.h 2013-02-17 10:22:08.012876000 +0800 |
8 | -+++ compiz/plugins/opengl/include/opengl/opengl.h 2013-02-17 10:23:36.643958000 +0800 |
9 | -@@ -578,6 +578,17 @@ |
10 | +--- a/plugins/opengl/include/opengl/opengl.h |
11 | ++++ b/plugins/opengl/include/opengl/opengl.h |
12 | +@@ -582,6 +582,17 @@ |
13 | |
14 | extern GLScreenPaintAttrib defaultScreenPaintAttrib; |
15 | |
16 | @@ -20,7 +18,7 @@ |
17 | class GLScreen; |
18 | class GLFramebufferObject; |
19 | class GLScreenInterface; |
20 | -@@ -770,6 +781,13 @@ |
21 | +@@ -774,6 +785,13 @@ |
22 | |
23 | bool glInitContext (XVisualInfo *); |
24 | |
25 | @@ -34,11 +32,9 @@ |
26 | WRAPABLE_HND (0, GLScreenInterface, bool, glPaintOutput, |
27 | const GLScreenPaintAttrib &, const GLMatrix &, |
28 | const CompRegion &, CompOutput *, unsigned int); |
29 | -Index: compiz/plugins/opengl/src/privates.h |
30 | -=================================================================== |
31 | ---- compiz.orig/plugins/opengl/src/privates.h 2013-02-17 10:22:08.012876000 +0800 |
32 | -+++ compiz/plugins/opengl/src/privates.h 2013-02-17 10:23:36.643958000 +0800 |
33 | -@@ -46,6 +46,24 @@ |
34 | +--- a/plugins/opengl/src/privates.h |
35 | ++++ b/plugins/opengl/src/privates.h |
36 | +@@ -47,6 +47,24 @@ |
37 | |
38 | extern CompOutput *targetOutput; |
39 | |
40 | @@ -63,7 +59,7 @@ |
41 | class GLDoubleBuffer : |
42 | public compiz::opengl::DoubleBuffer |
43 | { |
44 | -@@ -122,6 +140,7 @@ |
45 | +@@ -123,6 +141,7 @@ |
46 | class PrivateGLScreen : |
47 | public ScreenInterface, |
48 | public compiz::composite::PaintHandler, |
49 | @@ -71,7 +67,7 @@ |
50 | public OpenglOptions |
51 | { |
52 | public: |
53 | -@@ -206,6 +225,7 @@ |
54 | +@@ -207,6 +226,7 @@ |
55 | std::vector<GLTexture::BindPixmapProc> bindPixmap; |
56 | bool hasCompositing; |
57 | bool commonFrontbuffer; |
58 | @@ -79,7 +75,7 @@ |
59 | bool incorrectRefreshRate; // hack for NVIDIA specifying an incorrect |
60 | // refresh rate, causing us to miss vblanks |
61 | |
62 | -@@ -225,6 +245,10 @@ |
63 | +@@ -226,6 +246,10 @@ |
64 | |
65 | mutable CompString prevRegex; |
66 | mutable bool prevBlacklisted; |
67 | @@ -90,10 +86,8 @@ |
68 | }; |
69 | |
70 | class PrivateGLWindow : |
71 | -Index: compiz/plugins/opengl/src/screen.cpp |
72 | -=================================================================== |
73 | ---- compiz.orig/plugins/opengl/src/screen.cpp 2013-02-17 10:22:08.012876000 +0800 |
74 | -+++ compiz/plugins/opengl/src/screen.cpp 2013-02-17 10:23:36.643958000 +0800 |
75 | +--- a/plugins/opengl/src/screen.cpp |
76 | ++++ b/plugins/opengl/src/screen.cpp |
77 | @@ -67,6 +67,7 @@ |
78 | |
79 | |
80 | @@ -148,10 +142,8 @@ |
81 | if (strstr (glExtensions, "GL_ARB_texture_non_power_of_two")) |
82 | GL::textureNonPowerOfTwo = true; |
83 | GL::textureNonPowerOfTwoMipmap = GL::textureNonPowerOfTwo; |
84 | -Index: compiz/plugins/opengl/src/texture.cpp |
85 | -=================================================================== |
86 | ---- compiz.orig/plugins/opengl/src/texture.cpp 2013-02-17 10:22:08.012876000 +0800 |
87 | -+++ compiz/plugins/opengl/src/texture.cpp 2013-02-17 10:23:36.643958000 +0800 |
88 | +--- a/plugins/opengl/src/texture.cpp |
89 | ++++ b/plugins/opengl/src/texture.cpp |
90 | @@ -41,6 +41,7 @@ |
91 | #include "glx-tfp-bind.h" |
92 | |
93 | |
94 | === modified file 'debian/patches/ubuntu-config.patch' |
95 | --- debian/patches/ubuntu-config.patch 2013-02-14 05:47:11 +0000 |
96 | +++ debian/patches/ubuntu-config.patch 2013-05-11 08:07:29 +0000 |
97 | @@ -204,7 +204,6 @@ |
98 | <min>0</min> |
99 | <max>1</max> |
100 | <precision>0.01</precision> |
101 | - |
102 | --- a/plugins/decor/decor.xml.in |
103 | +++ b/plugins/decor/decor.xml.in |
104 | @@ -31,7 +31,7 @@ |
105 | @@ -243,7 +242,6 @@ |
106 | </option> |
107 | <option name="mipmap" type="bool"> |
108 | <_short>Mipmap</_short> |
109 | - |
110 | --- a/plugins/expo/expo.xml.in |
111 | +++ b/plugins/expo/expo.xml.in |
112 | @@ -17,6 +17,7 @@ |
113 | @@ -357,7 +355,6 @@ |
114 | <min>0.0</min> |
115 | <max>2.0</max> |
116 | <precision>0.01</precision> |
117 | - |
118 | --- a/plugins/ezoom/ezoom.xml.in |
119 | +++ b/plugins/ezoom/ezoom.xml.in |
120 | @@ -29,7 +29,6 @@ |
121 | @@ -393,7 +390,6 @@ |
122 | </option> |
123 | </subgroup> |
124 | </group> |
125 | - |
126 | --- a/plugins/fade/fade.xml.in |
127 | +++ b/plugins/fade/fade.xml.in |
128 | @@ -10,6 +10,7 @@ |
129 | @@ -413,7 +409,6 @@ |
130 | </option> |
131 | <option name="visual_bell" type="bell"> |
132 | <_short>Visual Bell</_short> |
133 | - |
134 | --- a/plugins/gnomecompat/gnomecompat.xml.in |
135 | +++ b/plugins/gnomecompat/gnomecompat.xml.in |
136 | @@ -53,6 +53,7 @@ |
137 | @@ -424,38 +419,6 @@ |
138 | </option> |
139 | </group> |
140 | </options> |
141 | - |
142 | ---- a/plugins/grid/grid.xml.in |
143 | -+++ b/plugins/grid/grid.xml.in |
144 | -@@ -23,17 +23,16 @@ |
145 | - <option name="put_center_key" type="key"> |
146 | - <_short>Put Center</_short> |
147 | - <_long>Move window to the center</_long> |
148 | -- <default><Control><Alt>KP_5</default> |
149 | - </option> |
150 | - <option name="put_left_key" type="key"> |
151 | - <_short>Put Left</_short> |
152 | - <_long>Move window to the left edge</_long> |
153 | -- <default><Control><Alt>KP_4</default> |
154 | -+ <default><Control><Super>Left</default> |
155 | - </option> |
156 | - <option name="put_right_key" type="key"> |
157 | - <_short>Put Right</_short> |
158 | - <_long>Move window to the right edge</_long> |
159 | -- <default><Control><Alt>KP_6</default> |
160 | -+ <default><Control><Super>Right</default> |
161 | - </option> |
162 | - <option name="put_top_key" type="key"> |
163 | - <_short>Put Top</_short> |
164 | -@@ -68,7 +67,6 @@ |
165 | - <option name="put_maximize_key" type="key"> |
166 | - <_short>Maximize</_short> |
167 | - <_long>Maximize window</_long> |
168 | -- <default><Control><Alt>KP_0</default> |
169 | - </option> |
170 | - <option name="put_restore_key" type="key"> |
171 | - <_short>Restore</_short> |
172 | - |
173 | --- a/plugins/place/place.xml.in |
174 | +++ b/plugins/place/place.xml.in |
175 | @@ -20,8 +20,8 @@ |
176 | @@ -469,7 +432,6 @@ |
177 | <max>5</max> |
178 | <desc> |
179 | <value>0</value> |
180 | - |
181 | --- a/plugins/resize/resize.xml.in |
182 | +++ b/plugins/resize/resize.xml.in |
183 | @@ -28,7 +28,7 @@ |
184 | @@ -516,7 +478,6 @@ |
185 | </default> |
186 | </option> |
187 | <subgroup> |
188 | - |
189 | --- a/plugins/scale/scale.xml.in |
190 | +++ b/plugins/scale/scale.xml.in |
191 | @@ -19,14 +19,14 @@ |
192 | @@ -607,7 +568,6 @@ |
193 | </option> |
194 | </group> |
195 | </options> |
196 | - |
197 | --- a/plugins/staticswitcher/staticswitcher.xml.in |
198 | +++ b/plugins/staticswitcher/staticswitcher.xml.in |
199 | @@ -11,7 +11,6 @@ |
200 | @@ -686,7 +646,6 @@ |
201 | <desc> |
202 | <value>0</value> |
203 | <_name>None</_name> |
204 | - |
205 | --- a/plugins/vpswitch/vpswitch.xml.in |
206 | +++ b/plugins/vpswitch/vpswitch.xml.in |
207 | @@ -95,13 +95,11 @@ |
208 | @@ -703,7 +662,6 @@ |
209 | <internal/> |
210 | </option> |
211 | <option name="initiate_button" type="button"> |
212 | - |
213 | --- a/plugins/wall/wall.xml.in |
214 | +++ b/plugins/wall/wall.xml.in |
215 | @@ -31,12 +31,12 @@ |
216 | @@ -853,7 +811,6 @@ |
217 | </option> |
218 | <option name="edgeflip_dnd" type="bool"> |
219 | <_short>Edge Flip DnD</_short> |
220 | - |
221 | --- a/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp |
222 | +++ b/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp |
223 | @@ -46,7 +46,7 @@ |
224 | @@ -865,3 +822,34 @@ |
225 | unsigned int DEFAULT_VIEWPORT_HEIGHT = 1; |
226 | |
227 | bool Advance (Display *d, bool r) |
228 | +--- a/plugins/grid/grid.xml.in |
229 | ++++ b/plugins/grid/grid.xml.in |
230 | +@@ -23,17 +23,16 @@ |
231 | + <option name="put_center_key" type="key"> |
232 | + <_short>Put Center Key</_short> |
233 | + <_long>Move window to the center.</_long> |
234 | +- <default><Control><Alt>KP_5</default> |
235 | + </option> |
236 | + <option name="put_left_key" type="key"> |
237 | + <_short>Put Left Key</_short> |
238 | + <_long>Move window to the left edge.</_long> |
239 | +- <default><Control><Alt>KP_4</default> |
240 | ++ <default><Control><Super>Left</default> |
241 | + </option> |
242 | + <option name="put_right_key" type="key"> |
243 | + <_short>Put Right Key</_short> |
244 | + <_long>Move window to the right edge.</_long> |
245 | +- <default><Control><Alt>KP_6</default> |
246 | ++ <default><Control><Super>Right</default> |
247 | + </option> |
248 | + <option name="put_top_key" type="key"> |
249 | + <_short>Put Top Key</_short> |
250 | +@@ -73,7 +72,7 @@ |
251 | + <option name="put_restore_key" type="key"> |
252 | + <_short>Restore</_short> |
253 | + <_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> |
254 | +- <default><Alt>F5</default> |
255 | ++ <default><Control><Super>Down</default> |
256 | + </option> |
257 | + </group> |
258 | + <group> |
259 | |
260 | === modified file 'plugins/grid/grid.xml.in' |
261 | --- plugins/grid/grid.xml.in 2013-04-25 10:11:04 +0000 |
262 | +++ plugins/grid/grid.xml.in 2013-05-11 08:07:29 +0000 |
263 | @@ -21,492 +21,486 @@ |
264 | <group> |
265 | <_short>Bindings</_short> |
266 | <option name="put_center_key" type="key"> |
267 | - <_short>Put Center</_short> |
268 | - <_long>Move window to the center</_long> |
269 | + <_short>Put Center Key</_short> |
270 | + <_long>Move window to the center.</_long> |
271 | <default><Control><Alt>KP_5</default> |
272 | </option> |
273 | <option name="put_left_key" type="key"> |
274 | - <_short>Put Left</_short> |
275 | - <_long>Move window to the left edge</_long> |
276 | + <_short>Put Left Key</_short> |
277 | + <_long>Move window to the left edge.</_long> |
278 | <default><Control><Alt>KP_4</default> |
279 | </option> |
280 | <option name="put_right_key" type="key"> |
281 | - <_short>Put Right</_short> |
282 | - <_long>Move window to the right edge</_long> |
283 | + <_short>Put Right Key</_short> |
284 | + <_long>Move window to the right edge.</_long> |
285 | <default><Control><Alt>KP_6</default> |
286 | </option> |
287 | <option name="put_top_key" type="key"> |
288 | - <_short>Put Top</_short> |
289 | - <_long>Move window to the top edge</_long> |
290 | + <_short>Put Top Key</_short> |
291 | + <_long>Move window to the top edge.</_long> |
292 | <default><Control><Alt>KP_8</default> |
293 | </option> |
294 | <option name="put_bottom_key" type="key"> |
295 | - <_short>Put Bottom</_short> |
296 | - <_long>Move window to the bottom edge</_long> |
297 | + <_short>Put Bottom Key</_short> |
298 | + <_long>Move window to the bottom edge.</_long> |
299 | <default><Control><Alt>KP_2</default> |
300 | </option> |
301 | <option name="put_topleft_key" type="key"> |
302 | - <_short>Put Top Left</_short> |
303 | - <_long>Move window to the top left corner</_long> |
304 | + <_short>Put Top Left Key</_short> |
305 | + <_long>Move window to the top left corner.</_long> |
306 | <default><Control><Alt>KP_7</default> |
307 | </option> |
308 | <option name="put_topright_key" type="key"> |
309 | - <_short>Put Top Right</_short> |
310 | - <_long>Move window to the top right corner</_long> |
311 | + <_short>Put Top Right Key</_short> |
312 | + <_long>Move window to the top right corner.</_long> |
313 | <default><Control><Alt>KP_9</default> |
314 | </option> |
315 | <option name="put_bottomleft_key" type="key"> |
316 | - <_short>Put Bottom Left</_short> |
317 | - <_long>Move window to the bottom left corner</_long> |
318 | + <_short>Put Bottom Left Key</_short> |
319 | + <_long>Move window to the bottom left corner.</_long> |
320 | <default><Control><Alt>KP_1</default> |
321 | </option> |
322 | <option name="put_bottomright_key" type="key"> |
323 | - <_short>Put Bottom Right</_short> |
324 | - <_long>Move window to the bottom right corner</_long> |
325 | + <_short>Put Bottom Right Key</_short> |
326 | + <_long>Move window to the bottom right corner.</_long> |
327 | <default><Control><Alt>KP_3</default> |
328 | </option> |
329 | <option name="put_maximize_key" type="key"> |
330 | - <_short>Maximize</_short> |
331 | - <_long>Maximize window</_long> |
332 | + <_short>Maximize Key</_short> |
333 | + <_long>Maximize window.</_long> |
334 | <default><Control><Alt>KP_0</default> |
335 | </option> |
336 | <option name="put_restore_key" type="key"> |
337 | <_short>Restore</_short> |
338 | - <_long>Restores grid-resized, semi-maximized and maximized windows to their original size and position.</_long> |
339 | - <default><Control><Alt>r</default> |
340 | - </option> |
341 | - </group> |
342 | - <group> |
343 | - <_short>Edges</_short> |
344 | - <subgroup> |
345 | - <_short>Resize Actions</_short> |
346 | - <_long>Window resize action</_long> |
347 | - <option name="top_left_corner_action" type="int"> |
348 | - <_short>Upper Left Corner</_short> |
349 | - <_long>Action to be performed when window is dropped on the top left corner.</_long> |
350 | - <default>4</default> |
351 | - <min>0</min> |
352 | - <max>10</max> |
353 | - <desc> |
354 | - <value>0</value> |
355 | - <_name>None</_name> |
356 | - </desc> |
357 | - <desc> |
358 | - <value>1</value> |
359 | - <_name>Bottom Left Corner</_name> |
360 | - </desc> |
361 | - <desc> |
362 | - <value>2</value> |
363 | - <_name>Bottom Half</_name> |
364 | - </desc> |
365 | - <desc> |
366 | - <value>3</value> |
367 | - <_name>Bottom Right Corner</_name> |
368 | - </desc> |
369 | - <desc> |
370 | - <value>4</value> |
371 | - <_name>Left Half</_name> |
372 | - </desc> |
373 | - <desc> |
374 | - <value>5</value> |
375 | - <_name>Fill Screen</_name> |
376 | - </desc> |
377 | - <desc> |
378 | - <value>6</value> |
379 | - <_name>Right Half</_name> |
380 | - </desc> |
381 | - <desc> |
382 | - <value>7</value> |
383 | - <_name>Top Left Corner</_name> |
384 | - </desc> |
385 | - <desc> |
386 | - <value>8</value> |
387 | - <_name>Top Half</_name> |
388 | - </desc> |
389 | - <desc> |
390 | - <value>9</value> |
391 | - <_name>Top Right Corner</_name> |
392 | - </desc> |
393 | - <desc> |
394 | - <value>10</value> |
395 | - <_name>Maximize</_name> |
396 | - </desc> |
397 | - </option> |
398 | - <option name="top_edge_action" type="int"> |
399 | - <_short>Top Edge</_short> |
400 | - <_long>Action to be performed when window is dropped on the top edge.</_long> |
401 | - <default>10</default> |
402 | - <min>0</min> |
403 | - <max>10</max> |
404 | - <desc> |
405 | - <value>0</value> |
406 | - <_name>None</_name> |
407 | - </desc> |
408 | - <desc> |
409 | - <value>1</value> |
410 | - <_name>Bottom Left Corner</_name> |
411 | - </desc> |
412 | - <desc> |
413 | - <value>2</value> |
414 | - <_name>Bottom Half</_name> |
415 | - </desc> |
416 | - <desc> |
417 | - <value>3</value> |
418 | - <_name>Bottom Right Corner</_name> |
419 | - </desc> |
420 | - <desc> |
421 | - <value>4</value> |
422 | - <_name>Left Half</_name> |
423 | - </desc> |
424 | - <desc> |
425 | - <value>5</value> |
426 | - <_name>Fill Screen</_name> |
427 | - </desc> |
428 | - <desc> |
429 | - <value>6</value> |
430 | - <_name>Right Half</_name> |
431 | - </desc> |
432 | - <desc> |
433 | - <value>7</value> |
434 | - <_name>Top Left Corner</_name> |
435 | - </desc> |
436 | - <desc> |
437 | - <value>8</value> |
438 | - <_name>Top Half</_name> |
439 | - </desc> |
440 | - <desc> |
441 | - <value>9</value> |
442 | - <_name>Top Right Corner</_name> |
443 | - </desc> |
444 | - <desc> |
445 | - <value>10</value> |
446 | - <_name>Maximize</_name> |
447 | - </desc> |
448 | - </option> |
449 | - <option name="top_right_corner_action" type="int"> |
450 | - <_short>Upper Right Corner</_short> |
451 | - <_long>Action to be performed when window is dropped on the top right corner.</_long> |
452 | - <default>6</default> |
453 | - <min>0</min> |
454 | - <max>10</max> |
455 | - <desc> |
456 | - <value>0</value> |
457 | - <_name>None</_name> |
458 | - </desc> |
459 | - <desc> |
460 | - <value>1</value> |
461 | - <_name>Bottom Left Corner</_name> |
462 | - </desc> |
463 | - <desc> |
464 | - <value>2</value> |
465 | - <_name>Bottom Half</_name> |
466 | - </desc> |
467 | - <desc> |
468 | - <value>3</value> |
469 | - <_name>Bottom Right Corner</_name> |
470 | - </desc> |
471 | - <desc> |
472 | - <value>4</value> |
473 | - <_name>Left Half</_name> |
474 | - </desc> |
475 | - <desc> |
476 | - <value>5</value> |
477 | - <_name>Fill Screen</_name> |
478 | - </desc> |
479 | - <desc> |
480 | - <value>6</value> |
481 | - <_name>Right Half</_name> |
482 | - </desc> |
483 | - <desc> |
484 | - <value>7</value> |
485 | - <_name>Top Left Corner</_name> |
486 | - </desc> |
487 | - <desc> |
488 | - <value>8</value> |
489 | - <_name>Top Half</_name> |
490 | - </desc> |
491 | - <desc> |
492 | - <value>9</value> |
493 | - <_name>Top Right Corner</_name> |
494 | - </desc> |
495 | - <desc> |
496 | - <value>10</value> |
497 | - <_name>Maximize</_name> |
498 | - </desc> |
499 | - </option> |
500 | - <option name="left_edge_action" type="int"> |
501 | - <_short>Left Edge</_short> |
502 | - <_long>Action to be performed when window is dropped on the left edge.</_long> |
503 | - <default>4</default> |
504 | - <min>0</min> |
505 | - <max>10</max> |
506 | - <desc> |
507 | - <value>0</value> |
508 | - <_name>None</_name> |
509 | - </desc> |
510 | - <desc> |
511 | - <value>1</value> |
512 | - <_name>Bottom Left Corner</_name> |
513 | - </desc> |
514 | - <desc> |
515 | - <value>2</value> |
516 | - <_name>Bottom Half</_name> |
517 | - </desc> |
518 | - <desc> |
519 | - <value>3</value> |
520 | - <_name>Bottom Right Corner</_name> |
521 | - </desc> |
522 | - <desc> |
523 | - <value>4</value> |
524 | - <_name>Left Half</_name> |
525 | - </desc> |
526 | - <desc> |
527 | - <value>5</value> |
528 | - <_name>Fill Screen</_name> |
529 | - </desc> |
530 | - <desc> |
531 | - <value>6</value> |
532 | - <_name>Right Half</_name> |
533 | - </desc> |
534 | - <desc> |
535 | - <value>7</value> |
536 | - <_name>Top Left Corner</_name> |
537 | - </desc> |
538 | - <desc> |
539 | - <value>8</value> |
540 | - <_name>Top Half</_name> |
541 | - </desc> |
542 | - <desc> |
543 | - <value>9</value> |
544 | - <_name>Top Right Corner</_name> |
545 | - </desc> |
546 | - <desc> |
547 | - <value>10</value> |
548 | - <_name>Maximize</_name> |
549 | - </desc> |
550 | - </option> |
551 | - <option name="right_edge_action" type="int"> |
552 | - <_short>Right Edge</_short> |
553 | - <_long>Action to be performed when window is dropped on the right edge.</_long> |
554 | - <default>6</default> |
555 | - <min>0</min> |
556 | - <max>10</max> |
557 | - <desc> |
558 | - <value>0</value> |
559 | - <_name>None</_name> |
560 | - </desc> |
561 | - <desc> |
562 | - <value>1</value> |
563 | - <_name>Bottom Left Corner</_name> |
564 | - </desc> |
565 | - <desc> |
566 | - <value>2</value> |
567 | - <_name>Bottom Half</_name> |
568 | - </desc> |
569 | - <desc> |
570 | - <value>3</value> |
571 | - <_name>Bottom Right Corner</_name> |
572 | - </desc> |
573 | - <desc> |
574 | - <value>4</value> |
575 | - <_name>Left Half</_name> |
576 | - </desc> |
577 | - <desc> |
578 | - <value>5</value> |
579 | - <_name>Fill Screen</_name> |
580 | - </desc> |
581 | - <desc> |
582 | - <value>6</value> |
583 | - <_name>Right Half</_name> |
584 | - </desc> |
585 | - <desc> |
586 | - <value>7</value> |
587 | - <_name>Top Left Corner</_name> |
588 | - </desc> |
589 | - <desc> |
590 | - <value>8</value> |
591 | - <_name>Top Half</_name> |
592 | - </desc> |
593 | - <desc> |
594 | - <value>9</value> |
595 | - <_name>Top Right Corner</_name> |
596 | - </desc> |
597 | - <desc> |
598 | - <value>10</value> |
599 | - <_name>Maximize</_name> |
600 | - </desc> |
601 | - </option> |
602 | - <option name="bottom_left_corner_action" type="int"> |
603 | - <_short>Bottom Left Corner</_short> |
604 | - <_long>Action to be performed when window is dropped on the bottom left corner.</_long> |
605 | - <default>4</default> |
606 | - <min>0</min> |
607 | - <max>10</max> |
608 | - <desc> |
609 | - <value>0</value> |
610 | - <_name>None</_name> |
611 | - </desc> |
612 | - <desc> |
613 | - <value>1</value> |
614 | - <_name>Bottom Left Corner</_name> |
615 | - </desc> |
616 | - <desc> |
617 | - <value>2</value> |
618 | - <_name>Bottom Half</_name> |
619 | - </desc> |
620 | - <desc> |
621 | - <value>3</value> |
622 | - <_name>Bottom Right Corner</_name> |
623 | - </desc> |
624 | - <desc> |
625 | - <value>4</value> |
626 | - <_name>Left Half</_name> |
627 | - </desc> |
628 | - <desc> |
629 | - <value>5</value> |
630 | - <_name>Fill Screen</_name> |
631 | - </desc> |
632 | - <desc> |
633 | - <value>6</value> |
634 | - <_name>Right Half</_name> |
635 | - </desc> |
636 | - <desc> |
637 | - <value>7</value> |
638 | - <_name>Top Left Corner</_name> |
639 | - </desc> |
640 | - <desc> |
641 | - <value>8</value> |
642 | - <_name>Top Half</_name> |
643 | - </desc> |
644 | - <desc> |
645 | - <value>9</value> |
646 | - <_name>Top Right Corner</_name> |
647 | - </desc> |
648 | - <desc> |
649 | - <value>10</value> |
650 | - <_name>Maximize</_name> |
651 | - </desc> |
652 | - </option> |
653 | - <option name="bottom_edge_action" type="int"> |
654 | - <_short>Bottom Edge</_short> |
655 | - <_long>Action to be performed when window is dropped on the bottom edge.</_long> |
656 | - <default>0</default> |
657 | - <min>0</min> |
658 | - <max>10</max> |
659 | - <desc> |
660 | - <value>0</value> |
661 | - <_name>None</_name> |
662 | - </desc> |
663 | - <desc> |
664 | - <value>1</value> |
665 | - <_name>Bottom Left Corner</_name> |
666 | - </desc> |
667 | - <desc> |
668 | - <value>2</value> |
669 | - <_name>Bottom Half</_name> |
670 | - </desc> |
671 | - <desc> |
672 | - <value>3</value> |
673 | - <_name>Bottom Right Corner</_name> |
674 | - </desc> |
675 | - <desc> |
676 | - <value>4</value> |
677 | - <_name>Left Half</_name> |
678 | - </desc> |
679 | - <desc> |
680 | - <value>5</value> |
681 | - <_name>Fill Screen</_name> |
682 | - </desc> |
683 | - <desc> |
684 | - <value>6</value> |
685 | - <_name>Right Half</_name> |
686 | - </desc> |
687 | - <desc> |
688 | - <value>7</value> |
689 | - <_name>Top Left Corner</_name> |
690 | - </desc> |
691 | - <desc> |
692 | - <value>8</value> |
693 | - <_name>Top Half</_name> |
694 | - </desc> |
695 | - <desc> |
696 | - <value>9</value> |
697 | - <_name>Top Right Corner</_name> |
698 | - </desc> |
699 | - <desc> |
700 | - <value>10</value> |
701 | - <_name>Maximize</_name> |
702 | - </desc> |
703 | - </option> |
704 | - <option name="bottom_right_corner_action" type="int"> |
705 | - <_short>Bottom Right Corner</_short> |
706 | - <_long>Action to be performed when window is dropped on the bottom right corner.</_long> |
707 | - <default>6</default> |
708 | - <min>0</min> |
709 | - <max>10</max> |
710 | - <desc> |
711 | - <value>0</value> |
712 | - <_name>None</_name> |
713 | - </desc> |
714 | - <desc> |
715 | - <value>1</value> |
716 | - <_name>Bottom Left Corner</_name> |
717 | - </desc> |
718 | - <desc> |
719 | - <value>2</value> |
720 | - <_name>Bottom Half</_name> |
721 | - </desc> |
722 | - <desc> |
723 | - <value>3</value> |
724 | - <_name>Bottom Right Corner</_name> |
725 | - </desc> |
726 | - <desc> |
727 | - <value>4</value> |
728 | - <_name>Left Half</_name> |
729 | - </desc> |
730 | - <desc> |
731 | - <value>5</value> |
732 | - <_name>Fill Screen</_name> |
733 | - </desc> |
734 | - <desc> |
735 | - <value>6</value> |
736 | - <_name>Right Half</_name> |
737 | - </desc> |
738 | - <desc> |
739 | - <value>7</value> |
740 | - <_name>Top Left Corner</_name> |
741 | - </desc> |
742 | - <desc> |
743 | - <value>8</value> |
744 | - <_name>Top Half</_name> |
745 | - </desc> |
746 | - <desc> |
747 | - <value>9</value> |
748 | - <_name>Top Right Corner</_name> |
749 | - </desc> |
750 | - <desc> |
751 | - <value>10</value> |
752 | - <_name>Maximize</_name> |
753 | - </desc> |
754 | - </option> |
755 | - <option name="snapoff_maximized" type="bool"> |
756 | - <_short>Snapoff Maximized/Semi-maximized Windows</_short> |
757 | - <_long>Snapoff maximized and vertically maximized windows by dragging them up or down and horizontally maximized ones by dragging them left or right.</_long> |
758 | - <default>false</default> |
759 | - </option> |
760 | - <option name="snapback_windows" type="bool"> |
761 | - <_short>Snap Windows Back To Original Size</_short> |
762 | - <_long>Snaps windows back to their original size if dragged away from their gridded position.</_long> |
763 | - <default>true</default> |
764 | - </option> |
765 | - <option name="cycle_sizes" type="bool"> |
766 | - <_short>Cycle Through Multiple Sizes</_short> |
767 | - <_long>Cycle through multiple different sizes by using the same keyboard shortcut multiple times in a row.</_long> |
768 | - <default>false</default> |
769 | - </option> |
770 | - </subgroup> |
771 | - <subgroup> |
772 | - <_short>Thresholds</_short> |
773 | + <_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> |
774 | + <default><Alt>F5</default> |
775 | + </option> |
776 | + </group> |
777 | + <group> |
778 | + <_short>Corners / Edges</_short> |
779 | + <option name="top_left_corner_action" type="int"> |
780 | + <_short>Upper Left Corner</_short> |
781 | + <_long>Action to be performed when window is dropped on the top left corner.</_long> |
782 | + <default>4</default> |
783 | + <min>0</min> |
784 | + <max>10</max> |
785 | + <desc> |
786 | + <value>0</value> |
787 | + <_name>None</_name> |
788 | + </desc> |
789 | + <desc> |
790 | + <value>1</value> |
791 | + <_name>Bottom Left Corner</_name> |
792 | + </desc> |
793 | + <desc> |
794 | + <value>2</value> |
795 | + <_name>Bottom Half</_name> |
796 | + </desc> |
797 | + <desc> |
798 | + <value>3</value> |
799 | + <_name>Bottom Right Corner</_name> |
800 | + </desc> |
801 | + <desc> |
802 | + <value>4</value> |
803 | + <_name>Left Half</_name> |
804 | + </desc> |
805 | + <desc> |
806 | + <value>5</value> |
807 | + <_name>Fill Screen</_name> |
808 | + </desc> |
809 | + <desc> |
810 | + <value>6</value> |
811 | + <_name>Right Half</_name> |
812 | + </desc> |
813 | + <desc> |
814 | + <value>7</value> |
815 | + <_name>Top Left Corner</_name> |
816 | + </desc> |
817 | + <desc> |
818 | + <value>8</value> |
819 | + <_name>Top Half</_name> |
820 | + </desc> |
821 | + <desc> |
822 | + <value>9</value> |
823 | + <_name>Top Right Corner</_name> |
824 | + </desc> |
825 | + <desc> |
826 | + <value>10</value> |
827 | + <_name>Maximize</_name> |
828 | + </desc> |
829 | + </option> |
830 | + <option name="top_edge_action" type="int"> |
831 | + <_short>Top Edge</_short> |
832 | + <_long>Action to be performed when window is dropped on the top edge.</_long> |
833 | + <default>10</default> |
834 | + <min>0</min> |
835 | + <max>10</max> |
836 | + <desc> |
837 | + <value>0</value> |
838 | + <_name>None</_name> |
839 | + </desc> |
840 | + <desc> |
841 | + <value>1</value> |
842 | + <_name>Bottom Left Corner</_name> |
843 | + </desc> |
844 | + <desc> |
845 | + <value>2</value> |
846 | + <_name>Bottom Half</_name> |
847 | + </desc> |
848 | + <desc> |
849 | + <value>3</value> |
850 | + <_name>Bottom Right Corner</_name> |
851 | + </desc> |
852 | + <desc> |
853 | + <value>4</value> |
854 | + <_name>Left Half</_name> |
855 | + </desc> |
856 | + <desc> |
857 | + <value>5</value> |
858 | + <_name>Fill Screen</_name> |
859 | + </desc> |
860 | + <desc> |
861 | + <value>6</value> |
862 | + <_name>Right Half</_name> |
863 | + </desc> |
864 | + <desc> |
865 | + <value>7</value> |
866 | + <_name>Top Left Corner</_name> |
867 | + </desc> |
868 | + <desc> |
869 | + <value>8</value> |
870 | + <_name>Top Half</_name> |
871 | + </desc> |
872 | + <desc> |
873 | + <value>9</value> |
874 | + <_name>Top Right Corner</_name> |
875 | + </desc> |
876 | + <desc> |
877 | + <value>10</value> |
878 | + <_name>Maximize</_name> |
879 | + </desc> |
880 | + </option> |
881 | + <option name="top_right_corner_action" type="int"> |
882 | + <_short>Upper Right Corner</_short> |
883 | + <_long>Action to be performed when window is dropped on the top right corner.</_long> |
884 | + <default>6</default> |
885 | + <min>0</min> |
886 | + <max>10</max> |
887 | + <desc> |
888 | + <value>0</value> |
889 | + <_name>None</_name> |
890 | + </desc> |
891 | + <desc> |
892 | + <value>1</value> |
893 | + <_name>Bottom Left Corner</_name> |
894 | + </desc> |
895 | + <desc> |
896 | + <value>2</value> |
897 | + <_name>Bottom Half</_name> |
898 | + </desc> |
899 | + <desc> |
900 | + <value>3</value> |
901 | + <_name>Bottom Right Corner</_name> |
902 | + </desc> |
903 | + <desc> |
904 | + <value>4</value> |
905 | + <_name>Left Half</_name> |
906 | + </desc> |
907 | + <desc> |
908 | + <value>5</value> |
909 | + <_name>Fill Screen</_name> |
910 | + </desc> |
911 | + <desc> |
912 | + <value>6</value> |
913 | + <_name>Right Half</_name> |
914 | + </desc> |
915 | + <desc> |
916 | + <value>7</value> |
917 | + <_name>Top Left Corner</_name> |
918 | + </desc> |
919 | + <desc> |
920 | + <value>8</value> |
921 | + <_name>Top Half</_name> |
922 | + </desc> |
923 | + <desc> |
924 | + <value>9</value> |
925 | + <_name>Top Right Corner</_name> |
926 | + </desc> |
927 | + <desc> |
928 | + <value>10</value> |
929 | + <_name>Maximize</_name> |
930 | + </desc> |
931 | + </option> |
932 | + <option name="left_edge_action" type="int"> |
933 | + <_short>Left Edge</_short> |
934 | + <_long>Action to be performed when window is dropped on the left edge.</_long> |
935 | + <default>4</default> |
936 | + <min>0</min> |
937 | + <max>10</max> |
938 | + <desc> |
939 | + <value>0</value> |
940 | + <_name>None</_name> |
941 | + </desc> |
942 | + <desc> |
943 | + <value>1</value> |
944 | + <_name>Bottom Left Corner</_name> |
945 | + </desc> |
946 | + <desc> |
947 | + <value>2</value> |
948 | + <_name>Bottom Half</_name> |
949 | + </desc> |
950 | + <desc> |
951 | + <value>3</value> |
952 | + <_name>Bottom Right Corner</_name> |
953 | + </desc> |
954 | + <desc> |
955 | + <value>4</value> |
956 | + <_name>Left Half</_name> |
957 | + </desc> |
958 | + <desc> |
959 | + <value>5</value> |
960 | + <_name>Fill Screen</_name> |
961 | + </desc> |
962 | + <desc> |
963 | + <value>6</value> |
964 | + <_name>Right Half</_name> |
965 | + </desc> |
966 | + <desc> |
967 | + <value>7</value> |
968 | + <_name>Top Left Corner</_name> |
969 | + </desc> |
970 | + <desc> |
971 | + <value>8</value> |
972 | + <_name>Top Half</_name> |
973 | + </desc> |
974 | + <desc> |
975 | + <value>9</value> |
976 | + <_name>Top Right Corner</_name> |
977 | + </desc> |
978 | + <desc> |
979 | + <value>10</value> |
980 | + <_name>Maximize</_name> |
981 | + </desc> |
982 | + </option> |
983 | + <option name="right_edge_action" type="int"> |
984 | + <_short>Right Edge</_short> |
985 | + <_long>Action to be performed when window is dropped on the right edge.</_long> |
986 | + <default>6</default> |
987 | + <min>0</min> |
988 | + <max>10</max> |
989 | + <desc> |
990 | + <value>0</value> |
991 | + <_name>None</_name> |
992 | + </desc> |
993 | + <desc> |
994 | + <value>1</value> |
995 | + <_name>Bottom Left Corner</_name> |
996 | + </desc> |
997 | + <desc> |
998 | + <value>2</value> |
999 | + <_name>Bottom Half</_name> |
1000 | + </desc> |
1001 | + <desc> |
1002 | + <value>3</value> |
1003 | + <_name>Bottom Right Corner</_name> |
1004 | + </desc> |
1005 | + <desc> |
1006 | + <value>4</value> |
1007 | + <_name>Left Half</_name> |
1008 | + </desc> |
1009 | + <desc> |
1010 | + <value>5</value> |
1011 | + <_name>Fill Screen</_name> |
1012 | + </desc> |
1013 | + <desc> |
1014 | + <value>6</value> |
1015 | + <_name>Right Half</_name> |
1016 | + </desc> |
1017 | + <desc> |
1018 | + <value>7</value> |
1019 | + <_name>Top Left Corner</_name> |
1020 | + </desc> |
1021 | + <desc> |
1022 | + <value>8</value> |
1023 | + <_name>Top Half</_name> |
1024 | + </desc> |
1025 | + <desc> |
1026 | + <value>9</value> |
1027 | + <_name>Top Right Corner</_name> |
1028 | + </desc> |
1029 | + <desc> |
1030 | + <value>10</value> |
1031 | + <_name>Maximize</_name> |
1032 | + </desc> |
1033 | + </option> |
1034 | + <option name="bottom_left_corner_action" type="int"> |
1035 | + <_short>Bottom Left Corner</_short> |
1036 | + <_long>Action to be performed when window is dropped on the bottom left corner.</_long> |
1037 | + <default>4</default> |
1038 | + <min>0</min> |
1039 | + <max>10</max> |
1040 | + <desc> |
1041 | + <value>0</value> |
1042 | + <_name>None</_name> |
1043 | + </desc> |
1044 | + <desc> |
1045 | + <value>1</value> |
1046 | + <_name>Bottom Left Corner</_name> |
1047 | + </desc> |
1048 | + <desc> |
1049 | + <value>2</value> |
1050 | + <_name>Bottom Half</_name> |
1051 | + </desc> |
1052 | + <desc> |
1053 | + <value>3</value> |
1054 | + <_name>Bottom Right Corner</_name> |
1055 | + </desc> |
1056 | + <desc> |
1057 | + <value>4</value> |
1058 | + <_name>Left Half</_name> |
1059 | + </desc> |
1060 | + <desc> |
1061 | + <value>5</value> |
1062 | + <_name>Fill Screen</_name> |
1063 | + </desc> |
1064 | + <desc> |
1065 | + <value>6</value> |
1066 | + <_name>Right Half</_name> |
1067 | + </desc> |
1068 | + <desc> |
1069 | + <value>7</value> |
1070 | + <_name>Top Left Corner</_name> |
1071 | + </desc> |
1072 | + <desc> |
1073 | + <value>8</value> |
1074 | + <_name>Top Half</_name> |
1075 | + </desc> |
1076 | + <desc> |
1077 | + <value>9</value> |
1078 | + <_name>Top Right Corner</_name> |
1079 | + </desc> |
1080 | + <desc> |
1081 | + <value>10</value> |
1082 | + <_name>Maximize</_name> |
1083 | + </desc> |
1084 | + </option> |
1085 | + <option name="bottom_edge_action" type="int"> |
1086 | + <_short>Bottom Edge</_short> |
1087 | + <_long>Action to be performed when window is dropped on the bottom edge.</_long> |
1088 | + <default>0</default> |
1089 | + <min>0</min> |
1090 | + <max>10</max> |
1091 | + <desc> |
1092 | + <value>0</value> |
1093 | + <_name>None</_name> |
1094 | + </desc> |
1095 | + <desc> |
1096 | + <value>1</value> |
1097 | + <_name>Bottom Left Corner</_name> |
1098 | + </desc> |
1099 | + <desc> |
1100 | + <value>2</value> |
1101 | + <_name>Bottom Half</_name> |
1102 | + </desc> |
1103 | + <desc> |
1104 | + <value>3</value> |
1105 | + <_name>Bottom Right Corner</_name> |
1106 | + </desc> |
1107 | + <desc> |
1108 | + <value>4</value> |
1109 | + <_name>Left Half</_name> |
1110 | + </desc> |
1111 | + <desc> |
1112 | + <value>5</value> |
1113 | + <_name>Fill Screen</_name> |
1114 | + </desc> |
1115 | + <desc> |
1116 | + <value>6</value> |
1117 | + <_name>Right Half</_name> |
1118 | + </desc> |
1119 | + <desc> |
1120 | + <value>7</value> |
1121 | + <_name>Top Left Corner</_name> |
1122 | + </desc> |
1123 | + <desc> |
1124 | + <value>8</value> |
1125 | + <_name>Top Half</_name> |
1126 | + </desc> |
1127 | + <desc> |
1128 | + <value>9</value> |
1129 | + <_name>Top Right Corner</_name> |
1130 | + </desc> |
1131 | + <desc> |
1132 | + <value>10</value> |
1133 | + <_name>Maximize</_name> |
1134 | + </desc> |
1135 | + </option> |
1136 | + <option name="bottom_right_corner_action" type="int"> |
1137 | + <_short>Bottom Right Corner</_short> |
1138 | + <_long>Action to be performed when window is dropped on the bottom right corner.</_long> |
1139 | + <default>6</default> |
1140 | + <min>0</min> |
1141 | + <max>10</max> |
1142 | + <desc> |
1143 | + <value>0</value> |
1144 | + <_name>None</_name> |
1145 | + </desc> |
1146 | + <desc> |
1147 | + <value>1</value> |
1148 | + <_name>Bottom Left Corner</_name> |
1149 | + </desc> |
1150 | + <desc> |
1151 | + <value>2</value> |
1152 | + <_name>Bottom Half</_name> |
1153 | + </desc> |
1154 | + <desc> |
1155 | + <value>3</value> |
1156 | + <_name>Bottom Right Corner</_name> |
1157 | + </desc> |
1158 | + <desc> |
1159 | + <value>4</value> |
1160 | + <_name>Left Half</_name> |
1161 | + </desc> |
1162 | + <desc> |
1163 | + <value>5</value> |
1164 | + <_name>Fill Screen</_name> |
1165 | + </desc> |
1166 | + <desc> |
1167 | + <value>6</value> |
1168 | + <_name>Right Half</_name> |
1169 | + </desc> |
1170 | + <desc> |
1171 | + <value>7</value> |
1172 | + <_name>Top Left Corner</_name> |
1173 | + </desc> |
1174 | + <desc> |
1175 | + <value>8</value> |
1176 | + <_name>Top Half</_name> |
1177 | + </desc> |
1178 | + <desc> |
1179 | + <value>9</value> |
1180 | + <_name>Top Right Corner</_name> |
1181 | + </desc> |
1182 | + <desc> |
1183 | + <value>10</value> |
1184 | + <_name>Maximize</_name> |
1185 | + </desc> |
1186 | + </option> |
1187 | + </group> |
1188 | + <group> |
1189 | + <_short>Resize Actions</_short> |
1190 | + <option name="snapback_windows" type="bool"> |
1191 | + <_short>Snap Windows Back To Original Size</_short> |
1192 | + <_long>Snaps windows back to their original size if dragged away from their gridded position.</_long> |
1193 | + <default>true</default> |
1194 | + </option> |
1195 | + <option name="cycle_sizes" type="bool"> |
1196 | + <_short>Cycle Through Multiple Sizes</_short> |
1197 | + <_long>Cycle through multiple different sizes by using the same keyboard shortcut multiple times in a row.</_long> |
1198 | + <default>false</default> |
1199 | + </option> |
1200 | + <subgroup> |
1201 | + <_short>Grid Snapback Thresholds</_short> |
1202 | <option name="left_edge_threshold" type="int"> |
1203 | <_short>Left Edge</_short> |
1204 | <_long>Maximum number of pixels from the left edge a window can be dropped.</_long> |
1205 | @@ -536,6 +530,16 @@ |
1206 | <max>500</max> |
1207 | </option> |
1208 | </subgroup> |
1209 | + <subgroup> |
1210 | + <_short>Grid Snapoff Threshold</_short> |
1211 | + <option name="snapoff_threshold" type="int"> |
1212 | + <_short>General Size</_short> |
1213 | + <_long>The pixels to drag until a grid-resized window snaps off.</_long> |
1214 | + <default>50</default> |
1215 | + <min>0</min> |
1216 | + <max>500</max> |
1217 | + </option> |
1218 | + </subgroup> |
1219 | </group> |
1220 | <group> |
1221 | <_short>Appearance</_short> |
1222 | |
1223 | === modified file 'plugins/grid/src/grid.cpp' |
1224 | --- plugins/grid/src/grid.cpp 2013-05-09 13:43:07 +0000 |
1225 | +++ plugins/grid/src/grid.cpp 2013-05-11 08:07:29 +0000 |
1226 | @@ -36,8 +36,8 @@ |
1227 | static int const CURVE_ANIMATION = 35; |
1228 | |
1229 | void |
1230 | -GridScreen::handleCompizEvent(const char* plugin, |
1231 | - const char* event, |
1232 | +GridScreen::handleCompizEvent(const char *plugin, |
1233 | + const char *event, |
1234 | CompOption::Vector& o) |
1235 | { |
1236 | if (strcmp(event, "start_viewport_switch") == 0) |
1237 | @@ -118,12 +118,12 @@ |
1238 | } |
1239 | |
1240 | bool |
1241 | -GridScreen::initiateCommon (CompAction *action, |
1242 | - CompAction::State state, |
1243 | - CompOption::Vector &option, |
1244 | - unsigned int where, |
1245 | - bool resize, |
1246 | - bool key) |
1247 | +GridScreen::initiateCommon (CompAction *action, |
1248 | + CompAction::State state, |
1249 | + CompOption::Vector &option, |
1250 | + unsigned int where, |
1251 | + bool resize, |
1252 | + bool key) |
1253 | { |
1254 | CompWindow *cw = 0; |
1255 | |
1256 | @@ -142,7 +142,7 @@ |
1257 | vertMaximizedGridPosition || |
1258 | where & GridMaximize; |
1259 | |
1260 | - if (!(cw->actions () & CompWindowActionResizeMask) || |
1261 | + if (!(cw->actions () & CompWindowActionResizeMask) || |
1262 | (maximizeH && !(cw->actions () & CompWindowActionMaximizeHorzMask)) || |
1263 | (maximizeV && !(cw->actions () & CompWindowActionMaximizeVertMask)) || |
1264 | where & GridUnknown) |
1265 | @@ -168,29 +168,20 @@ |
1266 | if (props.numCellsX == 1) |
1267 | centerCheck = true; |
1268 | |
1269 | - /* Do not overwrite the original size if we already have been gridded */ |
1270 | - if (!gw->isGridResized && !gw->isGridHorzMaximized && !gw->isGridVertMaximized) |
1271 | + /* Do not overwrite the original size if we already have been gridded or |
1272 | + * have been grid-maximized */ |
1273 | + if (!gw->isGridResized && !gw->isGridHorzMaximized && !gw->isGridVertMaximized && |
1274 | + !(cw->state () & MAXIMIZE_STATE)) |
1275 | /* Store size not including borders when using a keybinding */ |
1276 | gw->originalSize = slotToRect(cw, cw->serverBorderRect ()); |
1277 | } |
1278 | |
1279 | - if ((cw->state () & MAXIMIZE_STATE) && |
1280 | - (resize || optionGetSnapoffMaximized ())) |
1281 | - /* maximized state interferes with us, clear it */ |
1282 | + if ((cw->state () & MAXIMIZE_STATE) && resize) |
1283 | + // maximized state interferes with us, clear it |
1284 | cw->maximize (0); |
1285 | |
1286 | if ((where & GridMaximize) && resize) |
1287 | { |
1288 | - /* move the window to the correct output */ |
1289 | - if (cw == mGrabWindow) |
1290 | - { |
1291 | - /* TODO: Remove these magic numbers */ |
1292 | - xwc.x = workarea.x () + 50; |
1293 | - xwc.y = workarea.y () + 50; |
1294 | - xwc.width = workarea.width (); |
1295 | - xwc.height = workarea.height (); |
1296 | - cw->configureXWindow (CWX | CWY, &xwc); |
1297 | - } |
1298 | cw->maximize (MAXIMIZE_STATE); |
1299 | /* Core can handle fully maximized windows so we don't |
1300 | * have to worry about them. Don't mark the window as a |
1301 | @@ -202,6 +193,7 @@ |
1302 | |
1303 | for (unsigned int i = 0; i < animations.size (); ++i) |
1304 | animations.at (i).fadingOut = true; |
1305 | + |
1306 | return true; |
1307 | } |
1308 | |
1309 | @@ -246,12 +238,12 @@ |
1310 | * unless the user explicitely specified that in CCSM |
1311 | */ |
1312 | if (gw->lastTarget == where && |
1313 | - gw->isGridResized && |
1314 | + gw->isGridResized && |
1315 | !optionGetCycleSizes ()) |
1316 | return false; |
1317 | |
1318 | - /* !(Grid Left/Right/Top/Bottom) are only valid here, if |
1319 | - * cycling through sizes is disabled also |
1320 | + /* !(Grid Left/Right/Top/Bottom) are only valid here, |
1321 | + * if cycling through sizes is disabled also |
1322 | */ |
1323 | if ((where & ~(GridMaximize) || |
1324 | ((!horzMaximizedGridPosition || !vertMaximizedGridPosition) && |
1325 | @@ -398,7 +390,7 @@ |
1326 | |
1327 | rwc.x = gw->originalSize.x (); |
1328 | rwc.y = gw->originalSize.y (); |
1329 | - rwc.width = gw->originalSize.width (); |
1330 | + rwc.width = gw->originalSize.width (); |
1331 | rwc.height = gw->originalSize.height (); |
1332 | |
1333 | cw->configureXWindow (CWX | CWY | CWWidth | CWHeight, &rwc); |
1334 | @@ -469,10 +461,8 @@ |
1335 | */ |
1336 | if (centerCheck) |
1337 | { |
1338 | - if ((cw->serverBorderRect ().width () > |
1339 | - desiredSlot.width ()) || |
1340 | - cw->serverBorderRect ().width () < |
1341 | - desiredSlot.width ()) |
1342 | + if (cw->serverBorderRect ().width () > desiredSlot.width () || |
1343 | + cw->serverBorderRect ().width () < desiredSlot.width ()) |
1344 | { |
1345 | wc.x = (workarea.width () >> 1) - |
1346 | ((cw->serverBorderRect ().width () >> 1) - |
1347 | @@ -492,13 +482,13 @@ |
1348 | const GLMatrix &transform, |
1349 | CompOutput *output) |
1350 | { |
1351 | - CompRect rect; |
1352 | - GLMatrix sTransform (transform); |
1353 | + CompRect rect; |
1354 | + GLMatrix sTransform (transform); |
1355 | std::vector<Animation>::iterator iter; |
1356 | - GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); |
1357 | + GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer (); |
1358 | GLfloat vertexData[12]; |
1359 | GLushort colorData[4]; |
1360 | - GLushort *color; |
1361 | + GLushort *color; |
1362 | GLboolean isBlendingEnabled; |
1363 | |
1364 | const float MaxUShortFloat = std::numeric_limits <unsigned short>::max (); |
1365 | @@ -702,10 +692,10 @@ |
1366 | type.push_back (GridTypeMask (GridWindowType::GridTopRight, 9)); |
1367 | type.push_back (GridTypeMask (GridWindowType::GridMaximize, 10)); |
1368 | |
1369 | - |
1370 | for (unsigned int i = 0; i < type.size (); ++i) |
1371 | { |
1372 | GridTypeMask &tm = type[i]; |
1373 | + |
1374 | if (tm.type == t) |
1375 | return tm.mask; |
1376 | } |
1377 | @@ -721,35 +711,35 @@ |
1378 | switch (edge) |
1379 | { |
1380 | case Left: |
1381 | - ret = (int) optionGetLeftEdgeAction (); |
1382 | + ret = optionGetLeftEdgeAction (); |
1383 | break; |
1384 | |
1385 | case Right: |
1386 | - ret = (int) optionGetRightEdgeAction (); |
1387 | + ret = optionGetRightEdgeAction (); |
1388 | break; |
1389 | |
1390 | case Top: |
1391 | - ret = (int) optionGetTopEdgeAction (); |
1392 | + ret = optionGetTopEdgeAction (); |
1393 | break; |
1394 | |
1395 | case Bottom: |
1396 | - ret = (int) optionGetBottomEdgeAction (); |
1397 | + ret = optionGetBottomEdgeAction (); |
1398 | break; |
1399 | |
1400 | case TopLeft: |
1401 | - ret = (int) optionGetTopLeftCornerAction (); |
1402 | + ret = optionGetTopLeftCornerAction (); |
1403 | break; |
1404 | |
1405 | case TopRight: |
1406 | - ret = (int) optionGetTopRightCornerAction (); |
1407 | + ret = optionGetTopRightCornerAction (); |
1408 | break; |
1409 | |
1410 | case BottomLeft: |
1411 | - ret = (int) optionGetBottomLeftCornerAction (); |
1412 | + ret = optionGetBottomLeftCornerAction (); |
1413 | break; |
1414 | |
1415 | case BottomRight: |
1416 | - ret = (int) optionGetBottomRightCornerAction (); |
1417 | + ret = optionGetBottomRightCornerAction (); |
1418 | break; |
1419 | |
1420 | case NoEdge: |
1421 | @@ -862,6 +852,7 @@ |
1422 | if (edge != NoEdge && check) |
1423 | { |
1424 | CompWindow *cw = screen->findWindow (screen->activeWindow ()); |
1425 | + |
1426 | if (cw) |
1427 | { |
1428 | animations.push_back (Animation ()); |
1429 | @@ -894,12 +885,14 @@ |
1430 | { |
1431 | GRID_WINDOW (w); |
1432 | |
1433 | - if ((gw->pointerBufDx > SNAPOFF_THRESHOLD || |
1434 | - gw->pointerBufDy > SNAPOFF_THRESHOLD || |
1435 | - gw->pointerBufDx < -SNAPOFF_THRESHOLD || |
1436 | - gw->pointerBufDy < -SNAPOFF_THRESHOLD) && |
1437 | - gw->isGridResized && |
1438 | - optionGetSnapbackWindows ()) |
1439 | + int snapoffThreshold = optionGetSnapoffThreshold (); |
1440 | + |
1441 | + /* we just care about snapping of grid-resized windows */ |
1442 | + if ((gw->pointerBufDx > snapoffThreshold || |
1443 | + gw->pointerBufDy > snapoffThreshold || |
1444 | + gw->pointerBufDx < -snapoffThreshold || |
1445 | + gw->pointerBufDy < -snapoffThreshold) && |
1446 | + gw->isGridResized) |
1447 | restoreWindow (0, 0, o); |
1448 | } |
1449 | } |
1450 | @@ -938,13 +931,11 @@ |
1451 | pointerBufDx = pointerBufDy = 0; |
1452 | grabMask = mask; |
1453 | |
1454 | - if (!isGridResized && |
1455 | - !isGridHorzMaximized && |
1456 | - !isGridVertMaximized && |
1457 | - gScreen->optionGetSnapbackWindows ()) |
1458 | + if (!isGridResized && |
1459 | + !isGridHorzMaximized && |
1460 | + !isGridVertMaximized) |
1461 | /* Store size not including borders when grabbing with cursor */ |
1462 | - originalSize = gScreen->slotToRect(window, |
1463 | - window->serverBorderRect ()); |
1464 | + originalSize = gScreen->slotToRect (window, window->serverBorderRect ()); |
1465 | } |
1466 | else if (gwHandler.resetResize ()) |
1467 | { |
1468 | @@ -982,9 +973,9 @@ |
1469 | { |
1470 | window->moveNotify (dx, dy, immediate); |
1471 | |
1472 | - if (isGridResized && |
1473 | - !isGridHorzMaximized && |
1474 | - !isGridVertMaximized && |
1475 | + if (isGridResized && |
1476 | + !isGridHorzMaximized && |
1477 | + !isGridVertMaximized && |
1478 | !GridScreen::get (screen)->mSwitchingVp) |
1479 | { |
1480 | if (window->grabbed () && screen->grabExist ("expo")) |
1481 | @@ -996,6 +987,7 @@ |
1482 | gScreen->restoreWindow (0, 0, gScreen->o); |
1483 | return; |
1484 | } |
1485 | + |
1486 | if (window->grabbed () && (grabMask & CompWindowGrabMoveMask)) |
1487 | { |
1488 | pointerBufDx += dx; |
1489 | @@ -1036,8 +1028,7 @@ |
1490 | lastTarget = GridMaximize; |
1491 | |
1492 | if (window->grabbed ()) |
1493 | - originalSize = gScreen->slotToRect (window, |
1494 | - window->serverBorderRect ()); |
1495 | + originalSize = gScreen->slotToRect (window, window->serverBorderRect ()); |
1496 | } |
1497 | |
1498 | window->stateChangeNotify (lastState); |
1499 | @@ -1049,8 +1040,8 @@ |
1500 | CompOption::Vector &option) |
1501 | { |
1502 | XWindowChanges xwc; |
1503 | - int xwcm = 0; |
1504 | - CompWindow *cw = screen->findWindow (screen->activeWindow ()); |
1505 | + int xwcm = 0; |
1506 | + CompWindow *cw = screen->findWindow (screen->activeWindow ()); |
1507 | |
1508 | if (!cw) |
1509 | return false; |
1510 | @@ -1058,13 +1049,13 @@ |
1511 | GRID_WINDOW (cw); |
1512 | |
1513 | /* We have nothing to do here */ |
1514 | - if (!gw->isGridResized && |
1515 | - !gw->isGridVertMaximized && |
1516 | + if (!gw->isGridResized && |
1517 | + !gw->isGridVertMaximized && |
1518 | !gw->isGridHorzMaximized) |
1519 | return false; |
1520 | |
1521 | - else if (!gw->isGridResized && |
1522 | - gw->isGridHorzMaximized && |
1523 | + else if (!gw->isGridResized && |
1524 | + gw->isGridHorzMaximized && |
1525 | !gw->isGridVertMaximized) |
1526 | { |
1527 | /* Window has been horizontally maximized by grid. We only need |
1528 | @@ -1073,8 +1064,8 @@ |
1529 | gw->window->sizeHints ().flags |= gw->sizeHintsFlags; |
1530 | xwcm |= CWY | CWHeight; |
1531 | } |
1532 | - else if (!gw->isGridResized && |
1533 | - !gw->isGridHorzMaximized && |
1534 | + else if (!gw->isGridResized && |
1535 | + !gw->isGridHorzMaximized && |
1536 | gw->isGridVertMaximized) |
1537 | { |
1538 | /* Window has been vertically maximized by grid. We only need |
1539 | @@ -1083,8 +1074,8 @@ |
1540 | gw->window->sizeHints ().flags |= gw->sizeHintsFlags; |
1541 | xwcm |= CWX | CWWidth; |
1542 | } |
1543 | - else if (gw->isGridResized && |
1544 | - !gw->isGridHorzMaximized && |
1545 | + else if (gw->isGridResized && |
1546 | + !gw->isGridHorzMaximized && |
1547 | !gw->isGridVertMaximized) |
1548 | /* Window is just gridded (center, corners). |
1549 | * We need to handle everything. */ |
1550 | @@ -1093,15 +1084,25 @@ |
1551 | { |
1552 | /* This should never happen. But if it does, just bail out |
1553 | * gracefully. */ |
1554 | - assert (gw->isGridResized && |
1555 | + assert (gw->isGridResized && |
1556 | (gw->isGridHorzMaximized || gw->isGridVertMaximized)); |
1557 | return false; |
1558 | } |
1559 | |
1560 | if (cw == mGrabWindow) |
1561 | { |
1562 | - xwc.x = pointerX - (gw->originalSize.width () / 2); |
1563 | - xwc.y = pointerY + (cw->border ().top / 2); |
1564 | + /* The windows x-center is different in this case. */ |
1565 | + if (optionGetSnapbackWindows ()) |
1566 | + { |
1567 | + xwc.x = pointerX - (gw->originalSize.width () / 2); |
1568 | + xwc.y = pointerY + (cw->border ().top / 2); |
1569 | + } |
1570 | + else /* the user does not want the original size back */ |
1571 | + { |
1572 | + /* this one is quite tricky to get right */ |
1573 | + xwc.x = pointerX - gw->pointerBufDx - gw->currentSize.width () / 2; |
1574 | + xwc.y = pointerY - gw->pointerBufDy + cw->border ().top / 2; |
1575 | + } |
1576 | } |
1577 | else if (cw->grabbed () && screen->grabExist ("expo")) |
1578 | { |
1579 | @@ -1119,19 +1120,32 @@ |
1580 | xwc.y = gw->originalSize.y (); |
1581 | } |
1582 | |
1583 | - xwc.width = gw->originalSize.width (); |
1584 | - xwc.height = gw->originalSize.height (); |
1585 | + /* We just need the original size, if |
1586 | + * this option is enabled or we are not grabbed */ |
1587 | + if (optionGetSnapbackWindows () || |
1588 | + !(cw == mGrabWindow)) |
1589 | + { |
1590 | + xwc.width = gw->originalSize.width (); |
1591 | + xwc.height = gw->originalSize.height (); |
1592 | + } |
1593 | + else |
1594 | + { |
1595 | + /* the current size is also our new size */ |
1596 | + xwc.width = gw->currentSize.width (); |
1597 | + xwc.height = gw->currentSize.height (); |
1598 | + } |
1599 | |
1600 | if (cw->mapNum() && xwcm) |
1601 | cw->sendSyncRequest(); |
1602 | |
1603 | cw->configureXWindow (xwcm, &xwc); |
1604 | - gw->currentSize = CompRect (); |
1605 | - gw->pointerBufDx = 0; |
1606 | - gw->pointerBufDy = 0; |
1607 | + |
1608 | + gw->currentSize = CompRect (); |
1609 | + gw->pointerBufDx = 0; |
1610 | + gw->pointerBufDy = 0; |
1611 | gw->isGridHorzMaximized = false; |
1612 | gw->isGridVertMaximized = false; |
1613 | - gw->isGridResized = false; |
1614 | + gw->isGridResized = false; |
1615 | |
1616 | if (cw->state () & MAXIMIZE_STATE) |
1617 | cw->maximize(0); |
1618 | @@ -1143,18 +1157,6 @@ |
1619 | } |
1620 | |
1621 | void |
1622 | -GridScreen::snapbackOptionChanged (CompOption *option, |
1623 | - Options num) |
1624 | -{ |
1625 | - GRID_WINDOW (screen->findWindow |
1626 | - (CompOption::getIntOptionNamed (o, "window"))); |
1627 | - gw->isGridResized = false; |
1628 | - gw->isGridHorzMaximized = false; |
1629 | - gw->isGridVertMaximized = false; |
1630 | - gw->resizeCount = 0; |
1631 | -} |
1632 | - |
1633 | -void |
1634 | GridScreen::preparePaint (int msSinceLastPaint) |
1635 | { |
1636 | std::vector<Animation>::iterator iter; |
1637 | @@ -1270,6 +1272,7 @@ |
1638 | edge = lastEdge = lastResizeEdge = NoEdge; |
1639 | currentWorkarea = lastWorkarea = screen->getWorkareaForOutput |
1640 | (screen->outputDeviceForPoint (pointerX, pointerY)); |
1641 | + |
1642 | gridProps[GridUnknown] = GridProps (0,1, 1,1); |
1643 | gridProps[GridBottomLeft] = GridProps (0,1, 2,2); |
1644 | gridProps[GridBottom] = GridProps (0,1, 1,2); |
1645 | @@ -1301,9 +1304,6 @@ |
1646 | |
1647 | #undef GRIDSET |
1648 | |
1649 | - optionSetSnapbackWindowsNotify (boost::bind (&GridScreen:: |
1650 | - snapbackOptionChanged, this, _1, _2)); |
1651 | - |
1652 | optionSetPutRestoreKeyInitiate (boost::bind (&GridScreen:: |
1653 | restoreWindow, this, _1, _2, _3)); |
1654 | } |
1655 | @@ -1380,7 +1380,6 @@ |
1656 | wTransform.translate (translateX / scaleX - window->x (), |
1657 | translateY / scaleY - window->y (), 0.0f); |
1658 | |
1659 | - |
1660 | gWindow->glPaint (wAttrib, wTransform, region, wMask); |
1661 | } |
1662 | } |
1663 | @@ -1394,7 +1393,9 @@ |
1664 | bool |
1665 | GridPluginVTable::init () |
1666 | { |
1667 | - if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION)) |
1668 | + if (CompPlugin::checkPluginABI ("composite", CORE_ABIVERSION) && |
1669 | + CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) && |
1670 | + CompPlugin::checkPluginABI ("opengl", CORE_ABIVERSION)) |
1671 | return true; |
1672 | |
1673 | return false; |
1674 | |
1675 | === modified file 'plugins/grid/src/grid.h' |
1676 | --- plugins/grid/src/grid.h 2013-04-02 18:22:48 +0000 |
1677 | +++ plugins/grid/src/grid.h 2013-05-11 08:07:29 +0000 |
1678 | @@ -30,21 +30,19 @@ |
1679 | |
1680 | #include "grid_options.h" |
1681 | |
1682 | -static const unsigned short SNAPOFF_THRESHOLD = 50; |
1683 | - |
1684 | namespace GridWindowType |
1685 | { |
1686 | - static const unsigned int GridUnknown = (1 << 0); |
1687 | + static const unsigned int GridUnknown = (1 << 0); |
1688 | static const unsigned int GridBottomLeft = (1 << 1); |
1689 | - static const unsigned int GridBottom = (1 << 2); |
1690 | + static const unsigned int GridBottom = (1 << 2); |
1691 | static const unsigned int GridBottomRight = (1 << 3); |
1692 | - static const unsigned int GridLeft = (1 << 4); |
1693 | - static const unsigned int GridCenter = (1 << 5); |
1694 | - static const unsigned int GridRight = (1 << 6); |
1695 | - static const unsigned int GridTopLeft = (1 << 7); |
1696 | - static const unsigned int GridTop = (1 << 8); |
1697 | - static const unsigned int GridTopRight = (1 << 9); |
1698 | - static const unsigned int GridMaximize = (1 << 10); |
1699 | + static const unsigned int GridLeft = (1 << 4); |
1700 | + static const unsigned int GridCenter = (1 << 5); |
1701 | + static const unsigned int GridRight = (1 << 6); |
1702 | + static const unsigned int GridTopLeft = (1 << 7); |
1703 | + static const unsigned int GridTop = (1 << 8); |
1704 | + static const unsigned int GridTopRight = (1 << 9); |
1705 | + static const unsigned int GridMaximize = (1 << 10); |
1706 | }; |
1707 | |
1708 | typedef unsigned int GridType; |
1709 | @@ -93,16 +91,16 @@ |
1710 | |
1711 | Animation (); |
1712 | |
1713 | - GLfloat progress; |
1714 | + GLfloat progress; |
1715 | CompRect fromRect; |
1716 | CompRect targetRect; |
1717 | CompRect currentRect; |
1718 | - GLfloat opacity; |
1719 | - GLfloat timer; |
1720 | - Window window; |
1721 | - int duration; |
1722 | - bool complete; |
1723 | - bool fadingOut; |
1724 | + GLfloat opacity; |
1725 | + GLfloat timer; |
1726 | + Window window; |
1727 | + int duration; |
1728 | + bool complete; |
1729 | + bool fadingOut; |
1730 | }; |
1731 | |
1732 | class GridScreen : |
1733 | @@ -115,56 +113,80 @@ |
1734 | public: |
1735 | |
1736 | GridScreen (CompScreen *); |
1737 | - CompositeScreen *cScreen; |
1738 | - GLScreen *glScreen; |
1739 | - |
1740 | - CompRect workarea, currentRect, desiredSlot, lastSlot, |
1741 | - desiredRect, lastWorkarea, currentWorkarea; |
1742 | - GridProps props; |
1743 | - Edges edge, lastEdge, lastResizeEdge; |
1744 | + |
1745 | + CompositeScreen *cScreen; |
1746 | + GLScreen *glScreen; |
1747 | + |
1748 | + CompRect workarea; |
1749 | + CompRect currentRect; |
1750 | + CompRect desiredSlot; |
1751 | + CompRect lastSlot; |
1752 | + CompRect desiredRect; |
1753 | + CompRect lastWorkarea; |
1754 | + CompRect currentWorkarea; |
1755 | + |
1756 | + GridProps props; |
1757 | + |
1758 | + Edges edge; |
1759 | + Edges lastEdge; |
1760 | + Edges lastResizeEdge; |
1761 | + |
1762 | CompOption::Vector o; |
1763 | - bool centerCheck; |
1764 | - CompWindow *mGrabWindow; |
1765 | - bool animating; |
1766 | - bool mSwitchingVp; |
1767 | + bool centerCheck; |
1768 | + CompWindow *mGrabWindow; |
1769 | + bool animating; |
1770 | + bool mSwitchingVp; |
1771 | |
1772 | void getPaintRectangle (CompRect&); |
1773 | void setCurrentRect (Animation&); |
1774 | |
1775 | - bool initiateCommon (CompAction*, CompAction::State, |
1776 | - CompOption::Vector&, unsigned int, bool, bool); |
1777 | + bool initiateCommon (CompAction *, |
1778 | + CompAction::State , |
1779 | + CompOption::Vector &, |
1780 | + unsigned int , |
1781 | + bool , |
1782 | + bool ); |
1783 | |
1784 | - void glPaintRectangle (const GLScreenPaintAttrib&, |
1785 | - const GLMatrix&, CompOutput *); |
1786 | + void glPaintRectangle (const GLScreenPaintAttrib &, |
1787 | + const GLMatrix &, |
1788 | + CompOutput *); |
1789 | |
1790 | bool glPaintOutput (const GLScreenPaintAttrib &, |
1791 | - const GLMatrix &, const CompRegion &, |
1792 | - CompOutput *, unsigned int); |
1793 | + const GLMatrix &, |
1794 | + const CompRegion &, |
1795 | + CompOutput *, |
1796 | + unsigned int ); |
1797 | |
1798 | void preparePaint (int msSinceLastPaint); |
1799 | + |
1800 | void donePaint (); |
1801 | |
1802 | std::vector <Animation> animations; |
1803 | |
1804 | int edgeToGridType (); |
1805 | + |
1806 | unsigned int typeToMask (int); |
1807 | |
1808 | void handleEvent (XEvent *event); |
1809 | - void handleCompizEvent (const char *plugin, const char *event, CompOption::Vector &options); |
1810 | - |
1811 | - bool restoreWindow (CompAction*, |
1812 | - CompAction::State, |
1813 | - CompOption::Vector&); |
1814 | + |
1815 | + void handleCompizEvent (const char *plugin, |
1816 | + const char *event, |
1817 | + CompOption::Vector &options); |
1818 | + |
1819 | + bool restoreWindow (CompAction *, |
1820 | + CompAction::State , |
1821 | + CompOption::Vector &); |
1822 | |
1823 | void |
1824 | snapbackOptionChanged (CompOption *option, |
1825 | - Options num); |
1826 | + Options num); |
1827 | |
1828 | CompRect |
1829 | slotToRect (CompWindow *w, |
1830 | const CompRect& slot); |
1831 | + |
1832 | CompRect |
1833 | - constrainSize (CompWindow *w, |
1834 | + constrainSize (CompWindow *w, |
1835 | const CompRect& slot); |
1836 | }; |
1837 | |
1838 | @@ -177,24 +199,30 @@ |
1839 | |
1840 | GridWindow (CompWindow *); |
1841 | ~GridWindow (); |
1842 | - CompWindow *window; |
1843 | - GLWindow *gWindow; |
1844 | - GridScreen *gScreen; |
1845 | - |
1846 | - bool isGridResized; |
1847 | - bool isGridHorzMaximized; |
1848 | - bool isGridVertMaximized; |
1849 | + |
1850 | + CompWindow *window; |
1851 | + GLWindow *gWindow; |
1852 | + GridScreen *gScreen; |
1853 | + |
1854 | + bool isGridResized; |
1855 | + bool isGridHorzMaximized; |
1856 | + bool isGridVertMaximized; |
1857 | + |
1858 | unsigned int grabMask; |
1859 | - int pointerBufDx; |
1860 | - int pointerBufDy; |
1861 | - int resizeCount; |
1862 | - CompRect currentSize; |
1863 | - CompRect originalSize; |
1864 | - GridType lastTarget; |
1865 | + |
1866 | + int pointerBufDx; |
1867 | + int pointerBufDy; |
1868 | + |
1869 | + int resizeCount; |
1870 | + CompRect currentSize; |
1871 | + CompRect originalSize; |
1872 | + GridType lastTarget; |
1873 | unsigned int sizeHintsFlags; |
1874 | |
1875 | - bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&, |
1876 | - const CompRegion&, unsigned int); |
1877 | + bool glPaint (const GLWindowPaintAttrib &, |
1878 | + const GLMatrix &, |
1879 | + const CompRegion &, |
1880 | + unsigned int ); |
1881 | |
1882 | void grabNotify (int, int, unsigned int, unsigned int); |
1883 | |
1884 | @@ -203,9 +231,10 @@ |
1885 | void moveNotify (int, int, bool); |
1886 | |
1887 | void stateChangeNotify (unsigned int); |
1888 | - void validateResizeRequest (unsigned int &valueMask, |
1889 | + |
1890 | + void validateResizeRequest (unsigned int &valueMask, |
1891 | XWindowChanges *xwc, |
1892 | - unsigned int source); |
1893 | + unsigned int source); |
1894 | }; |
1895 | |
1896 | #define GRID_WINDOW(w) \ |
1897 | @@ -220,4 +249,3 @@ |
1898 | }; |
1899 | |
1900 | COMPIZ_PLUGIN_20090315 (grid, GridPluginVTable); |
1901 | - |
the xml cleanup is fine.
957 - ${GMOCK_LIBRARY} MAIN_LIBRARY} )
958 - ${GMOCK_
959 + ${GMOCK_LIBRARY})
GMOCK_MAIN_LIBRARY is necessary here.
1019 +/* fThreshold (); indow (CWX | CWY, &xwc);
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 = optionGetSnapof
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->configureXW
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.