Commit Graph

125 Commits

Author SHA1 Message Date
Giovanni Campagna
50aa15dec9 Reintroduce Wanda The Fish
When transitioning from gnome-panel to gnome-shell in 3.0 we
lost the ability to summon the wisdom of the mythical fish.
This patch restores this, for the few adepts that are aware of
the magical incantation.
(Not as configurable as the original one, but it's an easter egg
after all...)

https://bugzilla.gnome.org/show_bug.cgi?id=666606
2011-12-20 20:06:14 +01:00
Florian Müllner
f2c79be11a workspaces-display: Make workspacesView private
WorkspacesDisplay was introduced to manage the workspace objects
and views; however, the overview still accesses the view held
by the workspacesDisplay directly, which is a bit odd.
Add some additional methods needed by the overview, and make the
view a private property.

https://bugzilla.gnome.org/show_bug.cgi?id=652580
2011-12-01 17:55:13 +01:00
Giovanni Campagna
17c46c2452 Port everything to class framework
The last patch in the sequence. Every place that was previously
setting prototype has been ported to Lang.Class, to make code more
concise and allow for better toString().

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Dan Winship
75b824d032 *.js: Make emacs modelines consistent
js2-mode is no longer developed and we recommend js-mode these days,
so switch the modelines to specify that, and make them consistent
across all files.

https://bugzilla.gnome.org/show_bug.cgi?id=660358
2011-10-11 08:05:12 -04:00
Philippe Normand
595be5083c overview: Add API to remove search providers
As extensions are now expected to provide a "disable" function,
they need to remove search providers they added. Implement the
removal functionality and add a public removeSearchProvider()
method.

https://bugzilla.gnome.org/show_bug.cgi?id=657548
2011-09-04 13:28:08 +02:00
Philippe Normand
8b796e745d overview: Add public API to add search providers
Add a addSearchProvider() method, so extensions don't have to access the
view selector directly, which is now a private property of the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=658113
2011-09-04 13:28:08 +02:00
Adel Gadllah
1dee10c575 Toggle mutter's unredirect features on/off depending on the situation
We disable it when in the overview or when recording a video and otherwise
leave it enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=618497
2011-08-30 00:15:52 +02:00
Morten Mjelva
352fb7b833 search: Allow searching for people in overview mode
This adds contacts search to shell, powered by libfolks.
Changes:

- Add Folks and Gee to the build system
- ShellContactSystem, a backend in C
- ContactDisplay, search frontend in JS

https://bugzilla.gnome.org/show_bug.cgi?id=643018
2011-08-29 17:43:30 -04:00
Rui Matos
155997b5fa Overview: dim the background with the dim-factor property
Doing this rather than overdrawing a black rectangle saves us
(pixels in screen) * 8 bytes of memory bandwidth for every frame we draw going
into the overview.

It also allows us to dim the background on non-primary monitors making the
overall overview appearance consistent across all monitors.

https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 19:17:01 +01:00
Rui Matos
82ce8fe3ff Use Meta.BackgroundActor instances instead of cloning global.background_actor
Instances of this class share a single CoglTexture behind the scenes which
allows us to show the background with different rendering options without
duplicating the texture data.

https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 19:17:01 +01:00
Ray Strode
35e99266ba overview: Add dummy mode
We're not going to want an overview at the login screen,
but a lot of code in the shell depends on the overview
existing.

This commit adds a new isDummy constructor property to
allow creating the overview as a non-functional, stub object
that doesn't do anything visible.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:30:52 -04:00
Ray Strode
67ae8ed8e9 overview: make shellInfo private
This commit forwards the shellInfo setMessage method
to the overview itself and makes shellInfo private.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:29:41 -04:00
Ray Strode
356e4c0967 overview: make dash private
The dash object is currently exposed as a public object.
It's only used outside of the overview for the dash object's
iconSize property though.

