Commit Graph

194 Commits

Author SHA1 Message Date
Giovanni Campagna
37ef0e4bed WorkspacesView: don't access the allocation 4 times
Access it once, and save 3 GObject property accesses and related
copies.

https://bugzilla.gnome.org/show_bug.cgi?id=729823
2014-06-26 19:20:17 +02:00
Giovanni Campagna
309d40a92b WorkspacesView: separate setting the full and the actual geometry
They are different properties, they deserve different syncs.
Especially because a full allocation cycle sets both anyway, so
we should save some cycles this way.

https://bugzilla.gnome.org/show_bug.cgi?id=729823
2014-06-26 19:20:17 +02:00
Jasper St. Pierre
83cb26d70e js: Adapt to GSettings API change
The 'schema' property has been deprecated for a long time. Even though
this will likely be reverted in glib, let's stop using it.
2014-06-24 15:17:09 -04:00
Florian Müllner
11d8640ba6 workspacesView: Fix activating empty workspaces
By default, gesture actions no longer wait for the dnd threshold to
be reached before triggering, which breaks our mixing of click- and
pan actions. Fix this by only panning after reaching the threshold
and letting the click action go through if the pan is cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=722417
2014-01-17 09:30:59 -05:00
Giovanni Campagna
1b152e6bd0 WorkspacesView: fix removal of workspaces that are not at the end
Workspaces can removed from any index, and in particular they
will be removed by the WorkspaceTracker if they stop containing
windows at some point. Make sure WorkspacesView is not confused
and destroyes the right Workspace objects.

https://bugzilla.gnome.org/show_bug.cgi?id=721417
2014-01-03 22:46:45 +01:00
Florian Müllner
deb2f30b37 js: Use EVENT_PROPAGATE/EVENT_STOP constants in event handlers
Just as SOURCE_CONTINUE/SOURCE_REMOVE in source functions, these
constants increase code clarity over plain true/false.

https://bugzilla.gnome.org/show_bug.cgi?id=719567
2013-12-16 18:27:19 +01:00
Jasper St. Pierre
47a20756b9 workspace: Implement key navigation on the workspaces page
Simply use St's existing key navigation system by making all the window
clones StWidgets, and making the WorkspacesView a focus group.

Since the workspace view is effectively "fake", we need to add a focus
delegator so that when key focus is assigned to the fake workspaces page,
we can keynav inside it properly.

https://bugzilla.gnome.org/show_bug.cgi?id=644306
2013-12-04 11:22:55 -05:00
Jasper St. Pierre
b6c3c9891c workspacesView: Make sure to update workspace actors when entering the overview
Otherwise, they will be in the wrong positions.
2013-10-30 18:20:54 -04:00
Jasper St. Pierre
8f86fd6bae workspacesView: Simplify the workspacesOnlyOnPrimary implementation
Before, workspacesOnlyOnPrimary was implemented in quite a crazy manner:

 * If workspacesOnlyOnPrimary was false, we'd create one WorkspacesView per
   monitor, with the primary one being a bit special.

 * If workspacesOnlyOnPrimary was true, we'd create one WorkspacesView, and
   additional montiors would be handled inside that WorkspacesView as
   "extra workspaces".

This caused numerous bugs as the two modes weren't consistently
implemented, and a lot of code was duplicated between all the modes.
Fix this by always creating WorkspaceViews, even if it only handles
one interface. We do this by having two different WorkspacesView-ish
classes: WorkspacesView handles the traditional combination of lots
of workspces, and a new ExtraWorkspaceView is in control of only one
workspace.
2013-10-30 13:17:39 -04:00
Jasper St. Pierre
d5cd534320 workspacesView: Make each WorkspacesView own its set of workspaces
Right now, the workspace update code is complex and spread across parts:
WorkspacesView takes a set of workspaces and looks like it owns them, but
WorkspacesDisplay is actually in charge of setting them up and creating
new ones for each WorkspacesView.

Change initialization and handling to move all of the creation/destruction
responsibilities to WorkspacesView.

