Merge lp:~mc-return/compiz/compiz.merge-fix1082001-gridded-windows-jump-workspaces into lp:compiz/0.9.10
- compiz.merge-fix1082001-gridded-windows-jump-workspaces
- Merge into 0.9.10
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sami Jaktholm | Pending | ||
Compiz Maintainers | Pending | ||
Review via email: mp+157539@code.launchpad.net |
This proposal supersedes a proposal from 2013-04-05.
This proposal has been superseded by a proposal from 2013-04-08.
Commit message
*Grid code:
Prevent center and corner gridded windows from jumping viewports.
(Thanks and credits for this go to Sami Jaktholm)
Prevent top and bottom gridded windows from jumping viewports by
making those semi-maximize horizontally.
As those are actually semi-maximized horizontally, we will treat
them as such and let core handle the restoring, just like we
already do for vertically semi-maximized grid windows (left/right).
Now "Strg+Super+Down" will restore top and bottom gridded windows
correctly as well.
Also multiple gridding to top, bottom, left or right will not
overwrite the stored original size anymore.
Restore windows also when workspace switcher (expo) is active.
(Thanks and credits for this go to Sami Jaktholm)
Allow cycling for all gridded windows if explicitly specified by the
user in CCSM.
Forbid cycling through different sizes for corner and center-gridded
windows also per default, now fully fixing bug #878820 and following
the design specification by Ayatana Design there, making behaviour
consistent.
*Grid xml:
Added cycle_sizes bool option, which allows the user to choose the
prefered behaviour (fixed versus flexible sizes on multiple presses
on the same grid keyboard shortcut).
Default of this option is off, cycling disabled as specified by design.
Added punctuation where missing and removed it where usually is none.
Fixed typos, improved description and titles.
*Expo code:
Tell grid when viewport change is in progress.
(Thanks and credits for this go to Sami Jaktholm)
(fixes: LP: #878820, LP: #879218, LP: #882754 and LP: #1082001,
partially fixes: #1116538, #1164332)
Description of the change
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal | # |
Hey, I'm pretty busy at the moment. I'll get on to this ASAP.
On Thu, Apr 4, 2013 at 12:11 PM, MC Return <email address hidden> wrote:
> Ping ?
> --
> https:/
> Your team Compiz Maintainers is requested to review the proposed merge of lp:~mc-return/compiz/compiz.merge-fix1082001-gridded-windows-jump-workspaces into lp:compiz.
--
Sam Spilsbury
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> Hey, I'm pretty busy at the moment. I'll get on to this ASAP.
>
Please take your time. I am honestly sorry for stressing.
I am just so excited that this MP already fixes 3 IMHO important
Grid usability bugs and so I was curious about your opinion... ;)
I will continue to work on it in the meantime, because I am
confident now that I am able to fully fix the bugs linked here...
Once all the bugs are fixed, I want to continue with optimization
of the logic and splitting out the various codeparts into separate
functions... - but this should probably be made in a separate MP
as this diff is already large enough, which complicates your review
effort (I am sorry for that)...
I can only ensure you that all changes are tested well and extensively
and manually by myself, which reduces the risk of errors or regressions
slipping through undetected ->
http://
is an example for this ;)
Hope that I have all Grid bugs fixed, once you get to the review ;)
Sami Jaktholm (sjakthol) wrote : Posted in a previous version of this proposal | # |
Some thoughts:
1) Top or bottom gridded windows can't be restored by dragging. The window does move up and down but doesn't snap off without pressing restore button/key (seems to be the default behavior for horizontally maximized windows).
2) Code duplication for GridTop || GridBottom case in initiateCommon. This could go like:
if Top || Bottom || Left || Right
*restore original geometry and change sizeHints*
Resized = false
if Top || Bottom
else
3) The easiest solution to fix bug 1082001 is to make expo send start/end_
The first point definitely needs fixing, the second one is just an opinion...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
Hey sampo555 :)
Thanks a lot 4 your review, it is very appreciated.
> Some thoughts:
> 1) Top or bottom gridded windows can't be restored by dragging. The window
> does move up and down but doesn't snap off without pressing restore button/key
> (seems to be the default behavior for horizontally maximized windows).
>
I did not notice that problem, because on multimonitor systems it snaps off, once
your pointer crosses monitors when dragging.
I also have "Rotate Cube"->"Edge Flip DnD" enabled, which makes the top/bottom
gridded window restore as well.
But of course this should be no excuse. I'll try to find the problem and fix it.
> 2) Code duplication for GridTop || GridBottom case in initiateCommon. This
> could go like:
> if Top || Bottom || Left || Right
> *restore original geometry and change sizeHints*
> Resized = false
>
> if Top || Bottom
> maximize(HorzMask)
> HorzMaximized = true
> VertMaximized = false
> else
> maximize(VertMask)
> HorzMaximized = false
> VertMaximized = true
>
Yes. Will fix that also (was already on the TODO list).
> 3) The easiest solution to fix bug 1082001 is to make expo send
> start/end_
> listens for those events and knows not to block the window movement while
> viewport switch is in progress. Currently only wall and rotate are emitting
> those events although expo and cube are also triggering viewport switches (so
> cube might need the change too).
>
Very good observation. Actually awesome, sounds like the key to the solution. \o/
I still was unsure about the best way to approach the problem...
I think I'll have to conduct some experiments with that...
> The first point definitely needs fixing, the second one is just an opinion...
>
All of your points are valid and your review is very welcome.
They'll all get fixed ;).
sampo555, thanks for your involvement with Compiz.
I hope to see some new MPs from you soon...
P.S.: I'll change the status of this MP to "WIP", but additional comments are
always welcome...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
@sampo55:
Did some experiments with making expo send the start/end_
The main new problem I got by doing that, was that Expo drag-and-dropping windows failed to work once Expo announces start_viewport_
I am quite clueless @ the moment, so if you have a working solution or did experiments yourself, please propose a MP, so we can test it...
Sami Jaktholm (sjakthol) wrote : Posted in a previous version of this proposal | # |
I don't have any code to show as I just checked what wall did but expo didn't. As DnD fails, I assume you're emitting those events right when expo starts/quits(?). If you emit the events only when expo calls moveViewport, it shouldn't affect DnD windows (emitting those events equals to situation without grid). So something like this could work:
screen-
screen-
screen-
I don't have time to test it right now, but I can try it later...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> I don't have any code to show as I just checked what wall did but expo didn't.
> As DnD fails, I assume you're emitting those events right when expo
> starts/quits(?). If you emit the events only when expo calls moveViewport, it
> shouldn't affect DnD windows (emitting those events equals to situation
> without grid). So something like this could work:
> screen-
> CompOption:
> screen-
> screen-
> CompOption:
>
> I don't have time to test it right now, but I can try it later...
Yeah - that might indeed be the problem. I'll try that and will report here...
Thanks 4 your involvement, sampo555 - and sorry for spelling your synonym
incorrectly before ;)
Sami Jaktholm (sjakthol) wrote : Posted in a previous version of this proposal | # |
That seems to work, but there's still a problem as gridded windows (corners) can't be dragged anywhere in expo (also present in the current trunk). That's because grid ignores the fact that window is dragged in expo (for valid reasons) but still stops the window from moving.
Seems a bit tricky to get this one right :)
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> That seems to work, but there's still a problem as gridded windows (corners)
> can't be dragged anywhere in expo (also present in the current trunk). That's
> because grid ignores the fact that window is dragged in expo (for valid
> reasons) but still stops the window from moving.
>
> Seems a bit tricky to get this one right :)
Hehe, tricky describes it perfectly ;)
It would really be nice if you could propose the expo/cube code, as I did just get
to the point, where gridded corner windows do not jump viewports anymore, but I am
not able to drag any window in expo mode currently, which is ofc inacceptable...
Other observations:
In trunk it is currently possible to drag and drop corner-gridded windows in expo,
just dragging itself is not animated and the window disappears in one viewport and
suddenly pops up in the viewport it is dragged to once you release the mousebutton...
But on multimonitor systems it is not possible to drag the same windows from one
screen to the other, just from viewport to viewport...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
One other point:
Seems the cube does not need any changes, as just rotate cube seems to be responsible
for moving windows...
If you unfold the cube (which is a cube option) and change workspace corner-gridded
windows stay in their position, so it seems no fix is needed here...
Sami Jaktholm (sjakthol) wrote : Posted in a previous version of this proposal | # |
It seems to be very tricky to restore the gridded window inside expo. We can't use pointer location to calculate the restored position as it's absolute to the screen, not relative to expo viewport. We also can't restore it to original location as it might jump anywhere.
So there's pretty much two solutions:
1) Restore the window in place. Problem: the restored window might detach from the pointer, if the it's smaller than the gridded window (depending on where user grabs the window). This can't be easily solved as we don't know where the pointer is relative to the window.
2) Don't restore the window. If the window is moved inside expo, just forgot that it's gridded. This is less likely to cause any issues but it's not consistent with rest of grid behavior or nice thing to do to the user (I wouldn't like it).
Personally I like the first one more as it has a chance to get it right at least some times. The second option just feels a little broken. Anyways, an implementation of the first option can be found from lp:~sjakthol/compiz/grid-expo-interaction. Please test it, and if you think it's good, you can merge it to your branch and start debugging those horizontally maximized windows.
(I'm still the same guy - just did some profile reconfiguration)
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> It seems to be very tricky to restore the gridded window inside expo. We can't
> use pointer location to calculate the restored position as it's absolute to
> the screen, not relative to expo viewport. We also can't restore it to
> original location as it might jump anywhere.
>
> So there's pretty much two solutions:
> 1) Restore the window in place. Problem: the restored window might detach from
> the pointer, if the it's smaller than the gridded window (depending on where
> user grabs the window). This can't be easily solved as we don't know where the
> pointer is relative to the window.
> 2) Don't restore the window. If the window is moved inside expo, just forgot
> that it's gridded. This is less likely to cause any issues but it's not
> consistent with rest of grid behavior or nice thing to do to the user (I
> wouldn't like it).
>
> Personally I like the first one more as it has a chance to get it right at
> least some times. The second option just feels a little broken. Anyways, an
> implementation of the first option can be found from lp:~sjakthol/compiz/grid-
> expo-interaction. Please test it, and if you think it's good, you can merge it
> to your branch and start debugging those horizontally maximized windows.
>
> (I'm still the same guy - just did some profile reconfiguration)
Hi, Sami Jaktholm :)
I've tested your branch now and this looks like another big improvement to me.
Everything works exactly like you described. Top job !
I also think that the solution you found is our best bet at the moment and it
will still affect just corner- and center-gridded windows to restore to original
size when dragged inside expo.
This solution is just slightly inconsistent, compared to the behaviour of grid-
semi-maximized and maximized windows, which will keep their size when dragged to
a new viewport - but it is 100 times better than the version we have in trunk now,
which also acts inconsistent and makes gridded windows jump around and follow the
user's moves in expo...
Restoring the window to original size is always the best solution, because gridding
it back requires just one shortcut, while it can be nerving to have to manually resize
to get back to original size.
Btw, there is still a working workaround for users, who want to move a corner- or center-
gridded window from one workspace to another (rotate to cube face with window) - this
one works perfectly for gridded windows as well...
I still have to apply your other improvements here, and still have to find a solution
for snapping off horizontally maximized windows correctly and easily...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> Some thoughts:
> 1) Top or bottom gridded windows can't be restored by dragging. The window
> does move up and down but doesn't snap off without pressing restore button/key
> (seems to be the default behavior for horizontally maximized windows).
Yes. The problem is actually hidden in the move plugin. The option SnapoffMaximized ()
does not take care of & CompWindowState
You can easily check this wrong behaviour by horizontally maximizing a window by
right-mousebutton clicking the maximize button and you'll get the same behaviour
like for top and bottom gridded windows with this branch here...
Actually I should file another bug and fix that in another branch I guess, but I
do not know, maybe I'll simply attach another bug report here...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
I have now filed bug #1165198 about "Horizontally semi-maximized windows do not snap off easily"...
@Sami Jaktholm: Can you confirm ?
Sami Jaktholm (sjakthol) wrote : Posted in a previous version of this proposal | # |
A second branch might be a better solution. Let's keep this as a fix for grid&expo problem only. Once the other fix lands, I'm ok with this (although I'm probably not the best judge as I have very narrow understanding of how this stuff actually works).
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> A second branch might be a better solution. Let's keep this as a fix for
> grid&expo problem only. Once the other fix lands, I'm ok with this (although
> I'm probably not the best judge as I have very narrow understanding of how
> this stuff actually works).
Okay. The fix for the move snapoff problem should be relatively easy. I already
got a working solution (just a quick hack), but I am confident I can fix this
correctly soonish...
If you are interested: the problem is hidden in static void moveHandleMotio
There:
if (ms->optionGetS
does not check:
if (w->state () & CompWindowState
and thus Compiz has no strategy to snap off a horizontally semi-maximized window...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> A second branch might be a better solution. Let's keep this as a fix for
> grid&expo problem only. Once the other fix lands, I'm ok with this (although
> I'm probably not the best judge as I have very narrow understanding of how
> this stuff actually works).
I've uploaded the fix for bug #1165198 to this branch now anyway as it is somehow
related and is very separated fromthe rest (as the fix is in the move plugin).
Re-review and re-test needed ;)
Sami Jaktholm (sjakthol) wrote : Posted in a previous version of this proposal | # |
The change to move code might cause a change in behavior in a corner case. If the window is HorzMaximized but not VertMaximized, the code will never enter the next else if clause (where it would remaximize the window) as it returns in the new else if block. However I haven't found a way to trigger this case so it shouldn't be a problem.
I still think you should split these changes up as the move changes have nothing to do with the original problem.
Other than that, it looks good and works fine.
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
Hey Sami :)
Thanks for the review and testing.
I have tested the changes extensively as well and could find no regressions.
/offtopic on
But during testing I found a new bug unfortunately... it seems to have nothing to do with this MP and can be reproduced in trunk as well, but a multimonitor system is needed:
1.Semi-maximize horizontally or maximize a window on monitor 2
2.Change the viewport
3.Switch back to your window with a switcher, or via click on its icon in a dock/launcher
Result: The viewport will change correctly, but the window will move to the main monitor and maximize/
Can you reproduce this also (without this branch) ?
/offtopic off
Regarding move: Sure, I can make a new MP for that - my only personal problem is that my SSD is 96,8% full and each
MP with a compiled/tested Compiz build takes another 400MB away ;) - so I am quite handicapped with available space @ the moment...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
I've changed the partial fixes in the commit message to numbers, but I might have to remove the linked bug reports, so launchpad won't auto-track them and change them to "Fix Committed" when committing this to trunk, but I'll better adjust the status of those manually after the merge...
Sami Jaktholm (sjakthol) wrote : Posted in a previous version of this proposal | # |
I don't have a second monitor to test that.
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> I don't have a second monitor to test that.
No problem, seems to be completely unrelated anyway... will check that one @ a later stage...
We are now bailing out if we are repeating the same action:
Probably this would have been enough:
if (gw->lastTarget == where &&
gw-
return false
but it works now also (with a little bit of redundancy in the condition check) ;)
I'll have to optimize that a bit...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
Okay, behaviour is configurable now (at least for corner and center gridded windows), so we won't regress for noone...
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
Made the behaviour now fully configurable for all gridded windows.
Sami Jaktholm (sjakthol) wrote : Posted in a previous version of this proposal | # |
This has way too much going on. Please split these changes up (one fix per MP).
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
> This has way too much going on. Please split these changes up (one fix per
> MP).
I will explain first what happened after r3652, which is the last revision
you approved...
Btw, there are subcommits, which all have their own diff - making it easier
to follow development:
In
http://
I forbid cycling through different sizes for corner and center-gridded
windows also, now fully fixing bug #878820 and following the design
specification for now.
In
http://
I simplified the condition check to bail out if the last target was the
same like the current one to prevent corner and centered windows from
cycling through sizes, so that it looked like this:
if (gw->lastTarget == where &&
gw-
return false;
That means we bail out if the last target is the same as current one and
the window is already grid-resized, so we won't resize a corner/center
gridded window again.
In
http://
I added a cycle_sizes bool option, which allows the user to choose the
prefered behaviour (fixed versus flexible sizes on multiple presses
on the same grid keyboard shortcut).
Default of this option is off, cycling disabled as specified by design.
This is the relevant part in the xml, the rest are just minor punctuation/
wording fixes:
<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>
The only code change in this revision is this:
/* We do not want to allow cycling through sizes,
* unless the user explicitely specified that in CCSM */
if (gw->lastTarget == where &&
gw-
!optionGetC
return false;
That means we allow to cycle center and corner gridded
windows now, if the user specifies explicitly in CCSM.
In the final revision
http://
I had to implement the same choice for the rest of the
grid windows, namely left/right/
act like normal grid windows, if the user selects the
"want to cycle through sizes" option in CCSM
Voila, everything works perfectly :)
MC Return (mc-return) wrote : Posted in a previous version of this proposal | # |
I've separated the change to the move plugin now from the rest.
You can find the MP here:
https:/
Sam Spilsbury (smspillaz) wrote : | # |
Hey MCR1. Excellent work, here's some comments so far.
8 + CompOption::Vector o(0);
9 dndWindow-
10
11 + screen-
I believe there is a constant somewhere, either as a static member of CompOption or just as a global called "noOptions". I'd suggest using that.
43 - <_long>Warp and resize windows to fit an imaginary grid.</_long>
44 + <_long>Warp and resize windows to fit an imaginary grid</_long>
45 <category>Window Management<
46 <deps>
47 <requirement>
48 @@ -83,7 +83,7 @@
49 <_long>Window resize action</_long>
50 <option name="top_
51 <_short>Upper Left Corner</_short>
52 - <_long>Action to be performed when window is dropped on the top left corner</_long>
53 + <_long>Action to be performed when window is dropped on the top left corner.</_long>
Try to avoid mixing formatting changes with substantive changes.
319 - * computing what the 33% and 66% offsets would be
320 - */
321 + * computing what the 33% and 66% offsets would be
322 + */
I think that's probably an undesired formatting change.
Statements like this:
377 + if (where & GridLeft || where & GridRight ||
378 + where & GridTop || where & GridBottom)
And this:
308 + (where & ~(GridMaximize) ||
309 + (where & ~(GridLeft | GridRight | GridTop | GridBottom) &&
Can be combined, eg
unsigned int VerticalGrid = GridLeft | GridRight;
unsigned int HorizontalGrid = GridTop | GridBottom;
unsigned int ConstrainedGrid = VerticalGrid | HorizontalGrid | GridMaximize;
if (where & ~ConstrinedGrid)
...
if (where & VerticalGrid)
{
}
else if (where & HorizontalGrid)
{
}
530 + else if (!gw->isGridResized &&
531 + gw->isGridHorzM
532 + !gw->isGridVert
533 + {
534 + /* Window has been horizontally maximized by grid. We only need
535 + * to restore Y and height - core handles X and width. */
536 + if (gw->sizeHintsF
537 + gw->window-
538 + xwcm |= CWY | CWHeight;
539 + }
540 + else if (!gw->isGridResized &&
541 + !gw->isGridHorz
542 + gw->isGridVertM
543 {
544 /* Window has been vertically maximized by grid. We only need
545 - * to restore the X and width - core handles Y and height. */
546 + * to restore X and width - core handles Y and height. */
547 if (gw->sizeHintsF
548 gw->window-
549 xwcm |= CWX | CWWidth;
550 }
551 -
552 - else if (gw->isGridResized && !gw->isGridSemi
553 - /* Window is just gridded (top, bottom, center, corners). We
554 - * need to handle everything. */
555 + else if (gw->isGridResized &&
556 + !gw->isGridHorz
557 + !gw->isGridVert
558 + /* Window is just gridded (center, corners).
559 + * We need to handle everything. */
It might make sense to nest these blocks.
if (!isGridResized)
{
assert (isGridHorzMaxi
if (isGridHorzMaxi
{
...
}
else if (isGridVertMaxi
...
MC Return (mc-return) wrote : | # |
> Hey MCR1. Excellent work, here's some comments so far.
>
Hi Sam. First of all thanks for the review. It is very appreciated.
> 8 + CompOption::Vector o(0);
> 9 dndWindow-
> 10
> 11 + screen-
>
> I believe there is a constant somewhere, either as a static member of
> CompOption or just as a global called "noOptions". I'd suggest using that.
>
I am not sure where to find that, but I'll search...
> 43 - <_long>Warp and resize windows to fit an imaginary
> grid.</_long>
> 44 + <_long>Warp and resize windows to fit an imaginary
> grid</_long>
> 45 <category>Window Management<
> 46 <deps>
> 47 <requirement>
> 48 @@ -83,7 +83,7 @@
> 49 <_long>Window resize action</_long>
> 50 <option name="top_
> type="int">
> 51 <_short>Upper Left Corner</_short>
> 52 - <_long>Action to be performed when window
> is dropped on the top left corner</_long>
> 53 + <_long>Action to be performed when window
> is dropped on the top left corner.</_long>
>
> Try to avoid mixing formatting changes with substantive changes.
>
I am sorry - I just can't help myself. I want to harmonize how plugins and their
tooltips look & feel, so if I am fixing stuff in the xml - I automatically just
have to fix those also...
> 319 - * computing what the 33% and 66% offsets would be
> 320 - */
> 321 + * computing what the 33% and 66% offsets would be
> 322 + */
>
> I think that's probably an undesired formatting change.
>
Not sure, have to check...
> Statements like this:
>
> 377 + if (where & GridLeft || where & GridRight ||
> 378 + where & GridTop || where & GridBottom)
>
> And this:
>
> 308 + (where & ~(GridMaximize) ||
> 309 + (where & ~(GridLeft | GridRight | GridTop | GridBottom)
> &&
>
> Can be combined, eg
>
> unsigned int VerticalGrid = GridLeft | GridRight;
> unsigned int HorizontalGrid = GridTop | GridBottom;
> unsigned int ConstrainedGrid = VerticalGrid | HorizontalGrid | GridMaximize;
>
> if (where & ~ConstrinedGrid)
>
> ...
>
> if (where & VerticalGrid)
> {
> }
> else if (where & HorizontalGrid)
> {
> }
>
Yeah, I did not touch that any further for the sake of the diffs' size and
readability, but if you want me to fix it in this MP, I'll do it...
> 530 + else if (!gw->isGridResized &&
> 531 + gw->isGridHorzM
> 532 + !gw->isGridVert
> 533 + {
> 534 + /* Window has been horizontally maximized by grid. We only
> need
> 535 + * to restore Y and height - core handles X and width. */
> 536 + if (gw->sizeHintsF
> 537 + gw->window-
> 538 + xwcm |= CWY | CWHeight;
> 539 + }
> 540 + else if...
MC Return (mc-return) wrote : | # |
> Hey MCR1. Excellent work, here's some comments so far.
>
> 8 + CompOption::Vector o(0);
> 9 dndWindow-
> 10
> 11 + screen-
>
> I believe there is a constant somewhere, either as a static member of
> CompOption or just as a global called "noOptions". I'd suggest using that.
>
Hmm, I do not know exactly what to change here, as searching through the code
shows it is almost always used like that, if there are no options - this is from
wall.cpp for example:
CompOption:
...
...
screen-
I am quite clueless here, but the version we use seems correct...
MC Return (mc-return) wrote : | # |
> > 319 - * computing what the 33% and 66% offsets would be
> > 320 - */
> > 321 + * computing what the 33% and 66% offsets would
> be
> > 322 + */
> >
> > I think that's probably an undesired formatting change.
> >
Fixed (not yet pushed).
- 3659. By MC Return
-
Grid xml:
Improved tooltip for the "put_restore_key" reflecting it's enhanced
functionality. - 3660. By MC Return
-
Merged Grid from latest lp:compiz
Simplified bool GridScreen:
:restoreWindow (...):
If Grid has not touched the window we return false and let core do the
dirty work (Thanks go to Sam Spilsbury for suggesting this)Improved the CCSM grid restore tooltip
- 3661. By MC Return
-
Merged latest lp:compiz
Unmerged revisions
- 3661. By MC Return
-
Merged latest lp:compiz
- 3660. By MC Return
-
Merged Grid from latest lp:compiz
Simplified bool GridScreen:
:restoreWindow (...):
If Grid has not touched the window we return false and let core do the
dirty work (Thanks go to Sam Spilsbury for suggesting this)Improved the CCSM grid restore tooltip
- 3659. By MC Return
-
Grid xml:
Improved tooltip for the "put_restore_key" reflecting it's enhanced
functionality. - 3658. By MC Return
-
Grid:
We want to use the same functionality like the unmaximize_or_minimize_ window
shortcut normally provides, so if our window has not been touched by grid, we
will do the same with that window that core would normally do
(see src/actions.cpp, unmaximizeOrMinimizeWin and
launchpad bug LP: #1116538 for details)Note: If we use the same shortcut for unmaximize_
or_minimize_ window_ key (core)
and put_restore_key (grid) core will take over again, if grid gets disabled
If grid is enabled the unmaximize_or_minimize_ window_ key will be overridden,
because core always loads first and grid laterAlso note that this commit did not change any shortcut yet, but just provides
the functionality for grid - Please use your grid restore keybinding like you
would use the unmaximize_or_minimize_ window_ key normally to test
Preview Diff
1 | === modified file 'plugins/expo/src/expo.cpp' | |||
2 | --- plugins/expo/src/expo.cpp 2013-03-26 22:02:39 +0000 | |||
3 | +++ plugins/expo/src/expo.cpp 2013-04-08 20:23:21 +0000 | |||
4 | @@ -247,10 +247,13 @@ | |||
5 | 247 | void | 247 | void |
6 | 248 | ExpoScreen::finishWindowMovement () | 248 | ExpoScreen::finishWindowMovement () |
7 | 249 | { | 249 | { |
8 | 250 | CompOption::Vector o(0); | ||
9 | 250 | dndWindow->ungrabNotify (); | 251 | dndWindow->ungrabNotify (); |
10 | 251 | 252 | ||
11 | 253 | screen->handleCompizEvent ("expo", "start_viewport_switch", o); | ||
12 | 252 | screen->moveViewport (screen->vp ().x () - selectedVp.x (), | 254 | screen->moveViewport (screen->vp ().x () - selectedVp.x (), |
13 | 253 | screen->vp ().y () - selectedVp.y (), true); | 255 | screen->vp ().y () - selectedVp.y (), true); |
14 | 256 | screen->handleCompizEvent ("expo", "end_viewport_switch", o); | ||
15 | 254 | 257 | ||
16 | 255 | /* update saved window attributes in case we moved the | 258 | /* update saved window attributes in case we moved the |
17 | 256 | window to a new viewport */ | 259 | window to a new viewport */ |
18 | @@ -486,6 +489,8 @@ | |||
19 | 486 | void | 489 | void |
20 | 487 | ExpoScreen::donePaint () | 490 | ExpoScreen::donePaint () |
21 | 488 | { | 491 | { |
22 | 492 | CompOption::Vector o(0); | ||
23 | 493 | screen->handleCompizEvent ("expo", "start_viewport_switch", o); | ||
24 | 489 | switch (vpUpdateMode) { | 494 | switch (vpUpdateMode) { |
25 | 490 | case VPUpdateMouseOver: | 495 | case VPUpdateMouseOver: |
26 | 491 | screen->moveViewport (screen->vp ().x () - selectedVp.x (), | 496 | screen->moveViewport (screen->vp ().x () - selectedVp.x (), |
27 | @@ -504,6 +509,7 @@ | |||
28 | 504 | default: | 509 | default: |
29 | 505 | break; | 510 | break; |
30 | 506 | } | 511 | } |
31 | 512 | screen->handleCompizEvent ("expo", "end_viewport_switch", o); | ||
32 | 507 | 513 | ||
33 | 508 | if ((expoCam > 0.0f && expoCam < 1.0f) || dndState != DnDNone) | 514 | if ((expoCam > 0.0f && expoCam < 1.0f) || dndState != DnDNone) |
34 | 509 | cScreen->damageScreen (); | 515 | cScreen->damageScreen (); |
35 | 510 | 516 | ||
36 | === modified file 'plugins/grid/grid.xml.in' | |||
37 | --- plugins/grid/grid.xml.in 2013-01-16 23:12:46 +0000 | |||
38 | +++ plugins/grid/grid.xml.in 2013-04-08 20:23:21 +0000 | |||
39 | @@ -2,7 +2,7 @@ | |||
40 | 2 | <compiz> | 2 | <compiz> |
41 | 3 | <plugin name="grid" useBcop="true"> | 3 | <plugin name="grid" useBcop="true"> |
42 | 4 | <_short>Grid</_short> | 4 | <_short>Grid</_short> |
44 | 5 | <_long>Warp and resize windows to fit an imaginary grid.</_long> | 5 | <_long>Warp and resize windows to fit an imaginary grid</_long> |
45 | 6 | <category>Window Management</category> | 6 | <category>Window Management</category> |
46 | 7 | <deps> | 7 | <deps> |
47 | 8 | <requirement> | 8 | <requirement> |
48 | @@ -83,7 +83,7 @@ | |||
49 | 83 | <_long>Window resize action</_long> | 83 | <_long>Window resize action</_long> |
50 | 84 | <option name="top_left_corner_action" type="int"> | 84 | <option name="top_left_corner_action" type="int"> |
51 | 85 | <_short>Upper Left Corner</_short> | 85 | <_short>Upper Left Corner</_short> |
53 | 86 | <_long>Action to be performed when window is dropped on the top left corner</_long> | 86 | <_long>Action to be performed when window is dropped on the top left corner.</_long> |
54 | 87 | <default>4</default> | 87 | <default>4</default> |
55 | 88 | <min>0</min> | 88 | <min>0</min> |
56 | 89 | <max>10</max> | 89 | <max>10</max> |
57 | @@ -134,7 +134,7 @@ | |||
58 | 134 | </option> | 134 | </option> |
59 | 135 | <option name="top_edge_action" type="int"> | 135 | <option name="top_edge_action" type="int"> |
60 | 136 | <_short>Top Edge</_short> | 136 | <_short>Top Edge</_short> |
62 | 137 | <_long>Action to be performed when window is dropped on the top edge</_long> | 137 | <_long>Action to be performed when window is dropped on the top edge.</_long> |
63 | 138 | <default>10</default> | 138 | <default>10</default> |
64 | 139 | <min>0</min> | 139 | <min>0</min> |
65 | 140 | <max>10</max> | 140 | <max>10</max> |
66 | @@ -185,7 +185,7 @@ | |||
67 | 185 | </option> | 185 | </option> |
68 | 186 | <option name="top_right_corner_action" type="int"> | 186 | <option name="top_right_corner_action" type="int"> |
69 | 187 | <_short>Upper Right Corner</_short> | 187 | <_short>Upper Right Corner</_short> |
71 | 188 | <_long>Action to be performed when window is dropped on the top right corner</_long> | 188 | <_long>Action to be performed when window is dropped on the top right corner.</_long> |
72 | 189 | <default>6</default> | 189 | <default>6</default> |
73 | 190 | <min>0</min> | 190 | <min>0</min> |
74 | 191 | <max>10</max> | 191 | <max>10</max> |
75 | @@ -236,7 +236,7 @@ | |||
76 | 236 | </option> | 236 | </option> |
77 | 237 | <option name="left_edge_action" type="int"> | 237 | <option name="left_edge_action" type="int"> |
78 | 238 | <_short>Left Edge</_short> | 238 | <_short>Left Edge</_short> |
80 | 239 | <_long>Action to be performed when window is dropped on the left edge</_long> | 239 | <_long>Action to be performed when window is dropped on the left edge.</_long> |
81 | 240 | <default>4</default> | 240 | <default>4</default> |
82 | 241 | <min>0</min> | 241 | <min>0</min> |
83 | 242 | <max>10</max> | 242 | <max>10</max> |
84 | @@ -287,7 +287,7 @@ | |||
85 | 287 | </option> | 287 | </option> |
86 | 288 | <option name="right_edge_action" type="int"> | 288 | <option name="right_edge_action" type="int"> |
87 | 289 | <_short>Right Edge</_short> | 289 | <_short>Right Edge</_short> |
89 | 290 | <_long>Action to be performed when window is dropped on the right edge</_long> | 290 | <_long>Action to be performed when window is dropped on the right edge.</_long> |
90 | 291 | <default>6</default> | 291 | <default>6</default> |
91 | 292 | <min>0</min> | 292 | <min>0</min> |
92 | 293 | <max>10</max> | 293 | <max>10</max> |
93 | @@ -338,7 +338,7 @@ | |||
94 | 338 | </option> | 338 | </option> |
95 | 339 | <option name="bottom_left_corner_action" type="int"> | 339 | <option name="bottom_left_corner_action" type="int"> |
96 | 340 | <_short>Bottom Left Corner</_short> | 340 | <_short>Bottom Left Corner</_short> |
98 | 341 | <_long>Action to be performed when window is dropped on the bottom left corner</_long> | 341 | <_long>Action to be performed when window is dropped on the bottom left corner.</_long> |
99 | 342 | <default>4</default> | 342 | <default>4</default> |
100 | 343 | <min>0</min> | 343 | <min>0</min> |
101 | 344 | <max>10</max> | 344 | <max>10</max> |
102 | @@ -389,7 +389,7 @@ | |||
103 | 389 | </option> | 389 | </option> |
104 | 390 | <option name="bottom_edge_action" type="int"> | 390 | <option name="bottom_edge_action" type="int"> |
105 | 391 | <_short>Bottom Edge</_short> | 391 | <_short>Bottom Edge</_short> |
107 | 392 | <_long>Action to be performed when window is dropped on the bottom edge</_long> | 392 | <_long>Action to be performed when window is dropped on the bottom edge.</_long> |
108 | 393 | <default>0</default> | 393 | <default>0</default> |
109 | 394 | <min>0</min> | 394 | <min>0</min> |
110 | 395 | <max>10</max> | 395 | <max>10</max> |
111 | @@ -440,7 +440,7 @@ | |||
112 | 440 | </option> | 440 | </option> |
113 | 441 | <option name="bottom_right_corner_action" type="int"> | 441 | <option name="bottom_right_corner_action" type="int"> |
114 | 442 | <_short>Bottom Right Corner</_short> | 442 | <_short>Bottom Right Corner</_short> |
116 | 443 | <_long>Action to be performed when window is dropped on the bottom right corner</_long> | 443 | <_long>Action to be performed when window is dropped on the bottom right corner.</_long> |
117 | 444 | <default>6</default> | 444 | <default>6</default> |
118 | 445 | <min>0</min> | 445 | <min>0</min> |
119 | 446 | <max>10</max> | 446 | <max>10</max> |
120 | @@ -490,42 +490,47 @@ | |||
121 | 490 | </desc> | 490 | </desc> |
122 | 491 | </option> | 491 | </option> |
123 | 492 | <option name="snapoff_maximized" type="bool"> | 492 | <option name="snapoff_maximized" type="bool"> |
126 | 493 | <_short>Snapoff maximized windows</_short> | 493 | <_short>Snapoff Maximized/Semi-maximized Windows</_short> |
127 | 494 | <_long>Snapoff maximized windows when pulling to edge.</_long> | 494 | <_long>Snapoff maximized and vertically maximized windows by dragging them up or down and horizontally maximized ones by dragging them left or right.</_long> |
128 | 495 | <default>false</default> | 495 | <default>false</default> |
129 | 496 | </option> | 496 | </option> |
130 | 497 | <option name="snapback_windows" type="bool"> | 497 | <option name="snapback_windows" type="bool"> |
132 | 498 | <_short>Snap windows back to original size</_short> | 498 | <_short>Snap Windows Back To Original Size</_short> |
133 | 499 | <_long>Snaps windows back to their original size if dragged away from their gridded position.</_long> | 499 | <_long>Snaps windows back to their original size if dragged away from their gridded position.</_long> |
134 | 500 | <default>true</default> | 500 | <default>true</default> |
135 | 501 | </option> | 501 | </option> |
136 | 502 | <option name="cycle_sizes" type="bool"> | ||
137 | 503 | <_short>Cycle Through Multiple Sizes</_short> | ||
138 | 504 | <_long>Cycle through multiple different sizes by using the same keyboard shortcut multiple times in a row.</_long> | ||
139 | 505 | <default>false</default> | ||
140 | 506 | </option> | ||
141 | 502 | </subgroup> | 507 | </subgroup> |
142 | 503 | <subgroup> | 508 | <subgroup> |
143 | 504 | <_short>Thresholds</_short> | 509 | <_short>Thresholds</_short> |
144 | 505 | <option name="left_edge_threshold" type="int"> | 510 | <option name="left_edge_threshold" type="int"> |
145 | 506 | <_short>Left Edge</_short> | 511 | <_short>Left Edge</_short> |
147 | 507 | <_long>Maximum number of pixels from the left edge a window can be dropped</_long> | 512 | <_long>Maximum number of pixels from the left edge a window can be dropped.</_long> |
148 | 508 | <default>15</default> | 513 | <default>15</default> |
149 | 509 | <min>0</min> | 514 | <min>0</min> |
150 | 510 | <max>500</max> | 515 | <max>500</max> |
151 | 511 | </option> | 516 | </option> |
152 | 512 | <option name="right_edge_threshold" type="int"> | 517 | <option name="right_edge_threshold" type="int"> |
153 | 513 | <_short>Right Edge</_short> | 518 | <_short>Right Edge</_short> |
155 | 514 | <_long>Maximum number of pixels from the right edge a window can be dropped</_long> | 519 | <_long>Maximum number of pixels from the right edge a window can be dropped.</_long> |
156 | 515 | <default>15</default> | 520 | <default>15</default> |
157 | 516 | <min>0</min> | 521 | <min>0</min> |
158 | 517 | <max>500</max> | 522 | <max>500</max> |
159 | 518 | </option> | 523 | </option> |
160 | 519 | <option name="top_edge_threshold" type="int"> | 524 | <option name="top_edge_threshold" type="int"> |
161 | 520 | <_short>Top Edge</_short> | 525 | <_short>Top Edge</_short> |
163 | 521 | <_long>Maximum number of pixels from the top edge a window can be dropped</_long> | 526 | <_long>Maximum number of pixels from the top edge a window can be dropped.</_long> |
164 | 522 | <default>20</default> | 527 | <default>20</default> |
165 | 523 | <min>0</min> | 528 | <min>0</min> |
166 | 524 | <max>500</max> | 529 | <max>500</max> |
167 | 525 | </option> | 530 | </option> |
168 | 526 | <option name="bottom_edge_threshold" type="int"> | 531 | <option name="bottom_edge_threshold" type="int"> |
169 | 527 | <_short>Bottom Edge</_short> | 532 | <_short>Bottom Edge</_short> |
171 | 528 | <_long>Maximum number of pixels from the Bottom edge a window can be dropped</_long> | 533 | <_long>Maximum number of pixels from the bottom edge a window can be dropped.</_long> |
172 | 529 | <default>5</default> | 534 | <default>5</default> |
173 | 530 | <min>0</min> | 535 | <min>0</min> |
174 | 531 | <max>500</max> | 536 | <max>500</max> |
175 | @@ -535,24 +540,24 @@ | |||
176 | 535 | <group> | 540 | <group> |
177 | 536 | <_short>Appearance</_short> | 541 | <_short>Appearance</_short> |
178 | 537 | <option name="draw_indicator" type="bool"> | 542 | <option name="draw_indicator" type="bool"> |
181 | 538 | <_short>Draw Indicator</_short> | 543 | <_short>Preview Indicator</_short> |
182 | 539 | <_long>Draw Window Resize Indicator</_long> | 544 | <_long>Draw a window resize indicator preview.</_long> |
183 | 540 | <default>true</default> | 545 | <default>true</default> |
184 | 541 | </option> | 546 | </option> |
185 | 542 | <option name="draw_stretched_window" type="bool"> | 547 | <option name="draw_stretched_window" type="bool"> |
188 | 543 | <_short>Draw Stretched Window</_short> | 548 | <_short>Stretched Live Window Preview</_short> |
189 | 544 | <_long>Draw stretched window animation</_long> | 549 | <_long>Draw a stretched live window content animation.</_long> |
190 | 545 | <default>true</default> | 550 | <default>true</default> |
191 | 546 | </option> | 551 | </option> |
192 | 547 | <option name="animation_duration" type="int"> | 552 | <option name="animation_duration" type="int"> |
195 | 548 | <_short>Animation Duration</_short> | 553 | <_short>Preview Animation Duration</_short> |
196 | 549 | <_long>Grid animation duration (in ms)</_long> | 554 | <_long>Preview animation duration (in ms).</_long> |
197 | 550 | <default>350</default> | 555 | <default>350</default> |
198 | 551 | <min>0</min> | 556 | <min>0</min> |
199 | 552 | </option> | 557 | </option> |
200 | 553 | <option name="outline_color" type="color"> | 558 | <option name="outline_color" type="color"> |
203 | 554 | <_short>Outline Color</_short> | 559 | <_short>Preview Outline Color</_short> |
204 | 555 | <_long>Color of the resize indicator outline</_long> | 560 | <_long>Color and opacity of the resize indicator preview outline.</_long> |
205 | 556 | <default> | 561 | <default> |
206 | 557 | <red>0xfbfb</red> | 562 | <red>0xfbfb</red> |
207 | 558 | <green>0x8b8b</green> | 563 | <green>0x8b8b</green> |
208 | @@ -561,8 +566,8 @@ | |||
209 | 561 | </default> | 566 | </default> |
210 | 562 | </option> | 567 | </option> |
211 | 563 | <option name="fill_color" type="color"> | 568 | <option name="fill_color" type="color"> |
214 | 564 | <_short>Fill Color</_short> | 569 | <_short>Preview Fill Color</_short> |
215 | 565 | <_long>Fill color of the resize indicator</_long> | 570 | <_long>Fill color and opacity of the resize indicator preview.</_long> |
216 | 566 | <default> | 571 | <default> |
217 | 567 | <red>0xfbfb</red> | 572 | <red>0xfbfb</red> |
218 | 568 | <green>0x8b8b</green> | 573 | <green>0x8b8b</green> |
219 | 569 | 574 | ||
220 | === modified file 'plugins/grid/src/grid.cpp' | |||
221 | --- plugins/grid/src/grid.cpp 2013-03-22 11:58:33 +0000 | |||
222 | +++ plugins/grid/src/grid.cpp 2013-04-08 20:23:21 +0000 | |||
223 | @@ -63,7 +63,6 @@ | |||
224 | 63 | const CompRect& slot) | 63 | const CompRect& slot) |
225 | 64 | { | 64 | { |
226 | 65 | int cw, ch; | 65 | int cw, ch; |
227 | 66 | |||
228 | 67 | CompRect result = slotToRect (w, slot); | 66 | CompRect result = slotToRect (w, slot); |
229 | 68 | 67 | ||
230 | 69 | if (w->constrainNewWindowSize (result.width (), result.height (), &cw, &ch)) | 68 | if (w->constrainNewWindowSize (result.width (), result.height (), &cw, &ch)) |
231 | @@ -169,23 +168,23 @@ | |||
232 | 169 | if (props.numCellsX == 1) | 168 | if (props.numCellsX == 1) |
233 | 170 | centerCheck = true; | 169 | centerCheck = true; |
234 | 171 | 170 | ||
236 | 172 | if (!gw->isGridResized) | 171 | /* Do not overwrite the original size if we already have been gridded */ |
237 | 172 | if (!gw->isGridResized && !gw->isGridHorzMaximized && !gw->isGridVertMaximized) | ||
238 | 173 | /* Store size not including borders when using a keybinding */ | 173 | /* Store size not including borders when using a keybinding */ |
239 | 174 | gw->originalSize = slotToRect(cw, cw->serverBorderRect ()); | 174 | gw->originalSize = slotToRect(cw, cw->serverBorderRect ()); |
240 | 175 | } | 175 | } |
241 | 176 | 176 | ||
242 | 177 | if ((cw->state () & MAXIMIZE_STATE) && | 177 | if ((cw->state () & MAXIMIZE_STATE) && |
243 | 178 | (resize || optionGetSnapoffMaximized ())) | 178 | (resize || optionGetSnapoffMaximized ())) |
244 | 179 | { | ||
245 | 180 | /* maximized state interferes with us, clear it */ | 179 | /* maximized state interferes with us, clear it */ |
246 | 181 | cw->maximize (0); | 180 | cw->maximize (0); |
247 | 182 | } | ||
248 | 183 | 181 | ||
249 | 184 | if ((where & GridMaximize) && resize) | 182 | if ((where & GridMaximize) && resize) |
250 | 185 | { | 183 | { |
251 | 186 | /* move the window to the correct output */ | 184 | /* move the window to the correct output */ |
252 | 187 | if (cw == mGrabWindow) | 185 | if (cw == mGrabWindow) |
253 | 188 | { | 186 | { |
254 | 187 | /* TODO: Remove these magic numbers */ | ||
255 | 189 | xwc.x = workarea.x () + 50; | 188 | xwc.x = workarea.x () + 50; |
256 | 190 | xwc.y = workarea.y () + 50; | 189 | xwc.y = workarea.y () + 50; |
257 | 191 | xwc.width = workarea.width (); | 190 | xwc.width = workarea.width (); |
258 | @@ -198,7 +197,9 @@ | |||
259 | 198 | * gridded one. | 197 | * gridded one. |
260 | 199 | */ | 198 | */ |
261 | 200 | gw->isGridResized = false; | 199 | gw->isGridResized = false; |
263 | 201 | gw->isGridSemiMaximized = false; | 200 | gw->isGridHorzMaximized = false; |
264 | 201 | gw->isGridVertMaximized = false; | ||
265 | 202 | |||
266 | 202 | for (unsigned int i = 0; i < animations.size (); i++) | 203 | for (unsigned int i = 0; i < animations.size (); i++) |
267 | 203 | animations.at (i).fadingOut = true; | 204 | animations.at (i).fadingOut = true; |
268 | 204 | return true; | 205 | return true; |
269 | @@ -219,20 +220,46 @@ | |||
270 | 219 | (workarea.width () / props.numCellsX)); | 220 | (workarea.width () / props.numCellsX)); |
271 | 220 | desiredSlot.setWidth (workarea.width () / props.numCellsX); | 221 | desiredSlot.setWidth (workarea.width () / props.numCellsX); |
272 | 221 | 222 | ||
278 | 222 | /* Adjust for constraints and decorations */ | 223 | if (!optionGetCycleSizes ()) |
279 | 223 | if (where & ~(GridMaximize | GridLeft | GridRight)) | 224 | { |
280 | 224 | desiredRect = constrainSize (cw, desiredSlot); | 225 | /* Adjust for constraints and decorations */ |
281 | 225 | else | 226 | if (where & ~(GridMaximize | |
282 | 226 | desiredRect = slotToRect (cw, desiredSlot); | 227 | GridLeft | GridRight | GridTop | GridBottom)) |
283 | 228 | desiredRect = constrainSize (cw, desiredSlot); | ||
284 | 229 | else | ||
285 | 230 | desiredRect = slotToRect (cw, desiredSlot); | ||
286 | 231 | } | ||
287 | 232 | else /* (optionGetCycleSizes ()) */ | ||
288 | 233 | { | ||
289 | 234 | /* Adjust for constraints and decorations */ | ||
290 | 235 | if (where & ~GridMaximize) | ||
291 | 236 | desiredRect = constrainSize (cw, desiredSlot); | ||
292 | 237 | else | ||
293 | 238 | desiredRect = slotToRect (cw, desiredSlot); | ||
294 | 239 | } | ||
295 | 227 | 240 | ||
296 | 228 | /* Get current rect not including decorations */ | 241 | /* Get current rect not including decorations */ |
297 | 229 | currentRect.setGeometry (cw->serverX (), cw->serverY (), | 242 | currentRect.setGeometry (cw->serverX (), cw->serverY (), |
298 | 230 | cw->serverWidth (), | 243 | cw->serverWidth (), |
299 | 231 | cw->serverHeight ()); | 244 | cw->serverHeight ()); |
300 | 232 | 245 | ||
301 | 246 | /* We do not want to allow cycling through sizes, | ||
302 | 247 | * unless the user explicitely specified that in CCSM | ||
303 | 248 | */ | ||
304 | 249 | if (gw->lastTarget == where && | ||
305 | 250 | gw->isGridResized && | ||
306 | 251 | !optionGetCycleSizes ()) | ||
307 | 252 | return false; | ||
308 | 253 | |||
309 | 254 | /* Grid Left/Right/Top/Bottom are only valid here, if | ||
310 | 255 | * cycling through sizes is disabled also | ||
311 | 256 | */ | ||
312 | 233 | if (desiredRect.y () == currentRect.y () && | 257 | if (desiredRect.y () == currentRect.y () && |
313 | 234 | desiredRect.height () == currentRect.height () && | 258 | desiredRect.height () == currentRect.height () && |
315 | 235 | where & ~(GridMaximize | GridLeft | GridRight) && gw->lastTarget & where) | 259 | (where & ~(GridMaximize) || |
316 | 260 | (where & ~(GridLeft | GridRight | GridTop | GridBottom) && | ||
317 | 261 | !optionGetCycleSizes ())) && | ||
318 | 262 | gw->lastTarget & where) | ||
319 | 236 | { | 263 | { |
320 | 237 | int slotWidth25 = workarea.width () / 4; | 264 | int slotWidth25 = workarea.width () / 4; |
321 | 238 | int slotWidth33 = (workarea.width () / 3) + cw->border ().left; | 265 | int slotWidth33 = (workarea.width () / 3) + cw->border ().left; |
322 | @@ -258,34 +285,38 @@ | |||
323 | 258 | props.gravityRight * slotWidth33); | 285 | props.gravityRight * slotWidth33); |
324 | 259 | gw->resizeCount++; | 286 | gw->resizeCount++; |
325 | 260 | break; | 287 | break; |
326 | 288 | |||
327 | 261 | case 2: | 289 | case 2: |
328 | 262 | gw->resizeCount++; | 290 | gw->resizeCount++; |
329 | 263 | break; | 291 | break; |
330 | 292 | |||
331 | 264 | case 3: | 293 | case 3: |
332 | 265 | desiredSlot.setWidth (slotWidth33); | 294 | desiredSlot.setWidth (slotWidth33); |
333 | 266 | desiredSlot.setX (workarea.x () + | 295 | desiredSlot.setX (workarea.x () + |
334 | 267 | props.gravityRight * slotWidth66); | 296 | props.gravityRight * slotWidth66); |
335 | 268 | gw->resizeCount++; | 297 | gw->resizeCount++; |
336 | 269 | break; | 298 | break; |
337 | 299 | |||
338 | 270 | case 4: | 300 | case 4: |
339 | 271 | desiredSlot.setWidth (slotWidth25); | 301 | desiredSlot.setWidth (slotWidth25); |
340 | 272 | desiredSlot.setX (workarea.x () + | 302 | desiredSlot.setX (workarea.x () + |
341 | 273 | props.gravityRight * slotWidth75); | 303 | props.gravityRight * slotWidth75); |
342 | 274 | gw->resizeCount++; | 304 | gw->resizeCount++; |
343 | 275 | break; | 305 | break; |
344 | 306 | |||
345 | 276 | case 5: | 307 | case 5: |
346 | 277 | desiredSlot.setWidth (slotWidth75); | 308 | desiredSlot.setWidth (slotWidth75); |
347 | 278 | desiredSlot.setX (workarea.x () + | 309 | desiredSlot.setX (workarea.x () + |
348 | 279 | props.gravityRight * slotWidth25); | 310 | props.gravityRight * slotWidth25); |
349 | 280 | gw->resizeCount++; | 311 | gw->resizeCount++; |
350 | 281 | break; | 312 | break; |
351 | 313 | |||
352 | 282 | default: | 314 | default: |
353 | 283 | break; | 315 | break; |
354 | 284 | } | 316 | } |
355 | 285 | } | 317 | } |
356 | 286 | else /* keys (2, 5, 8) */ | 318 | else /* keys (2, 5, 8) */ |
357 | 287 | { | 319 | { |
358 | 288 | |||
359 | 289 | if ((currentRect.width () == desiredRect.width () && | 320 | if ((currentRect.width () == desiredRect.width () && |
360 | 290 | currentRect.x () == desiredRect.x ()) || | 321 | currentRect.x () == desiredRect.x ()) || |
361 | 291 | (gw->resizeCount < 1) || (gw->resizeCount > 5)) | 322 | (gw->resizeCount < 1) || (gw->resizeCount > 5)) |
362 | @@ -299,6 +330,7 @@ | |||
363 | 299 | desiredSlot.setX (workarea.x () + slotWidth17); | 330 | desiredSlot.setX (workarea.x () + slotWidth17); |
364 | 300 | gw->resizeCount++; | 331 | gw->resizeCount++; |
365 | 301 | break; | 332 | break; |
366 | 333 | |||
367 | 302 | case 2: | 334 | case 2: |
368 | 303 | desiredSlot.setWidth ((slotWidth25 * 2) + | 335 | desiredSlot.setWidth ((slotWidth25 * 2) + |
369 | 304 | (slotWidth17 * 2)); | 336 | (slotWidth17 * 2)); |
370 | @@ -306,20 +338,25 @@ | |||
371 | 306 | (slotWidth25 - slotWidth17)); | 338 | (slotWidth25 - slotWidth17)); |
372 | 307 | gw->resizeCount++; | 339 | gw->resizeCount++; |
373 | 308 | break; | 340 | break; |
374 | 341 | |||
375 | 309 | case 3: | 342 | case 3: |
376 | 310 | desiredSlot.setWidth ((slotWidth25 * 2)); | 343 | desiredSlot.setWidth ((slotWidth25 * 2)); |
377 | 311 | desiredSlot.setX (workarea.x () + slotWidth25); | 344 | desiredSlot.setX (workarea.x () + slotWidth25); |
378 | 312 | gw->resizeCount++; | 345 | gw->resizeCount++; |
379 | 313 | break; | 346 | break; |
380 | 347 | |||
381 | 314 | case 4: | 348 | case 4: |
382 | 315 | desiredSlot.setWidth (slotWidth33 - | 349 | desiredSlot.setWidth (slotWidth33 - |
384 | 316 | (cw->border ().left + cw->border ().right)); | 350 | (cw->border ().left + |
385 | 351 | cw->border ().right)); | ||
386 | 317 | desiredSlot.setX (workarea.x () + slotWidth33); | 352 | desiredSlot.setX (workarea.x () + slotWidth33); |
387 | 318 | gw->resizeCount++; | 353 | gw->resizeCount++; |
388 | 319 | break; | 354 | break; |
389 | 355 | |||
390 | 320 | case 5: | 356 | case 5: |
391 | 321 | gw->resizeCount++; | 357 | gw->resizeCount++; |
392 | 322 | break; | 358 | break; |
393 | 359 | |||
394 | 323 | default: | 360 | default: |
395 | 324 | break; | 361 | break; |
396 | 325 | } | 362 | } |
397 | @@ -352,37 +389,62 @@ | |||
398 | 352 | 389 | ||
399 | 353 | gw->sizeHintsFlags = 0; | 390 | gw->sizeHintsFlags = 0; |
400 | 354 | 391 | ||
404 | 355 | /* Special case for left and right, actually vertically maximize | 392 | if (!optionGetCycleSizes ()) |
402 | 356 | * the window */ | ||
403 | 357 | if (where & GridLeft || where & GridRight) | ||
405 | 358 | { | 393 | { |
427 | 359 | /* First restore the window to its original size */ | 394 | /* Special cases for left/right and top/bottom gridded windows, where we |
428 | 360 | XWindowChanges rwc; | 395 | * actually vertically respective horizontally semi-maximize the window |
429 | 361 | 396 | */ | |
430 | 362 | rwc.x = gw->originalSize.x (); | 397 | if (where & GridLeft || where & GridRight || |
431 | 363 | rwc.y = gw->originalSize.y (); | 398 | where & GridTop || where & GridBottom) |
432 | 364 | rwc.width = gw->originalSize.width (); | 399 | { |
433 | 365 | rwc.height = gw->originalSize.height (); | 400 | /* First restore the window to its original size */ |
434 | 366 | 401 | XWindowChanges rwc; | |
435 | 367 | cw->configureXWindow (CWX | CWY | CWWidth | CWHeight, &rwc); | 402 | |
436 | 368 | 403 | rwc.x = gw->originalSize.x (); | |
437 | 369 | gw->isGridSemiMaximized = true; | 404 | rwc.y = gw->originalSize.y (); |
438 | 370 | gw->isGridResized = false; | 405 | rwc.width = gw->originalSize.width (); |
439 | 371 | 406 | rwc.height = gw->originalSize.height (); | |
440 | 372 | /* Maximize the window */ | 407 | |
441 | 373 | cw->maximize (CompWindowStateMaximizedVertMask); | 408 | cw->configureXWindow (CWX | CWY | CWWidth | CWHeight, &rwc); |
442 | 374 | 409 | ||
443 | 375 | /* Be evil */ | 410 | if (where & GridLeft || where & GridRight) |
444 | 376 | if (cw->sizeHints ().flags & PResizeInc) | 411 | { |
445 | 377 | { | 412 | gw->isGridVertMaximized = true; |
446 | 378 | gw->sizeHintsFlags |= PResizeInc; | 413 | gw->isGridHorzMaximized = false; |
447 | 379 | gw->window->sizeHints ().flags &= ~(PResizeInc); | 414 | gw->isGridResized = false; |
448 | 415 | |||
449 | 416 | /* Semi-maximize the window vertically */ | ||
450 | 417 | cw->maximize (CompWindowStateMaximizedVertMask); | ||
451 | 418 | } | ||
452 | 419 | else /* GridTop || GridBottom */ | ||
453 | 420 | { | ||
454 | 421 | gw->isGridHorzMaximized = true; | ||
455 | 422 | gw->isGridVertMaximized = false; | ||
456 | 423 | gw->isGridResized = false; | ||
457 | 424 | |||
458 | 425 | /* Semi-maximize the window horizontally */ | ||
459 | 426 | cw->maximize (CompWindowStateMaximizedHorzMask); | ||
460 | 427 | } | ||
461 | 428 | |||
462 | 429 | /* Be evil */ | ||
463 | 430 | if (cw->sizeHints ().flags & PResizeInc) | ||
464 | 431 | { | ||
465 | 432 | gw->sizeHintsFlags |= PResizeInc; | ||
466 | 433 | gw->window->sizeHints ().flags &= ~(PResizeInc); | ||
467 | 434 | } | ||
468 | 435 | } | ||
469 | 436 | else /* GridCorners || GridCenter */ | ||
470 | 437 | { | ||
471 | 438 | gw->isGridResized = true; | ||
472 | 439 | gw->isGridHorzMaximized = false; | ||
473 | 440 | gw->isGridVertMaximized = false; | ||
474 | 380 | } | 441 | } |
475 | 381 | } | 442 | } |
477 | 382 | else | 443 | else /* if (optionGetCycleSizes ()) */ |
478 | 383 | { | 444 | { |
479 | 384 | gw->isGridResized = true; | 445 | gw->isGridResized = true; |
481 | 385 | gw->isGridSemiMaximized = false; | 446 | gw->isGridHorzMaximized = false; |
482 | 447 | gw->isGridVertMaximized = false; | ||
483 | 386 | } | 448 | } |
484 | 387 | 449 | ||
485 | 388 | int dw = (lastBorder.left + lastBorder.right) - | 450 | int dw = (lastBorder.left + lastBorder.right) - |
486 | @@ -657,31 +719,40 @@ | |||
487 | 657 | { | 719 | { |
488 | 658 | int ret; | 720 | int ret; |
489 | 659 | 721 | ||
491 | 660 | switch (edge) { | 722 | switch (edge) |
492 | 723 | { | ||
493 | 661 | case Left: | 724 | case Left: |
494 | 662 | ret = (int) optionGetLeftEdgeAction (); | 725 | ret = (int) optionGetLeftEdgeAction (); |
495 | 663 | break; | 726 | break; |
496 | 727 | |||
497 | 664 | case Right: | 728 | case Right: |
498 | 665 | ret = (int) optionGetRightEdgeAction (); | 729 | ret = (int) optionGetRightEdgeAction (); |
499 | 666 | break; | 730 | break; |
500 | 731 | |||
501 | 667 | case Top: | 732 | case Top: |
502 | 668 | ret = (int) optionGetTopEdgeAction (); | 733 | ret = (int) optionGetTopEdgeAction (); |
503 | 669 | break; | 734 | break; |
504 | 735 | |||
505 | 670 | case Bottom: | 736 | case Bottom: |
506 | 671 | ret = (int) optionGetBottomEdgeAction (); | 737 | ret = (int) optionGetBottomEdgeAction (); |
507 | 672 | break; | 738 | break; |
508 | 739 | |||
509 | 673 | case TopLeft: | 740 | case TopLeft: |
510 | 674 | ret = (int) optionGetTopLeftCornerAction (); | 741 | ret = (int) optionGetTopLeftCornerAction (); |
511 | 675 | break; | 742 | break; |
512 | 743 | |||
513 | 676 | case TopRight: | 744 | case TopRight: |
514 | 677 | ret = (int) optionGetTopRightCornerAction (); | 745 | ret = (int) optionGetTopRightCornerAction (); |
515 | 678 | break; | 746 | break; |
516 | 747 | |||
517 | 679 | case BottomLeft: | 748 | case BottomLeft: |
518 | 680 | ret = (int) optionGetBottomLeftCornerAction (); | 749 | ret = (int) optionGetBottomLeftCornerAction (); |
519 | 681 | break; | 750 | break; |
520 | 751 | |||
521 | 682 | case BottomRight: | 752 | case BottomRight: |
522 | 683 | ret = (int) optionGetBottomRightCornerAction (); | 753 | ret = (int) optionGetBottomRightCornerAction (); |
523 | 684 | break; | 754 | break; |
524 | 755 | |||
525 | 685 | case NoEdge: | 756 | case NoEdge: |
526 | 686 | default: | 757 | default: |
527 | 687 | ret = -1; | 758 | ret = -1; |
528 | @@ -694,7 +765,6 @@ | |||
529 | 694 | void | 765 | void |
530 | 695 | GridScreen::handleEvent (XEvent *event) | 766 | GridScreen::handleEvent (XEvent *event) |
531 | 696 | { | 767 | { |
532 | 697 | CompOutput out; | ||
533 | 698 | CompWindow *w; | 768 | CompWindow *w; |
534 | 699 | 769 | ||
535 | 700 | screen->handleEvent (event); | 770 | screen->handleEvent (event); |
536 | @@ -706,6 +776,7 @@ | |||
537 | 706 | 776 | ||
538 | 707 | currentWorkarea = screen->getWorkareaForOutput | 777 | currentWorkarea = screen->getWorkareaForOutput |
539 | 708 | (screen->outputDeviceForPoint (pointerX, pointerY)); | 778 | (screen->outputDeviceForPoint (pointerX, pointerY)); |
540 | 779 | |||
541 | 709 | if (lastWorkarea != currentWorkarea) | 780 | if (lastWorkarea != currentWorkarea) |
542 | 710 | { | 781 | { |
543 | 711 | lastWorkarea = currentWorkarea; | 782 | lastWorkarea = currentWorkarea; |
544 | @@ -719,7 +790,7 @@ | |||
545 | 719 | cScreen->damageRegion (desiredSlot); | 790 | cScreen->damageRegion (desiredSlot); |
546 | 720 | } | 791 | } |
547 | 721 | 792 | ||
549 | 722 | out = screen->outputDevs ().at ( | 793 | CompOutput out = screen->outputDevs ().at ( |
550 | 723 | screen->outputDeviceForPoint (CompPoint (pointerX, pointerY))); | 794 | screen->outputDeviceForPoint (CompPoint (pointerX, pointerY))); |
551 | 724 | 795 | ||
552 | 725 | /* Detect corners first */ | 796 | /* Detect corners first */ |
553 | @@ -843,8 +914,8 @@ | |||
554 | 843 | 914 | ||
555 | 844 | /* Don't allow non-pagers to change | 915 | /* Don't allow non-pagers to change |
556 | 845 | * the size of the window, the user | 916 | * the size of the window, the user |
559 | 846 | * specified this size, thank-you */ | 917 | * specified this size */ |
560 | 847 | if (isGridSemiMaximized) | 918 | if (isGridHorzMaximized || isGridVertMaximized) |
561 | 848 | if (source != ClientTypePager) | 919 | if (source != ClientTypePager) |
562 | 849 | xwcm = 0; | 920 | xwcm = 0; |
563 | 850 | } | 921 | } |
564 | @@ -868,7 +939,10 @@ | |||
565 | 868 | pointerBufDx = pointerBufDy = 0; | 939 | pointerBufDx = pointerBufDy = 0; |
566 | 869 | grabMask = mask; | 940 | grabMask = mask; |
567 | 870 | 941 | ||
569 | 871 | if (!isGridResized && !isGridSemiMaximized && gScreen->optionGetSnapbackWindows ()) | 942 | if (!isGridResized && |
570 | 943 | !isGridHorzMaximized && | ||
571 | 944 | !isGridVertMaximized && | ||
572 | 945 | gScreen->optionGetSnapbackWindows ()) | ||
573 | 872 | /* Store size not including borders when grabbing with cursor */ | 946 | /* Store size not including borders when grabbing with cursor */ |
574 | 873 | originalSize = gScreen->slotToRect(window, | 947 | originalSize = gScreen->slotToRect(window, |
575 | 874 | window->serverBorderRect ()); | 948 | window->serverBorderRect ()); |
576 | @@ -909,8 +983,18 @@ | |||
577 | 909 | { | 983 | { |
578 | 910 | window->moveNotify (dx, dy, immediate); | 984 | window->moveNotify (dx, dy, immediate); |
579 | 911 | 985 | ||
581 | 912 | if (isGridResized && !isGridSemiMaximized && !GridScreen::get (screen)->mSwitchingVp) | 986 | if (isGridResized && |
582 | 987 | !isGridHorzMaximized && | ||
583 | 988 | !isGridVertMaximized && | ||
584 | 989 | !GridScreen::get (screen)->mSwitchingVp) | ||
585 | 913 | { | 990 | { |
586 | 991 | if (window->grabbed () && screen->grabExist ("expo")) | ||
587 | 992 | { | ||
588 | 993 | /* Window is being dragged in expo. Restore the original geometry | ||
589 | 994 | * right away to avoid any confusion. */ | ||
590 | 995 | gScreen->restoreWindow (0, 0, gScreen->o); | ||
591 | 996 | return; | ||
592 | 997 | } | ||
593 | 914 | if (window->grabbed () && (grabMask & CompWindowGrabMoveMask)) | 998 | if (window->grabbed () && (grabMask & CompWindowGrabMoveMask)) |
594 | 915 | { | 999 | { |
595 | 916 | pointerBufDx += dx; | 1000 | pointerBufDx += dx; |
596 | @@ -933,7 +1017,10 @@ | |||
597 | 933 | !(window->state () & MAXIMIZE_STATE)) | 1017 | !(window->state () & MAXIMIZE_STATE)) |
598 | 934 | { | 1018 | { |
599 | 935 | lastTarget = GridUnknown; | 1019 | lastTarget = GridUnknown; |
601 | 936 | if (isGridSemiMaximized && (lastState & MAXIMIZE_STATE) == CompWindowStateMaximizedVertMask) | 1020 | if ((isGridHorzMaximized && |
602 | 1021 | (lastState & MAXIMIZE_STATE) == CompWindowStateMaximizedHorzMask) || | ||
603 | 1022 | (isGridVertMaximized && | ||
604 | 1023 | (lastState & MAXIMIZE_STATE) == CompWindowStateMaximizedVertMask)) | ||
605 | 937 | gScreen->restoreWindow(0, 0, gScreen->o); | 1024 | gScreen->restoreWindow(0, 0, gScreen->o); |
606 | 938 | } | 1025 | } |
607 | 939 | else if (!(lastState & MAXIMIZE_STATE) && | 1026 | else if (!(lastState & MAXIMIZE_STATE) && |
608 | @@ -969,7 +1056,9 @@ | |||
609 | 969 | 1056 | ||
610 | 970 | GRID_WINDOW (cw); | 1057 | GRID_WINDOW (cw); |
611 | 971 | 1058 | ||
613 | 972 | if (!gw->isGridResized && !gw->isGridSemiMaximized) | 1059 | if (!gw->isGridResized && |
614 | 1060 | !gw->isGridHorzMaximized && | ||
615 | 1061 | !gw->isGridVertMaximized) | ||
616 | 973 | { | 1062 | { |
617 | 974 | /* Grid hasn't touched this window or has maximized it. If it's | 1063 | /* Grid hasn't touched this window or has maximized it. If it's |
618 | 975 | * maximized, unmaximize it and get out. */ | 1064 | * maximized, unmaximize it and get out. */ |
619 | @@ -977,25 +1066,38 @@ | |||
620 | 977 | cw->maximize(0); | 1066 | cw->maximize(0); |
621 | 978 | return true; | 1067 | return true; |
622 | 979 | } | 1068 | } |
625 | 980 | 1069 | else if (!gw->isGridResized && | |
626 | 981 | else if (!gw->isGridResized && gw->isGridSemiMaximized) | 1070 | gw->isGridHorzMaximized && |
627 | 1071 | !gw->isGridVertMaximized) | ||
628 | 1072 | { | ||
629 | 1073 | /* Window has been horizontally maximized by grid. We only need | ||
630 | 1074 | * to restore Y and height - core handles X and width. */ | ||
631 | 1075 | if (gw->sizeHintsFlags) | ||
632 | 1076 | gw->window->sizeHints ().flags |= gw->sizeHintsFlags; | ||
633 | 1077 | xwcm |= CWY | CWHeight; | ||
634 | 1078 | } | ||
635 | 1079 | else if (!gw->isGridResized && | ||
636 | 1080 | !gw->isGridHorzMaximized && | ||
637 | 1081 | gw->isGridVertMaximized) | ||
638 | 982 | { | 1082 | { |
639 | 983 | /* Window has been vertically maximized by grid. We only need | 1083 | /* Window has been vertically maximized by grid. We only need |
641 | 984 | * to restore the X and width - core handles Y and height. */ | 1084 | * to restore X and width - core handles Y and height. */ |
642 | 985 | if (gw->sizeHintsFlags) | 1085 | if (gw->sizeHintsFlags) |
643 | 986 | gw->window->sizeHints ().flags |= gw->sizeHintsFlags; | 1086 | gw->window->sizeHints ().flags |= gw->sizeHintsFlags; |
644 | 987 | xwcm |= CWX | CWWidth; | 1087 | xwcm |= CWX | CWWidth; |
645 | 988 | } | 1088 | } |
650 | 989 | 1089 | else if (gw->isGridResized && | |
651 | 990 | else if (gw->isGridResized && !gw->isGridSemiMaximized) | 1090 | !gw->isGridHorzMaximized && |
652 | 991 | /* Window is just gridded (top, bottom, center, corners). We | 1091 | !gw->isGridVertMaximized) |
653 | 992 | * need to handle everything. */ | 1092 | /* Window is just gridded (center, corners). |
654 | 1093 | * We need to handle everything. */ | ||
655 | 993 | xwcm |= CWX | CWY | CWWidth | CWHeight; | 1094 | xwcm |= CWX | CWY | CWWidth | CWHeight; |
656 | 994 | else | 1095 | else |
657 | 995 | { | 1096 | { |
658 | 996 | /* This should never happen. But if it does, just bail out | 1097 | /* This should never happen. But if it does, just bail out |
659 | 997 | * gracefully. */ | 1098 | * gracefully. */ |
661 | 998 | assert (gw->isGridResized && gw->isGridSemiMaximized); | 1099 | assert (gw->isGridResized && |
662 | 1100 | (gw->isGridHorzMaximized || gw->isGridVertMaximized)); | ||
663 | 999 | return false; | 1101 | return false; |
664 | 1000 | } | 1102 | } |
665 | 1001 | 1103 | ||
666 | @@ -1004,6 +1106,16 @@ | |||
667 | 1004 | xwc.x = pointerX - (gw->originalSize.width () / 2); | 1106 | xwc.x = pointerX - (gw->originalSize.width () / 2); |
668 | 1005 | xwc.y = pointerY + (cw->border ().top / 2); | 1107 | xwc.y = pointerY + (cw->border ().top / 2); |
669 | 1006 | } | 1108 | } |
670 | 1109 | else if (cw->grabbed () && screen->grabExist ("expo")) | ||
671 | 1110 | { | ||
672 | 1111 | /* We're restoring a window inside expo by dragging. This is a bit | ||
673 | 1112 | * tricky. Pointer location is absolute to the screen, not relative | ||
674 | 1113 | * to expo viewport. So we can't use pointer location to calculate | ||
675 | 1114 | * the position of the restore window. | ||
676 | 1115 | * | ||
677 | 1116 | * The best solution is to resize it in place. */ | ||
678 | 1117 | xwcm = CWWidth | CWHeight; | ||
679 | 1118 | } | ||
680 | 1007 | else | 1119 | else |
681 | 1008 | { | 1120 | { |
682 | 1009 | xwc.x = gw->originalSize.x (); | 1121 | xwc.x = gw->originalSize.x (); |
683 | @@ -1018,7 +1130,8 @@ | |||
684 | 1018 | gw->currentSize = CompRect (); | 1130 | gw->currentSize = CompRect (); |
685 | 1019 | gw->pointerBufDx = 0; | 1131 | gw->pointerBufDx = 0; |
686 | 1020 | gw->pointerBufDy = 0; | 1132 | gw->pointerBufDy = 0; |
688 | 1021 | gw->isGridSemiMaximized = false; | 1133 | gw->isGridHorzMaximized = false; |
689 | 1134 | gw->isGridVertMaximized = false; | ||
690 | 1022 | gw->isGridResized = false; | 1135 | gw->isGridResized = false; |
691 | 1023 | if (cw->state () & MAXIMIZE_STATE) | 1136 | if (cw->state () & MAXIMIZE_STATE) |
692 | 1024 | cw->maximize(0); | 1137 | cw->maximize(0); |
693 | @@ -1035,7 +1148,8 @@ | |||
694 | 1035 | GRID_WINDOW (screen->findWindow | 1148 | GRID_WINDOW (screen->findWindow |
695 | 1036 | (CompOption::getIntOptionNamed (o, "window"))); | 1149 | (CompOption::getIntOptionNamed (o, "window"))); |
696 | 1037 | gw->isGridResized = false; | 1150 | gw->isGridResized = false; |
698 | 1038 | gw->isGridSemiMaximized = false; | 1151 | gw->isGridHorzMaximized = false; |
699 | 1152 | gw->isGridVertMaximized = false; | ||
700 | 1039 | gw->resizeCount = 0; | 1153 | gw->resizeCount = 0; |
701 | 1040 | } | 1154 | } |
702 | 1041 | 1155 | ||
703 | @@ -1197,7 +1311,8 @@ | |||
704 | 1197 | gWindow (GLWindow::get(window)), | 1311 | gWindow (GLWindow::get(window)), |
705 | 1198 | gScreen (GridScreen::get (screen)), | 1312 | gScreen (GridScreen::get (screen)), |
706 | 1199 | isGridResized (false), | 1313 | isGridResized (false), |
708 | 1200 | isGridSemiMaximized (false), | 1314 | isGridHorzMaximized (false), |
709 | 1315 | isGridVertMaximized (false), | ||
710 | 1201 | grabMask (0), | 1316 | grabMask (0), |
711 | 1202 | pointerBufDx (0), | 1317 | pointerBufDx (0), |
712 | 1203 | pointerBufDy (0), | 1318 | pointerBufDy (0), |
713 | 1204 | 1319 | ||
714 | === modified file 'plugins/grid/src/grid.h' | |||
715 | --- plugins/grid/src/grid.h 2013-01-21 15:17:50 +0000 | |||
716 | +++ plugins/grid/src/grid.h 2013-04-08 20:23:21 +0000 | |||
717 | @@ -182,7 +182,8 @@ | |||
718 | 182 | GridScreen *gScreen; | 182 | GridScreen *gScreen; |
719 | 183 | 183 | ||
720 | 184 | bool isGridResized; | 184 | bool isGridResized; |
722 | 185 | bool isGridSemiMaximized; | 185 | bool isGridHorzMaximized; |
723 | 186 | bool isGridVertMaximized; | ||
724 | 186 | unsigned int grabMask; | 187 | unsigned int grabMask; |
725 | 187 | int pointerBufDx; | 188 | int pointerBufDx; |
726 | 188 | int pointerBufDy; | 189 | int pointerBufDy; |
Ping ?