This commit makes the dash object private and proxies the dash
iconSize property to the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:25:04 -04:00
Ray Strode
80a9d2e7c9 overview: Make viewSelector private
It's only used internally by the overview itself,
and by some performance testing code, so don't
expose it as a public object.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:23:59 -04:00
Colin Walters
10dcc100e9 Kill off ShellAppInfo, move into ShellApp
This dramatically thins down and sanitizes the application code.

The ShellAppSystem changes in a number of ways:
* Preferences are special cased more explicitly; they aren't apps,
  they're shortcuts for an app), and we don't have many of them, so
  don't need e.g. the optimizations in ShellAppSystem for searching.
* get_app() changes to lookup_app() and returns null if an app isn't
  found.  The semantics where it tried to find the .desktop file
  if we didn't know about it were just broken; I am pretty sure no
  caller needs this, and if they do we'll fix them.
* ShellAppSystem maintains two indexes on apps (by desktop file id
  and by GMenuTreeEntry), but is no longer in the business of
  dealing with GMenuTree as far as hierarchy and categories go.  That
  is moved up into js/ui/appDisplay.js.  Actually, it flattens both
  apps and settings.

Also, ShellWindowTracker is now the sole reference-owner for
window-backed apps.  We still do the weird "window:0x1234beef" id
for these apps, but a reference is not stored in ShellAppSystem.

The js/ui/appDisplay.js code is rewritten, and sucks a lot less.
Variable names are clearer:

_apps -> _appIcons
_filterApp -> _visibleApps
_filters -> _categoryBox

Similarly for function names.  We no longer call (for every app) a
recursive lookup in GMenuTree to see if it's in a particular section
on every category switch; it's all cached.

NOTE - this intentionally reverts the incremental loading code from
commit 7813c5b93f.  It's fast enough
here without that.

https://bugzilla.gnome.org/show_bug.cgi?id=648149
2011-08-10 12:59:32 -04:00
Rui Matos
361308eb1b Revert "wip: cross fade the window_group and window clones going in/out of the overview"
This reverts commit 1625591598.
2011-07-20 00:45:53 +01:00
Rui Matos
1625591598 wip: cross fade the window_group and window clones going in/out of the overview
https://bugzilla.gnome.org/show_bug.cgi?id=653868
2011-07-20 00:25:11 +01:00
Dan Winship
64b2b4a7d4 layout: new file handling shell layout
Remove ShellGlobal's monitor-related methods, and have
Main.layoutManager provide that information instead. Move
Main._relayout() to LayoutManager, and have other objects connect to
the layout manager's 'monitors-changed' signal to know when the screen
geometry has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=636963
2011-07-06 08:38:35 -04:00
Florian Müllner
737f395d6c dnd: Rename DND.removeMonitor() to DND.removeDragMonitor()
DND.addDragMonitor() and DND.removeMonitor() are inconsistently
named, so rename the latter.

https://bugzilla.gnome.org/show_bug.cgi?id=652730
2011-06-27 21:39:28 +02:00
Adel Gadllah
c450120409 SwipeScroll: Only allow starting with the left button
Currently we allow starting swipe-scroll with any mouse button
which is weird from an UI pov and causes inconsistencies with
event handling.

https://bugzilla.gnome.org/show_bug.cgi?id=647186
2011-06-27 17:08:25 +02:00
Dan Winship
898b2b903d environment: put gettext stuff into global environment
Rather than defining _() as a local function in every module, put it
into the global environment (along with C_() and ngettext()).

https://bugzilla.gnome.org/show_bug.cgi?id=649203
2011-05-16 14:57:21 -04:00
Marina Zhurakhinskaya
812812d817 MessageTray: show multiple notifications per source
Add an ability to show multple notifications per source, so that
the user doesn't miss seeing any notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=611611
2011-03-22 18:18:11 -04:00
Adel Gadllah
528fc9bc47 XDND: Allow workspace switching using the thumbnails
Currently activating a window on a different workspace requires very
long drag distances, which is very inconvenient to use.

Fix that by allowing switching workspaces using the thumbnails which is
consistent with window and launcher dnd and much easier to use.