We pass in monitorIndex into each WorkspacesView, which is a lie in the
workspacesOnlyOnPrimary case, as the primary WorkspacesView currently has
the responsibility of handling the extra workspaces on all the other
monitors. The commit will clean this up and punt the responsibility back
to WorkspacesDisplay.
2013-10-30 13:17:39 -04:00
Jasper St. Pierre
a5a6fd3bc2 workspacesView: Don't tween the upper of our scroll adjustment
This really doesn't make sense. The new upper should be the new workspace
index as soon as it's available.
2013-10-30 13:17:39 -04:00
Jasper St. Pierre
287ddda5df workspacesView: Don't zoom into the overview based on a signal
Instead, simply have somebody else call us, like we do for hiding
the overview as well.
2013-10-30 13:17:39 -04:00
Jasper St. Pierre
7747f1c31d workspacesView: Don't use a drag monitor to get the clone
Just use the new variable passed to the signal.
2013-10-30 13:17:39 -04:00
Jasper St. Pierre
8097cbbbe3 workspacesView: Don't do any special handling for item-dragging
The code here really only cares about new windows.
2013-10-30 13:17:39 -04:00
Jasper St. Pierre
026fd4cf35 workspace: Punt the geometry-fizzling-out logic here 2013-10-30 13:17:38 -04:00
Jasper St. Pierre
87016f9620 workspacesView: Remove spacing
It's not used in the theme and it complicates the layout code a bit
too much; in fact, if set, things start breaking.
2013-10-30 13:17:38 -04:00
Jasper St. Pierre
a2f9b8ea9b workspacesView: Remove dead code 2013-10-01 18:41:26 -04:00
Jasper St. Pierre
f8234b07f8 workspacesView: Don't double-destroy workspaces
The WorkspaceView actors contain the Workspace actors, so destroying the
WorkspaceView actors should be enough.

https://bugzilla.gnome.org/show_bug.cgi?id=707889
2013-09-11 10:15:26 -04:00
Adel Gadllah
b1c936164c overview: Really fix zoom animation
Commit 16fa186b63 attempted to fix the zoom animation problem
by throwing changes on the floor while the overview is animating. This has
the side effect that we might end up missing some positioning changes causes
windows to overlap the workspace thumbnails.

So revert those changes and fix it by simply by passing
WindowPositionFlags.ANIMATE during the overview animation.
This way the animation works as expected and we don't miss any position changes.

https://bugzilla.gnome.org/show_bug.cgi?id=703105
2013-06-26 18:06:54 +02:00
Adel Gadllah
16fa186b63 overview: Fix zoom animation
When the allocation of the workspacesView changes during the animation we override
the tween with one that does not animate causing the overview zoom animation
not to happen.

Fix that by ignoring the alloactionChanged notification during the overview
animation.
2013-06-24 22:56:17 +02:00
Florian Müllner
e0a6a623d2 workspacesView: Adapt to changes in windowManager
The actionMoveWorkspace() function was changed in commit 8727661c1,
adapt its use in workspacesView as well.

https://bugzilla.gnome.org/show_bug.cgi?id=659288
2013-05-21 22:42:28 +02:00
Giovanni Campagna
d0310bd745 Overview: don't use the overlay_group
It's a deprecated concept, and we want to have our own actor
that we can add to the chrome to handle the input region.

https://bugzilla.gnome.org/show_bug.cgi?id=700735
2013-05-21 22:24:53 +02:00
Giovanni Campagna
a9058e471c WorkspacesView: set the actual geometry when creating workspaces
If we created a workspace after showing the view, we would never
set the geometry on it, which would cause an exception in the
window layout code and leave the DND state tracking in an undefined
state.

https://bugzilla.gnome.org/show_bug.cgi?id=699029
2013-04-27 15:09:19 +02: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
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
f0c2ad00f8 workspacesView: Calculate the workspaces geometry ourselves
To ensure that we don't recalculate window layouts when zooming
in or out, we need to always pass the full geometry. This will
break window repositioning when we zoom back in; for the purposes
of commit clarity, this breaks this feature for now. It will be
added back soon.

https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-22 14:00:59 -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
2506673514 workspacesView: Minor cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Jasper St. Pierre
7cb12015fd workspacesView: Fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=694469
2013-04-20 08:33:26 -04:00
Giovanni Campagna
160c721afc Revert "WorkspacesView: set the clip when setting the geometry"
This reverts commit d3ab367fcd.
Pushed by mistake.
2013-03-17 19:39:58 +01:00
Giovanni Campagna
9e60a55dd7 WorkspacesView: don't fail when doing window DND from the last workspace
DND of windows has a lot of side effects, including the possibility of
current workspace disappering from under our feet. We need to account
for that when trying to activate it.

https://bugzilla.gnome.org/show_bug.cgi?id=685285
2013-03-17 19:35:14 +01:00
Giovanni Campagna
d3ab367fcd WorkspacesView: set the clip when setting the geometry
Fixes clipping the windows when you open the overview with the workspace
switcher expanded and then shrink it.

https://bugzilla.gnome.org/show_bug.cgi?id=694092
2013-03-17 19:26:12 +01:00
Florian Müllner
f83ad77c08 workspacesView: Remove some unused variables
More left-overs from the custom swipe-scrolling code.

https://bugzilla.gnome.org/show_bug.cgi?id=686639
2013-02-20 20:17:20 +01:00
Florian Müllner
af219ce9e7 workspacesView: Allow workspace switching via scroll wheel
This is already possible over the workspace switcher, extend this
behavior to the entire window picker area.

