Commit Graph

166 Commits

Author SHA1 Message Date
Jasper St. Pierre
e0252f35be workspace: Sort windows when we calculate slots
This ensures that windows don't change positions when we lay
them out again when expanding the workspace switcher.

https://bugzilla.gnome.org/show_bug.cgi?id=698776
2013-04-24 14:10:30 -04:00
Jasper St. Pierre
8b3b91d78d workspace: Invalidate the current layout when windows are added or removed
If windows are removed or added, we shouldn't keep the old layout, as it's
not valid anymore. If windows are removed, this is especially bad, as the
rows contain references to the removed window objects, causing crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=698622
2013-04-22 18:33:34 -04:00
Jasper St. Pierre
e1de3973fe workspace: Recalculate window positions when we have no layout
If for any reason the current layout is invalidated, queue a
reposition.

https://bugzilla.gnome.org/show_bug.cgi?id=698622
2013-04-22 18:33:34 -04:00
Cosimo Cecchi
ab26fc438a workspace: only scale a layout row when it doesn't fit
Instead of applying an additional scale factor to all the rows in the
layout, only do it for those rows that don't fit.
This avoids the visual distraction of resizing a row when there's no
need to.
2013-04-22 18:06:09 -04:00
Jasper St. Pierre
c37259b01d workspace: Lay out windows based on the real allocation
Instead of doing an entire recalculation of window positions when
sliding the thumbnails box, simply recalculate the position and scale
with basic aspect ratio math. This also ensures that windows won't
miraculously swap positions, even if we reposition windows while the
thumbnails box is expanded.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-22 14:01:00 -04:00
Jasper St. Pierre
bde8cc3285 workspace: Split out window repositioning logic and rename
Split out the part that moves the window clones around from
the part that calculates the window clone positions, and rename
both methods so that the overall meaning is more clear.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-22 14:01:00 -04:00
Jasper St. Pierre
59ba5504d0 workspace: Calculate the window slots when we reposition
Repositioning will eventually be separated from recalculation
to accomodate two different geometries, so we'll need to do
the padding and area manipulation in two different areas.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-22 14:01:00 -04:00
Jasper St. Pierre
65eb5a3d05 workspace: Separate out spacing/padding code
This will be used when we introduce the second geometry.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-22 14:01:00 -04:00
Jasper St. Pierre
b925322e9e workspace: Make room for a second geometry to keep track of
As we want to eventually track two geometries, we need to rename
our very plain "_x, _y, _width, _height". While we could just prefix
them, I think that stuffing them in an object makes more sense.

At the same time, make the variable and method name more descriptive
by adding such a prefix, as well as a bit of documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-22 14:01:00 -04:00
Jasper St. Pierre
e3957f3bac workspacesView: Make setGeometry take a rectangle
This cleanup will be more important in the future,
but for now, we can simply pass a monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Jasper St. Pierre
caaac9b9ec workspace: Do window slot computing in three steps
This ensures that we have the correct Y value when sorting
windows.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Jasper St. Pierre
1dac4d00c4 workspace: Abort relayouting much earlier
This means that the code for computeAllWindowSlots is a bit
cleaner, which will help in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Jasper St. Pierre
b41902f4df workspace: Only create one strategy
Now that we don't have any other strategies but the unaligned
one, we only need to construct it once.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Jasper St. Pierre
ada70dd683 workspace: Remove more dead code
By the time zoomToOverview is called, an animation will
always be in progress.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Jasper St. Pierre
7e5d8a8d54 workspace: Make positionWindows private
It's not used outside, and it's going to be broken up soon.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Jasper St. Pierre
e981cae27c workspace: Don't save the current layout
This was saved so that doing something which called relayout
but only changed the area rectangle would simply be needed to
recompute window scaling parameters. With the new overview
relayout, the flow control changed, it turns out that the
current layout is always cleared. Remove this for now, and we'll
put in a different strategy for this.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Jasper St. Pierre
d7c377c229 workspace: Use Workspace.WindowPositionFlags.NONE in another case
https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Giovanni Campagna
ceae032112 Workspace/WorkspaceThumbnail: fix Clutter warnings from stacking code
Windows can be restacked at any time, including when the stackAbove
property of the window clone is being dragged, and thus parented to
the uiGroup. To do stacking properly, we need to skip it for the duration
of the drag, and sync it again at the end (which is already done by
mutter because of the workspace change)

https://bugzilla.gnome.org/show_bug.cgi?id=685285
2013-03-17 19:26:13 +01:00
Giovanni Campagna
0ceefb48c8 Workspace: don't place new windows at random locations
Instead, have them grow from the center of their assigned slots.

https://bugzilla.gnome.org/show_bug.cgi?id=695582
2013-03-17 19:26:09 +01:00
Jasper St. Pierre
083c37a7b2 workspace: Fix bad window positions with small windows
This can happen if you open two or three terminal windows, and then
open the overview -- they're not centered. The issue is that because
of the WINDOW_CLONE_MAXIMUM_SCALE clamping, the scale that is being
laid out is different from the scale that the layout was calculated
for.