https://bugzilla.gnome.org/show_bug.cgi?id=643945
2011-03-22 00:05:17 +01:00
Owen W. Taylor
c81c564941 overview: Don't pick for every overlay
Don't do an individual hover fixup for every window overlay, instead
just use the new global.sync_hover() to fix up hovers once we have
finished showing the overview.

Based on a patch from Adel Gadllah <adel.gadllah@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=638613
2011-03-21 17:45:51 -04:00
Florian Müllner
6ae914da2f overview: Handle drag-cancelled signal for items
Allow handling the drag-cancelled signal for non-window items, just
like the handling for windows instroduced in commit a80e88e33.

https://bugzilla.gnome.org/show_bug.cgi?id=644324
2011-03-19 11:16:10 +01:00
Owen W. Taylor
e8eec2d357 Use points for font sizes
Do a basic job of converting font sizes from pixels to points, so they
will scale will the global GNOME scale factor. Some other sizes that are
clearly related to the font sizes are changed to ems, but no comprehensive
attempt is made to get rid of px units.

https://bugzilla.gnome.org/show_bug.cgi?id=636868
2011-03-15 12:01:40 -04:00
Adel Gadllah
29d473f2fa XDND: Fix dragMonitor leak in WorkspacesDisplay
WorkspacesDisplay removes its dragMonitor in _dragEnd, but
this was never called in when a xdnd drag ended causing
dragMonitors to stack up and handling events multiple times.

Fix that by making sure that _dragEnd is called when xdnd ends.

https://bugzilla.gnome.org/show_bug.cgi?id=644642
2011-03-14 22:03:33 +01:00
Owen W. Taylor
d16acc43d9 viewSelector: allow programmatically switching to tabs
Add the idea of an 'id' for a tab, and add a public switchTab method
so you can switch to 'applications' or 'windows'. This will be useful
for performance tests that test tab switching performance.

https://bugzilla.gnome.org/show_bug.cgi?id=644266
2011-03-11 19:25:40 -05:00
Alexander Larsson
a80e88e33e dnd: Add a drag-cancelled signal
This lets us start the workspace zoom out animation right when the
snapback starts, rather than waiting for the snapback to finish.

https://bugzilla.gnome.org/show_bug.cgi?id=643786
2011-03-09 10:36:09 +01:00
Alexander Larsson
0207f1f29b Restructure the way we handle positioning zooming in Workspace
We currently show the workspace in the overview in a rectangle
with the same aspect ratio as the screen. Originally this was
probably done since it showed the desktop, but we don't do this
anymore, and the positioning of the windows in the overview is
strictly a grid, so its not in any way related to monitor geometry.
Additionally, in the multihead case the screen aspect ratio is
very different from the overview monitor geometry, so a lot of
space is lost.

So, instead we just fill the entire inner rectangle of the overview
with the workspace. However, the way the zoom into and out of the
workspace right now is by scaling the workspace so that it covers
the entire monitor. This cannot really work anymore when the workspace
is a different aspect ratio. Furthermore the coordinates of the
window clone actors are of two very different types in the "original
window" case and the "window in a slot case". One is screen relative,
the other is workspace relative. This makes it very hard to compute
the cost of window motion distance in computeWindowMotion.

In order to handle this we change the way workspace actor positioning
and scaling work. All workspace window clone actors are stored in
true screen coordingates, both the original window positions and the
in-a-slot ones. Global scaling of the workspace is never done, we
just reposition everything in both the initial zoom and when the
controls appear from the side.

There is one issue in the initial and final animations, which is that
the clip region we normally have for the workspacesView will limit the
animation of the clones to/from the original positions, so we disable
the clip region during these animations.

https://bugzilla.gnome.org/show_bug.cgi?id=643786
2011-03-09 10:36:02 +01:00
Dan Winship
0cccf1d4cc viewSelector: add Applications pane and search entry to Ctrl-Alt-Tab
Add Ctrl-Alt-Tab support to ViewTab, and fix the Applications pane to
scroll to track the keyboard focus.

