Commit Graph

76 Commits

Author SHA1 Message Date
Colin Walters
7703bee284 [workspaces] Use a stable minimum-motion placement for windows
Rather than having the mapping from window into "slots" (or
possible positions in the workspaces) be dependent on stacking
order, compute the minimum-motion which is a vector from one
top left corner to another.  This order won't change as long
as the window set and their positions stay fixed.

There are two minimum motion algorithims; one simply computes
all possible placements by permuting the window list, up to
a current maximum of 5 windows.  Past that (which also happens
to be the number where we switch to a grid), we use a "greedy"
algorithm which for each slot, finds the window with least motion
for that slot.

To break any ties, we use an internal integer in MetaWindow which
enumerates the order in which windows were created.

https://bugzilla.gnome.org/show_bug.cgi?id=582654
2009-09-22 18:14:32 -04:00
Dan Winship
3734479cbd [lightbox] Add lightbox.js and use it in overview, alt-tab, and run dialog
https://bugzilla.gnome.org/show_bug.cgi?id=596000
2009-09-22 17:23:14 -04:00
Dan Winship
ceefc5eea4 Convert remaining uses of "let me = this;" to Lang.bind
https://bugzilla.gnome.org/show_bug.cgi?id=595293
2009-09-15 13:11:23 -04:00
Colin Walters
9feda69888 When in window filtering mode, reset filter before showing window
When we had a filtered set of windows, and want to exit the overview
into a particular window, what we do is re-show all the old windows
first, but don't reset the scaling on them.  This will involve
some overlapping, but that's not a big deal because we'll immediately
get overlap anyways in the normal case zooming the windows back.

https://bugzilla.gnome.org/show_bug.cgi?id=594699
2009-09-14 15:41:19 -04:00
Colin Walters
33f9895d71 Don't proxy methods through overview; add a getWorkspacesForWindow()
Duplicating the methods was unnecessary.  Also, we want a getWorkspacesForWindow()
method as preparation for multi-monitor work.

https://bugzilla.gnome.org/show_bug.cgi?id=594699
2009-09-14 15:41:12 -04:00
Colin Walters
2812c21322 Allow popup menu to be persistent, and support direct window selection
When the user click+hold+release over the icon, the effect we want
is for the menu to stick around.

Also, allow the user to mouse over the actual windows and select
them directly.  If the user mouses over a window, reflect that in
the menu.

https://bugzilla.gnome.org/show_bug.cgi?id=594699
2009-09-14 15:37:29 -04:00
Colin Walters
dfe16f4af6 Revert "[AppWell] Allow popup menu to be persistent, and support direct window selection"
This reverts commit 6e31e59b57.
2009-09-11 18:58:30 -04:00
Colin Walters
6e31e59b57 [AppWell] Allow popup menu to be persistent, and support direct window selection
When the user click+hold+release over the icon, the effect we want
is for the menu to stick around.

Also, allow the user to mouse over the actual windows and select
them directly.  If the user mouses over a window, reflect that in
the menu.
2009-09-11 18:57:44 -04:00
Dan Winship
d8cabbee0b More global-ization 2009-09-11 17:23:42 -04:00
Colin Walters
913aeae166 Actually update well menu filtering for review messages
My updates got lost due to accidentally being on a rebase branch.
2009-09-09 17:28:52 -04:00
Colin Walters
05812ef7f9 [AppWell] Enable lightboxing immediately on popup
Rather than starting lightboxing only when the mouse enters the
menu, start it when an application filter is set.

Also delete a stale function in WindowClone from previous work.

http://bugzilla.gnome.org/show_bug.cgi?id=594555
2009-09-09 11:40:09 -04:00
Dan Winship
678a88dbdb Remove some "let global ..."s that snuck back in as part of old patches 2009-09-09 09:42:00 -04:00
Dan Winship
5e944c9a3b Move the add workspace button out of the Workspaces object, into Overview
http://bugzilla.gnome.org/show_bug.cgi?id=594049
2009-09-09 09:36:59 -04:00
Dan Winship
4b727ef40d Scroll wheel should zoom windows in the overview
Allow using the scroll wheel to zoom in on windows in the overview.

Original patch from JP St. Pierre.
http://bugzilla.gnome.org/show_bug.cgi?id=591849
2009-09-08 17:37:24 -04:00
Dan Winship
d0d79c5b3e Make "global" global.
Rather than doing "let global = Shell.Global.get()" everywhere we
need it, just create a global variable called "global".

http://bugzilla.gnome.org/show_bug.cgi?id=594546
2009-09-08 16:21:15 -04:00
Colin Walters
25410a730e Bug 591763 - Add application window menu
When we have multiple windows for an application, implement the following
behavior:

* On click + immediate release, go to the most recently used
* On click, hold for 0.6s, pop up a menu with windows, filtering
  the window list to just those windows.
  Mouse over on the window list highlights the moused-over window.

Implement this by splitting well item into InactiveWellItem
and RunningWellItem, sharing a base class BaseWellItem.
2009-09-08 14:31:44 -04:00
Dan Winship
38d21c8edf Remove some vestigial code 2009-09-03 09:50:39 -04:00
Steve Frécinaux
bcc3dc0711 Consolidate window tracking filters between app monitor and overview.
The windows we considered for both the app monitor and the overview
workspaces were the same, but the code was duplicated once in C, once
in Javascript.
2009-08-31 21:35:23 +02:00
Colin Walters
dd1a309cb6 dnd: Centralize drag actor positioning code, use shellWorkspaceLaunch for workspaces
We had multiple copies of the code to position a drag actor given a particular
source.  Instead, just put it inside dnd.js.

Second, rather than test for GenericDisplay/WellDisplayItem etc.,
in various places, add a new method on each source "shellWorkspaceLaunch"
which both marks the item as being droppable on a workspace, and is
called by the workspaces code to launch the item.
2009-08-20 19:37:50 -04:00
Owen W. Taylor
4aae57c274 Explicitly set the size of the workspace actors
Instead of counting on the implicit sizing of ClutterGroup, which isn't
going to work well because of current limitations of ClutterClone, set
the size of workspace explicitly based on the screen size.

This should fix various problems with drag-and-drop being unreliable;
if a workspace was sized to big it could overlap other workspaces or
elements of the overview.

http://bugzilla.gnome.org/show_bug.cgi?id=591643
2009-08-13 08:50:05 -04:00
Marina Zhurakhinskaya
fb0ca1ba9d Make dragging an item to the Add Workspace button launch it on a new workspace
It is convenient to drag an item to the Add Workspace button and
have it be launched on a new workspace.

Based on a patch from Josh Adams.
2009-08-12 20:13:24 -04:00
Colin Walters
f00500d3d5 Bug 591246 - Move towards shell-black02 mockup
Remove the last use of passing width into Dash by having the
Pane with the previews scaling dynamically and relying on
Clutter scaling.

If we only have one workspace, don't display a selection frame
for it.

Rework Dash into a searchArea and sectionArea, which get
explicitly sized by overlay.js.  We use the workspaces size
to choose the size of those dash areas.

Switch dash colors/boxes etc. to ones from shell-black02.

Add a gradient to the panel.

Add a magnifier.svg for use in search.
2009-08-12 16:07:05 -04:00
Sander Dijkhuis
47af454115 Bug 591437 - Rename overlay.js to overview.js
Replace 'overlay' with the more descriptive name 'overview'
where the Activities Overview is meant. Call it Overview
(capitalized) in code comments.

The overlay-group and overlay-key provided by Mutter are not
affected, since they may be used for other components than
the Activities Overview.
2009-08-11 15:15:25 +02:00
Sander Dijkhuis
1f31e80c47 Bug 584609 - Zoom the whole overlay when showing or hiding
Instead of only transforming the active workspace, create a
zooming effect when showing or hiding the overlay. This makes
the transitions simpler: the workspaces are now fixed to the
overlay actor group and will not slide over the Dash.

overlay.js: Add zoom animations, fade in/out Dash during those,
    remove obsolete Dash clipping and stacking logic, add public
    get[Scale|Position]() and getZoomedIn[Scale|Position]()
    functions.
workspaces.js: Remove zoom animations, add fade animations for
    the remove button, add helper functions for the overlay
    zooming, keep the movement of windows linear to that of
    their workspaces, remove the updatePosition() and
    updateInOverlay() functions and fullSize variables that
    were left from the old overlay design.
2009-08-11 02:21:13 +02:00
Owen W. Taylor
06d17e08c0 Reposition windows when scaling workspaces
The scale of windows within a workspace is determined by the
scale of the workspace since we never scale a window bigger
than the original size of the window. So when we rescale
workspaces we have to rerun Workspace.positionWindows().

http://bugzilla.gnome.org/show_bug.cgi?id=591124
2009-08-10 10:09:25 -04:00
Owen W. Taylor
4830808d2f When fading in window icons, use the final position not current position
The onComplete when positioning windows may come before the
final stage of the workspace positioning animation. So we can't
use actor.get_transformed_position() to figure out where to put
the icons. Compute the final position manually ourselves instead.