Implement and document a hack-ish solution which simply keeps the
scale for the layout as originally calculated, but centers the
windows inside the cell.

https://bugzilla.gnome.org/show_bug.cgi?id=694902
2013-02-28 18:15:15 -05:00
Jasper St. Pierre
b24a10aa00 workspace: Use the scaled width when calculating the total width
This is a small inconsistency I found in the code after review.

https://bugzilla.gnome.org/show_bug.cgi?id=694902
2013-02-28 18:13:50 -05:00
Jasper St. Pierre
e1ef14d12b workspace: Write a giant wall of text describing the algorithm
I wrote this for me to find solutions to some problems we were having
with the current situation, so why not check it in?

https://bugzilla.gnome.org/show_bug.cgi?id=694902
2013-02-28 18:13:50 -05:00
Jasper St. Pierre
1a33de91e2 workspace: Separate out per-window scaling as a separate variable
Multiplication is linear, so we can split this out as a separate
component. This will make it easier to think of it as an additional
per-window scaling factor, rather than tweaking the scale a bit,
which is more correct to the model.

https://bugzilla.gnome.org/show_bug.cgi?id=694902
2013-02-28 16:26:09 -05:00
Jasper St. Pierre
6e15e2d72a workspace: Remove unused variable
This typo seems to have been here since the very beginning;
no "state" variable appears anywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=694902
2013-02-28 16:26:08 -05:00
Jasper St. Pierre
d58b715c52 workspace: Remove some additional features used for GridLayoutStrategy
While we won't tear down the entire strategy infrastructure, we want to
rework some layout code in the future, so just tear this piece out for
now.

https://bugzilla.gnome.org/show_bug.cgi?id=694902
2013-02-28 16:26:08 -05:00
Adel Gadllah
627a2412d2 ui: Don't use Clutter.Group
It is deprecated use Clutter.Actor instead.

https://bugzilla.gnome.org/show_bug.cgi?id=694441
2013-02-22 14:28:58 +01:00
Giovanni Campagna
ad71b969b2 Workspace: fix stacking of window clones
We must set the stack above property of window clones, or they will
not stack themselves properly when a drag is cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=694292
2013-02-20 20:56:58 +01:00
Florian Müllner
0e12215614 workspace: Remove zooming of window previews
Using the scroll wheel to switch workspaces makes sense, but it is
currently only supported on the workspace switcher, as it conflicts
with window zooming in the picker.
As changing workspaces is far more useful than the zoom feature,
remove the latter in order to "free" the scroll wheel for workspace
switching.

https://bugzilla.gnome.org/show_bug.cgi?id=686639
2013-02-20 20:17:19 +01:00
Adel Gadllah
4b3c9e826d workspace: Don't use grid layout
Right now we arrange the window thumbnails in a grid if there are more than two
rows of them. This was originally intended to reduce the amount of noise in the
thumbnail arrangement. It also made sense when the thumbnails were of a similar
size.

Nowadays we reflect the size of windows in the size of the thumbnail. This
leads to huge amounts of space between some windows when they are grid aligned.
Removing the grid alignment would also lead to larger thumbnails.

https://bugzilla.gnome.org/show_bug.cgi?id=694210
2013-02-20 00:44:37 +01:00
Adel Gadllah
3430012136 overview: Don't display minimized windows differently in the overview
Making them not fully opaque just makes them harder to see and there is no reason why the user should care whether the window is minimized or not when
switching to a window display them like any other windows.

https://bugzilla.gnome.org/show_bug.cgi?id=693991
2013-02-18 19:40:48 +01:00
Adel Gadllah
9936f97fcb overview: Sort windows by travel distance within rows
Sort windows inside the rows by there travel distance.

https://bugzilla.gnome.org/show_bug.cgi?id=690313
2013-02-18 12:02:22 +01:00
Giovanni Campagna
5c7f0a0ad8 WindowOverlay: remove animations when relayouting
If WindowOverlay.relayout() is called without animation, we must stop
any preexisting animation, otherwise it will continue to run with the
previous parameters and cause the overlay to end up in the wrong position.

https://bugzilla.gnome.org/show_bug.cgi?id=693970
2013-02-16 19:08:02 +01:00
Cosimo Cecchi
bc75e5ec44 workspace: include the close button overlap in the right side chrome
As we do for the top side; the border is overlaied in the top/right
corner.

https://bugzilla.gnome.org/show_bug.cgi?id=682050
2013-02-14 18:18:22 -05:00
Cosimo Cecchi
3d8a87563d workspaceThumbnail: pack ThumbnailsBox in the overview directly
Use a SlidingControl subclass and pack that in the overview group
directly.

https://bugzilla.gnome.org/show_bug.cgi?id=682050
2013-02-14 18:18:21 -05:00
Jasper St. Pierre
d2c45f428f workspace, workspaceThumbnail: Fix another bad rebase
It seems I pushed an old version of the patch by accident.
2013-02-07 02:31:52 -05:00
Jasper St. Pierre
f738c2be9d main: Remove isWindowActorDisplayedOnWorkspace
We now have a convenience method in mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=691746
2013-02-07 01:36:31 -05:00
Jasper St. Pierre
0335f2726a workspace: Use mutter's work area calcuating rather than doing it manually
https://bugzilla.gnome.org/show_bug.cgi?id=692680
2013-02-06 22:35:10 -05:00
Florian Müllner
f4626cf8ad workspace: Make previews of minimized windows translucent
Because the comment says so! Seriously, Jakub suggested this after
bug 682887 brought back a rebranded default shortcut for minimize.