The Windows pane can be switched to, but navigation within the pane is
not yet implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=618887
2011-03-07 11:15:05 -05:00
Dan Winship
7aa326a836 overview, appDisplay: add Dash to Ctrl-Alt-Tab
Add the dash to Ctrl-Alt-Tab, add appropriate :focus CSS, and connect
to the popup-menu signal on dash icons.

https://bugzilla.gnome.org/show_bug.cgi?id=618887
2011-03-07 11:15:05 -05:00
Maxim Ermilov
3a6b4f3eb5 main: correct pushModal/popModal mechanism
1. disconnect destroy signals in popModal (actors can have great lifetime and then pushed again)
2. incorrect pushModal/popModal pair in overview
https://bugzilla.gnome.org/show_bug.cgi?id=64078
2011-03-03 03:53:04 +03:00
Adel Gadllah
260e6662f0 overview: Remove unused 'getWorkspacesForWindow' method 2011-02-25 19:43:47 +01:00
Dan Winship
d5735496af viewSelector: don't process key presses from capture-event
Rather than connecting to stage::capture-event and then trying to
guess whether or not a given key-press should be handled by us or not,
handle the end-search-on-Escape case from entry::key-press-event
(since it only makes sense when the entry is focused anyway) and the
start-search-on-printable-key case from stage::key-press-event (which
will only get the events that no other actor wanted for itself).

Similarly, do exit-overview-on-Escape and switch-panes cases from
stage::key-press-event, rather than
viewSelector.actor::key-press-event, so that they will work correctly
even if the keyboard focus is somewhere else. (Also fix a longstanding
bug in the pane-switching code, which was supposed to be disabled when
a search was active, but was checking a non-existent variable.)

https://bugzilla.gnome.org/show_bug.cgi?id=642502
2011-02-24 09:36:36 -05:00
Adel Gadllah
6d6ec46f25 XDND: Remove the switch timeout in _onDragEnd
When the user cancels the drag while hovering over a window the timeout
handler will throw an exception because the drag actor will be destroyed
at this point.

Fix that by removing the timeout in _onDragEnd.
2011-02-24 11:47:00 +01:00
Adel Gadllah
8d78c3a2ab XDND: Always update the timestamp on motion
The xdnd timestamp gets updated on every xdnd-position event,
so while waiting for the window timeout to fire we need to make sure we
update the timestamp when getting on motion to activate the window
with the correct timestamp.
2011-02-24 11:46:53 +01:00
Owen W. Taylor
9c4cee7875 overview: avoid round-off errors when sizing and positioning view selector
We need the view selector to extend all the way to the right edge of the
monitor, so size and position the view selector in a way that the sum of
its X position and its width add up to the primary monitor width.

https://bugzilla.gnome.org/show_bug.cgi?id=642834
2011-02-21 12:20:38 -05:00
Florian Müllner
6b429b7f50 view-selector: Remove show/hide functions
As Main.overview is now usable from the view selector's constructor,
move the setup of signal connections there and remove the show/hide
methods which were used as workaround.

https://bugzilla.gnome.org/show_bug.cgi?id=642196
2011-02-16 19:58:21 +01:00
Florian Müllner
f1c279765b dash: Remove show/hide functions
As Main.overview is now usable from the dash's constructor, move
the setup of signal connections there and remove the show/hide
methods which were used as workaround.

https://bugzilla.gnome.org/show_bug.cgi?id=642196
2011-02-16 19:58:21 +01:00
Florian Müllner
f39e693324 overview: Split a public init() function out of the constructor
The Overview does not only hold the different elements visible in
the overview, but is also a central point to manage drag signals.
As objects which are constructed in the overview constructor cannot
access Main.overview (as its constructor has not finished yet), we
use misnamed show/hide methods to work around this limitation, which
are called when entering/leaving the overview.
A better way to handle this problem is to remove the limitation
altogether by splitting the overview constructor between internals,
which remain in the constructor, and more complex objects which
need to access Main.overview, and whose initialization is moved
to a public init() function which is called by main.js after the
overview has been constructed.