http://bugzilla.gnome.org/show_bug.cgi?id=591123
2009-08-10 09:59:40 -04:00
Owen W. Taylor
02ee6f69b3 Fix updating of workspace frame actor
Both the position and size of the frame actor depend on the scale
of the workspace, so update them both when the scale changes.

On the other hand, the the frame actor doesn't need to be
repositioned when the workspace moves (since it is relative to the
workspace). We do base the frame  position of the desktop actor, but
that will presumably stay fixed (at 0,0) in most all cases.

http://bugzilla.gnome.org/show_bug.cgi?id=591122
2009-08-10 09:56:35 -04:00
Owen W. Taylor
5d0808e1c0 Use the size of the window, not of the clone to position windows
When Workspace._positionWindows is called, the clone might nto
yet have its final size (because of the clone is is a clone of
the window texture and the window texture isn't updated until
right before painting.) So get the size from the MetaWindow
instead ... the MetaWindow size is determined synchronously when
the window is managed.

http://bugzilla.gnome.org/show_bug.cgi?id=590741
2009-08-10 09:54:38 -04:00
Siegfried-Angel Gevatter Pujals
5a75b44f71 Consider height when positioning windows in the overlay
I've done some little modifications to the window positioning code
used in the overlay so that it considers the height of the windows
and they don't overlap or get out of the workspace.

I've also raised the hard-coded scales a bit to have the windows as
big as possible without overlapping (this could use some testing on
a non-widescreen monitor).
2009-08-08 22:10:40 +02:00
Colin Walters
4d52c10958 Bug 589316 - Add application/window icon to overlay windows
To better distinguish between vast fields of white of which many
windows are composed, add the application icon to the bottom
right of the window.

We fade them in to avoid an abrupt feel.  The icons are in the
workspaces group, not individual workspace groups to avoid
having to adjust them when we scale the workspaces.

Replace Workspace._lookupIndexAndClone with Workspace.lookupIndex,
and make the caller go from index to clone, or clone and index.
2009-08-07 13:29:34 -04:00
Owen W. Taylor
354112fb41 Tweak sizing of windows in overview
Tweak arrangements with 2,3,4,5 windows in a desktop so:

 - Windows are a bit bigger
 - All windows for 5 windows are equally sized instead of making
   the windows in the bottom row larger

This does cause some more problems with tall windows overlapping
or running off the edge of the workspace, but it's an overall
small improvement to the behavior.
2009-08-06 15:19:04 -04:00
Colin Walters
026f014d32 Bug 589937 - Raise clone on window activation
We had duplicate code in appDisplay and workspaces for handling activating
a window; unify that inside workspaces, add an API to Main.overlay to
access it from both contexts.

Also, explicitly raise the clone we're activating to the top
before starting the animation to leave the overlay.
2009-07-31 19:26:32 -04:00
Sander Dijkhuis
2aea9c59a4 Bug 588173 - No remove button on the first workspace
If there is only one workspace and it's empty, it should
not get a remove button. Add a workspaceNum != 0 check to
workspaces.js.
2009-07-14 14:58:24 +02:00
Marina Zhurakhinskaya
79c166c38d Make workspaces accept a drop of AppDisplay.WellDisplayItem
AppDispplay.WellDisplayItem needed to be added along with the
GenericDisplay.GenericDisplayItem as a type of a drop object
that workspaces accept.
2009-06-30 16:42:00 -04:00
Jon McCann
99e6004c66 Use full opacity for windows in workspace/window selector
The goal of the workspace view is to identify and select windows.  Transparency
results in the blending of the window and the background (and icons on the
desktop).  I think the transparency is counterproductive.

We used it in the initial mockups kind of as a lark - it wasn't well thought
out.

http://bugzilla.gnome.org/show_bug.cgi?id=582647
2009-05-20 17:07:37 -04:00
Dan Winship
062e1aa78b Reorganize overlay hiding/showing code
Rather than having main.js manage this, put it into overlay.js, and
have the overlay object emit signals that other code can watch to do
things when the overlay is showing/shown/hiding/hidden.
2009-05-07 16:41:07 -04:00
Dan Winship
88e68dec21 Let small windows appear at full size in the overlay if there is room
Previously we forced all windows to shrink at least as much as the
workspace itself did. Now we allow to shrink by a smaller amount (or
not at all) if they'll still fit within their allotted slot.

http://bugzilla.gnome.org/show_bug.cgi?id=571192
2009-05-05 15:35:04 -04:00
Owen W. Taylor
20e755023b Clean up underscores in function and variable names
Try to fix all places where we accidentally used foo_bar instead
of fooBar for function names, function parameters, and variables.

(Lucas Rocha pointed out one example.)