https://bugzilla.gnome.org/show_bug.cgi?id=692999
2013-02-01 14:54:38 +01:00
Jasper St. Pierre
ef69c228fd workspace: Use a better algorithm for computing individual thumbnail scale
The one we had before could make unmaximized windows appear to be bigger
than maximized ones, for a few reasons. Ensure that this doesn't happen
again, and add some comments to explain the whys and needs for twiddling
the individual thumbnail size.

https://bugzilla.gnome.org/show_bug.cgi?id=686944
2013-01-24 15:14:03 -05:00
Jasper St. Pierre
7ba0f07732 workspace: Clamp individual maximized scales to WINDOW_CLONE_MAXIMUM_SCALE
We clamp the overall layout's scale to WINDOW_CLONE_MAXIMUM_SCALE, but since
we do a bit of tweaking to try and make super small windows a tad larger, it's
theoretically possible that windows may become larger than the proper maximum
scale. Fix this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=686944
2013-01-24 15:13:54 -05:00
Giovanni Campagna
27ad8305e5 Overview: apply extra padding to windows in external monitor
Add an style class targetting workspaces located outside the overview,
and use it for extra padding around the window clones. Padding is passed
down and applied inside LayoutStrategy, consolidating code that previously
handled the bottom side only.

https://bugzilla.gnome.org/show_bug.cgi?id=690171
2013-01-18 20:58:07 +01:00
Florian Müllner
3f29680fb6 workspace: Use MetaButtonLayout to get side of close button
The current code parses the button-layout setting because MetaButtonLayout
was not usable from introspection. With that fixed, we can switch to
using meta_prefs_get_button_layout().

https://bugzilla.gnome.org/show_bug.cgi?id=689263
2013-01-10 00:08:55 +01:00
Jasper St. Pierre
770ff19313 workspace: Add smooth scrolling support to zoom windows
https://bugzilla.gnome.org/show_bug.cgi?id=687573
2012-12-20 08:40:05 -05:00
Giovanni Campagna
944762ac83 WindowOverlay: fix title sizing
After the first time the title was placed, we were setting its width,
thus forcing get_preferred_width() to return that as the minimum and
natural width.
To workaround that, explicitly reset the width to -1, -1, causing
StLabel->get_preferred_width() to be called, which would give us a meaningful
value for minimum and natural width.

https://bugzilla.gnome.org/show_bug.cgi?id=688234
2012-12-18 16:00:54 +01:00
Giovanni Campagna
c66068c435 Workspace: fix window clone slot reporting
WindowOverlay was at times seeing bogus values reported as WindowClone
sizes. Fix that by storing and passing the value from the authoritative
source, that is, the LayoutStrategy.

https://bugzilla.gnome.org/show_bug.cgi?id=688234
2012-12-18 16:00:54 +01:00
Giovanni Campagna
d479c936b8 Workspace: miscellaneuous cleanups
Use a single GSettings object for all layout changes of window overlays,
and avoid quadratic behavior for window positioning.

https://bugzilla.gnome.org/show_bug.cgi?id=650843
2012-12-18 16:00:54 +01:00
Giovanni Campagna
96f44e1959 WindowOverlay: animate the close button together with the border
Since the introduction of overlay hover borders, there has a been
a timing disconnection between hiding the border and button, and
this creates noise and reduces the effect of the window+overlay
as a single unit.
Solve that by animating the close button too, so that the two actors
are shown and hidden always at the same time.
Also, consolidate the code to make it clear to future authors that
those two items need to stay coordinated.

https://bugzilla.gnome.org/show_bug.cgi?id=688966
2012-11-24 18:55:47 +01:00
Giovanni Campagna
a370697385 Workspace: Highlight window clone and caption when hovered
Windows in the overview should be highlighted when hovered, to indicate
they are an active target.

Based on a patch by Marc Plano-Lesay <marc.planolesay@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=665310
2012-11-20 18:01:11 +01:00
Stéphane Démurget
86596749fa Revert "overview: highlight windows on launcher hover"
This reverts commit 76229a3601.

Pushed by accident.
2012-11-07 00:33:32 +01:00
Stéphane Démurget
76229a3601 overview: highlight windows on launcher hover
When in the overview, if you move the mouse cursor over one of the
application launchers in the dash, all the unrelated windows are dimmed
both both in the window view and in the workspace view.

It helps to easily understand whether or not there are already opened
windows for this application, and where they are. It can also help in
differentiating the windows in the overview (sometimes the thumbnails
aren't precise enough to easily know which thumbnail belongs to which
application).

https://bugzilla.gnome.org/show_bug.cgi?id=657315
2012-11-07 00:27:31 +01:00