https://bugzilla.gnome.org/show_bug.cgi?id=642196
2011-02-16 19:58:17 +01:00
Florian Müllner
2f3e47b586 overview: Make the dash public
In order to enable components other than Overview to read the
dash's iconSize, make the dash a public property of the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=639428
2011-02-12 23:32:57 +01:00
Florian Müllner
eb8fc738af swipe-scrolling: Take threshold into account during drag
On button-release, a threshold is used to determine if the gesture
should be considered a click and thus ignored. While the drag is
active though, the controlled actor is dragged immediately. As a
result, dragging by a tiny amount does not trigger a snap back when
the action is interpreted as a click. As a fix, do not update the
dragged actor's position until the same threshold is passed.

https://bugzilla.gnome.org/show_bug.cgi?id=640494
2011-01-25 10:31:52 +01:00
Florian Müllner
b9e1d917da swipe-scroll: Don't eat button-release events on click
The main overview group starts capturing events on button-press
events to implement swipe-scrolling. While reactive children of
the group which handle both button-press and button-release events
don't trigger swipe-scrolling, children that only rely on
button-release have stopped working - at least the primary/secondary
icons of the search entry are affected. While the capture handler
already checks the pointer movement between press and release to
determine whether the action should be considered a click rather
than a drag, it still blocks the release event from propagating.
Instead, only block release events for drag actions, but not for
clicks.

https://bugzilla.gnome.org/show_bug.cgi?id=640493
2011-01-25 10:31:52 +01:00
Florian Müllner
a6da22fa70 overview: Add a facility for swipe-scrolling
The workspaces view allows to drag the active workspace to swipe-scroll
to the next or previous workspace. While this behavior can come in handy
in general, there are good reasons to move the functionality to the
overview:

 - Finding a spot on a workspace to start a drag can be hard,
   especially when the workspace contains a single window
 - With the new layout, workspaces have no visible border, making
   it hard to predict where a drag can be initiated
 - The same behavior is equally useful for other elements

So add setScrollAdjustment() to the overview, which allows setting
an adjustment controlled with swipe-scrolling (either horizontally
or vertically); only a single adjustment can be controlled at a
time. A swipe-scroll can be initiated on any part of the background that
is not occupied by a reactive actor. For cases where further control
is needed, 'swipe-scroll-start' and 'swipe-scroll-end' signals are
emitted.

https://bugzilla.gnome.org/show_bug.cgi?id=635034
2011-01-24 02:59:32 +01:00
Florian Müllner
df3560143d overview: Always return a value in _onDragMotion()
Drag monitor functions are supposed to return a value, but
_onDragMotion() does not always do so. Add the missing return
value and remove unnecessary else.
2011-01-20 17:04:38 +01:00
Adel Gadllah
ee6a852996 XDND: Don't reset switch timeout when pointer is over the same window
Currently we reset the timeout on every mouse movement which means
the user has to keep the mouse at the exact same position for 1.25
seconds.

Be more tolerant and allow the user to move the mouse over the
window without reseting the timeout, which should make activating
windows easier.

https://bugzilla.gnome.org/show_bug.cgi?id=638896
2011-01-20 09:57:50 +01:00
Florian Müllner
56f6c9c5f6 genericDisplay: Remove unused module
GenericDisplay used to provide a common base class for places and
recent items, none of which exists anymore. As of current mockups,
display items in "Finding and Reminding" should be based on
BaseIcon / IconGrid instead.
2011-01-14 22:30:02 +01:00
Dan Winship
7322a4e4ef messageTray: add SystemNotificationSource, moved from overview.js
Move the overview's "System Information" source here, so it can be
used by non-overview code as well.

https://bugzilla.gnome.org/show_bug.cgi?id=635089
2011-01-13 12:14:40 -05:00
Adel Gadllah
0052657a22 Overview: Update warping code to new gdk api 2011-01-05 23:45:02 +01:00