https://bugzilla.gnome.org/show_bug.cgi?id=686639
2013-02-20 20:17:20 +01:00
Florian Müllner
420f0109ee workspacesView: Treat 'gesture-cancel' the same as 'gesture-end'
When a swipe scroll completes, we scroll the active workspace into
view. This works fine if the gesture is completed properly by
emitting 'gesture-end', but not when Clutter considers the gesture
cancelled - in that case, the view remains stuck in an intermediate
position. To fix, treat 'gesture-cancel' the same as 'gesture-end'.

https://bugzilla.gnome.org/show_bug.cgi?id=689394
2013-02-20 17:43:44 +01:00
Cosimo Cecchi
c550e2ccf5 workspacesView: simplify code
We always pass the same coordinates to setGeometry and setClipRect in
WorkspacesView; remove the latter to simplify code.

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
Giovanni Campagna
176daa1469 WorkspacesDisplay: clean up workspacesView lists
Rather than sometimes having a list and sometimes null, keep an array
always and check for its length.

https://bugzilla.gnome.org/show_bug.cgi?id=688234
2012-12-18 16:00:54 +01:00
Giovanni Campagna
5487f8cf93 WorkspacesView: don't use clutter_actor_reparent()
It's deprecated and in this case is not needed because at that point
the actor hasn't been parented yet.

https://bugzilla.gnome.org/show_bug.cgi?id=688234
2012-12-18 16:00:54 +01:00
Cosimo Cecchi
6c64c0873c workspaceThumbnail: unify restack handling
Both WorkspacesDisplay and ThumbnailsBox need to know when windows have been
restacked. Instead of each tracking changes on their own or trying to call
each other, have the overview keep track and do the calculations, emitting
a signal with the result.

https://bugzilla.gnome.org/show_bug.cgi?id=690175
2012-12-17 13:24:25 +01:00
Cosimo Cecchi
d2c6149923 workspaceThumbnail: handle show/hide when entering/leaving the overview
Handle this internally, instead of having WorkspacesDisplay show/hide
us.

https://bugzilla.gnome.org/show_bug.cgi?id=690175
2012-12-17 13:24:25 +01:00
Tanner Doshier
9f98f6f02d workspaceThumbnail: handle scroll-event internally
Instead of having WorkspacesDisplay calling us.

https://bugzilla.gnome.org/show_bug.cgi?id=690175
2012-12-17 13:24:25 +01:00
Tanner Doshier
2f7c0b1985 workspaceThumbnail: make ThumbnailsBox track workspace changes itself
Instead of having WorkspacesDisplay calling us.

https://bugzilla.gnome.org/show_bug.cgi?id=690175
2012-12-17 13:24:25 +01:00
Cosimo Cecchi
a0e340f06e workspaces-view: make sure to add spacing between view and controls
The thumbnail controls are not a separate actor in the overview group
yet, so we need to ensure a spacing between them and the workspaces
view.
Instead of exporting the overview spacing, just add a temporary style
class to the workspaces-view actor for it. It will be removed in the
future when we change the layout of overview elements.

https://bugzilla.gnome.org/show_bug.cgi?id=690174
2012-12-15 14:13:36 -05:00
Tanner Doshier
04d68c6e36 overview: overview as boxlayouts
https://bugzilla.gnome.org/show_bug.cgi?id=682286
2012-12-13 09:38:45 -05:00
Florian Müllner
6eb05af306 workspacesView: Restore activation of (empty) workspaces
Clicking empty workspaces to leave the overview was broken by
commit 830e701d13, restore the previous behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=689552
2012-12-03 19:40:29 +01:00
Jasper St. Pierre
830e701d13 workspacesView: Don't use the overview swipe scrolling system
Switch to a ClutterPanAction instead too.

https://bugzilla.gnome.org/show_bug.cgi?id=689062
2012-11-30 16:03:34 -05:00
Jasper St. Pierre
57d9e7d5aa workspacesView: Clean up scroll code a bit
There's no code path that results in us not animating.

https://bugzilla.gnome.org/show_bug.cgi?id=689062
2012-11-30 16:03:34 -05:00
Jasper St. Pierre
bb88265d78 workspacesViews: Update new padding rules for workspacesOnlyOnPrimary
Tim Lunn fixed this for the !workspacesOnlyOnPrimary case, but not the
other.
2012-11-27 17:46:53 -05:00
Tim Lunn
f63fceb2ea workspacesDisplay: add spacing around the workspacesView
On additional monitors the workspacesView takes up the entire monitor
and in some cases windows in overview can end up hard against the
edge of the monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=688133
2012-11-21 20:02:38 +01:00