http://bugzilla.gnome.org/show_bug.cgi?id=581141
2009-05-04 13:50:49 -04:00
Sander Dijkhuis
7c8cb8450c Bug 578584 - Use the wallpaper for the overlay background
The overlay looks nicer with the root window pixmap drawn on the
background. It is scaled up to twice the size, with positioning
based on the rule of thirds.

The sideshow animations shown when entering or leaving the
overlay and toggling the extended view were implemented by
Marina Zhurakhinskaya. They replace the old method of having a
black rectangle behind the workspaces that partly covers the
sideshow during transitions.

configure.ac: Add gdk-x11, clutter-x11 and clutter-glx modules.
overlay.js: Add a root window pixmap actor, make sideshow width
    definitions more logical, replace the way the sideshow
    animates when entering or leaving the overlay.
workspaces.js: Remove the backdrop, add helper functions for the
    overlay transitions.
shell-global.[ch]: Add a method that creates an actor displaying
    the root window pixmap and returning clones of it.
2009-04-22 02:46:36 +02:00
Dave Jordan
a074ef5d7c Use a grid pattern in overlay if more than 6 windows
The diagonal arrangement currently used in the overlay when there are
more than 6 windows is hard to read and hides most of the previews.
Both of these issues are fixed by arranging the windows in a grid pattern.

http://bugzilla.gnome.org/show_bug.cgi?id=576269
2009-03-31 18:58:46 -04:00
Marina Zhurakhinskaya
c018b7652f Don't add windows to overlay workspaces when overlay is being exited.
When a window is added while overlay is being exited (e.g. because
some application was launched), we don't want to add that window to
the workspace's window clones. Previously, the window clone was added
and an animation to place the windows to their overlay workspace view
positions was triggered, which resulted in the wrong animation being
shown and an abrupt change in window positions when the actual workspace
was shown.

Add a boolean argument to two _positionWindows() calls that were missing
an argument.
2009-03-17 18:33:54 -04:00
Marina Zhurakhinskaya
8aa56e373f Bug 574691 – Stay in the overlay mode after drag and drop
Just calling launch() on the item instead of activate(), launches the item but doesn't close the overlay mode.
2009-03-10 13:37:01 -04:00
Owen W. Taylor
0f7abf96a7 Port to Clutter-0.9
tools/build/gnome-shell.modules: Point  at master branch of Clutter (0.9)
  and make gobject-introspection a dep of Clutter.
configure.ac src/Makefile.am: Use Clutter-0.9
js/ui/button.js js/ui/genericDisplay.js js/ui/overlay.js js/ui/panel.js
js/ui/runDialog.js js/ui/workspaces.js src/shell-status-menu.c:
  Use ClutterText instead of ClutterLabel and ClutterEntry
js/ui/workspaces.js js/ui/genericDisplay.js: Use ClutterClone instead
  of ClutterCloneTexture
src/shell-global.[ch]: Add Shell.get_event_key_symbol() to workaround
  unaccessibility of clutter_key_event_symbol() to use.
js/runDialog.js js/overlay.js: Use Shell.get_event_key_symbol() as
  appropriate.
2009-02-23 14:53:06 -05:00
Jonathan Matthew
0eb4873ba0 Bug 572384 - can't select windows that are on all workspaces in the overlay
Workspace._onCloneSelected doesn't need to ask the window which
workspace it's on, it can just use its own workspaceNum field.
2009-02-20 00:02:49 +10:00
Marina
2d3988c5fc Bug 570579: Redo the layout of overlay components
Divide the screen into a grid and use it to determine the layout of the overlay components in a more consistent manner.

Remove the 'Add workspace' control and slide the workspaces
display to the side without scaling it when switching to the 'More' mode.
2009-02-10 17:38:06 -05:00
Dan Winship
11561fd902 Abstract drag-and-drop a bit and add application/recent document DND. #569717 2009-02-10 11:20:48 -05:00
Dan Winship
e79c776c2e Add a wrapper around tweener to do some extra integration
Automatically removes tweens on destroyed actors, and provides
additional "animation started/stopped" callbacks (eg, for tracking
whether or not to show window clone titles)
2009-02-10 11:20:39 -05:00
Colin Walters
34f5adc9c0 Ignore newly added non-overlay windows
This prevents e.g. the popup menu from statusmenu from appearing
as a toplevel window.

svn path=/trunk/; revision=185
2009-02-04 22:40:24 +00:00
Dan Winship
48e578ddaa Small fix for when a new window is added just before leaving the overlay
svn path=/trunk/; revision=182
2009-02-04 18:24:20 +00:00
Dan Winship
4850ea608f Track window adds/removes in the overlay. #568983
svn path=/trunk/; revision=180
2009-02-04 14:50:50 +00:00