Compare commits

...

774 Commits

Author SHA1 Message Date
60d87ef4ba Handle global keybindings in the shell
Handling global keybindings, such as volume and brightness keys
but also custom keybindings, directly in the compositor is the only way
to deal with grabs and modal operations that could be active (primarily
the overview, for which special policy was introduced in the last
commit)

https://bugzilla.gnome.org/show_bug.cgi?id=613543
2012-11-10 17:04:48 +01:00
d886dc17e1 Prefix keybinding names with 'internal-keybinding-'
This is what mutter does internally now, to disambiguate them with
custom keybindings introduced with display.add_keybinding().

https://bugzilla.gnome.org/show_bug.cgi?id=613543
2012-11-10 17:04:48 +01:00
9dd2a467ba Main: filter keybindings when the shell is modal
Mutter now handles some keybindings even when the compositor is
grabbed, so we need to filter the invocation at the handler level.
This allows to finally get rid of a old hack.

https://bugzilla.gnome.org/show_bug.cgi?id=613543
2012-11-10 16:22:03 +01:00
e757b06987 power: indicate 1 hour remaining correctly
Before 60 minutes remaining were displayed
as "0 minutes" now it is "1 hour".

https://bugzilla.gnome.org/show_bug.cgi?id=687958
2012-11-09 17:19:05 +01:00
6f2da1baf1 Updated Hebrew translation. 2012-11-09 11:36:39 +02:00
f30dcad8a7 messageTray: Close the notification on Escape
Now that the notifications can be focused with the keyboard, it's
important we can close the active one also this way.

https://bugzilla.gnome.org/show_bug.cgi?id=652082
2012-11-08 21:19:52 +01:00
7dc235511e messageTray: Add a notification focus keybinding
At the moment, only the mouse can be used to focus and answer a chat
notification.

This adds a new keybinding (defaults to <Super>+n) to focus and expand
the active notification.

https://bugzilla.gnome.org/show_bug.cgi?id=652082
2012-11-08 15:46:16 +01:00
644c210fe2 Rename "System Settings" to "Settings"
"System Settings" has been renamed to "Settings" in gnome-control-center.
See bug https://bugzilla.gnome.org/show_bug.cgi?id=681543

This patch does the same rename in the shell itself, as per

https://bugzilla.gnome.org/show_bug.cgi?id=687738
2012-11-07 16:05:23 +00:00
68e8f98671 .gitignore: Update to ignore the generated manpage 2012-11-07 14:39:28 +01:00
1228db6ac1 unlockDialog: better confirmation button label
If I click on "Not listed?" in the login screen, I come to a username
field with two buttons: "Cancel" and "Sign In".

Clicking on "Sign In" doesn't actually sign me in though - it takes me
to the login entry. It would be better to rename "Sign In" to "Next" for
the username stage, therefore.

Gdm emit a signal to ask a question or a secret, but we can not know if
this is the last authentication question, hence we only use "Sign In"
for secret questions which improve the situation a lot.

https://bugzilla.gnome.org/show_bug.cgi?id=687656
2012-11-07 01:26:35 +01:00
86596749fa Revert "overview: highlight windows on launcher hover"
This reverts commit 76229a3601.

Pushed by accident.
2012-11-07 00:33:32 +01:00
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
95abdeb919 dash: simplify app retrieval from AppWellIcon
This has also the benefit of getting the application even if it can not
be retrieved through AppSystem, which can happen if the runtime WMClass
does not match the one of the desktop file.

This especially looked wrong with the following commits related to the
bug.

https://bugzilla.gnome.org/show_bug.cgi?id=657315
2012-11-07 00:27:31 +01:00
df0151d338 dash: rename a local variable for clarity
createAppIcon creates an appIcon, not a 'display', which made things
unnecessarily more difficult to understand.

https://bugzilla.gnome.org/show_bug.cgi?id=657315
2012-11-07 00:26:50 +01:00
ee2f12fe81 dash: properly restore item label on popup close
We simply hide the label when the popup is opened instead of relying
on the popup state when the hover state change.

To do this we replace the flag isMenuUp by a 'menu-state-changed' signal
on the AppWellIcon. This simplifies the dash label visibility handling
code that need additional changes for the bug.

https://bugzilla.gnome.org/show_bug.cgi?id=657315
2012-11-07 00:26:11 +01:00
10c104529f remote-search: initialize the DBus proxy asynchronously
Initializing this synchronously means that we will possibly wait for the
process to be auto-activated and answering to our call.
If the process is already running it also might not answer immediately
our request, as it might be doing sync I/O.
The right thing to do is to initialize the proxy asynchronously; there
are try/catch blocks in place for when the object is not available, or
not properly initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=687491
2012-11-06 18:11:56 -05:00
cbc8ec6508 remote-search: don't use g_file_query_exists()
This is called in the main thread, which we should never block for
synchronous I/O.
Since the operation we're wrapping is async already, just use
g_file_query_info_async() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=687491
2012-11-06 17:47:48 -05:00
8e7758e280 remote-search: require a DesktopId field in search providers
Remote search providers install an auxiliary keyfile to specify
static information, such as the object path/bus name needed to activate
the binary. Such keyfiles also specify the application the providers
pushes results for; currently, we support two formats for application
information
- two fields, "Title" and "Icon" that specify a (translatable) title and
  an icon name for display
- one field "DesktopId" that specifies the desktop file name of the
  application backing the provider, which obsoletes the previous
  Title/Icon syntax

Since all providers in GNOME use DesktopId now, and we need to ensure a
remote search providers is always backed by an application for future
development, this commit drops the support for the older syntax.

https://bugzilla.gnome.org/show_bug.cgi?id=687491
2012-11-06 17:47:48 -05:00
9aefbd189c view-selector: add missing semicolon
https://bugzilla.gnome.org/show_bug.cgi?id=687491
2012-11-06 17:47:47 -05:00
b9d50584d8 screenshield: use the correct actor for the background
Commit 4fd690333a added the GLSL snippet to
the background actor, but then discarded the newly created actor.
2012-11-06 17:47:13 -05:00
e5f7390c09 ScreenShield: hide the cursor while the lock screen is on
While the screen is locked and the cursor is not moved, the mouse
cursor should be hidden, to indicate the machine is idle.

https://bugzilla.gnome.org/show_bug.cgi?id=682535
2012-11-06 23:10:01 +01:00
797b1ff8bb ScreenShield: account for motion velocity when hiding the lock screen
Switch from a ClutterDragAction to a ClutterGestureAction, that gives
us the velocity of mouse motion at each step, and use it to compute the
animation time for completing the hide gesture.

https://bugzilla.gnome.org/show_bug.cgi?id=682537
2012-11-06 23:04:15 +01:00
09b738045c MessageTray: change height in chat notification to have more context.
https://bugzilla.gnome.org/show_bug.cgi?id=665255
2012-11-06 21:53:28 +00:00
4fd690333a ScreenShield: blur and desaturate the screenshield background
The background is the same as the normal desktop, so we blur and
desaturate it to clearly show that it's not the normal system state.
To do so, we don't use standard ClutterEffects, to avoid the FBO
indirection. Instead, we take advantage of MetaBackgroundActor support
for GLSL code and paint the shaded background texture directly.

https://bugzilla.gnome.org/show_bug.cgi?id=682536
2012-11-06 22:50:10 +01:00
5ef5e25a7f Use "Decline" instead of "Reject" for incoming calls
This makes GNOME Shell more polite
Fixes bug #661194
2012-11-06 20:52:53 +00:00
87e8770cbc loginDialog: support disable-user-list key
In some deployments showing a user list at the login
screen is undesirable.

GDM's fallback login screen has a configuration key:

org.gnome.login-screen disable-user-list false

that causes the user-list to get hidden.

This commit adds similar functionality to the normal,
shell-based login screen.

Based on a series of patches by Marius Rieder.

https://bugzilla.gnome.org/show_bug.cgi?id=660660
2012-11-06 15:05:15 -05:00
cac9d120be loginDialog: hide session list until username is entered
Right now when a user clicks "Not Listed?" they end up
seeing a session list that gets reset after they enter their
username.

This commit hides the session list until the username has
been entered.

https://bugzilla.gnome.org/show_bug.cgi?id=660660
2012-11-06 15:02:36 -05:00
1ae0fadbf4 loginDialog: don't rely on PAM to ask for a username
For the "Not Listed?" case we will need to be able
to identify when the user has entered their username.

Once we have a way of tracking when the username is
entered, we can then defer showing the session list
too early, before the user can reliably pick a
session.

This username tracking will also be important for
implementing a disable-user-list configuration key.
If the config key gets toggled off at runtime, we'll
need to know if we're at a disruptive part of
the authentication process or not, so we know whether
we can can expose the user list right away, or wait
until the authentication conversation finishes.

Right now, we pass null in for an initial username,
and let the PAM machinery ask the user, which means we
have no good way of knowing when the username is entered.

This commit changes the "Not Listed?" code to ask the
user their username up front, before starting the PAM
conversation in much the same way we do if the user
picks a user from the user list.

https://bugzilla.gnome.org/show_bug.cgi?id=660660
2012-11-06 15:02:36 -05:00
65497e089a [l10n] Updated German translation 2012-11-06 20:15:34 +01:00
2d763bd033 st-entry: Change the pointer cursor on enter/leave events
Change the pointer cursor to an i-beam when it is inside the ClutterText.

https://bugzilla.gnome.org/show_bug.cgi?id=687130
2012-11-06 11:47:49 +00:00
4ebf396cf5 a11y: fixing a regression with the accessible name at dash items
After some changes, the tooltip label at the dash is not available
until it is visually shown. As this is not anymore a reliable
source of accessible name, we just set the accessible name
with the string used on that label.

https://bugzilla.gnome.org/show_bug.cgi?id=686583
2012-11-06 10:05:18 +01:00
6faa50d496 Add a --disable-man configure option
OSTree doesn't have DocBook stylesheets, so generating
man pages from xml causes build failures there.
2012-11-05 23:43:03 -05:00
6fcd6298c8 Use the same xsltproc parameters as other modules
Using the same parameters makes sure that the generated man
pages look more or less uniform.
2012-11-05 23:42:52 -05:00
5c16be5dbb Some updates to the man page
Mention relevant files, and how gnome-shell gets started
in the session.

https://bugzilla.gnome.org/show_bug.cgi?id=680601
2012-11-05 19:32:01 -05:00
e3abb6f178 Convert man page to Docbook
This make it easier to update the content and to transform
the man page into other output formats, like HTML.

https://bugzilla.gnome.org/show_bug.cgi?id=680601
2012-11-05 19:31:54 -05:00
70736be4eb mobile-providers: new country-specific type to gather providers
shell_mobile_providers_parse() was returning the country information split
into a hash table with providers and a hash table with country names. This
patch merges both outputs into a single per-country object, so the parse()
method now returns a GHashTable with the following element-type:
   (element-type utf8 ShellCountryMobileProvider>)
This also avoids more complex setups like returning lists inside of hash tables,
which was actually breaking either g-i or gtk-doc.

shell_mobile_providers_parse() was also modified to allow inputting the paths
of the country codes and provider list files to use. If paths are not given, the
default ones will be used. This helps us to provide test files during unit
tests.

Both the findProviderForMCCMNC() and findProviderForSid() methods are exported
out of the GSM and CDMA specific classes, and new unit tests for them are
implemented. Tests can be run manually with:
    $> ./tests/run-test.sh tests/unit/mobileProviders.js

https://bugzilla.gnome.org/show_bug.cgi?id=687356.
2012-11-05 22:20:08 +01:00
1c3e7330f3 ScreenShield: don't rely on gnome-session to hide the lightbox
If we lock before the user becomes active again, gnome-session will never
change presence from IDLE, and thus we'll never hide the lightbox.
Instead, install our own idle monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=687020
2012-11-05 22:04:09 +01:00
6e4c89b310 main: hide the overview on key release
Entering the overview with the overlay key is done on key release but
exiting the overview on key press, which is inconsistent.

This change makes the overview hidden also on key release.

https://bugzilla.gnome.org/show_bug.cgi?id=683024
2012-11-05 21:14:28 +01:00
73b4a0ef5f st-theme: Optimize string_in_list
Rather than using a complicated set of function calls across
library boundaries and our own scanning logic, use strtok(),
which glibc already provides, and is probably much more optimized.

https://bugzilla.gnome.org/show_bug.cgi?id=687465
2012-11-05 15:10:31 -05:00
d88002c4ed Revert "panel: programmatic anim. control of AnimatedIcon"
This reverts commit e04a4c3923.

This commit exposed an already-existing race condition in the panel
animation code that caused the shell to crash for some people.

https://bugzilla.gnome.org/show_bug.cgi?id=687112
2012-11-05 14:31:04 -05:00
025c63c045 Implement non-linear overview shade for background
Adding a radial gradent to the dimming effect gives more depth to
the background.
Shading is computed in a GLSL fragment shader, and uses distance to
center of the screen to interpolate the darkening value to use.

Based on a patch by Pierre-Eric Pelloux-Prayer <pelloux@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=669798
2012-11-05 19:16:53 +01:00
b189cbd46e Updated Norwegian bokmål translation 2012-11-05 19:10:48 +01:00
a21ddb5914 gnome-shell-perf-tool: Fix various problems
* Fix wrong parameter name to on_name_appeared callbacks
* optparse doesn't just leave extra command line arguments, it
  errors out, so don't try to pass through extra arguments -
  instead add explicit passthrough for '--replace'
* Fix usage of Gio.DBusProxy
* Add a default value for --perf so that if it's not supplied
  things don't die with a mysterious error message. (This wasn't
  needed when --perf enabled perf-mode)

https://bugzilla.gnome.org/show_bug.cgi?id=687287
2012-11-05 13:08:25 -05:00
e04a4c3923 panel: programmatic anim. control of AnimatedIcon
The AnimatedIcon does not have an API for controlling the animation but
relies on the :visible property changes to start and stop a timeout used
to update the frame.

This has the inconvenient of having a side effect when visible is set to
true multiple times, and is not really the API expected from such
component.

Switch to a start/stop API instead. Also, update to the first frame at
startup while we are at it, since this is the expected behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=687583
2012-11-05 15:05:14 +01:00
ae0821e07b Disable the login button when there is no input
You can't login until something has been entered in the password field.
We should therefore make the login button insensitive until you have
entered some text.

https://bugzilla.gnome.org/show_bug.cgi?id=687112
2012-11-05 10:17:46 +00:00
a508bece36 Updated Czech translation 2012-11-04 20:00:52 +01:00
2c9969a8f4 Updated Russian translation 2012-11-04 20:49:26 +04:00
dd9fc91f6f keyboard: simplify using Caribou.KeyModel.label
https://bugzilla.gnome.org/show_bug.cgi?id=687242
2012-11-03 08:57:23 +09:00
39d9838cc1 Show feedback notifications when the user is busy
Notifications that are created in response to direct user actions like
"is ready" or "'foo' has been removed from favorites" should always be
displayed even though the user has marked him/herself busy.

https://bugzilla.gnome.org/show_bug.cgi?id=662900
2012-11-02 19:25:26 +01:00
1397c7c624 build: Add missing file
Fix distcheck breakage from commit 687e1eabed.
2012-11-02 16:56:42 +01:00
c09fcba94f layout: Remove message tray pointer barrier
The barrier was introduced to make the message tray hot corner
usable in multiple monitor setups. With the hot corner gone in
3.6, the pointer barrier doesn't make much sense anymore, so
remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=687457
2012-11-02 16:29:37 +01:00
c77b38fc4f telepathyClient: Fix auto-scroll to bottom
Instead of keeping track of the old adjustment.upper keep track of the
old adjustment.value that corresponded to the bottom scroll position.

This fixes the integrated chatview not always scrolling to the bottom
by removing the assumption that page_size is constant between updates,
which is not the case as the view is presented in various different ways.

https://bugzilla.gnome.org/show_bug.cgi?id=686571
2012-11-02 12:06:52 +01:00
aef9b733e5 loginDialog: drop spurious parameter
_onNotListed had an unusued, incorrect parameter.

This commit drops it.

https://bugzilla.gnome.org/show_bug.cgi?id=660660
2012-11-01 14:24:45 -04:00
348208617b Use the correct icon in the restart dialog
It currently uses system-shutdown-symbolic. view-refresh-symbolic
is a better fit in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=670687
2012-11-01 16:21:52 +00:00
2c34c8e20f Overview search box is too subtle
When it isn't focused, the search box can be quite hard to see.

The text/icon/border color is changed to be brighter in order to increase
contrast with the dark background and this works well with various
wallpapers.

https://bugzilla.gnome.org/show_bug.cgi?id=686479
2012-11-01 11:32:40 +00:00
d19fa731d6 Updated Polish translation 2012-10-31 19:15:34 +01:00
59bb1cc387 Add a setting to force the 'Log out' menuitem
I've heard quite a bit of feedback from people who want to log out,
even if they are the sole user on their system. It doesn't seem worth
alienating them over this; so add a setting to make the 'Log out' item
always show up.
https://bugzilla.gnome.org/show_bug.cgi?id=686057
2012-10-31 12:46:49 -04:00
56909d0646 Show 'Log out' in more situations
When the current user is a remote account, or a we are logged in
as root, we should always show 'Log out'.

https://bugzilla.gnome.org/show_bug.cgi?id=686736
2012-10-31 12:45:08 -04:00
04da29c939 appMenu: Update on icon theme changes
While we recreate icons on style changes elsewhere, the faded
icon in the application menu will stick around after icon theme
changes until another application is focused.

https://bugzilla.gnome.org/show_bug.cgi?id=687224
2012-10-31 00:06:46 +01:00
307f7a3024 IM status menu: adjust the combo popup background
The transparent background for available/unavailable IM status menu
makes the text difficult to read.

Simplifies that by using the default combo-popup background instead of a
custom one.

https://bugzilla.gnome.org/show_bug.cgi?id=658091
2012-10-30 22:51:50 +00:00
e80bfa39f5 userMenu: Use "offline" instead of "unavailable"
https://bugzilla.gnome.org/show_bug.cgi?id=687226
2012-10-30 23:01:22 +01:00
29714922ea calendar: Drop unnecessary libedataserverui dependency
The libedataserverui dependency is a relic of the old E-D-S API.
As of 3.6.0, E-D-S now centralizes authentication prompts so clients
don't have to display their own.  This also allows trading the GTK+
main loop for a plain GMainLoop in gnome-shell-calendar-server.c.

https://bugzilla.gnome.org/show_bug.cgi?id=687189
2012-10-30 14:18:39 -04:00
88192114ac NetworkAgent: cancel requests when disabling component
When the NetworkAgent is disabled (for example because the lock screen
is being activated), cancel all modal dialogs.

https://bugzilla.gnome.org/show_bug.cgi?id=685239
2012-10-30 16:34:13 +01:00
9d78208b76 NetworkMenu: don't use a global switch for all VPN connections
Stop pretending that VPN is a NMDevice, and split the useful bits into
a NMConnectionBased interface.
Make each connection have its own switch menu item and handle its own
status, and remove the VPN section title, which is no longer needed.

https://bugzilla.gnome.org/show_bug.cgi?id=682929
2012-10-30 16:08:33 +01:00
d817bf0395 theme: standardize the run dialog text styles a bit
Use the standard color for dialog headings, and use the standard
text style for the entry field. These tweaks make the dialog easier
to read.

https://bugzilla.gnome.org/show_bug.cgi?id=687127
2012-10-30 15:50:05 +01:00
4d51056226 runDialog: Remove "Run" button again
While not in the mockups, it was introduced during review of commit
0c807bddaf after discussion on IRC, but the designers disagree;
remove it again.

https://bugzilla.gnome.org/show_bug.cgi?id=687127
2012-10-30 15:50:05 +01:00
a607174a25 runDialog: Add entry to focus chain
Currently the entry takes the intial key focus, but is not actually
part of the focus chain. Fix that, even though keynav does not work
too well for the dialog anyway, due to the entry consuming tab for
command completion.

https://bugzilla.gnome.org/show_bug.cgi?id=687127
2012-10-30 15:50:05 +01:00
37d6a624b7 Improve the button insensitive style
The current insensitive style for buttons needs to be improved. Right
now we just change the text color: this doesn't make it clear that the
button is actually insensitive.

Instead of just changing the text color, we make the button background
almost transparent. We also make the text color the same as the border
color, use a thinner border.

This patch also simplifies some border rule overwrites to emphasis
only the border width is changed on focus, and makes the button look
closer to the mockups.

https://bugzilla.gnome.org/show_bug.cgi?id=687110
2012-10-30 12:35:48 +00:00
0c807bddaf runDialog: Better match style of other modal dialogs
Update the run dialog to
 - use a proper title
 - use dialog buttons
 - use the standard entry style

https://bugzilla.gnome.org/show_bug.cgi?id=687127
2012-10-29 19:12:12 +01:00
a0470bfc66 UnlockDialog: clear the password on failure
It is wrong, and the user can't correct it because it's obfuscated.
Just let him type it again.

https://bugzilla.gnome.org/show_bug.cgi?id=687132
2012-10-29 17:54:12 +01:00
b9463d23e8 ShellUserVerifier: fix fail counter
If it is updated after checking, it counts the number of failures
not including the current one, so it allows one extra attempt. Instead,
by updating it before checking, we get the expected result of dropping the
curtain at the third password.

https://bugzilla.gnome.org/show_bug.cgi?id=687132
2012-10-29 17:54:12 +01:00
04debd1623 LoginDialog: clear previous auth failed messages when trying again
When the user has the entered the password for the second time
and clicked OK, clear messages from the previous attempt, so any
new failure is shown clearly.

https://bugzilla.gnome.org/show_bug.cgi?id=687132
2012-10-29 17:54:11 +01:00
9d31576cf5 App search: Match GenericName too
This is making shell search results more useful in many cases,
such as 'web', 'browser', spreadsheet'.
https://bugzilla.gnome.org/show_bug.cgi?id=687121
2012-10-29 11:24:36 -04:00
8daca28a90 Updated Slovak translation 2012-10-28 19:50:05 +00:00
9899604261 Updated Slovak translation 2012-10-28 18:27:51 +00:00
687e1eabed Overview: Resize the window title labels on content change
Reposition the window overlay when the title changes, using the current
transformed size of the window clone.
Includes a test that changes title to a string of random length every 3 seconds.

Based on a patch by Alex Hultman <alexhultman@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=620874
2012-10-27 18:18:48 +02:00
eb09f34114 recorder: save recorded video as recent item
Often the first thing a user wants to do after making a recording
is post it somewhere.

This commit adds the video to recently used items, so that it shows
up prominently in open file choosers.

https://bugzilla.gnome.org/show_bug.cgi?id=680647
2012-10-26 13:29:30 -04:00
fbeb446ed7 recorder: rename "filename" property to "file-template"
The filename property is actually a template string with
substitution variables, not a filename.

This commit renames for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=680647
2012-10-26 13:29:30 -04:00
92033ce0f5 recorder: keep test-recorder alive until done recording
Recording continues for some time after the recorder object
is closed, since closing isn't a synchronous operation.

This commit defers quiting the test-recorder application until
the recording is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=680647
2012-10-26 13:29:30 -04:00
9171bab5e5 recorder: keep recorder object alive until pipeline finishes
We want to make sure the recorder isn't finalized until the
saved recording hits disk.  This means the pipeline object needs
a hard reference on the recorder.

https://bugzilla.gnome.org/show_bug.cgi?id=680647
2012-10-26 13:29:30 -04:00
f9819eb7b0 recorder: Clean up stage lifetime handling
The stage is a floating object. We don't own a reference
to it, so we shouldn't unref it.

This commit removes the erroneous unref call and makes sure
we call clutter_actor_destroy on the stage when we're done
with it.

https://bugzilla.gnome.org/show_bug.cgi?id=680647
2012-10-26 13:29:30 -04:00
85728f0d15 layout: Use a MetaBackgroundActor, not a custom ClutterX11TexturePixmap
While looking at how the plymouth implementation was built, I was so
short-sighted and focused on the string "_XROOTPMAP_ID" that I didn't
realize it was the name of the standard background on the root window.
Remove our own implementation, and switch to using a standard mutter
MetaBackgroundActor.

https://bugzilla.gnome.org/show_bug.cgi?id=682428
2012-10-26 11:54:25 -04:00
9396849d56 message-tray: Restore Fittsability of summary items
The reactive area of tray items should extend to the screen edge. This
regressed when implementing the new tray design, make it work again.

https://bugzilla.gnome.org/show_bug.cgi?id=686474
2012-10-26 16:32:07 +02:00
6f5e5672bb panelMenu: Fix exception when destroying menuless button
There's explicit API to create PanelMenu.Buttons with no menu, so
guard against this case in destroy().

https://bugzilla.gnome.org/show_bug.cgi?id=686763
2012-10-26 15:49:26 +02:00
b936e60876 screenShield: Tweak curtain animation timings
Rationale:
 - Getting something out of the way should be quick;

 - Very few things in the real world move linearly so, linear
   animations, especially for something as big and visible as this,
   felt too artificial;

 - Moving the curtain out should start slower to make it feel like
   having weight (it fills the whole screen after all) but quickly
   accelerate towards the end to make it snappy too.

https://bugzilla.gnome.org/show_bug.cgi?id=686745
2012-10-26 12:56:17 +02:00
fa4bd91213 build: Stop linking gnome-desktop
Since commit 80eac7370e removed the last build-time dependency ages
ago, we only use GnomeDesktop via introspection.
2012-10-26 12:37:33 +02:00
81eeef7d3c messageTray: Hide summary notification immediately when closing the tray
When the summary notification is open when the tray is closed, we end
up with two concurrent animations: the notification fading out, and the
tray moving away from underneath it. Sliding out the tray should be the
primary transition here, so hide the notification immediately to not
draw the user's attention away from it.

https://bugzilla.gnome.org/show_bug.cgi?id=686888
2012-10-25 22:45:36 +02:00
a7b5134820 messageTray: Hide notification close button immediately on click
Having the close button move away from under the pointer after
clicking it is confusing and distracts from the main transition,
which is hiding the notification. Just hide it immediately.

https://bugzilla.gnome.org/show_bug.cgi?id=682237
2012-10-25 22:41:32 +02:00
92a01c67ba messageTray: Don't destroy the notification when clicking on the close button
Clicking on the close button should simply hide the notification.

https://bugzilla.gnome.org/show_bug.cgi?id=682237
2012-10-25 22:41:32 +02:00
71c23613b5 messageTray: Only hide the notification stack on clicking close
Rather than destroying the entire source, which is unintuitive, simply
close the notification. Removing the entire source is still possible
by right-clicking on the summary item and choosing "Remove".

https://bugzilla.gnome.org/show_bug.cgi?id=682237
2012-10-25 22:41:05 +02:00
4f876995de messageTray: make SummaryItem._closeButton public
Use this to show/hide the close button instead of closeButtonVisible.

https://bugzilla.gnome.org/show_bug.cgi?id=682237
2012-10-25 21:45:18 +02:00
9cf4a76196 po: Enforce RTL in fa/ug for messages that might end up as LTR
See commit 8b796d80a7.

https://bugzilla.gnome.org/show_bug.cgi?id=686630
2012-10-25 20:12:25 +02:00
9efe5287e4 gdm: Move logo into the panel
GDM has a 'logo' key in its schema to allow distributors to add
some branding. It is currently placed above the user list, which
no longer works too well since the login screen lost its dialog
window. Display the logo in the top-left corner instead of the
Activities button instead.

https://bugzilla.gnome.org/show_bug.cgi?id=685852
2012-10-25 18:31:16 +02:00
8c4b34de4e messageTray: Fix close button position in RTL locales 2012-10-25 18:31:16 +02:00
93e3559dc3 style: Adjust close button overlap
After changing the button size, we need to adjust the x-offset by
1px (apparently the y-offset already assumed the correct size).
2012-10-25 18:31:16 +02:00
caa0f63e1f style: Fix close button size
The image is actually 32px, so we end up with a slightly fuzzy
button when scaling up to 34px. Don't do that.

Spotted by lamefun.xOr<at>gmail.com

https://bugzilla.gnome.org/show_bug.cgi?id=686574
2012-10-25 18:27:59 +02:00
a4e29e1244 calendar: Handle calendar-server errors
The current code assumes that the GetEvents call will always
receive, causing an exception in the error case.

https://bugzilla.gnome.org/show_bug.cgi?id=686805
2012-10-24 18:26:03 +02:00
599f2f43e3 Revert "screenShield: Connect to the actor's show signal instead of using BEFORE_REDRAW"
This reverts commit bdeb7d86b6.

git bz PEBKAC
2012-10-24 10:17:43 -04:00
3a453c5f73 messageTray: Fix lightbox
Commit 448517032e accidentally reverted the condition for showing
the lightbox. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=686728
2012-10-24 09:03:12 +02:00
98b313c75f popupMenu: Overwrite ongoing animations when calling close repeatedly
Currently close() is a no-op when the menu has already been closed.
However, repeated calls could pass different animation parameters.
For instance in the user menu, we try to hide the menu immediately
before locking the screen, to avoid the popup jumping across the
screen while fading out - as we do this from the corresponding
item's activate handler, the closing is still animated if the menu's
own handler (which requests a full animation) is run first.
Fix this by changing close() to overwrite ongoing animations before
bailing out early.

https://bugzilla.gnome.org/show_bug.cgi?id=686484
2012-10-23 22:21:45 +02:00
8b796d80a7 po: Enforce RTL in he for messages that might end up as LTR
As the messages start with a string placeholder that might be
untranslated, we need an explicit mark to ensure that the string
does not end up as LTR.

https://bugzilla.gnome.org/show_bug.cgi?id=686630
2012-10-23 22:21:45 +02:00
719a8908a6 Release 3.7.1
Update NEWS
2012-10-23 21:14:10 +02:00
fed007ecae userMenu: Use LoginManager for suspend
https://bugzilla.gnome.org/show_bug.cgi?id=686482
2012-10-23 21:14:10 +02:00
990443465f powerMenu: Use LoginManager for suspend
https://bugzilla.gnome.org/show_bug.cgi?id=686482
2012-10-23 21:14:10 +02:00
1f183b8a4e loginManager: Add support for suspend()
Logind provides a Suspend method, which we should use instead of
the UPower API when available. Expose this in loginManager, using
the UPower API for the ConsoleKit implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=686482
2012-10-23 21:14:10 +02:00
96556eb959 workspacesView: Add some more spacing between window and workspace thumbs
https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-10-23 15:12:45 -04:00
3ffeeac577 overview: Reduce space between window picker and dash
Do this in a hacky way by hardcoding this, for now. When we land
search rework, we can fix this.

https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-10-23 15:12:45 -04:00
d7929a2340 workspacesView: Don't conform to aspect ratio
We want the window picker to use the full height of the area it's given.

https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-10-23 15:12:45 -04:00
667019a8c1 workspace: Don't relayout windows when zooming workspace thumbnails
It looks ugly and busy to have windows shuffle around when I just wanted
to look at my workspaces.

https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-10-23 15:12:45 -04:00
d9b46b4782 workspace: Use all available space for windows in window selector
Change the layout strategy to be more like the mockups. With less than
two rows of windows, we try to fit every window in a non-aligned situation;
with more than three rows of windows, we try to fit every window in an
aligned situation.

Based heavily on a patch from Pierre-Eric Pelloux-Prayer <pelloux@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-10-23 15:12:45 -04:00
e249218a9d Allow testing GDM login dialog from the session
Check an environment variable, GDM_GREETER_TEST. If 1, LoginDialog will
skip anything that fails outside a GDM session.
It is therefore possible to test the GDM greeter without installing it
system-wide, by attempting login as the already logged in user (uses the
same code path as the unlock dialog).

https://bugzilla.gnome.org/show_bug.cgi?id=683725
2012-10-23 19:09:00 +02:00
a2b1946b01 workspacesView: Fix updating when number of workspaces changes
Ouch. This went unnoticed for a long time as by default (using
dynamic workspaces) only one workspace is added at a time, which
happens to work fine.

https://bugzilla.gnome.org/show_bug.cgi?id=686487
2012-10-23 18:27:07 +02:00
96a80f7ba0 workspacesView: Fix typo
We want to check for a setting, not the existence of a function.

https://bugzilla.gnome.org/show_bug.cgi?id=686487
2012-10-23 18:27:07 +02:00
9955fbf4f8 Updated Greek translation 2012-10-23 15:41:32 +03:00
14966b0cd0 Telepathy: Set empathy-chat as prefered handler when delegating channels
https://bugzilla.gnome.org/show_bug.cgi?id=686296
2012-10-23 12:37:05 +02:00
6e1a8f16a8 build: Bump gnome-desktop required version for GnomeIdleMonitor 2012-10-23 09:19:03 +02:00
d106191e6a Port to GnomeIdleMonitor
https://bugzilla.gnome.org/show_bug.cgi?id=682224
2012-10-22 12:06:45 -04:00
418cf6281e screenShield: explicitly load gnome-screensaver in fallback mode.
When running gnome-shell from lightDM, gnome-screensaver is no
longer auto-loaded. As a result the dbus calls for Lock user etc
will fail.

https://bugzilla.gnome.org/show_bug.cgi?id=683060
Bug-Ubuntu: https://launchpad.net/bugs/1064354
2012-10-22 11:21:18 -04:00
bdeb7d86b6 screenShield: Connect to the actor's show signal instead of using BEFORE_REDRAW
This should make sure that we grab at the right time while at the same time
not break focus handling.

https://bugzilla.gnome.org/show_bug.cgi?id=684650
2012-10-22 11:20:30 -04:00
a0e0cc1038 workspacesView: Simplify extraWorkspaces handling
https://bugzilla.gnome.org/show_bug.cgi?id=686002
2012-10-21 18:53:48 -04:00
78f6dec73b workspacesView: Don't show workspace switcher when it doesn't make sense
Hide workspace switcher if dynamic workspaces is disabled and number of
workspaces is set to one only, since the user is bound to only one workspace
and showing the switcher is redundant.

Signed-off-by: Seif Lotfy <seif@lotfy.com>
2012-10-20 01:39:52 +02:00
f6458f215f userMenu: Hide menu immediately before suspending
The same logic as for commit 1f30670c1d applies to the case
where we lock the screen before suspending - we don't want the
menu to jump to the opposite screen side to fade out, so remove
the animation altogether.

https://bugzilla.gnome.org/show_bug.cgi?id=686484
2012-10-19 19:09:41 +02:00
c7e0d547c4 Add missing translations for GSetting schema
These are showing in the UI of gnome-tweak-tool.

https://bugzilla.gnome.org/show_bug.cgi?id=686413
2012-10-18 22:58:51 +02:00
fa54cfa0c3 Updated slovak translation 2012-10-18 20:41:36 +02:00
31ea3f737c messageTray: Remove hack for the lack of negative units in libcroco
libcroco now has native support for negative units.

https://bugzilla.gnome.org/show_bug.cgi?id=686240
2012-10-18 12:50:49 -04:00
2a8a8065a8 ScreenShield: implement o.g.ScreenSaver.GetActiveTime
Part of the old gnome-screensaver interface, returns the number of seconds
that the screensaver has been active for.

https://bugzilla.gnome.org/show_bug.cgi?id=686064
2012-10-18 15:30:40 +02:00
d3ba002313 st: Remove unused methods
This reverts commits cd024e21f0 and dc9ad8df80.

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-10-17 23:25:56 +02:00
f18fd8d959 userMenu: Rely on automatic texture changes
This reverts commit 6f3cf0ae50.

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-10-17 23:25:56 +02:00
d54f7b13fb st-widget: Keep background-image and border-image updated
Currently we miss changes to a file referenced in background-image
or border-image.
Connect to the StTextureCache::texture-file-changed signal to keep
up with file changes and update the drawing state if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-10-17 23:25:56 +02:00
9c8b75206c st-texture-cache: Add texture-file-changed signal
For textures loaded from files, the cache might hide image changes
by keeping the data of a previous version around indefinitely. For
instance AccountsService will notify of avatar changes, but as new
image is copied over the old one, we will continue to use the old
image data.
Install a file monitor for each file resource we load and clear
the corresponding data from the cache on changes, emitting the
new StTextureCache::texture-file-changed signal.

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-10-17 23:25:56 +02:00
15273c7f22 st: Canonicalize URLs in stylesheets
Make _st_theme_resolve_url() a bit smarter by canonicalizing the
resulting path (e.g. resolving references to /./ and /../).

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-10-17 23:25:56 +02:00
0ea8217c55 st: Fix handling of file:// URIs in _st_theme_resolve_uri()
https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-10-17 23:03:07 +02:00
1735f28f5a Remove use of deprecated g_type_init () ...
... and bump GObject requirement accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=686318
2012-10-17 22:49:32 +02:00
8de4070f7f autorunManager: Stop erring on the side of caution for network mounts
Every mount that we care about that's local should have a GVolume
associated with it.

https://bugzilla.gnome.org/show_bug.cgi?id=686241
2012-10-17 12:24:45 -04:00
45e64f453f runDialog: Use a symbolic icon
Another fallout from the St.IconType changes

https://bugzilla.gnome.org/show_bug.cgi?id=686233
2012-10-17 12:04:28 -04:00
62dc5f2ac6 Updated Serbian translation 2012-10-17 10:09:46 +02:00
86c85a752e loginScreen: Add support for 'disable-restart-buttons'
GDM's GSettings schema contains a 'disable-restart-buttons' key
that currently is only supported by the fallback greeter.
Implement support in the shell greeter as well.

https://bugzilla.gnome.org/show_bug.cgi?id=686247
2012-10-16 22:57:37 +02:00
3de0ebf7fd messageTray: Change timestamp string formats
The timestamps before contained unnecessary information.
Additionally, align the timestamps to be in the middle of the
bubble for design reasons.

https://bugzilla.gnome.org/show_bug.cgi?id=680989
2012-10-16 22:35:10 +02:00
1496ba0bbd messageTray: Clean up "TODO" code
The code here says to remove it after the GNOME3 release. Better late
than never.
2012-10-16 12:20:46 -04:00
f5974f6793 messageTray: Primarily use a GIcon to drive the source's icon
This is a bit of a cleanup since we ported notification icons/secondary
icons to be in the same situation.

https://bugzilla.gnome.org/show_bug.cgi?id=680426
2012-10-16 12:14:16 -04:00
928ea3bb01 messageTray: Use a GIcon for a notification's icon/secondary icon
Using a GIcon instead of an actor means that we can always create
a new icon with the right size from an old icon.

https://bugzilla.gnome.org/show_bug.cgi?id=680426
2012-10-16 12:14:16 -04:00
b7acb1d488 st-texture-cache: Remove load_icon_name
With the St.Icon bug fixed, we have removed the last use of load_icon_name.
Celebration time!
2012-10-16 11:01:25 -04:00
360d94dd67 modalDialog: Remove the fade in buttons code
Due to a typo, it never worked correctly. After a fix-up to the appropriate
method, the behavior is suboptimal, as the buttons only fade in the first time
the modal dialog is constructed. Just remove the fade-in behavior, rather than
keeping this non-working code around.

https://bugzilla.gnome.org/show_bug.cgi?id=677426
2012-10-16 10:49:20 -04:00
671a813135 Updated Japanese translation 2012-10-16 23:30:05 +09:00
c005417f9b Updated Galician translations 2012-10-16 14:22:21 +02:00
b5ec68bda3 Updated Spanish translation 2012-10-16 11:11:40 +02:00
b4ed29094d Updated Belarusian translation. 2012-10-16 12:05:56 +03:00
284ab031b8 Updated Slovenian translation 2012-10-16 08:34:57 +02:00
6ad5064c09 Updated Indonesian translation 2012-10-16 07:15:32 +07:00
3a8e723a36 data: Expose '<Super>F10' shortcut in System Settings
https://bugzilla.gnome.org/show_bug.cgi?id=672909
2012-10-16 01:38:12 +02:00
dd3484b93f dash: Open 'Show Apps' with Super+A
This is a workaround for power users for the "Show Apps" button
placement being too inconvenient to press at the bottom of the
dash favorites list.

Unity also uses Super+A to show the Apps lens.

https://bugzilla.gnome.org/show_bug.cgi?id=685738
2012-10-16 01:38:12 +02:00
205773b700 Bump version to 3.6.1
Update NEWS
2012-10-16 01:34:30 +02:00
f2039070e6 build: Add missing files 2012-10-16 01:34:30 +02:00
cf58a7eafd dash: Reset show-apps label on drag-end
Currently the label for the show-apps button is only updated during
drag operations, so after an item is successfully dropped on the
button, the label will still read "Remove from Favorites".
Fix this by resetting the label on drag-end.

https://bugzilla.gnome.org/show_bug.cgi?id=684627
2012-10-15 23:22:34 +02:00
487749c25b st-entry: Force a relayout if necessary
ClutterText will only queue a relayout after font changes if it has
any contents other than the empty string. As a result, its height
request may change after the first character has been entered. To
avoid this visual glitch, force a relayout on actual font changes.

https://bugzilla.gnome.org/show_bug.cgi?id=685534
2012-10-15 23:01:42 +02:00
48fb16b570 ScreenShield: show the unlock dialog on the primary monitor when using the keyboard
Make ModalDialog.open() accept an optional onPrimary argument, and
pass it when the dialog is activated using ESC or Return.

https://bugzilla.gnome.org/show_bug.cgi?id=685855
2012-10-15 22:45:19 +02:00
f94369dd6e Updated German translation 2012-10-15 20:46:38 +02:00
fc0bd3b9e8 Updated Latvian translation. 2012-10-15 20:15:59 +03:00
19946f1d19 Updated Danish translation 2012-10-15 06:36:57 +02:00
562f56130a Updated Kannada Translation 2012-10-14 23:24:53 +05:30
99f97adfc6 UnlockDialog: reset UI on verification failure
When failing verification, reset the UI to the default pre-password
request state, waiting for the next prompt.

https://bugzilla.gnome.org/show_bug.cgi?id=685441
2012-10-14 18:48:13 +02:00
5ad7db722d ScreenShield: don't allow cancelling the curtain by pressing esc twice in the dialog
If esc is pressed twice in succession in the unlock dialog, the curtain
is cancelled, but the dialog is cleared after the first esc cancels it,
and it's not destroyed and recreated.

https://bugzilla.gnome.org/show_bug.cgi?id=685441
2012-10-14 18:48:13 +02:00
a7d344d287 Make org.gnome.ScreenSaver.SetActive work
The interface was declared to take an unsigned integer instead
of a boolean, as gnome-screensaver does. Due to this,
gnome-screensaver-command --activate or --deactivate does not
work when used with gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=686063
2012-10-13 21:07:08 -04:00
0ac215f9de autorunManager: Fix another StIconType removal regression
https://bugzilla.gnome.org/show_bug.cgi?id=686079
2012-10-13 14:40:51 +02:00
4342155748 dateMenu: Hide "Open Calendar" item if calendar unavailable
The configured calendar application might not actually be installed.
Instead of failing with an error message, hide the menu item altogether
in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=686050
2012-10-13 14:40:51 +02:00
b561694bf0 theme: Remove left-over style 2012-10-13 14:40:51 +02:00
cae9a8d608 Updated Korean translation 2012-10-13 18:56:02 +09:00
88fbdba018 panel: Fix a copy/paste type when dealing with panel corners
Since panel corners are currently square, this doesn't really affect much,
but it's very clear what the code was supposed to be. At the same time,
also fix up a redeclaration with 'let', which technically isnt' kosher.
2012-10-12 17:47:21 -04:00
046067565a workspace: fix typo in removeThumbnails.
https://bugzilla.gnome.org/show_bug.cgi?id=684869
2012-10-12 17:44:10 -04:00
11299d9913 Updated British English translation 2012-10-12 18:57:03 +01:00
42ab233b08 L10N: Updated Persian translation 2012-10-12 20:38:12 +03:30
4a92d7d1b2 st-im-text: Chain up to parent first in dispose()
The actor's GtkIMContext is freed in dispose and reset in unrealize - as
ClutterActor's dispose will unrealize the actor if necessary, chaining
up to the parent after clearing the im context will result in warnings
if the actor is still realized, so chain up first.

https://bugzilla.gnome.org/show_bug.cgi?id=686016
2012-10-12 14:56:34 +02:00
2502ca6ccc tests: Actually call test() in box-layout 2012-10-11 19:27:56 -03:00
651030ba93 layout: Fix an accidental undefined variable error
The layout code was using actorData without defining it first.

https://bugzilla.gnome.org/show_bug.cgi?id=673189
2012-10-11 19:23:40 -03:00
8dfea9566e Updated Norwegian bokmål translation. 2012-10-11 20:25:20 +02:00
8cc54ce2a2 loginDialog: Add focus indication
While keynav works on login screen and unlock dialog, most elements
currently miss a focus indication.

https://bugzilla.gnome.org/show_bug.cgi?id=684730
2012-10-11 19:04:43 +02:00
3abfcda8b5 loginDialog: Use the same focus root for dialog and ctrl-alt-tab
Adding a group to the Ctrl-Alt-Tab popup will also add it to the
focus manager. Due to that, we currently end up with two focus
groups added for the login dialog - an explicit one for the entire
dialog, and an implicit one for the main content group.
When doing keynav, we ascend in the widget hierarchy from the
currently focused actor until we find a valid focus root, so
adding a children of the dialog as focus root breaks keynav to
any actors that are not inside the main content group.
The simple fix is to use the same group in both cases.

https://bugzilla.gnome.org/show_bug.cgi?id=684730
2012-10-11 19:04:43 +02:00
cf0ae8f182 screenShield: Remove erroneous top/bottom padding that may appear
If there are either no resident or persistent notifications, we'll
add some spacing for those boxes that may contain nothing. Make them
invisible to remove the spacing for those elements. It's possible
that we may want to be smarter about this in StBoxLayout to remove
spacing for zero-sized actors, but today is not the day.

https://bugzilla.gnome.org/show_bug.cgi?id=685919
2012-10-11 12:26:00 -03:00
d90bf5c6dc theme: Make the notifications box match mockups better
Adjust font sizes, spacing and padding, and add a box shadow
to the notifications box.

https://bugzilla.gnome.org/show_bug.cgi?id=685919
2012-10-11 12:26:00 -03:00
955b550e95 screenShield: Add some padding between the clock and notifications box
https://bugzilla.gnome.org/show_bug.cgi?id=685919
2012-10-11 12:26:00 -03:00
b3cd46a5c8 screenShield: Align notifications to the left, not the middle
With different lengths of text in notifications, icons aren't
aligned and things look ugly. Put notifications on the left
for now.

https://bugzilla.gnome.org/show_bug.cgi?id=685919
2012-10-11 12:26:00 -03:00
3fdc8bfa3d main: Override focus-change-on-pointer-rest preference
The application menu is currently unusable with non-maximized
windows when using focus-follows-mouse mode. Override mutter's
focus-change-on-pointer-rest preference, so that the actual
focus change is delayed until the pointer stops moving.

https://bugzilla.gnome.org/show_bug.cgi?id=678169
2012-10-11 16:30:33 +02:00
e8f96a6e16 loginDialog: Sync :expanded better with user list visibility
Now that we use a different text style for the username depending on
whether the user list is expanded or not, changing the :expanded style
before the actual transition looks disruptive. Adding the style right
before fading in other items and removing it right after fading them
out gives a better result.

https://bugzilla.gnome.org/show_bug.cgi?id=685201
2012-10-11 16:14:38 +02:00
dc15df1aa7 loginDialog: Remove now unused functions
https://bugzilla.gnome.org/show_bug.cgi?id=685201
2012-10-11 16:14:38 +02:00
05f5fac35b loginDialog: Use the same prompt layout as the unlock dialog
Currently the layout of the password prompt differs slightly between
login dialog and unlock screen - for the former, the prompt is
displayed next to the user avatar, replacing the user name, for
the latter, it is diplayed below both avatar and name.

https://bugzilla.gnome.org/show_bug.cgi?id=685201
2012-10-11 16:14:38 +02:00
5bfcc5392d messageTray: Reset summary after losing focus to outside actor
Currently when the summary boxpointer is ungrabbed automatically
because the keyboard focus was moved outside the message tray
(for instance by selecting the overview search entry or opening
the right-click menu of a dash item), after the popup is hidden
_updateState() will grab focus and show the popup again.
Work around this by unsetting the clicked summary item when losing
focus to an actor outside the message tray.

https://bugzilla.gnome.org/show_bug.cgi?id=685156
2012-10-11 14:28:42 +02:00
d2e830cce3 messageTray: Do not add the tray unconditionally to ctrl-alt-tab
Commit 448517032e added the message tray unconditionally to
the Ctrl-Alt-Tab popup, but while this makes sense for a normal
session, we do not want it in the login screen.
Be a bit more careful where we make the tray available.

https://bugzilla.gnome.org/show_bug.cgi?id=685914
2012-10-11 08:00:55 +02:00
1e942be639 Add a new code style/hacking guide
Written in Markdown style.

Somewhat based off of the gjs code style guide found at
http://git.gnome.org/browse/gjs/plain/doc/Style_Guide.txt.

https://bugzilla.gnome.org/show_bug.cgi?id=661241
2012-10-10 19:11:36 -03:00
576009bad0 theme: Make the selected text color white for all entries
This was accidentally changed when Allan cleaned up the styles for
all entries
2012-10-10 18:21:03 -03:00
f71108a214 extensionPrefs: Remove an extra parameter to set_cell_data_func 2012-10-10 18:21:03 -03:00
7109bd52f2 Updated Thai translation 2012-10-09 18:34:05 +07:00
0f6effa263 Calendar: hide all actions when on the login screen
No events on the login screen, and no opening calendars or
settings either.

https://bugzilla.gnome.org/show_bug.cgi?id=685142
2012-10-08 19:48:44 +02:00
8b0301ed00 Updated Irish translation 2012-10-07 16:21:57 -06:00
4f56fb125e overview: Make sure that we put the desktop clone at the right place
This ensures that the desktop window's smooth fadeout when going to
the overview is in the same spot as the desktop window, which may not
always be at 0, 0.

https://bugzilla.gnome.org/show_bug.cgi?id=681159
2012-10-06 16:07:55 -03:00
6487cd8c6f dash: Only set the label's text when initially showing the label
Having the tooltip change when it's visible looks strange and glitchy.
This also makes sure that "Remove from Favorites" doesn't change, even
when the user removes their mouse cursor from it.

https://bugzilla.gnome.org/show_bug.cgi?id=685313
2012-10-06 16:07:55 -03:00
06e5c25383 dash: Make the dash items accessible
https://bugzilla.gnome.org/show_bug.cgi?id=685313
2012-10-06 16:07:54 -03:00
36e5ae4a25 dash: Construct the label at init
Nothing doesn't use a label, so it doesn't make sense to
lazily initialize it.

https://bugzilla.gnome.org/show_bug.cgi?id=685313
2012-10-06 16:07:54 -03:00
245e43ea8c dash: Make the tooltip and hover effect sync up to the real insensitivity
We shouldn't display "Remove from Favorites" when dropping on the button
will do nothing.

https://bugzilla.gnome.org/show_bug.cgi?id=685313
2012-10-06 16:07:54 -03:00
52871c781a dash: Make the show apps button insensitive when we're dragging a non-favorite
This doesn't handle the tooltip case, unfortunately. That will come in a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=685313
2012-10-06 16:07:54 -03:00
f994ada576 dash: Clean up unused code
https://bugzilla.gnome.org/show_bug.cgi?id=685313
2012-10-06 16:07:53 -03:00
147a6e49dc dash: Refactor some common code
Take the code that gets an app from a "source" that's duplicated
in lots of spots and refactor it out.

https://bugzilla.gnome.org/show_bug.cgi?id=685313
2012-10-06 16:07:53 -03:00
be24ee435c messageTray: Clean up and consolidate code for tween completion
https://bugzilla.gnome.org/show_bug.cgi?id=685341
2012-10-06 16:07:52 -03:00
9fac285b69 messageTray: Fix some artifacts when tweening back from the tray
The math to calculate the clip isn't quite right here -- it overcompensates
in the Y value.

https://bugzilla.gnome.org/show_bug.cgi?id=685341
2012-10-06 16:07:42 -03:00
3ed5f9cd15 gdm: Try harder to move focus to the first user
_moveFocusToItems seems to be called to early causing
clutter_actor_grab_key_focus not to be called.

So queue another attempt with BEFORE_REDRAW priority when
this happens to make sure we actually move the focus sucessfully.

https://bugzilla.gnome.org/show_bug.cgi?id=684650
2012-10-06 18:15:02 +02:00
17e70ff8ec notificationDaemon: Store tray-icon-added/removed ids
This allows extensions to reuse the trayManager.
2012-10-06 16:11:54 +02:00
6dab119650 extensionUtils: Don't warn about missing url
This did not have the desired effect and just produces noise.
2012-10-05 20:35:07 +02:00
f80eb89d57 jhbuildrc-gnome-shell: switch to the GNOME 3.8 moduleset
Now that GNOME 3.6 is out, the default development platform
should be the 3.8 moduleset.
2012-10-05 13:59:57 -04:00
f6c2902fe4 gnome-shell-build-setup.sh: Fix warning about git-bz symlink
The warning when changing the git-bz symlink triggered on
initial install. Suppress that.
2012-10-05 13:57:31 -04:00
1e890a8a0a gnome-shell-build-setup.sh: install libdb on Fedora 18.
For F18, db4-devel doesn't install the main -ldb and db.h any more,
so we need the libdb-devel package and Berkeley DB 5.
2012-10-05 13:52:41 -04:00
aa1a84e677 gnome-shell-build-setup.sh: add a note about removing install directory
If the user relocates from ~/gnome-shell to ~/gnome, they need to
remove the install directory or left-over paths will cause problems.
2012-10-05 13:35:58 -04:00
9395f310d6 extensionUtils: don't log verbosely on missing extension directory
A missing extension directory isn't worth debug spew, so check
if the error when reading the extension directory is NOT_FOUND,
and if so, suppress output.

https://bugzilla.gnome.org/show_bug.cgi?id=685466
2012-10-05 13:08:02 -04:00
b99bb3d4bb gnome-shell-build-setup.sh: Move default directory to ~/gnome
gnome-shell-build-setup.sh is generally useful for working on GNOME.
If moving on from hacking on gnome-shell to some other module,
having the checkout location be ~/gnome-shell is a little odd and
cumbersome, so start out checking things out into ~/gnome/source
and installing them into ~/gnome/install.

Add a warning if the old ~/gnome-shell exists to avoid unnecessary
checking out of every module again.

https://bugzilla.gnome.org/show_bug.cgi?id=685355
2012-10-05 13:08:02 -04:00
4f66f096ff userMenu: Ignore 'lock-enabled' setting for user switching
The preference controls whether the screen should be locked when
the screensaver is activated, not whether the screen should be
locked at all. In particular after having switched to a different
user, log out should not automatically switch back to the unlocked
session, so always activate the lock when user switching.

https://bugzilla.gnome.org/show_bug.cgi?id=685536
2012-10-05 16:15:47 +02:00
7f5f2284f3 Updated Hebrew tranlation. 2012-10-05 11:02:25 +02:00
59f9f4fca1 Updated Hebrew translation. 2012-10-05 11:02:25 +02:00
55284e418c modalDialog: Add alternative keys to activate default
Currently Return is used to activate the default button of a modal
dialog if no key is specified. It makes sense to allow alternatives
as the keypad's Enter key as well in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=685511
2012-10-04 21:18:54 +02:00
20d4ffde6e loginDialog: Rely on default button for activation
Currently the default action is performed twice when pressing Return
in the login dialog, once in response to the entry's 'activate' signal,
and again by activating the default button. Usually this is not a
problem, as the second invocation is simply ignored, however it breaks
the case where multiple consecutive questions are asked (e.g. username
and password in the 'Not listed' case).
Fix the problem by not handling the 'activate' signal at all.

https://bugzilla.gnome.org/show_bug.cgi?id=685511
2012-10-04 21:18:54 +02:00
78e5d4df9d Update French translation 2012-10-04 15:34:55 +02:00
1118ec9653 GActionMuxer: disconnect group signals on finalize
The signals for the action group were being disconnected when the action
group was explicitly removed from the GActionMuxer but the same was not
being done when it was finalized.

This means that a change in the state of an action group that used to be
associated with a finalized GActionMuxer would result in a crash.  This
would happen for stateful application actions after closing a window.

https://bugzilla.gnome.org/show_bug.cgi?id=681399
2012-10-04 12:03:23 +02:00
7d6c85be42 messageTray: Don't animate the desktop clone for a failed tray grab
If we fail to grab for the message tray, we shouldn't be animating
the desktop clone. This is a regression from commit fe124e6.

https://bugzilla.gnome.org/show_bug.cgi?id=685342
2012-10-04 04:02:16 -03:00
0192a6cb12 unlockDialog: Make the prompt entry insensitive while logging in
This ensures that the user can't confusingly edit the entry while
waiting for a response.

https://bugzilla.gnome.org/show_bug.cgi?id=685444
2012-10-04 04:02:16 -03:00
0e01a81219 userMenu: Remove 'Switch Session' item
GDM does not allow concurrent logins of a single user, so making
'Switch Session' a user switch operation does not work - in order
to choose a different session, users have to log out.
Rather than making 'Switch Session' an alias of 'Log out' (which
is available anyway when multiple sessions are defined), remove
the item altogether - 'Switch Session' suggests an operation that
does not loose state, and we currently favor 'Switch Session' over
'Switch User', so on systems that have both multiple users and
multiple sessions, the latter would become unavailable.

https://bugzilla.gnome.org/show_bug.cgi?id=685062
2012-10-04 08:57:55 +02:00
36edf20273 gnome-shell-build-setup.sh: Add additional system packages
Add system packages for asn1Parser, cracklib, ruby, wireless-tools,
libsystemd-login.

https://bugzilla.gnome.org/show_bug.cgi?id=685352
2012-10-03 16:16:52 -04:00
a1bf19dbdf ShellUserVerifier: fix typo in function name, caught on auth error
https://bugzilla.gnome.org/show_bug.cgi?id=685434
2012-10-03 22:07:27 +02:00
0ad739e78b autorunManager: Don't try to scan remote filesystems
Content-Type scanning can be super expensive. The autorun manager is meant
for local filesystems that are plugged into a USB port or similar, not
remote NFS or sshfs mounts.

https://bugzilla.gnome.org/show_bug.cgi?id=684093
2012-10-03 14:36:37 -03:00
ff9509b901 autorunManager: Don't scan the filesystem if autorun is disabled
Content-Type scanning can be expensive, and the user disabled autorun, so...

https://bugzilla.gnome.org/show_bug.cgi?id=684093
2012-10-03 14:34:52 -03:00
7e496b1979 autorunManager: Clean up mount operations
Add a processMount function that's shared between mount scanning
and hotplug.

https://bugzilla.gnome.org/show_bug.cgi?id=684093
2012-10-03 14:34:52 -03:00
448517032e messageTray: Show the message tray in Ctrl+Alt+Tab outside of the overview
Since the message tray is accessible outside of the overview, it doesn't
make sense to show it only there.

https://bugzilla.gnome.org/show_bug.cgi?id=684633
2012-10-03 13:04:47 -03:00
a171e92e6c ctrlAltTab: Only set the stage focus mode when we're focusing a widget
This ensures that we don't accidentally lose focus when switching to
the message tray.

https://bugzilla.gnome.org/show_bug.cgi?id=684633
2012-10-03 13:04:46 -03:00
06e9bf9b0a gnome-shell-build-setup.sh: install git-bz
Someone starting gnome-shell development work needs git-bz set up.
Install it into the user account much like we install jhbuild.

(Getting git-bz packaged into distributions would be better, but
this improves thing easily.)

https://bugzilla.gnome.org/show_bug.cgi?id=685354
2012-10-03 09:49:39 -04:00
7d9ec8cea0 jhbuildrc-gnome-shell: add ignore_suggests = True
Adding ignore_suggests = True avoids building some large modules like
evolution speeding the build. But more importantly, it removes
gnome-disk-utility from the build. gnome-disk-utility has a hard
dependency on udisks-1.99, which is not found on anything but the
latest systems.

https://bugzilla.gnome.org/show_bug.cgi?id=685353
2012-10-03 09:49:39 -04:00
5b4553ff0c Revert "st-texture-cache: Remove load_icon_name"
This reverts commit 8b6df2e23f.

I shouldn't be going around removing API in minor releases.
Sorry about that.
2012-10-02 21:40:40 -03:00
d4ce7aef59 dnd: Fix regression from e6fd2be
We need to fetch the actor's parent before we reparent, otherwise
we won't put it back properly at the end.
2012-10-02 21:16:28 -03:00
8b6df2e23f st-texture-cache: Remove load_icon_name
With the St.Icon bug fixed, we have removed the last use of load_icon_name.
Celebration time!
2012-10-02 18:42:42 -03:00
e2ff5846df wanda: Use an StIcon again for createIcon
With the DND bug fixed, this is no longer necessary.
2012-10-02 18:42:41 -03:00
24efeff788 Really hide 'Show Keyboard Layout' on the lock screen
We have to set _showLayoutItem.actor.visible,
not _showLayoutItem.visible.
2012-10-02 15:34:10 -04:00
4f359e62df workspaceThumbnail: Fix the dynamic workspaces check for dragging
Be able to move windows between workspaces with static workspaces
enabled; the incorrect check here simply disabled all dragging
operations.

https://bugzilla.gnome.org/show_bug.cgi?id=684641
2012-10-02 16:15:23 -03:00
e6fd2bed4d dnd: Add drag actors to the stage before querying their sizes
Drag actors may be St widgets, which require that they're added
to the stage before they have a size.

https://bugzilla.gnome.org/show_bug.cgi?id=684888
2012-10-02 16:15:23 -03:00
9fb6510135 Updated Bulgarian translation 2012-10-02 05:38:07 +03:00
7206b61838 dash: Make padding even on the top/bottom of the dash
When Florian landed the new dash container to show the all apps button
always, he got the math wrong -- he forgot to add padding around the
container, and used the height of the box to calculate a y2 position,
rather than the y2 position of the box.

https://bugzilla.gnome.org/show_bug.cgi?id=684619
2012-10-01 06:49:13 -03:00
e8ab0b3e8f Updated Lithuanian translation 2012-09-30 12:31:59 +03:00
843788580e [l10n] Updated Italian translation. 2012-09-29 18:09:10 +02:00
4ceb3d890d Updated Norwegian bokmål translation 2012-09-28 16:10:46 +02:00
3f8995b25e Updated Danish translation 2012-09-27 22:54:39 +02:00
37e0cefc79 Updated Lithuanian translation 2012-09-27 22:26:37 +03:00
f026741dbb Updated Russian translation 2012-09-27 16:38:39 +04:00
044b121e01 Updated Serbian translation 2012-09-27 05:28:17 +02:00
d57c3b4f89 Updated Czech translation 2012-09-26 22:40:49 +02:00
960f7d5f2e Updated Hungarian translation 2012-09-26 16:12:46 +02:00
2f61381651 Updated Belarusian translation. 2012-09-26 15:06:04 +03:00
ba6e931e21 Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-09-26 11:53:23 +08:00
440aa0d369 Update Simplified Chinese Translations 2012-09-26 08:48:31 +08:00
f42d4b5fa2 [l10n] Updated Catalan (Valencian) translation 2012-09-26 01:29:34 +02:00
5d9fa2c484 [l10n] Updated Catalan translation 2012-09-26 01:29:28 +02:00
f5c86fa171 Added uk translation 2012-09-25 21:18:28 +03:00
f9019ce62d Update French translation 2012-09-25 17:28:22 +02:00
ee485e1728 Updated Polish translation 2012-09-25 15:14:11 +02:00
8f2a6f8387 Bump version to 3.6.0
Update NEWS
2012-09-25 12:59:31 +02:00
908bf3b117 volume: Fix initial visibility of input
Currently the visibility of input volume is only updated when a stream
is added/removed - apparently no one noticed until now, as in the normal
user session we get away with this as long as we have some startup sound,
but this is not the case in the lock screen, so we may end up showing
input volume incorrectly.

https://bugzilla.gnome.org/show_bug.cgi?id=684611
2012-09-25 12:02:06 +02:00
6a739afd25 gdm: Make SessionList accessible
https://bugzilla.gnome.org/show_bug.cgi?id=684748
2012-09-25 12:02:06 +02:00
506490e32d Updated Hebrew translation. 2012-09-25 11:31:42 +02:00
846771f2a1 Updated Hebrew translation. 2012-09-25 11:31:36 +02:00
759b7584e0 hindi update 2012-09-25 14:39:53 +05:30
e5cb224598 Updated Arabic translation 2012-09-25 11:06:42 +02:00
e32df1b405 Updated Galician translations 2012-09-25 10:48:11 +02:00
db9f91b687 Updated Spanish translation 2012-09-25 10:27:16 +02:00
0941357068 Updated Greek translation 2012-09-25 11:22:01 +03:00
d8993c52d0 Updated Latvian translation 2012-09-25 10:45:06 +03:00
6424b2dd03 Assamese translation updated 2012-09-25 12:29:55 +05:30
2a4eb3ed1a Updated Slovenian translation 2012-09-25 08:58:03 +02:00
c9fa00cce1 Updated Portuguese translation 2012-09-25 07:59:40 +01:00
18eedbc02d keyboard: Disable "tray" button in lock/login screen
It is not possible to summon the tray via shortcut or dwelling
while the screen is locked, so it is odd to allow it from the
on-screen-keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-25 08:25:26 +02:00
ef9f63fe59 keyboard: Ignore focus changes from extended keys
The keyboard is shown/hidden automatically when (un)focusing a
ClutterText actor. This behavior is unwanted when opening the
extended keys popup, so focus changes to the popup are ignored.
However, we also want to ignore focus changes from the popup
to avoid the keyboard hiding itself after pressing an extended
key.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-25 08:25:26 +02:00
f8ce788425 keyboard: Fix check for extended keys
The existing check tested for non-existent properties.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-25 08:25:25 +02:00
6c1bd95643 keyboard: Ignore focus changes caused by tray showing/hiding
The keyboard is shown/hidden automatically when (un)focusing a
ClutterText actor. This behavior breaks with the message tray now
grabbing/releasing key focus when toggled. Fix this by ignoring
all focus changes to or from the message tray.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-25 08:25:25 +02:00
2ed7ee8f71 keyboard: Keep tray after clicking summary item
Currently if a summary item signals that it has handled a click
itself, the tray hides itself. This behavior is wrong for the
On-Screen-Keyboard, which appears as a unit with the tray, so add
a property to opt-out of the default behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-25 08:25:25 +02:00
2e63709450 grabHelper: Ignore events from On-Screen-Keyboard
GrabHelper automatically releases grabs when the user clicks outside
the grabbed actors. However at least for the message-tray (which is
the only user of grabHelper at the moment), we must ignore any events
from the On-Screen-Keyboard, to prevent the tray from hiding at every
key press.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-25 08:25:24 +02:00
6611d639a8 messageTray: Only update keyboardVisible as necessary
This fixes a case of _updateState() being called recursively,
resulting in stray grab()/ungrab() calls the leave the entire
desktop in a stuck focus state.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-25 08:25:24 +02:00
fe124e6ab3 Keyboard: update for the message tray changes
The message tray is now modal and pushes the view up, but the keyboard
is shown below it. Solve this by applying a special styling to the
keyboard and message tray combination, and by not pushing the windows
up when the keyboard is shown.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-25 08:25:24 +02:00
fee0a8527d Updated Marathi Translations 2012-09-25 09:03:28 +05:30
2f6b00403f Updated Indonesian translation 2012-09-25 09:55:32 +07:00
dbe2c117e3 update Punjabi Translation 2012-09-25 06:46:18 +05:30
c4b1ccb6d6 Updated Brazilian Portuguese Translation 2012-09-24 21:58:42 -03:00
2c70ee7e43 [l10n] Update Japanese translation 2012-09-25 09:35:23 +09:00
f7826616b8 gdm: Make UserList accessible
https://bugzilla.gnome.org/show_bug.cgi?id=684728
2012-09-25 02:06:02 +02:00
9f476a12dd gdm: Provide an accessible name for powerMenu
https://bugzilla.gnome.org/show_bug.cgi?id=684727
2012-09-25 02:06:02 +02:00
6f3cf0ae50 userMenu: Force reload of background-image on icon changes
When changing the user's avatar image, AccountsService will
overwrite the old image with the new one, so the location
returned by get_icon_file() is always the same.
In order to pick up the change, we need to make sure to clear the
previous image from both StTextureCache and StThemeNode's paint
cache.

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-09-24 22:03:06 +02:00
cd024e21f0 st-widget: Add method to clear background-image
For performance reasons, resources required to paint a widget are
aggressively cached; we know of at least one case where our caching
prevents updating the used background-image correctly, so add explicit
API to clear all associated cache data.

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-09-24 22:03:05 +02:00
c4c470c1f3 st-theme-node: Add method to invalidate drawing state
StThemeNode caches its resources aggressively to keep the required
work on paint to a minimum - right now, resources are only recreated
on allocation changes.
In order to update the background-image property correctly when the
underlying file changes, resources need to be recreated without a
size change, so add an explicit method for that.

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-09-24 22:03:05 +02:00
dc9ad8df80 st-texture-cache: Add API to remove cache data
The current API assumes that image data loaded from files remains
valid during the life time of the shell. This assumption is mostly
valid for image files we provide ourselves (with the exception being
designers working on those files), but not necessarily for "external"
files - provide API to explicitly remove cached data associated with
a URI for those cases.

https://bugzilla.gnome.org/show_bug.cgi?id=679268
2012-09-24 22:03:04 +02:00
74d6225993 Update Czech translation 2012-09-24 18:31:14 +02:00
e1e0c5035d Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-09-24 22:58:55 +08:00
adf6d0eb82 Update Czech translation by Adam Matousek 2012-09-24 15:43:00 +02:00
90df435345 Added Kyrgyz translation 2012-09-24 14:34:08 +06:00
83d57211db Added 'ky' to LINGUAS 2012-09-24 14:33:12 +06:00
0a8eeb2827 [l10n] Updated Estonian translation 2012-09-24 10:42:16 +03:00
0c324c42f4 [l10n] Update Japanese translation 2012-09-24 11:45:40 +09:00
3adf54a952 Updated Latvian translation 2012-09-23 20:23:09 +03:00
8076c66a4c Updated Russian translation 2012-09-23 20:32:14 +04:00
f9c583a636 Updated Russian translation 2012-09-23 19:50:31 +04:00
30d536b19c hindi update 2012-09-23 20:46:41 +05:30
1957899146 [l10n] Updated German translation 2012-09-23 12:31:15 +02:00
b52c83d88a [l10n]Updated Catalan (Valencian) translation 2012-09-23 00:21:06 +02:00
27ff388413 [l10n] Updated Catalan translation 2012-09-23 00:21:00 +02:00
d4306f7768 update Simplified Chinese (zh_CN) translation 2012-09-23 04:35:44 +08:00
5d0a57c97d Finnish translation update by Jiri Grönroos 2012-09-22 21:54:22 +03:00
a87ba467ae messageTray: Don't open the tray from a dwell if we're in a modal grab
If we're in an alt-tab popup or modal dialog, we shouldn't pop up the tray
at all.

https://bugzilla.gnome.org/show_bug.cgi?id=684458
2012-09-22 15:39:22 -03:00
7df7cd01eb messageTray: Clean up commented code a bit
Since we changed the grabHelper.grab call to be in a conditional,
it's been a little clear what the comment has been referring to.

https://bugzilla.gnome.org/show_bug.cgi?id=684458
2012-09-22 15:39:22 -03:00
098d805a8b [l10n] Updated Italian translation. 2012-09-22 16:54:29 +02:00
4a21034a00 Updated Hebrew translation. 2012-09-22 15:06:30 +03:00
7904e359f2 Updated Hebrew translation. 2012-09-22 15:06:07 +03:00
0c8a94beb8 screenShield: Fix unlock animation
When unlocking succeeds, the transition back to the user session is
animated. However, commit 8cf9baa1 broke the transition by hiding the
actor before starting the animation.

https://bugzilla.gnome.org/show_bug.cgi?id=684591
2012-09-22 13:50:25 +02:00
c13a573792 Updated Danish translation 2012-09-22 12:27:49 +02:00
f9b42e12ae Updated British English translation 2012-09-22 11:18:23 +01:00
5c2031b768 Updated Bulgarian translation 2012-09-22 12:52:52 +03:00
49643882d4 Updated Korean translation 2012-09-22 18:50:34 +09:00
175ddaa3a1 searchDisplay: Fix alignment of section headers in RTL locales
https://bugzilla.gnome.org/show_bug.cgi?id=684379
2012-09-21 21:03:52 +02:00
cc1d6e97b8 Updated Brazilian Portuguese Translation 2012-09-21 15:26:12 -03:00
79b96ab301 Updated Lithuanian translation 2012-09-21 20:53:34 +03:00
44d9316023 Updated Belarusian translation. 2012-09-21 20:02:55 +03:00
5b0c9a74fb Updated Spanish translation 2012-09-21 17:52:32 +02:00
3429fc3e4c userMenu: Close menu immediately on user/session switch
The same reasoning as for commit 1f30670c1d also applies to
VT switches.

https://bugzilla.gnome.org/show_bug.cgi?id=684459
2012-09-21 16:07:38 +02:00
d11d8d5353 Updated translation for Odia. 2012-09-21 17:34:09 +05:30
1742bd6ded Updated Galician translations 2012-09-21 13:18:37 +02:00
9f6e118ea0 Updated Portuguese translation 2012-09-20 22:19:24 +01:00
717bbd3bb5 Updated Serbian translation 2012-09-20 20:23:24 +02:00
e8ebe4de14 popupMenu: Set initial visibility of settings items
With the recent session mode changes, the visibility of settings
items is now only set on sessionMode::updated - while the signal
is emitted when the session mode is initialized, settings items
that are added after that are visible regardless of the allowSettings
setting until the next sessionMode::updated signal is received.
Fix this by explicitly setting the initial visibility of settings
items.

https://bugzilla.gnome.org/show_bug.cgi?id=684473
2012-09-20 20:04:05 +02:00
0ff614ccd4 Don't show network dialogs in the lock screen
Remove the network agent component from the lock screen and unlock
dialog session modes.

https://bugzilla.gnome.org/show_bug.cgi?id=684384
2012-09-20 20:03:23 +02:00
d0a77b7e0c keyboard: Make input source items accessible
https://bugzilla.gnome.org/show_bug.cgi?id=684462
2012-09-20 19:59:27 +02:00
2815889090 Updated Malayalam file 2012-09-20 22:57:20 +05:30
1317956663 Updated Malayalam file 2012-09-20 21:40:54 +05:30
a2303d8895 Updated Malayalam file 2012-09-20 21:39:01 +05:30
2161c793dc Updated Hungarian translation 2012-09-20 14:56:16 +02:00
a2f943db8f Updated Galician translations 2012-09-20 13:20:04 +02:00
23a31b9c00 Update French translation 2012-09-20 12:25:57 +02:00
2591d1b94b Updated Thai translation 2012-09-20 16:23:00 +07:00
300f97f102 Updated Greek translation 2012-09-20 11:10:59 +03:00
7e3f6c3066 Updated Marathi Translations 2012-09-20 12:34:06 +05:30
601d232064 Updated Arabic translation 2012-09-20 06:55:05 +02:00
8854ac84ad Updated Arabic translation 2012-09-20 06:45:35 +02:00
0302c3fbd4 Updated HINDI translation 2012-09-20 09:53:23 +05:30
6b6fdc6cfe Assamese translation updated 2012-09-20 00:14:33 +05:30
7126ce86ec Updated Bulgarian translation 2012-09-19 20:42:24 +03:00
760bf52f75 update Punjabi Translation 2012-09-19 21:27:02 +05:30
6d791d31de Updated Polish translation 2012-09-19 16:42:35 +02:00
21adc98d70 updated Tamil translation 2012-09-19 19:46:23 +05:30
6fd7a56568 Updated Slovenian translation 2012-09-19 13:47:04 +02:00
fba427fcaf Bump version to 3.5.92
Update NEWS
2012-09-19 13:12:02 +02:00
7753361ffb shell-docs: Remove left-over includes
Clean out a couple of references to code that was removed or
marked private.
2012-09-19 13:12:02 +02:00
c1590d9ed7 Revert "messageTray: Fix summary position in RTL locales"
This reverts commit e6ba7c6e40.
The original issue is fixed by Clutter commit 64c7973c7429c.
2012-09-19 13:12:02 +02:00
23c1138a58 screenShield: Fix regression from 114f6f577f 2012-09-19 13:12:01 +02:00
2acb097662 grabHelper: Fix regression for dwelling with mouse down
b203a95a78 introduced a regression
where we forgot to bail out if the pushModal didn't succeed properly.

https://bugzilla.gnome.org/show_bug.cgi?id=684344
2012-09-19 08:10:12 -03:00
449d116af2 Fix 10884ef7f5
Bad rebase and code left in that had no effect.
2012-09-19 13:01:56 +02:00
110240981d Updated Telugu Translation 2012-09-19 16:22:35 +05:30
ac5c6de929 Updated Indonesian translation 2012-09-19 17:33:45 +07:00
51bdc44352 gdm: Fix property typo
Introduced by cc6744055f
2012-09-19 12:11:25 +02:00
bafe34696d build: Install keybinding files for control-center
As some keybindings are now provided by gnome-shell rather than
mutter, it makes sense to expose those in System Settings.

https://bugzilla.gnome.org/show_bug.cgi?id=671010
2012-09-19 11:50:57 +02:00
114f6f577f screenShield: Delay destruction of unlock dialog
While the unlock dialog is created early so that it appears below
the shield while the curtain slides up, it is destroyed immediately
when the shield slides back in.
Keep it around until the shield is down instead.

https://bugzilla.gnome.org/show_bug.cgi?id=684342
2012-09-19 11:50:57 +02:00
1f30670c1d userMenu: Close menu immediately when activating Lock
When locking the screen, the user menu is moved to the opposite
side. Unless we close the menu immediately without animation, the
menu will jump to the other side and fade out while the screen
shield slides down.

https://bugzilla.gnome.org/show_bug.cgi?id=684343
2012-09-19 11:50:57 +02:00
10884ef7f5 ShellUserVerifier: catch DBus errors and report them to the user
Instead of leaving the login or unlock dialogs in an inconsistent state,
catch DBus errors and show an Authentication Error message. The error
details are logged in the session logs.

https://bugzilla.gnome.org/show_bug.cgi?id=683060
2012-09-19 11:50:57 +02:00
5e12e5f42a layout: Add a fake root pixmap actor at startup, and fade it out
This provides us with a smooth transition between plymouth and gdm.

https://bugzilla.gnome.org/show_bug.cgi?id=682428
2012-09-19 11:45:24 +02:00
e7a2e1f268 Updated Thai translation 2012-09-19 12:21:44 +07:00
cc6744055f gdm: Don't fade in the log in dialog
Instead, directly show it.

https://bugzilla.gnome.org/show_bug.cgi?id=682428
2012-09-19 01:41:17 -03:00
e6ba7c6e40 messageTray: Fix summary position in RTL locales
https://bugzilla.gnome.org/show_bug.cgi?id=684214
2012-09-19 03:44:49 +02:00
ea4855e908 Updated Galician translations 2012-09-19 02:47:41 +02:00
5c7da4b0e6 status/keyboard: Fix hidden separator when menu changes while open
Due to the way the IBus API works we might get property changes while
the menu is already open. In that case the separator visibility logic
doesn't work since it only applies on menu open/close. This works
around that issue.

https://bugzilla.gnome.org/show_bug.cgi?id=682314
2012-09-18 21:32:37 +02:00
9659d934ac status/keyboard: Add menu items for IBus Anthy's InputMode, TypingMode
IBus has a properties API which are basically generic knobs into the
engine which are serialized and presented in a way that allows us to
easily build actionable UI elements with them.

Instead of implementing the whole generic system and accepting
everything coming out of the engines, for now, this patch just adds
support for a couple of important IBus Anthy properties.

https://bugzilla.gnome.org/show_bug.cgi?id=682314
2012-09-18 21:32:37 +02:00
de93677271 Allow the shell to run without the screenshield
The screenshield requires gdm 3.5, which can be problematic in
jhbuild configurations, or distributions that don't use GDM as the display
manager. Allow transparent fallback to gnome-screensaver in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=683060
2012-09-18 20:25:09 +02:00
6ef3c628e6 messageTray: Move focus ourselves when entering by keybinding
When the tray is triggered by keybinding rather than dwelling, the
first summary item should be given key focus. Currently this is
achieved by grabbing the focus before toggling the tray, so that
the grabHelper will move the focus for us. However this interferes
with the grabHelper's focus save/restore mechanism - for instance,
after using the keybinding once, the tray will always come up with
the first item focused.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-18 18:45:42 +02:00
f2af0be9ac messageTray: Allow to start keynav with Tab
Currently it is only possible to use keynav inside the tray if it
has been triggered with the keyboard shortcut. Make it possible to
initiate keynav by hitting Tab in other cases as well.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-18 18:45:41 +02:00
ef7b74a104 grabHelper: Remove support for untracked grabs
https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-18 18:45:41 +02:00
906368d916 messageTray: Add shortcuts to summary boxpointer
Currently opening the summary boxpointer acts as a stop gap for
keynav - the only shortcut still working is "Escape" to hide the
tray altogether.
Change the handling of Escape to only close the summary boxpointer
and allow to use the down arrow as alternative (unless the boxpointer
already processes the key press itself of course, like the chat
entry does). Also add a Delete shortcut to dismiss the open summary
item.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-18 18:45:41 +02:00
809cbf58c6 grabHelper: Ungrab the entire stack on "outside clicks"
Currently clicks outside the grabbed actors are handled the same as
the user pressing Escape - a single actor is popped from the grab stack.
However according to the design, outside clicks should release all grabs.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-18 18:45:41 +02:00
a5d60050a2 messageTray: Allow to open summary item with up arrow
When using keynav in the top bar, menus may be opened using the
down arrow; in a similar fashion, allow to open the summary
boxpointer with the up arrow.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-18 18:45:40 +02:00
2c130c8668 history: Allow events to bubble up when arrowing past the first/last item
Currently the HistoryManager consumes all arrow up/down key presses
unconditionally. Change this to only consume the event if the entry
text was actually changed, e.g. not when trying to move past the
first/last item.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-18 16:44:08 +02:00
c0ff02d9c7 Updated Spanish translation 2012-09-18 16:36:42 +02:00
cb627db392 Updated Greek translation 2012-09-18 15:59:15 +03:00
33bd6bc75b Updated gujarati file 2012-09-18 17:00:22 +05:30
ea5bf109cb hindi update 2012-09-18 16:06:01 +05:30
b150a2842e hindi update 2012-09-18 15:59:55 +05:30
2a46c39019 hindi update 2012-09-18 15:17:39 +05:30
5ca5f026c5 Assamese translation updated 2012-09-18 14:56:39 +05:30
15f22add79 Updated Portuguese translation 2012-09-18 07:58:05 +01:00
131fa6a359 Updated Indonesian translation 2012-09-18 11:20:04 +07:00
2d184e1842 Updated Polish translation 2012-09-18 00:04:08 +02:00
95a55a2c1c Updated Hungarian translation 2012-09-17 23:21:16 +02:00
8eecbb5c17 Updated Lithuanian translation 2012-09-17 23:28:55 +03:00
abfdcaa1b5 Updated Russian translation 2012-09-18 00:06:46 +04:00
8ee74e5661 st-theme: Fix extension ordering with !important
Extensions need to have priority over !important styles too.

https://bugzilla.gnome.org/show_bug.cgi?id=684163
2012-09-17 17:03:59 -03:00
ff31ccdd30 grabHelper: Remove unused parameters
Some left-overs from commit b203a95a7 ...

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-17 21:53:53 +02:00
f6645a41d2 grabHelper: Set _grabbedFromKeynav
This one got lost in commit b203a95a7.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-17 21:53:53 +02:00
daceb8105f Updated Slovenian translation 2012-09-17 21:37:35 +02:00
4beba796d7 Wanda: remove unnecessary destroy signal connection
'destroy' is emitted before the actor is unmapped during destruction, so
notify::mapped would emit an exception. Since unmapping is guaranteed,
the 'destroy' signal is unnecessary.

https://bugzilla.gnome.org/show_bug.cgi?id=684154
2012-09-17 19:49:58 +02:00
70c34baafb Wanda: don't recreate the texture if the icon size doesn't change
Wanda flickers if the animation is recreated, but we don't need to if
the size doesn't change (as we're not affected by icon theme changes).

https://bugzilla.gnome.org/show_bug.cgi?id=684154
2012-09-17 19:49:57 +02:00
e71c016477 recorder: Port to new gstreamer vp8enc api
The speed and quality properties have been removed in favor of properties
closer to the upstream library.

Removing the properies from the pipeline would result into a huge
slowdown so we have to map the old values to the new ones.

According to the source code of the old vp8enc element quality maps to
(int)(63 - quality * 6.2) for min_quantizer and max_quantizer, while
speed maps to cpu-used = speed == 0 ? 0 : (speed - 1).

So set min_quantizer and min_quantizer to 13, and cpu-used to 5 based on
the above formulas.

https://bugzilla.gnome.org/show_bug.cgi?id=684206
2012-09-17 19:49:04 +02:00
633bbd8a9e Fix regression from 38f943ef81
In gdm mode there is no activities button, and accessing it causes an
exception.

https://bugzilla.gnome.org/show_bug.cgi?id=684162
2012-09-17 15:31:04 +02:00
4c82df56e9 Updated POTFILES.in 2012-09-16 22:45:07 +02:00
0d62ec5b03 lookingGlass: Fix object inspector for multi-monitor scenarios
Otherwise the object inspector appears off-screen.

https://bugzilla.gnome.org/show_bug.cgi?id=683982
2012-09-16 17:38:18 -03:00
38f943ef81 messageTray: Do not block hot corner when open
https://bugzilla.gnome.org/show_bug.cgi?id=682255
2012-09-16 19:53:49 +02:00
e421953fcd panel: Make activities button's hot corner public
https://bugzilla.gnome.org/show_bug.cgi?id=682255
2012-09-16 19:53:49 +02:00
f39098a4f2 ViewSelector: remove the places & devices search provider
Remove the PlacesManager, its search provider and all associated code.
Places search is now provided by nautilus using the external search
provider API.

https://bugzilla.gnome.org/show_bug.cgi?id=683506
2012-09-16 19:02:22 +02:00
b203a95a78 grabHelper: Rework grabbing code to properly handle stacking
When Dan Winship wrote the GrabHelper code originally, it didn't
handle a grab stack. I wrote the grab stack code hastily when landed
the message tray, not understanding all of the code that was involved
here.

Fix it so that we properly do the operations for each type of grab
when we first need to, and not sometimes when the first grab is taken.

https://bugzilla.gnome.org/show_bug.cgi?id=683546
2012-09-15 10:32:31 -03:00
2bb1a6792a update Simplified Chinese (zh_CN) translation 2012-09-15 17:00:59 +08:00
e30d45a2b0 Updated Bulgarian translation 2012-09-15 08:27:48 +03:00
afcd90ae27 messageTray: Fix _hideTray() being called recursively
_hideTray() is called by _updateState() when the tray is visible
but should be hidden; however, _updateState() may be called again
from within _hideTray() when releasing the GrabHelper grab, so
unless we update the _trayState variable before that, _hideTray()
will be called a second time.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-15 00:17:44 +02:00
94c1d5a18c focus-manager: Make groups "refcounted"
Rather than unconditionally removing a focus root in remove_group(),
decrement a counter that add_group() increments, and only actually
remove a focus root when the counter drops to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=682243
2012-09-15 00:17:44 +02:00
4254fa3d38 ScreenShield: Make Return key dismiss screenshield
A couple of people have walked up to me and asked how to get to the
unlock screen from the screen shield. This was partly addressed by
bug 682285, but all three people who asked me about this said they
tried the return key and were surprised when it didn't work.

It sort of makes sense, since the user is "enter"ing the computer or
"return"ing to it.

This commit makes enter work in addition to the existing escape key.

https://bugzilla.gnome.org/show_bug.cgi?id=683889
2012-09-14 16:28:13 -04:00
3b293e91e3 viewSelector: Make the start search event available to input methods
Since we now use the capture phase to feed events into the input
method, we must set the capture flag for the event that starts
searches so that IMs can get at it.

https://bugzilla.gnome.org/show_bug.cgi?id=684040
2012-09-14 21:50:38 +02:00
3d6320295e UnlockDialog: allow typing before the first question from PAM
If the user starts typing right away, assume that the entry is
for a password and don't clear it when the secret request actually
comes. Then, if the user completes typing, we also stash the answer
and send it to GDM right away on the first PAM prompt.

https://bugzilla.gnome.org/show_bug.cgi?id=681576
2012-09-14 18:40:19 +02:00
7654f1ca3e MessageTray: remove bad fast path in hideSummaryBoxPointer
The onUngrab callback already checks if all notifications are destroyed and
hides immediately if so. Previous code instead would leave state handling
in an inconsistent state, by not removing the grab, not setting
summaryBoxPointerState to HIDDEN and not disconnecting various signals.

https://bugzilla.gnome.org/show_bug.cgi?id=684036
2012-09-14 18:29:47 +02:00
e62c66b153 TelepathyClient: fix regression from 6f5b700833
https://bugzilla.gnome.org/show_bug.cgi?id=684035
2012-09-14 18:29:47 +02:00
638507caff fingerprint: autostart fprintd when necessary
commit e333263fd6 changed fingerprint.js
to not throw an exception when fprintd is uninstalled, by adding the
flags DO_NOT_LOAD_PROPERTIES and DO_NOT_AUTO_START

DO_NOT_LOAD_PROPERTIES is correct.  Loading the properties is what makes
it fail at initialization time when not installed.  DO_NOT_AUTO_START is
not correct though. It means fprintd will never get activated implicitly
when we need it.

This commit removes DO_NOT_AUTO_START thus making fprintd start when we
need it, but not fail at initialization time when not around.

https://bugzilla.gnome.org/show_bug.cgi?id=683131
2012-09-14 12:12:46 -04:00
107f5de58e ScreenShield: animate going from the unlock dialog to the lock screen
If the user presses esc in the dialog, tween the lock screen from
the top instead of showing it immediately.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-09-14 17:11:57 +02:00
b1451523ca messageTray: Disable the tray dwell when the user is interacting
Look at the focus window's interaction timestamp to catch the case
where the user is typing and knocks the pointer into the tray or
mouses down to the bottom of the screen and clicks on something.
If the focus window's interaction time differs at the start and
end of the tray dwell then we don't activate the tray.

https://bugzilla.gnome.org/show_bug.cgi?id=683811
2012-09-14 10:42:40 -04:00
f7a95b5edc Update French translation 2012-09-14 11:07:42 +02:00
be290fafe7 ScreenShield: wait for stage mapping before taking a grab
In gdm, we would attempt to become modal during the synchronous initialization,
and this would fail, as X prevents grabs on unmapped windows. Instead,
wait for the stage to be visible before becoming modal.

https://bugzilla.gnome.org/show_bug.cgi?id=683357
2012-09-14 00:54:50 +02:00
b7ae74edb9 Revert showing notifications in the locked screen
As PAM messages are now shown below the password entry, there is no
need for this complexity, and we can just hide all notifications.
Also, this avoids the ambiguity between notification.showWhenLocked and
source.showInLockScreen, which have very different effects.

https://bugzilla.gnome.org/show_bug.cgi?id=683369
2012-09-14 00:06:30 +02:00
b3041ae9fc TelepathyClient: fix includes
The chat menu requires the PopupMenu module.

https://bugzilla.gnome.org/show_bug.cgi?id=683989
2012-09-13 23:59:55 +02:00
7499b04638 Fix insensitive styling for popup menu items
The selector for insensitive popup menu items was wrong (a PopupMenuItem is
a ShellGenericContainer, not a StButton). Fixing it showed that previous
:insensitive tracking was manual for a reason: we have many items that are
not reactive, but don't want the insensitive styling (for example those in
the battery menu).
Fix it by adding a new style-class, popup-inactive-menu-item, that is added
to all new PopupMenuItems that are not activatable.

https://bugzilla.gnome.org/show_bug.cgi?id=683988
2012-09-13 23:48:17 +02:00
bf2d2071fc Keyboard: fix timestamp handling to account for CURRENT_TIME
CLUTTER_CURRENT_TIME (like GDK_CURRENT_TIME and libX11 CurrentTime) is 0,
and thus compares lower than all valid timestamps, meaning that
focus changes without an X11 event in the stack are ignored by
the on screen keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=664309
2012-09-13 23:48:17 +02:00
488820daec TelepathyClient: don't emit an error if an unknown message is acknowledged
pending-messages-removed is emitted for sent messages too, but we don't
include those in the _pendingMessages list. Avoid useless spew in the session
logs in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=683449
2012-09-13 22:41:17 +02:00
77c15b76b5 Fix extension styling
St.Theme.load_stylesheet() does not queue a theme context change, so
any styling of widgets created before will not be updated. To fix this,
load the stylesheet before the extension builds its own UI in enable()

https://bugzilla.gnome.org/show_bug.cgi?id=682128
2012-09-13 22:41:17 +02:00
e71129aa68 autorunManager: Don't show a right-click menu
Activating the source shouldn't be possible, and neither should
removing it.

https://bugzilla.gnome.org/show_bug.cgi?id=683438
2012-09-13 15:45:07 -03:00
6f5b700833 messageTray: Split out the building of the right menu to a separate method
Besides code cleanliness, this allows us to stub out a right-click menu
for resident sources.

https://bugzilla.gnome.org/show_bug.cgi?id=683438
2012-09-13 15:45:07 -03:00
9627864ca8 status/network: Fix another StIconType regression 2012-09-13 20:32:11 +02:00
2a8625ffae screenShield: Add box-shadow to the shield
According to the mockups, the screen shield should cast a shadow
when lifted.
2012-09-13 19:15:37 +02:00
ed82c3763c recorder: Fix more fallout from session-mode changes 2012-09-13 14:29:59 +02:00
22266899dc shellEntry: Make the entry have a fake focus state when a context menu is open
This means that right-clicking on an entry shouldn't visibly change the theme,
which is unexpected. Make sure that closing the menu refocused the entry, too.

https://bugzilla.gnome.org/show_bug.cgi?id=683509
2012-09-12 14:15:18 -03:00
9dfd1bfa41 shellEntry: Don't use a ClutterClickAction to pop up a menu
This removes support for long press, but fixes the brokenness of
other types of event handling.

https://bugzilla.gnome.org/show_bug.cgi?id=683509
2012-09-12 14:15:17 -03:00
409af28cb7 status/keyboard: Handle IBus engines which don't specify a symbol
In this case, fall back to the 2 or 3 letter language code or, failing
that, to a keyboard symbol.

https://bugzilla.gnome.org/show_bug.cgi?id=683613
2012-09-12 18:54:51 +02:00
4fe604bfe8 status/keyboard: Make IBus display strings consistent with g-c-c
Instead of entries like "Anthy" we want "Japanese (Anthy)".

https://bugzilla.gnome.org/show_bug.cgi?id=683124
2012-09-12 18:54:50 +02:00
49df72ceda st-im-text: Replace key-* handler with captured-event
When using an input method like IBus, the IM is expected to process
key events before anything else. Currently this doesn't always work
as expected, as the event filtering is done in the default handlers
of the key-press and key-release events, e.g. only after other
handlers have been run.
To allow the IM to filter events earlier, move the code to a
captured-event handler instead.

https://bugzilla.gnome.org/show_bug.cgi?id=658325
2012-09-12 18:50:26 +02:00
2db029bcdb dash: Don't underallocate show-apps button
When the dash contains more icons than fit at the minimum icon size,
icons are cut off at the end. This means that the show-apps button
will be the first to disappear, which is problematic given it's the
sole access point for other applications (for those that refuse to
use search at least).
Fix by using a dedicated widget for the dash actor, so that in case
of underallocation only icons above the show-apps button end up being
cut off.

https://bugzilla.gnome.org/show_bug.cgi?id=683340
2012-09-12 16:32:52 +02:00
7fd128eabc Updated Marathi Translations 2012-09-12 16:25:12 +05:30
5e3d8dd3eb Assamese translation updated 2012-09-11 21:01:34 +05:30
785be2f327 Hide the user menu in the GDM greeter lock screen
https://bugzilla.gnome.org/show_bug.cgi?id=683705
2012-09-10 21:23:25 +02:00
8cf9baa132 ScreenShield: move lock status handling to use session mode
Have distinct session modes for the lock screen and the unlock dialog,
and rework the logic in ScreenShield to have the lock-screen mode stack
onto the unlock-dialog mode (where applicable)

https://bugzilla.gnome.org/show_bug.cgi?id=682542
2012-09-10 21:23:25 +02:00
09e3aed770 St: don't focus hidden actors
If an actors is not mapped (visible and all parents visible), then don't
allow navigating focus to it.
This fixes a regression in the keyboard navigation of the panel with
invisibile items.

https://bugzilla.gnome.org/show_bug.cgi?id=683529
2012-09-10 21:23:25 +02:00
452ac297ab PolkitAgent: don't crash if there is no avatar
If we're asking for root's password, we don't show an avatar. Don't
emit an exception in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=683707
2012-09-10 18:40:05 +02:00
7ebb5c6a10 NotificationDaemon: don't fail if a tray icon has no WM_CLASS
If there is no WM_CLASS for a tray icon, it returns null, not the empty
string. Detect that case without an exception.

https://bugzilla.gnome.org/show_bug.cgi?id=683724
2012-09-10 18:40:05 +02:00
00e0d24a6a Updated Thai translation. 2012-09-10 23:19:00 +07:00
8a269041fb messageTray: Restyle the summary counters
They are bigger and show an ellipsis if the count goes over 99. They
now have a blurred background and a drop shadow based on
data/theme/close-window.svg.

https://bugzilla.gnome.org/show_bug.cgi?id=682891
2012-09-10 17:41:30 +02:00
9f48adcff9 MessageTray: fix unexpanded height when receiving multiple telepathy messages
ClutterBinLayout is so amazingly broken: it uses the y_expand property to
find out if the children needs to honor alignment/fill, but that property is
"bubbled up" from the grand-children, so the notificationWidget would notice
the y_expand on the notificationBin (necessary to make the layout manager on
notificationWidget honor the alignment property for the bin), and would
receive the full height of the MessageTray actor from the parent's layout manager,
resulting in a notificationWidget shifting up, with the notification detached
from the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=683628
2012-09-10 10:41:37 +02:00
48e7d732b9 Updated Portuguese translation 2012-09-09 12:38:56 +01:00
30048b74d1 Updated Korean translation 2012-09-09 07:25:27 +09:00
c866b0dbfd Clean up vestiges of the OpenSearch system
https://bugzilla.gnome.org/show_bug.cgi?id=683583
2012-09-07 20:49:35 +02:00
1c79f18b13 stage: Change background color to grey
The stage's background color can visible on screencasts when multiple monitors
with different resolutions are in use.

Change it to from blue to grey to look better as requested by the designers.

https://bugzilla.gnome.org/show_bug.cgi?id=683514
2012-09-07 18:29:20 +02:00
6d704be88b Updated Belarusian translation. 2012-09-07 18:58:44 +03:00
5af389c087 Updated Hebrew translation. 2012-09-07 16:13:59 +03:00
475dde4193 Updated German translation 2012-09-07 09:47:48 +02:00
8c534163e1 Panel: don't animate session mode switches
It causes problems with extensions, and it's excessively distracting.

https://bugzilla.gnome.org/show_bug.cgi?id=683526
2012-09-06 21:38:18 +02:00
657887b241 Revert "userMenu: Don't update the presence icon immediately"
This reverts commit f1ca96bbf0.
We're moving towards atomic panel upgrade, so we don't need this.

https://bugzilla.gnome.org/show_bug.cgi?id=683526
2012-09-06 21:38:17 +02:00
10da35cbef boxpointer: Clean up
https://bugzilla.gnome.org/show_bug.cgi?id=680077
2012-09-06 20:59:58 +02:00
00f15c1075 boxpointer: Avoid malformed boxpointer arrow
If the arrow's origin is so close to the edge that the arrow will not
be isosceles, we try to compensate as follows:
  - We skip the rounded corner and settle for a right angled arrow as
    as shown below.
    |\_____
    |
    |
  - If the arrow was going to be acute angled, we move the position of
    the box to maintain the arrow's accuracy.

https://bugzilla.gnome.org/show_bug.cgi?id=680077
2012-09-06 20:56:04 +02:00
19f92df8ab Updated Slovenian translation 2012-09-06 19:57:27 +02:00
8639cf8060 l10n: Updated Persian translation 2012-09-06 20:44:44 +04:30
2501d29e9d Updated Brazilian Portuguese translation. 2012-09-06 11:32:17 -04:00
8109dd684e sessionMode: Introduce the concept of "primary" modes
With the recent session mode changes, there is now a mix of modes
that are meant to apply to the entire session (specified as parameter
to the --mode command line switch) and temporary modes like the lock
screen; introduce a property to make the difference explicit, and only
allow "primary" modes to be specified on the command line.

https://bugzilla.gnome.org/show_bug.cgi?id=683488
2012-09-06 17:02:51 +02:00
5a259dd6b0 GrabHelper: always navigate focus when grabbing
Users of GrabHelper.grab() espect that the actor parameter (or one of its
children) will receive focus, irrespective of the previous focus location.
This fixes the key focus on the chat entry when expanding the notification.

https://bugzilla.gnome.org/show_bug.cgi?id=683449
2012-09-06 15:20:14 +02:00
2ed28211ed popupMenu: Don't always ignore SubMenu children in width requests
Hidden children are currently ignored in width requests; in the
case of submenu items, this results in abrupt width changes of
open menus when the corresponding SubMenuMenuItem is toggled.
To fix, only ignore SubMenu children when the corresponding
SubMenuMenuItem is hidden as well.

https://bugzilla.gnome.org/show_bug.cgi?id=683485
2012-09-06 13:56:44 +02:00
9d0eaa216f layout: Fix hiding panel for fullscreen apps
Yet another fallout from the sessionMode changes ...

https://bugzilla.gnome.org/show_bug.cgi?id=683487
2012-09-06 13:56:44 +02:00
58477282fe popupSubMenu: Only remove padding when scrollbar is shown
The special padding rules for submenu items currently ensure that
content aligns properly when the scrollbar is shown. While they
work nicely for the network menu, it looks odd for non-scrolled
submenus, so make this case explicit by introducing a :scrolled
pseudo class and adjust the style rules to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=683009
2012-09-06 13:56:44 +02:00
6b016c2528 st-texture-cache: Fix stretched textures
st_texture_cache_load_from_raw() enforces a square ClutterTexture,
resulting in the texture being stretched if the passed in image
data has a different width:height ratio.
Add padding in those cases as we already do when loading from pixbufs.

https://bugzilla.gnome.org/show_bug.cgi?id=683483
2012-09-06 13:56:43 +02:00
b98c5f94ee shellSearchProvider: Fix GetResultMetas definition
The searchProvider interface originally used a GetResultMeta method to
return meta data of a single id; when it was changed to GetResultMetas,
the return value was not updated accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=683482
2012-09-06 13:56:43 +02:00
ad8bdb929a ShellDBus: fully show the lock screen before returning for Lock
Otherwise, gnome-settings-daemon proceeds with suspension too early,
and we may end up with visible windows on resume.

https://bugzilla.gnome.org/show_bug.cgi?id=683448
2012-09-06 13:15:27 +02:00
5030d59fcc messageTray: Focusing the text entry should force chats to stay open
https://bugzilla.gnome.org/show_bug.cgi?id=682236
2012-09-06 12:05:54 +02:00
ec52928736 messageTray: A variable to indicate that the close button was clicked
Otherwise critical resident notifications can not be closed by
clicking the close button.

https://bugzilla.gnome.org/show_bug.cgi?id=683472
2012-09-06 12:04:11 +02:00
7f479e18e6 Finnish translation update by Jiri Grönroos 2012-09-06 08:59:38 +03:00
7999e9020d Updated Greek translation 2012-09-06 02:40:59 +03:00
43ba93a817 screenShield: Animate the raising of the lock screen with the scroll wheel
A sudden transition to the lock screen is a bit jarring.
2012-09-05 14:51:30 -03:00
b37e02c90a screenShield: Fix typo
We aren't French, no matter how much we may want to be.

https://bugzilla.gnome.org/show_bug.cgi?id=683305
2012-09-05 14:28:57 -03:00
be5df17a4a grabHelper: Clean up the code a bit
I don't remember why I added needsGrab in the first place.
2012-09-05 14:28:45 -03:00
ffbc1fd190 unlockDialog: Fix centering of label in screen shield
The code here was trying to center the label, but that didn't
happen because we allocated the entire space to the label, which
still plonks it at the top.
2012-09-05 14:26:01 -03:00
457fb604dd autorunManager: Fix another regression
We may not have a resident source to destroy if no mounts are found.
2012-09-05 13:47:01 -03:00
09c81f79f6 AutorunManager: fix regression from the components rewrite
Message tray sources cannot be reused after destruction, so connect
to 'destroy' signal and clear out the previous one.
Also, fix some code paths that used the autorun manager incorrectly.

https://bugzilla.gnome.org/show_bug.cgi?id=683377
2012-09-05 16:22:11 +02:00
0725a7d836 SessionMode: add polkit to gdm session
It's needed to shutdown when other users are logged in or inhibitors are
active.

https://bugzilla.gnome.org/show_bug.cgi?id=683400
2012-09-05 16:14:02 +02:00
f957ae71c3 Don't start new components when activating the screen-shield in gdm
Previous code was activating the networkAgent and telepathyClient
in the lock-screen, irrespective of the previous mode.
Now it checks if the session mode is locked down, and if so it refuses
to start new components.

https://bugzilla.gnome.org/show_bug.cgi?id=683400
2012-09-05 16:14:02 +02:00
011c9d1beb Updated Indonesian translation 2012-09-05 21:07:28 +07:00
aed589a98d Updated British English translation 2012-09-05 13:58:08 +01:00
3830e90642 Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-09-05 20:08:12 +08:00
3710b88ab9 Bluetooth: don't restrict the length of non numeric PINs
The protocol restriction is only for numeric PINs (passkeys, in bluez
jargon). For passwords, any length is allowed.

https://bugzilla.gnome.org/show_bug.cgi?id=683356
2012-09-05 13:15:33 +02:00
5c990f103e Rewrite the layout code of the message tray
Previous code had a mixture of fixed positioning and ClutterBinLayout,
and this was broken badly for autorun notifications.
Rewrite to use ClutterBinLayout and Clutter properties exclusively.

https://bugzilla.gnome.org/show_bug.cgi?id=683378
2012-09-05 12:42:11 +02:00
2890fc9d7d Updated Serbian translation 2012-09-05 10:37:18 +02:00
0223507a2e Updated Arabic translation 2012-09-05 07:08:55 +02:00
59412a9405 Components/Keyring: unregister the system prompter when disabling
Otherwise, we get a critical when enabling again
2012-09-05 01:13:36 +02:00
110d58bbc3 Reintroduce run dialog
Fix regression from 92d8d65543, bad rebase.
2012-09-05 01:10:44 +02:00
eda17defb2 messageTray: Move close button above notification widget stack
This allows us to click on the entire close button, not just the part
of it that's unobscured.
2012-09-04 19:21:31 -03:00
f563fb124e shell-gtk-embed: Fix NULL pointer dereference
Clutter will try to unmap during a dispose if we have a parent, so if we
set our own actor to NULL before the chain up, we're going to attempt to
unmap our own NULL actor. Fix that by swapping the order in which we
chain up.

https://bugzilla.gnome.org/show_bug.cgi?id=672790
2012-09-04 19:21:30 -03:00
14d0a96999 shell-recorder: Fix warning message about unknown escapes
We were showing the percent character here.

https://bugzilla.gnome.org/show_bug.cgi?id=677434
2012-09-04 19:21:30 -03:00
f0474ffccc shell-recorder: Remove the ability to pause the timeline
https://bugzilla.gnome.org/show_bug.cgi?id=677434
2012-09-04 19:21:30 -03:00
11ce6845f2 shell-recorder: Remove count and unique filename settigs
These aren't used anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=677434
2012-09-04 19:21:30 -03:00
70d610b5e4 shell-recorder: Fix accidental fallthrough
Don't append a unique identifier when we asked for a timestamp.

https://bugzilla.gnome.org/show_bug.cgi?id=677434
2012-09-04 19:21:29 -03:00
f5ca649977 shell-recorder: Don't use a default filename
The default filename isn't localized and isn't the same one that
the shell sets. Just remove the fallback mechanism, and abort
recording if somebody didn't set the filename

https://bugzilla.gnome.org/show_bug.cgi?id=677434
2012-09-04 19:21:29 -03:00
8954d33019 Updated Polish translation 2012-09-05 00:20:30 +02:00
2e6205bc05 Updated POTFILES.in 2012-09-05 00:06:19 +02:00
e0dea63079 Updated POTFILES.in 2012-09-04 23:59:30 +02:00
7c244b01c6 Panel: move the _panelContainer down to PanelMenu
Panel already forces each item to be a PanelMenu.Button, so it's better
to have the latter handle the bin container too, instead of attaching
a private property that might collide with internal usage by the indicator.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 23:52:41 +02:00
3f5edf7c3e VolumeMenu: read output and input if PulseAudio is already ready when constructing
Previously we would only read the default sink and default source when
the connection to PulseAudio succeded. This worked because all VolumeMenu
users where initialized synchronously during shell load.
With the recent session mode changes though, the lock screen menu is
created on demand, and when it loads PA is already connected, so
it doesn't update the sliders.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 23:52:41 +02:00
92d8d65543 ScreenShield: use session mode to handle the GDM login dialog
Have main.js call .showDialog() when going back from the lock-screen, instead
of using the return value of createUnlockDialog to know if the dialog
was persistent.
_keepDialog is still used as LoginDialog cannot really be destroyed,
and cancelling it does not destroy it.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 23:52:41 +02:00
cebd8e14e9 screenShield: Zoom out on login
The sudden transition from the lock screen to the user session
may be a bit sudden and overwhelming. Make ourselves more shell-like
by resizing out the screen shield according to mockups.

https://bugzilla.gnome.org/show_bug.cgi?id=683170
2012-09-04 18:42:46 -03:00
16e92a7ca3 sessionMode: Inherit from a more restrictive session mode by default
It makes more sense to define session modes in terms of what you're
adding to the bare shell, not in terms of what you're taking away
from the user session.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 18:42:45 -03:00
59e2710137 sessionMode: Reindent
This puts all the parameters at the same indent level, which makes the
file much easier to read.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 18:42:45 -03:00
f1ca96bbf0 userMenu: Don't update the presence icon immediately
If we don't freeze the presence icon, we can end up in a place where
we'll be updating the icon before we fade out the panel indicators when
coming back from the lock screen.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 18:42:45 -03:00
ec01f5d5ee userMenu: Make the user menu insensitive in the lock screen
And show a lock icon as well.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 18:42:44 -03:00
2a800e4ce0 Rearchitect the Shell to have a components system
Components are pieces of the shell code that can be added/removed
at runtime, like extension, but are tied more directly to a session
mode. The session polkit agent, the network agent, autorun/automount,
are all components, keyring, recorder and telepathy client are all
now copmonents.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 18:42:44 -03:00
ca2e09fe8b sessionMode: Allow changing the session mode at runtime
Since we eventually want to add a system for changing the top panel
contents depending on the current state of the shell, let's use the
"session mode" feature for this, and add a mechanism for updating the
session mode at runtime. Add support for every key besides the two
functional keys, and make all the components update automatically when the
session mode is changed. Add a new lock-screen mode, and make the lock
screen change to this when locked.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-04 18:42:44 -03:00
7e343f11f2 st-bin: Make sure not to allocate hidden children 2012-09-04 18:42:44 -03:00
db20a54861 Login/UnlockDialog: don't reset immediately if auth fails
Instead of showing a notification, add a small message immediately
below the entry, and give the user two more attempts to login,
before going back to the welcome or lock screen.

https://bugzilla.gnome.org/show_bug.cgi?id=682544
2012-09-04 23:38:46 +02:00
ec4f6b7f91 Updated Hungarian translation 2012-09-04 15:54:39 +02:00
08a69cdcbd Bump version to 3.5.91
Update NEWS
2012-09-04 10:55:28 +02:00
aa9c095c8e panel: Make sure to show the app menu button after unlocking the screen
I'm not sure how we missed this one.

https://bugzilla.gnome.org/show_bug.cgi?id=683154
2012-09-03 19:24:11 -03:00
b257029d3e main: Remove some cruft
Main.hotCorners has been empty for a long, long time.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-03 18:14:53 -03:00
cb9062f818 calendar: Launch the calendar server with DBus autostart
The supposed reason for launching the calendar server in a peculiar
way was so that the process would be killed when the Shell was killed,
but that didn't actually work. Launch the calendar server through auto-start,
and persist all throughout the session.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-03 18:14:53 -03:00
3a1f623ea3 sessionMode: Remove extraStylesheet
It's been unused ever since the gdm merge.

https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-03 18:14:41 -03:00
47d46e367e ScreenShield/MessageTray: fix crash after the introduction of close buttons
Commit 5c6b1fd0c modified the hierarchy of SummaryItem contents, by
introducing a notificationStackWidget in place of the StackView, but
forgot to update the bits in ScreenShield.NotificationsBox that accessed
and reparented that directly, causing a crash by invalid theme node access.

https://bugzilla.gnome.org/show_bug.cgi?id=682683
2012-09-03 23:08:36 +02:00
e5534e86ab Panel: clean up button construction code
We already could build the right part of the panel declaratively according
to the session mode. Extend that to handle the left and center parts.
Also, move the mapping from the roles to the classes in panel.js, as it shared
by all modes.

https://bugzilla.gnome.org/show_bug.cgi?id=682546
2012-09-03 23:08:36 +02:00
e0ca572572 Updated Polish translation 2012-09-03 19:13:16 +02:00
ca4b86e7ca messageTray: Don't hide the banner after NOTIFICATION_TIMEOUT
... if the notification originally popped up under the pointer, and
the pointer is moving inside it.

https://bugzilla.gnome.org/show_bug.cgi?id=682238
2012-09-03 18:48:10 +02:00
f177bd0b51 ScreenShield: Allow lifting up the curtain with the mouse wheel
On a traditional mouse, or with edge-scrolling on a touchpad, it just
feels natural to unlock by scrolling up.

https://bugzilla.gnome.org/show_bug.cgi?id=683164
2012-09-03 17:19:40 +02:00
11086e8ef8 messageTray: s/_useLongerHideTimeout/_useLongerTrayLeftTimeout/
Typo introduced in 6d2d4fcc77
2012-09-03 16:21:53 +02:00
1237aef727 Updated Spanish translation 2012-09-03 15:58:57 +02:00
79bfea5970 st-widget: Unset hover when setting track_hover to FALSE
https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-03 02:51:22 -03:00
50f8ae6fc7 st-bin: Don't allocate a hidden actor
https://bugzilla.gnome.org/show_bug.cgi?id=683156
2012-09-03 02:51:22 -03:00
73ec86797b Updated Italian translation 2012-09-02 23:19:23 +02:00
703417a760 ShellUserVerifier: fix cancellation
Ensure that all async callbacks check and ignore G_IO_ERROR_CANCELLED.
Ensure that all runs of authentication have their own GCancellable, so
that .begin() can be called multiple times on the same user verifier.
Check for fingerprint reader when beginning authentication, and not
when reset by GDM.

https://bugzilla.gnome.org/show_bug.cgi?id=682544
2012-09-02 23:09:23 +02:00
3013a87bd2 theme: Tweak the padding of #summary-mode
Change the padding values of #summary-mode to be 6px on right and left
to match the values in .summary-source, which determine the padding
between the top and bottom edges of the tray and the items.

https://bugzilla.gnome.org/show_bug.cgi?id=682248
2012-09-02 18:48:00 +02:00
833cb2556b gdm: Fix powerMenu icon name
Fallout from commit c21b1e5fe0
2012-09-02 14:55:45 +02:00
8f4f8fccdb Updated Lithuanian translation 2012-09-02 15:36:29 +03:00
38e4ab1cea updated Tamil translation 2012-09-02 16:53:22 +05:30
366a3e2c35 Updated Norwegian bokmål translation 2012-09-02 12:07:39 +02:00
fcb175ebb3 update Punjabi Translation 2012-09-02 10:05:41 +05:30
a76cc79f88 ScreenShield: add a drop shadow to the animated arrows
Introduce a StShadowHelper to manage drop shadows from JS (which
cannot use Cogl directly), and use it in a new StWidget-derived
JS class to draw the arrow.

https://bugzilla.gnome.org/show_bug.cgi?id=682285
2012-09-01 16:38:51 +02:00
1a6d74fcb2 ScreenShield: rework the arrow in the lock screen
User testing has shown that it is not discoverable that the whole
lock screen can be dragged. A new mockup includes more arrows
and a short animation every 4 seconds.

https://bugzilla.gnome.org/show_bug.cgi?id=682285
2012-09-01 16:38:51 +02:00
eb351b1882 MessageTray: escape the tray when a legacy icon is clicked
Legacy tray icons may want to take a pointer grab to show a popup menu,
and this is incompatible with message tray modality. To solve this,
escape the tray when forwarding clicks to the tray icons, and wait
for the input mode change to actually synthetize the X event.

https://bugzilla.gnome.org/show_bug.cgi?id=682244
2012-09-01 16:38:51 +02:00
43caace1b6 boxpointer: Use the -arrow-rise as padding instead of a magic number
This makes sense if we want to follow what the following comment says:
// We also want to keep it onscreen, and separated from the
// edge by the same distance as the main part of the box is
// separated from its sourceActor

Using a magic number violates the "separated from the edge ...
separated from its sourceActor" part.

https://bugzilla.gnome.org/show_bug.cgi?id=682343
2012-09-01 13:14:45 +02:00
167ed7c35b loginDialog: Fix regression from updating icon
Remove a rogue reference to _updateIcon.
2012-09-01 08:06:41 -03:00
69735940ec messageTray: Summary items should be square and have spacing
Each summary icon is 48x48 with a padding of 6px on each side. Thus,
each summary item is 60px wide. Therefore the summary mode should be
60px high instead of 72px.

Changed the tray actor to use a ClutterBinLayout so that it honors the
y-expand property of its children.

https://bugzilla.gnome.org/show_bug.cgi?id=682248
2012-09-01 12:36:00 +02:00
1a7fad129d Updated Vietnamese translation 2012-09-01 17:21:45 +07:00
6931e6cf0f po/vi: import from Damned Lies 2012-09-01 17:18:22 +07:00
87e021cd2e statusArea: hide power indicator on desktop
On a desktop system the power indicator does not get hidden correctly,
since a blank icon '' is returned instead of null.

https://bugzilla.gnome.org/show_bug.cgi?id=683080
2012-09-01 09:41:24 +02:00
d3f5d94afe Updated Galician translations 2012-09-01 02:22:15 +02:00
a3d8b5e526 Fix some more icon names
Message tray sources should never have symbolic icons.
The VPN secondary icon in the panel instead should.
2012-08-31 23:31:25 +02:00
5e46abfa03 Use UserAvatarWidget to display user avatars
Replace duplicate custom code with a common widget.

https://bugzilla.gnome.org/show_bug.cgi?id=683137
2012-08-31 23:31:25 +02:00
f4740bac65 Updated Polish translation 2012-08-31 22:55:42 +02:00
dc10e61a20 Fix some more symbolic icon names
Reviewed by Jasper St. Pierre in IRC.
2012-08-31 22:46:53 +02:00
82c8aad157 NetworkMenu: remove broken device activation policy
Previously, when toggling a switch on we tried to replicate NM policy and
find a good connection to activate. This is broken in many situations.
Instead, only activate something when we can be sure it's what the user
wants (i.e. when there is only one connection, or when there is none,
and thus connecting will trigger the config dialog)

https://bugzilla.gnome.org/show_bug.cgi?id=683136
2012-08-31 22:35:44 +02:00
4ba1f26e4d searchDisplay: Improve the placement and style of the "No results" text
During user testing, it was shown that several people did not notice the
miniscule text label. Make it large and centered.

https://bugzilla.gnome.org/show_bug.cgi?id=683135
2012-08-31 16:43:52 -03:00
f8805e8311 windowManager: Disable the window dimmer when we close all attached dialogs
This saves some GLSL resources and an FBO.

https://bugzilla.gnome.org/show_bug.cgi?id=683073
2012-08-31 16:43:52 -03:00
c815979f2a magnifier: Don't use some deprecated APIs
Stop using Clutter.Group and Clutter.Rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=683073
2012-08-31 16:43:52 -03:00
54e5ffcac1 magnifier: Don't set the size of the uiGroup
The magnifier shouldn't mess with global properties like this.

https://bugzilla.gnome.org/show_bug.cgi?id=683073
2012-08-31 16:43:51 -03:00
3fd0502cb9 magnifier: Round the uiGroup to integer positions
This removes the jaggies from text, and other sorts of things.

https://bugzilla.gnome.org/show_bug.cgi?id=683073
2012-08-31 16:43:51 -03:00
8aed51180f magnifier: Use PointerWatcher to poll the mouse pointer
This gives us a more efficient method to watch the mouse pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=683073
2012-08-31 16:43:51 -03:00
e616877fd2 js: Fix up for Clutter.Color changes
Spotted by darkxst on IRC.

https://bugzilla.gnome.org/show_bug.cgi?id=683073
2012-08-31 16:43:51 -03:00
df15ee4074 Updated Arabic translation 2012-08-31 16:06:38 +02:00
4cf3acd0ec Updated Greek translation 2012-08-31 11:10:43 +03:00
77ea16e18f st-im-text: Support surrounding-text
https://bugzilla.gnome.org/show_bug.cgi?id=683015
2012-08-31 02:16:42 +02:00
85d993386a st-im-text: Simplify dispose
There's no need to disconnect signal handlers on a private object that
we are destroying.
2012-08-31 02:16:42 +02:00
14a7da767b status/volume: Fix initial symbolic icon 2012-08-30 21:53:25 +02:00
2f3df71cc1 status/network: Fix VPN symbolic icon 2012-08-30 21:38:39 +02:00
dc13e72b89 messageTray: Use monitor geometry for dwelling
In multi-monitor setups, the screen might extend below the edge of
the monitor that holds the tray. In that case the tray is currently
triggered from a secondary monitor, which is rather surprising;
change the check to use the correct monitor geometry instead.

https://bugzilla.gnome.org/show_bug.cgi?id=683044
2012-08-30 18:52:17 +02:00
2beff9896a Fix a couple of symbolic icons
Some fallout from commit c21b1e5fe0 ...
2012-08-30 14:55:33 +02:00
43af6f4792 Updated Galician translations 2012-08-30 14:18:31 +02:00
04d1a35cb5 PopupMenu: propagate all open-state-changed down to PopupMenuSection
PopupMenuBase relies on open-state-changed to update the separator
visibility, but PopupMenuSection were only emitting when the parent
closed, so the first time the menu was opened, separator visiblity was
wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=682998
2012-08-30 01:10:47 +02:00
f075b36d4f Updated Lithuanian translation 2012-08-29 23:34:28 +03:00
c21b1e5fe0 st: Remove StIconType
GTK+ works by explicitly specifying a -symbolic suffix for all icons.
Do the same here.

https://bugzilla.gnome.org/show_bug.cgi?id=682540
2012-08-29 16:41:09 -03:00
042c1fd54b Updated Spanish translation 2012-08-29 17:02:23 +02:00
ee6086373b st-im-text: Support pre-edit
Use clutter_text_set_preedit_string() to wedge pre-edit text
into ClutterText.

https://bugzilla.gnome.org/show_bug.cgi?id=664041
2012-08-29 14:46:52 +02:00
382310fe51 Updated Polish translation 2012-08-29 01:51:06 +02:00
d52cb510fc Updated POTFILES.in 2012-08-29 01:49:24 +02:00
c1de2788b1 Add a new lock screen menu to combine volume network and power
The design has a combined volume-network-power indicator in the lock
screen, which when opened shows a volume slider. Implement it by abstracting
the volume menu into a PopupMenuSection, and by creating three StIcons
bound to the real ones.

https://bugzilla.gnome.org/show_bug.cgi?id=682540
2012-08-29 01:13:23 +02:00
41dc9e0894 PanelMenu: Allow multiple icons in one SystemStatusButton
This generalizes the code previously used by NetworkMenu, so that all
SystemStatusButton now can add multiple icons.

https://bugzilla.gnome.org/show_bug.cgi?id=682540
2012-08-29 01:13:23 +02:00
d3b0d23d8f StIcon: deprecate StIcon:icon-name and StIcon:icon-type
Reroute setting those properties to a GIcon. API users are expected
to create GIcon directly now.
The advantage is that from a StIcon you can now create a similar one
by accessing :gicon.

https://bugzilla.gnome.org/show_bug.cgi?id=682540
2012-08-29 01:13:23 +02:00
f96dcaccbe MessageTray: clamp unexpanded notification height
The height of an unexpanded notification could include expanded
content if the notification has extra widgets (like actions and images),
so tweening to that cause it to expand visually.
Instead, use the height of the message tray before the restyle
as an upper bound.

https://bugzilla.gnome.org/show_bug.cgi?id=682738
2012-08-29 01:04:28 +02:00
2672f205fd notificationDaemon: Explicitly return false from an idle 2012-08-28 19:50:08 -03:00
1ba21ed367 Updated Galician translations 2012-08-29 00:27:17 +02:00
79408d359c placeDisplay: Remove "Connect to..." item
Opening a dialog without an associated application is odd, so require
users to use nautilus itself to create new connections.

https://bugzilla.gnome.org/show_bug.cgi?id=682817
2012-08-28 21:43:53 +02:00
12c76e53cb Updated Polish translation 2012-08-28 18:54:54 +02:00
ac44426557 Updated Spanish translation 2012-08-28 16:06:50 +02:00
684e5bec15 Updated Norwegian bokmål translation 2012-08-28 07:45:08 +02:00
70d19530c4 Use the term password instead of passphrase
Since that is what the primary label uses as well as the gtk mount
operation.

https://bugzilla.gnome.org/show_bug.cgi?id=682645
2012-08-27 21:16:08 -04:00
e34ab6c5ae Add 1em of padding below the password box
https://bugzilla.gnome.org/show_bug.cgi?id=682645
2012-08-27 21:12:26 -04:00
b3cb9d8459 Fix the spacing in the mount operation auth prompt
We weren't setting the correct style attributes like we
were in the polkit auth dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=682645
2012-08-27 19:03:00 -04:00
df3fa973ad main: Load extensions as late as possible
Since we want extensions to be able to be loaded at any time, that
means that the startup case should be as close to the live-time
install case.

https://bugzilla.gnome.org/show_bug.cgi?id=682822
2012-08-27 17:40:07 -03:00
1f4895428d Implemented FUEL entries to Assamese translation 2012-08-28 00:17:03 +05:30
417941a1bf overview: Fix ShellInfo.setMessage()
Commit 22eea750 made info messages show up in the lock screen, but
as setShowWhenLocked() throws an exception when called on non-transient
notifications, the transient hint has to be set first.

https://bugzilla.gnome.org/show_bug.cgi?id=682268
2012-08-27 12:15:34 +02:00
973a6b21a2 Assamese translation updated 2012-08-27 14:45:09 +05:30
b50604d070 a11y: set a proper label for the "Show Applications" dash button
https://bugzilla.gnome.org/show_bug.cgi?id=682366
2012-08-27 10:43:35 +02:00
a1ecf459b3 a11y: exposing the proper button role while using toggle_mode on St.Button
https://bugzilla.gnome.org/show_bug.cgi?id=682366
2012-08-27 10:43:35 +02:00
6ea80eadd6 a11y: set a label_actor for the summary items on the message tray
https://bugzilla.gnome.org/show_bug.cgi?id=677229
2012-08-27 10:43:35 +02:00
9dafaa2c0c ScreenShield: don't bump the lock screen while animating
Bumping overrides any animation, and causes the installed onComplete
not to run, which in turn breaks suspending from the user menu (as
it listens to lock-screen-shown).
Add a state variable (using an enumeration shared with messageTray)
to control the lock screen, and only bump when the lock is still.

https://bugzilla.gnome.org/show_bug.cgi?id=682746
2012-08-26 23:43:14 +02:00
50e5736c03 Updated Greek translation 2012-08-26 22:56:24 +03:00
46fcfb7629 build: Bump version in jhbuildrc
We were still pointing to the 3.4 moduleset, switch that to the 3.6 one.
2012-08-26 19:46:27 +02:00
8a86540090 Revert the other half of "St: don't attempt to give focus to non reactive actors"
This reverts commit 26d3b1929e.

https://bugzilla.gnome.org/show_bug.cgi?id=667439
2012-08-26 11:56:45 -03:00
785ab8192b shell-app: Fix a memory leak in the running state
We need to free two strings that we allocated here.

https://bugzilla.gnome.org/show_bug.cgi?id=682710
2012-08-26 11:56:08 -03:00
3c386e0c50 gdm: reset cancellable if cancelled.
Otherwise the second attempt tot login after pressing "escape" key
on the login "freeze" and raise an exception about IOError operation
cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=681537
2012-08-26 14:35:11 +02:00
bec48492ab ScreenShield: hide Removable devices in the lock screen
Showing the removable devices is potentially a security risk (as
they include network shares). Also, a nautilus launched from there
can't be used, so it's just a way to overload the system.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-26 14:30:45 +02:00
13a10f8afd Updated Hebrew translation. 2012-08-26 10:46:10 +03:00
00fe97a55a Updated Arabic translation 2012-08-26 06:15:54 +02:00
9e665e4903 Updated Russian translation 2012-08-24 10:47:14 +04:00
efc128e681 workspacesView: Refactor thumb zooming out code
https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-08-23 23:36:25 -03:00
6851c5443a workspace: Refactor code a bit
https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-08-23 23:36:25 -03:00
baf08dd688 Updated Polish translation 2012-08-24 04:25:26 +02:00
67115b3e9b extensionDownloader: Fix extension installation
The name of the method is "get_as_bytes"

https://bugzilla.gnome.org/show_bug.cgi?id=682578
2012-08-23 22:57:46 -03:00
4ca2697271 shellDBus: Fix reloadExtension
We need to recreate and reimport the extension here, not just reimport
the same exact code.

https://bugzilla.gnome.org/show_bug.cgi?id=682578
2012-08-23 22:57:46 -03:00
4696bfbb80 extensionSystem: Make unloadExtension take an extension object, not a UUID
For consistency with loadExtension.

https://bugzilla.gnome.org/show_bug.cgi?id=682578
2012-08-23 22:57:45 -03:00
18c62a1987 Make workspace selector more similar to the mockup
This makes the workspace indicator respect the "padding" style attribute.
Also, since we no longer draw the border on top of the thumbnail,
we need to be pixel-precise in allocating the indicator height.

We use this to make the workspace selector more similar to the mockup.

https://bugzilla.gnome.org/show_bug.cgi?id=662087
2012-08-23 21:17:22 +02:00
d60a4e97d6 shell-app: Don't match on comments
Comments are meant to be displayed, not to be searched - we should
rather advertise the use of Keywords, which yields much better results.

https://bugzilla.gnome.org/show_bug.cgi?id=682529
2012-08-23 18:02:56 +02:00
43883a6945 Updated Spanish translation 2012-08-23 17:41:55 +02:00
58ff5c6cc6 a11y: setting label actor for endSessionDialog.ListItem
https://bugzilla.gnome.org/show_bug.cgi?id=677503
2012-08-23 11:14:57 +02:00
3902e8bff0 messageTray: fix dwelling during mouse-down
If the user has the mouse down - for example when they are selecting
text and dragging - then the attempt to get a modal grab will fail.

grabHelper: allow the .grab() function to fail and do nothing in this
modal case if the grab fails.

messageTray: handle grab failure and don't pop up the tray. Change the
logic for tray dwelling so that we only try to pop up the tray once
while the pointer is in the dwell area - this avoids the possiility
that the tray will pop up once the user releases the mouse.

https://bugzilla.gnome.org/show_bug.cgi?id=682385
2012-08-23 01:49:21 -04:00
5d6f37017b Updated Lithuanian translation 2012-08-22 22:29:46 +03:00
ecbf2f1429 messageTray: Handle 'popup-menu' signal on summary items
Now that the message-tray is key navigable, we should enable
triggering the right-click menu by keyboard shortcut as well.

https://bugzilla.gnome.org/show_bug.cgi?id=682486
2012-08-22 21:00:52 +02:00
56dc2eb96e remoteSearch: Don't add providers more than once
Currently we load all search providers from XDG_DATA_DIRS, so if
the same provider is installed several times in different directories,
we happily show duplicate results. To fix, keep track of all remote
providers we add and skip those that already have been loaded from a
different directory.

https://bugzilla.gnome.org/show_bug.cgi?id=682470
2012-08-22 21:00:52 +02:00
2154a22c90 layout: Don't unnecessarily go through Main for a property
We *are* Main.layoutManager, here.

https://bugzilla.gnome.org/show_bug.cgi?id=682429
2012-08-22 15:56:55 -03:00
3fafe0da07 dash: Add tooltip label to show applications icon
Make the tooltip dependent on whether we are currently dragging
on hover or not.

https://bugzilla.gnome.org/show_bug.cgi?id=682445
2012-08-22 15:55:24 -03:00
983535224e dash: Fix some issues with the label API
Be able to call setLabelText more than once.

https://bugzilla.gnome.org/show_bug.cgi?id=682445
2012-08-22 15:55:24 -03:00
88effdd9c3 appMenu: Make show() a no-op in locked state
The app menu is hidden when entering the lock screen, however it
might be shown again while the lock is still in place - we don't
want this ever to be the case, so make show() a no-op while the
screen is locked.

https://bugzilla.gnome.org/show_bug.cgi?id=682475
2012-08-22 20:31:43 +02:00
e9a4843eb0 AutorunManager: Fix fallout from LoginManager rework
AutorunManager relied on AutomountManager to find if the session
was active, and this broke when this stopped exporting a public
method for it. Fix AutorunManager to have its own reference to
the LoginManager.

https://bugzilla.gnome.org/show_bug.cgi?id=682455
2012-08-22 19:16:34 +02:00
c50132b29f theme: improve scrollbars coloring
https://bugzilla.gnome.org/show_bug.cgi?id=682476
2012-08-22 17:27:19 +02:00
e92a6b3c6c workspacesView: Avoid an unnecessary animation
Currently we animate scrolling to the active workspace both when
the number of workspaces changed and after changing the active
workspace. So in case we don't actually change workspace, this
results in an unnecessary animation that may even have unwanted
side effects: when done during the overview transition (e.g. in
the case of opening and activating a window on an empty workspace),
non-active workspaces become visible during the transition.
To fix, don't scroll to the active workspace when the number of
workspaces changes and rely on the 'switch-workspace' signal being
emitted as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=682002
2012-08-22 16:26:59 +02:00
66a36bf591 Updated Norwegian bokmål translation 2012-08-22 12:35:25 +02:00
39559f0a09 [l10n] Update Japanese translation 2012-08-22 19:07:15 +09:00
712623946f network: Fix icon_size parameter
We forgot to update this to NOTIFICATION_ICON_SIZE

https://bugzilla.gnome.org/show_bug.cgi?id=682412
2012-08-22 00:34:12 -03:00
47ce72e011 Fix modal dialog styling for network secret prompts
https://bugzilla.gnome.org/show_bug.cgi?id=682412
2012-08-22 00:34:12 -03:00
7f8c5c4f64 Updated Polish translation 2012-08-22 04:31:52 +02:00
64fdff6ace Updated Polish translation 2012-08-22 04:28:21 +02:00
fa2b413095 Bump version to 3.5.90
Update NEWS
2012-08-22 00:56:38 +02:00
46b7a95ec8 messageTray: Remove the message tray hot corner
Since dwell at the bottom of the screen is now the primary way of
summoning the tray, removing the hot corner to avoid having two
separate things that can be accidentally triggered.

https://bugzilla.gnome.org/show_bug.cgi?id=682310
2012-08-21 18:27:33 -04:00
55922c0568 Updated POTFILES.in 2012-08-21 20:33:28 +02:00
1c927868d8 network: ignore unrecognized/irrelevant devices/connections
Don't log a warning if an unrecognized device type is seen.

Don't show slave connections in the menu. (Eg, don't show the
individual wired connections making up a bond, since they can't be
used individually.)

Make the icon only reflect the status of connections that are visible
in the menu. (ie, don't show the "connecting" icon when an
unrecognized connection type is connecting, and don't show a
"connected" status if the only active connections are of unrecognized
types.)

https://bugzilla.gnome.org/show_bug.cgi?id=682364
2012-08-21 13:37:54 -04:00
0a1f0e58d0 gdm: Add network login hint
Different networks have different user identifers.

This can be confusing to the user, so to make it clearer,
we try to provide a hint.

https://bugzilla.gnome.org/show_bug.cgi?id=681975
2012-08-21 13:15:29 -04:00
9024c5d7ac gdm: generalize fingerprint message into login hint
The fingerprint message is useful for users that click their
names in the user list to let them know if fingerprint login
is available.

This same place on screen (below the login entry) can potentially
be used for other messages as well.

This commit changes the variable and style names surrounding
this feature to be more generic.

A subsequent commit will leverage this functionality to provide
a hint on how to log in to the local enterprise domain controller
(if relevant).

https://bugzilla.gnome.org/show_bug.cgi?id=681975
2012-08-21 13:15:28 -04:00
370de395f7 a11y: name label and main status chooser item don't neeed to be focusable
This also gets the status combobox focusable again.

https://bugzilla.gnome.org/show_bug.cgi?id=667439
2012-08-21 18:18:42 +02:00
8ebd2ff9eb a11y: adding a proper state for menu items with a dot
https://bugzilla.gnome.org/show_bug.cgi?id=682366
2012-08-21 18:17:21 +02:00
83a1c7283d a11y: exposing percentage label on power menu items
https://bugzilla.gnome.org/show_bug.cgi?id=682366
2012-08-21 18:16:51 +02:00
695f84e14f Style the tray so it is less prominent in the overview
This will help to ensure that it doesn't distract from the other
elements in the overview, such as the dash, window thumbnails and
workspace switcher.

https://bugzilla.gnome.org/show_bug.cgi?id=682342
2012-08-21 10:28:06 -04:00
54f3036f86 messageTray: add dwelling at the bottom of the screen to open the tray
If the user leaves the mouse pointer at the bottom of the screen for a second,
open the tray. This simulates the eventual plan of measuring "pressure" by how
far the pointer is moved past the edge of the screen. Measuring pressure will
take X server changes.

https://bugzilla.gnome.org/show_bug.cgi?id=682310
2012-08-21 02:36:56 -04:00
446583400e pointerWatcher: add a class to track the pointer
Add a class to efficiently poll the pointer position, stopping polling
when the user is idle.

https://bugzilla.gnome.org/show_bug.cgi?id=682310
2012-08-21 02:36:56 -04:00
3776c50986 workspace: Position windows only when needed
Right now, when entering the overview, we compute the window slots about
four or five times, from scratch each time. Move to a queued system where
extraneous calls to positionWindows don't matter.

https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-08-20 18:22:49 -04:00
4ff0697ee7 workspace: Reindent
https://bugzilla.gnome.org/show_bug.cgi?id=582650
2012-08-20 18:22:49 -04:00
cd43c4983b userMenu: Make presence chooser insensitive when offline
Setting an IM presence only makes sense when connected to the
network, reflect this by making the presence chooser insensitive
when no network is available.

https://bugzilla.gnome.org/show_bug.cgi?id=677982
2012-08-21 00:10:28 +02:00
0f065ebce6 userMenu: Delay restoring presence until the network comes up
Trying to connect to IM servers while offline is pointless, in
particular now that we added a progress indication which makes
the connection attempt very visible.
To fix, wait for the network to become available until restoring
a previous IM presence.

https://bugzilla.gnome.org/show_bug.cgi?id=677982
2012-08-21 00:10:28 +02:00
a2e0e0ad06 messageTray: Adjust the position of the close button
Make this closer to the mockups.

https://bugzilla.gnome.org/show_bug.cgi?id=682253
2012-08-20 18:06:52 -04:00
d721fc2c17 messageTray: Put the notification widget in the center
Rather than stretching the entire screen length

https://bugzilla.gnome.org/show_bug.cgi?id=682253
2012-08-20 18:06:52 -04:00
becaeafeac messageTray: Port the close buttons over to Clutter properties
Rather than computing everything manually, let Clutter calculate
things for us.

https://bugzilla.gnome.org/show_bug.cgi?id=682253
2012-08-20 18:06:52 -04:00
99c97707ac calendar: Fix showing "Next Week" on Sundays
The original code was assuming that getDay() on a Sunday would
return 7 rather than 0. This broke the "Next Week" logic
in several places.
This commit introduces a dayInWeek variable which takes the following
values on the according days:

weekstart = 1:
Mo: 0
Tu: 1
We: 2
Th: 3
Fr: 4
Sa: 5
Su: 6

weekstart = 0:
Su: 0
Mo: 1
Tu: 2
We: 3
Th: 4
Fr: 5
Sa: 6

Using this we can simplify and fix the conditional that decides
whether to show "This week" or "Next week" which was broken on
Sundays.

This commit also fixes the period that gets shown for "Next week"
on Sundays. Due to the bug it was 13 + 1 - 0 or 13 + 0 - 0 on
Sundays:

weekStart = 1:
saturday: saturday + 13 - day_in_week = saturday + 8 = sunday next week
sunday: sunday + 13 - day_in_week = sunday + 7 = sunday next week

weekStart = 0:
friday: friday + 13 - day_in_week = friday + 8 = saturday next week
saturday: saturday + 13 - day_in_week = friday + 7 = saturday next week

https://bugzilla.gnome.org/show_bug.cgi?id=682198
2012-08-20 22:51:45 +02:00
75ed427e04 theme: Put back the transition from overview to desktop for the message tray
https://bugzilla.gnome.org/show_bug.cgi?id=682271
2012-08-20 16:51:12 -04:00
d1e35d11d0 messageTray: Put the lightbox opacity down
https://bugzilla.gnome.org/show_bug.cgi?id=682271
2012-08-20 16:51:12 -04:00
ee0102e86e viewSelector: Allow to close the application view with escape
With the latest changes to the overview, the application view is now
clearly on a different level compared to the window picker. For that
reason it now makes sense to close it on Escape rather than hiding
the overview directly, as we do for search.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 20:40:01 +02:00
776b71bad5 viewSelector: Allow to start keynav using the down arrow
As the search entry acts like it had keyboard focus, it seems
logical to use the down arrow to move focus to the active page.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 20:40:01 +02:00
37da87d9e1 perf: Update to latest overlay changes
Removing tabs from the overview broke the perf test for the
application view; update test to the new method of bringing
it up.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 20:40:01 +02:00
ea14d74141 viewSelector: Clean up focusTrap in search results
Rather than relying on implementation details of StWidget's keyboard
navigation to "hide" the focusTrap from arrow key navigation, implement
the desired behavior explicitly in a custom widget.

https://bugzilla.gnome.org/show_bug.cgi?id=663901
2012-08-20 20:40:00 +02:00
4b60a8deb8 Updated Spanish translation 2012-08-20 20:04:06 +02:00
7cca0a9cd8 Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-08-20 23:15:37 +08:00
f347aba01b overview: Increase the searchEntry width to 320 pixels
https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:20 +02:00
8c40ded498 viewSelector: Replace tab system with pages
The old tab system is no longer a good fit for the current design, so
replace most of the abstractions with a simpler page system.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:19 +02:00
c267a7a7f9 viewSelector: Merge SearchTab into the ViewSelector
Tabs used to provide an abstraction for a page and the control used to
activate it. As the latter has now been replaced with external controls
handled directly in the viewSelector, the abstraction itself doesn't make
much sense anymore. In preparation of replacing it, move the search
handling provided by the SearchTab directly in the viewSelector.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:19 +02:00
0959adcfe3 overview: Center the dash vertically
https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:19 +02:00
7d12f47bf8 viewSelector: Remove shortcut to switch between tabs
We no longer have tabs, so it no longer makes sense to keep the shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:19 +02:00
dff673533d viewSelector: Remove tab title bar
All the functionality provided by the tab titles has been replaced, so the
title bar can be removed without loss of functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:18 +02:00
816a29d582 viewSelector: Hook up the dash's showApps button
We pass the dash’s showApps button to the viewSelector, and we connect it
to the showing and hiding of the appsView. This is necessary because there
are different mechanisms for switching the views, and it has to stay in
sync with the button’s state.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:18 +02:00
27fbe4cd83 dash: Refactor favRemoveTarget to showAppsIcon
In the new designs, we no longer need favRemoveTarget. As it shares a lot
of its functionality with the new showAppsIcon, we refactor and restyle it
accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:18 +02:00
2ee6f49a93 dash: Make the favRemoveTarget always visible
We’ll be repurposing the favRemoveTarget, which calls for it the be
permanently visibe.  The favRemoveTarget used to be added to the dash when
needed and removed again when it wasn’t. This made that it always appeared
at the bottom of the dash. Now that we always show it, we also need to
explicitly define it to be at the bottom of the dash.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:18 +02:00
0ea2d98768 overview: Move the entry out of the SearchTab into the overview
The entry should be positioned in the center of the overview. This makes
that its position can’t be set in the viewSelector without making things
overly complicated. Therefore we move the entry to the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:17 +02:00
b5dc78a968 viewSelector: Use a fixed set of view tabs
Design calls for views being accessible by other means than the current tab
system, so we have no longer a need for the public viewTab API. Move the
initialization of tabs to the viewSelector and make
viewSelector.addViewTab() private.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 14:23:17 +02:00
ebe7890a49 Updated Spanish translation 2012-08-20 14:17:50 +02:00
ef4231b9c0 search: Junk the OpenSearch system
The original design for the overview had buttons for searching for
Wikipedia and Google, but in practice this is a bad idea. The buttons
are the default activations, meaning that using the overview as a
fluent motion of launching something - "firefxo<Enter>", will launch
Google/Wikipedia.

https://bugzilla.gnome.org/show_bug.cgi?id=670168
2012-08-19 21:19:17 -04:00
7e2bab48c9 messageTray: Force the tray closed when exiting the overview 2012-08-19 21:15:52 -04:00
eebab34b62 grabHelper: Make sure to return not null when the stack contains fake grabs
We did this if there's nothing in the grab stack, but didn't do this
when there's no real grabs in the grab stack.
2012-08-19 21:15:52 -04:00
05d613f3a3 messageTray: Fix going to left-click/right-click on the same summary item
This code was originally here to close the summary box pointer if it was
already open, but it seems that it isn't necessary, and is causing all
sorts of problems.
2012-08-19 21:15:52 -04:00
5c6b1fd0cc messageTray: add close button to notifications
Displaying a close button provides a discoverable way to close notifications.
Clicking the close button on new notifications, dismisses them, but doesn't
remove the notification source from the message tray if it is resident.

Clicking the close button on summary notifications acts the same way as clicking
"Remove" option in the right click menu, which is to remove the notification
stack and its source, even if it is resident or a tray icon.
2012-08-19 21:15:51 -04:00
f8eab659d9 messageTray: hide removed notification without tweening
This reflects more accurately what happens when a notification is removed.

this._pointerInTray value needs to be set to false in this case.
2012-08-19 21:15:51 -04:00
4a214d8238 messageTray: be sure to remove destroyed notifications from the notification stack
This allows us to correctly identify when the notification stack is empty.
2012-08-19 21:15:51 -04:00
44b4741e35 messageTray: Close the current box pointer when clicking on the same item 2012-08-19 21:15:51 -04:00
95b9863a70 messageTray: Close the current box pointer when clicking on the tray 2012-08-19 21:15:50 -04:00
4dfe3d21e1 messageTray: Always close the tray when clicking outside of it
Even when a summary box pointer item is up.
2012-08-19 21:15:50 -04:00
3568e6d42d grabHelper: Only connect to specific signals when actually taking a grab
When we enter the overview, we don't explicitly don't take a grab, so we
shouldn't connect to key-focus-changed and things like that, otherwise
random overview code will drop our grab for us.

This fixes escape in the overview not dropping when a notification is up.
2012-08-19 21:15:50 -04:00
c3ae4542b2 grabHelper: Fix ungrabbing properly
Make sure to account for modalCount properly, rather than just
tracking modalCount for the last actor on the stack. Additionally,
traverse the popped actors in the reverse order so that onUngrabbed
callbacks are called at the proper place in time.
2012-08-19 21:15:50 -04:00
3031036cb0 grabHelper: Make sure to call onUngrabbed for all popped actors 2012-08-19 21:15:50 -04:00
11dc510ae4 grabHelper: Fix some keyboard focus issues with the message tray
This will need to be revisited.
2012-08-19 21:15:49 -04:00
79c25d1dc8 grabHelper: Clean up
Remove a dummy "return;", and remove an unused parameter.
2012-08-19 21:15:49 -04:00
1fd17b5027 messageTray: Be able to "switch" notifications
If you click on a summary item while another is up, we should
swap without an extra click.
2012-08-19 21:15:49 -04:00
7a6b2abfeb theme: Make sure to select the summary source item when showing the box pointer 2012-08-19 21:15:49 -04:00
fe8e62c6a8 messageTray: keep the desktop clone at integral positions tweening it
Drawing the desktop at non-integral positions is slower because it
turns off the obscured-area clipping logic, so avoid that.
2012-08-19 21:15:48 -04:00
e937fd07e5 theme: Add a new style for .summary-source-button:focus
We don't need .summary-source-button:selected because we are moving the
focus to the summary item when it is clicked and therefore it is always
focused.

https://bugzilla.gnome.org/show_bug.cgi?id=681519
2012-08-19 21:15:48 -04:00
c668d16a00 messageTray: Grab the key focus when entering from the keybinding 2012-08-19 21:15:48 -04:00
c33e2d1971 messageTray: Add the summary view to the focus manager
This makes keynav work between summary items
2012-08-19 21:15:48 -04:00
0711a70398 js: Use global.focus_manager, rather than grabbing it ourselves 2012-08-19 21:15:48 -04:00
cb5095370e messageTray: Use a Lightbox to shade the window_group
This is a visual indication of the fact that a grab is in place.

https://bugzilla.gnome.org/show_bug.cgi?id=681392
2012-08-19 21:15:47 -04:00
8f71920622 messageTray: Correct idleness
If the user is already active when the notification pops up, we
won't get an idle watcher because there's no transition from
active to idle or vice versa. Correct this by initializing the
state correctly from XSync.
2012-08-19 21:15:47 -04:00
3da0e9e86a messageTray: Make it keyboard navigable in the overview
https://bugzilla.gnome.org/show_bug.cgi?id=681519
2012-08-19 18:41:52 -04:00
e8c8fecb35 messageTray: Make the hot corner summon the tray 2012-08-19 18:41:52 -04:00
8bb2c425c6 messageTray: Properly track notificationExpanded
This makes a lot more sense.
2012-08-19 18:41:52 -04:00
1f6d807882 messageTray: Make modal 2012-08-19 18:41:52 -04:00
8d1ed9f88a messageTray: Port to GrabHelper
https://bugzilla.gnome.org/show_bug.cgi?id=671001
2012-08-19 18:41:51 -04:00
d766f865f3 Introduce a new GrabHelper
PopupMenu.PopupMenuManager and MessageTray.FocusGrabber had a lot of
code in common. Let's refactor this common code out into a new class,
"GrabHelper". This replaces FocusGrabber completely, and nukes half
of PopupMenuManager.

Based on a patch by Dan Winship <danw@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=643687

https://bugzilla.gnome.org/show_bug.cgi?id=671001
2012-08-19 18:41:51 -04:00
c540cb5e16 st-scroll-bar: use clutter_grab_pointer()
StScrollBar was intercepting motion events by using captured-event on
the stage, which required additional dirty tricks, which required
additional hacks. Simplify it by just using clutter_grab_pointer()
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=671001
2012-08-19 18:41:51 -04:00
b36029f6c4 theme: Update message-tray style in the overview
The currently used style works well in "normal" mode, where the
tray is shown to be located beneath the window layer (pushing the
latter up when revealed). It does not work very well in the overview,
so use the same style as dash and workspace switcher there.
2012-08-19 18:41:50 -04:00
a8e6bfcb3d message-tray: Add :overview pseudo class when in overview
The designers would like the message-tray to use different styles
depending on whether it is shown in the overview or not, so use
an :overview pseudo class as the top bar.
2012-08-19 18:41:50 -04:00
9c7222daea messageTray: don't show the tray after new items are added
Because showing the tray now moves the desktop around, we should no
longer show it when it's not triggered by the user.
2012-08-19 18:41:50 -04:00
ab5c0bcfcf messageTray: don't time out banners when the user is inactive
This will ensure that the user doesn't miss notifications.
2012-08-19 18:41:50 -04:00
1a2dcf213e theme: move the message tray's summary box pointer higher
The SummaryBoxPointer was peeking in the message tray. Now it is
raised 4px higher.
2012-08-19 18:41:49 -04:00
6f8e7f07f3 messageTray: restyle the message tray
The patch implements the new visual style for the message tray,
that is now larger and has textured background. The icons are
also larger.

https://bugzilla.gnome.org/show_bug.cgi?id=677213
2012-08-19 18:41:49 -04:00
0ac4787f1a messageTray: remove the labels of the items in the message tray
According to the new visual style for the message tray we no longer
show the title of the source in the message tray.

https://bugzilla.gnome.org/show_bug.cgi?id=677213
2012-08-19 18:41:49 -04:00
16bbe9782b messageTray: Clone, clip & move the window_group when tray is toggled
1) straddling windows get clipped at the monitor boundary
2) we move the bottom monitor and not the primary because that is
   where the tray is
3) to stop the wallpaper from the bottom monitor leaking into the
   primary, we adjust the clip as the clone animates up/down

https://bugzilla.gnome.org/show_bug.cgi?id=681392
2012-08-19 18:41:48 -04:00
5594c119f5 Add screenShield.js into POTFILES.in
https://bugzilla.gnome.org/show_bug.cgi?id=682189
2012-08-19 20:48:43 +09:00
a909017a2b UnlockDialog: Fix "other user" label
The unlock dialog has a mechanism for manually typing in a username
and password.  This mechanism is mislabeled:

Login as another user

when it should be labeled

Log in as another user

This commit adds the space.

Spotted by Stef Walter <stefw@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=681750
2012-08-18 23:03:29 -04:00
9a7914eee9 Consolidate systemd and consolekit in a common abstract class
Various code around had different paths for ConsoleKit and
logind. Consolidate it by making an abstract class that all
callers can use, which hides the implementation details of the
two daemons.

https://bugzilla.gnome.org/show_bug.cgi?id=682096
2012-08-18 18:09:55 +02:00
98c461dcd8 build: Require clutter-1.0 >= 1.11.11
Usage of ClutterDragAction->drag_area was introduced with
b53d18fe1c
2012-08-18 08:56:38 +02:00
5991c8dca3 messageTray: Hook SourceActor up to source icon changes automatically
Instead of manually tracking source icon changes, or requiring a manual
call to _setSummaryIcon, add a way to emit a signal when we're guaranteed
the icon has been changed, and then the source actor will automatically
update the icon.
_setSummaryIcon is still available for sources such as the notification
daemon, that require special treatment for the summary icon (to be used
with tray icons)

https://bugzilla.gnome.org/show_bug.cgi?id=680426
2012-08-18 00:36:13 +02:00
b9226fbcbd screenShield: Add missing import 2012-08-17 19:31:03 +02:00
b6375d3e40 ScreenShield: listen to login managers to unlock the session
Handle locking and unlocking from outside. This fixes coming
back from fast user switching.

https://bugzilla.gnome.org/show_bug.cgi?id=682096
2012-08-17 19:10:27 +02:00
8dc9ceb2bc ScreenShield: make .lock() and .unlock() idempotent
Those methods can be called multiple times in certain situations,
and will be even more so after hooking them to the system bus.
2012-08-17 19:10:27 +02:00
6cb713b0e3 Consolidate ConsoleKit and Systemd code
In preparation for accessing it in the screenshield, factor out
common code for ConsoleKit and Systemd.
Also, clean up ConsoleKit manager, as the daemon is required in
a non systemd installation. In particular:
- We allow it to be autostarted at session startup (or really,
  we expect it to be already there, started by GDM during session
  opening).
- We no longer silently assume that the session is active if
  it can't start.

https://bugzilla.gnome.org/show_bug.cgi?id=682096
2012-08-17 19:10:27 +02:00
dafa27fccd a11y: can_focus=!reactive as a general rule is not true anymore
In some cases can_focus value is taken directly as
!reactive. But this is not the case anymore, as
we are interested on navigate on non reactive items

https://bugzilla.gnome.org/show_bug.cgi?id=667439
2012-08-17 17:32:52 +02:00
190f2f82ac a11y: allow navigation on non reactive items
At this moment non-reactive items are being used in
several cases as non-sensitive, but they still
require keyboard navigation.

https://bugzilla.gnome.org/show_bug.cgi?id=667439
2012-08-17 17:32:16 +02:00
43767ab2b9 Updated Serbian translation 2012-08-17 12:37:51 +02:00
3042e647ff telepathyClient: Pass a proper launch client to launch empathy-accounts
https://bugzilla.gnome.org/show_bug.cgi?id=682045
2012-08-16 20:10:25 -04:00
a004ad6088 telepathyClient: Pass the right amount of parameters
https://bugzilla.gnome.org/show_bug.cgi?id=682045
2012-08-16 20:10:24 -04:00
addb247c33 telepathyClient: Remove some obsolete wrappers
gjs can handle these cases natively now

https://bugzilla.gnome.org/show_bug.cgi?id=682045
2012-08-16 20:10:24 -04:00
8f129e1c9d messageTray: Defer creation of mainIcon
We need to make sure the Source is fully constructed before creating
mainIcon, as SourceActor will query the count of the source.

This fixes Telepathy Chats.

https://bugzilla.gnome.org/show_bug.cgi?id=682045
2012-08-16 20:10:24 -04:00
341b6a1290 UnlockDialog: go back to the lock screen automatically when idle
Now that GDM no longer emits auth failures after 25 seconds, we
need to handle inactivity ourselves.
This has also the advantage that it tracks real inactivity, rather
than a timeout from a fixed point in time.

https://bugzilla.gnome.org/show_bug.cgi?id=682041
2012-08-17 01:32:02 +02:00
6a9b1996e4 ShellIdleMonitor: turn it into a singleton
It doesn't make sense to have multiple ShellIdleMonitors, since
each has its own GDK filter function, but they all get the same
events. In preparation for having it accessed from other places
than the message tray, make it a singleton.

https://bugzilla.gnome.org/show_bug.cgi?id=682041
2012-08-17 01:32:02 +02:00
a5f2d289bd ScreenShield: reduce curtain sliding time to 0.5 seconds
Current time is too long, 0.5 was proved to be more effective
in user testing.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-17 01:32:02 +02:00
e3a8228065 Updated Galician translations 2012-08-17 00:35:34 +02:00
fd04c59e63 UnlockDialog: add an explicit cancel button
Pressing escape to cancelling the unlock procedure is not discoverable
enough.
At the same time, fix styling to avoid bluish hover effects.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-16 23:18:02 +02:00
f8b1a84b81 ScreenShield: Fix updating visibility of the notification box
If there were no persistent or resident notification sources,
nothing ever would call _updateVisibility, and the box would stay
there empty

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-16 23:18:02 +02:00
b53d18fe1c ScreenShield: constrain vertical movement of the screen lock
Don't allow dragging the screen lock above and below the screen,
as in particular dragging below breaks the illusion of the curtain.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-16 23:18:02 +02:00
d0a94768a6 ScreenShield: bump the lock screen slightly when pressing a key
When pressing a key different from escape (one thus that has no
effect), bump the screen up, to indicate that it eats keyboard
input and it must be lifted up.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-16 23:18:02 +02:00
80fde70995 UnlockDialog: remove hover effect from the avatar widget
It is not clickable, so it should not have any hover.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-16 22:42:41 +02:00
cbb56b6128 Hide user menu and a11y menu in the screen lock
This is a temporary patch. The user menu button needs to move to
the left, and the a11y menu in some cases needs to be hidden outside
of the screen lock too.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-16 22:42:40 +02:00
cbd2188c04 MonitorConstraint: fix clamping monitor index
I will test my patches, I promise.
2012-08-16 22:15:36 +02:00
2b30afa618 ScreenShield: place the lock screen contents only on the primary monitor
Use the new monitor constraint to place the clock and notification
box on the primary monitor only. The background is still extended
to the whole screen.
Get rid of the LockDialogGroup hack, now that ClutterBinLayout
respects fixed position correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=681743
2012-08-16 21:46:04 +02:00
1a65374e21 Port modal dialogs to the new MonitorConstraint
This commit makes ModalDialog use the new MonitorConstraint instead
of custom code to force itself on the right monitor.
At the same it ports wanda, which has something similar to a modal
dialog, but is not using the ModalDialog module.

https://bugzilla.gnome.org/show_bug.cgi?id=681743
2012-08-16 21:45:21 +02:00
3e94f6bc3c LayoutManager: add a ClutterConstraint for tracking monitor sizes
Instead of connecting manually to LayoutManager, or using ShellGenericContainer,
make a ClutterConstraint subclass that can track automatically
a specific monitor index, or the primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=681743
2012-08-16 21:45:21 +02:00
1dbbb4f91c Use GDM instead of libaccountsservice for fast user switching
libaccountsservice uses gdmflexiserver internally, which has been
removed from gdm. Instead, use libgdm directly.

https://bugzilla.gnome.org/show_bug.cgi?id=680231
2012-08-16 20:57:30 +02:00
b3b847fadd ScreenShield: fix regression from 2c627cad
A method was renamed but one call site was forgotten.
2012-08-16 19:35:23 +02:00
ff25a5e251 windowManager: Update animation of attached modals (again)
The fade animation we started using after centering attached
modal dialogs didn't work too well. So after going back to the
scale animation, adjust it to scale from the center rather
than the top, which works quite well.

https://bugzilla.gnome.org/show_bug.cgi?id=681601
2012-08-16 09:52:17 +02:00
aaf61cbbbe Revert "windowManager: Update animation of attached modals"
This reverts commit 6ab25cd791.

https://bugzilla.gnome.org/show_bug.cgi?id=681601
2012-08-16 09:52:17 +02:00
ca7c4edd41 windowManager: Update dim effect
The combination of desaturating and lowering the brightness does
not work too well in all cases, in particular for applications
using the dark theme variant. Dropping the desaturation effect and
making the brightness adjustment more profound gives a better
result.

https://bugzilla.gnome.org/show_bug.cgi?id=681601
2012-08-16 09:52:17 +02:00
028e83181b main: Do not hard-code <super> as overlay-key
Use the new OVERLAY_KEY keybinding action instead of special-casing
the overlay-key to make sure the same key will be used in- and outside
the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=665547
2012-08-16 09:44:22 +02:00
31c3783c7c Updated Marathi Translations 2012-08-16 12:26:19 +05:30
f63371dadb messageTray: Set can_focus to true for SummaryItem
https://bugzilla.gnome.org/show_bug.cgi?id=681519
2012-08-15 03:10:30 +02:00
9f07a3dd4a keyringPrompt: Improve styling here as well
Again, center the "Password" label, and add some spacing between
it and the entry.

https://bugzilla.gnome.org/show_bug.cgi?id=681821
2012-08-14 13:14:08 -03:00
06262a903e UserMenu: don't lock the screen if automatic lock disabled
If automatic lock is disabled in the control center, only lock
when explicitly using the Lock menu item, and not for Suspend or
Switch user/session.

https://bugzilla.gnome.org/show_bug.cgi?id=680231
2012-08-14 02:16:22 +02:00
e01e79d9fb Use symbolic icons for workspace switch OSD
https://bugzilla.gnome.org/show_bug.cgi?id=680738
2012-08-13 13:27:40 -04:00
2c627cad10 ScreenShield: prepare the dialog when the user starts dragging
This way if the user drags long enough it will see the dialog
below the curtain, and it will appear as it was always there.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-13 17:59:19 +02:00
b33e51be45 Update Punjabi Translation 2012-08-13 07:33:13 +05:30
b17f5b678d Updated German translation 2012-08-12 20:00:46 +02:00
c6a6ae594a Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-08-12 23:15:32 +08:00
9f02129af3 Updated Hebrew translation. 2012-08-10 14:44:34 +03:00
6037350380 Updated Spanish translation 2012-08-10 11:15:05 +02:00
5de38cd9f6 Assamese translation updated 2012-08-09 12:59:46 +05:30
7950c4afdd messageTray: Add a toggle-message-tray keybinding to toggle the tray
The default value is <Super>m.

https://bugzilla.gnome.org/show_bug.cgi?id=681392
2012-08-09 01:36:24 +02:00
e304854fa5 Bump version to 3.5.5
Update NEWS
2012-08-07 21:26:18 +02:00
d7f54213f1 ScreenShield: when explicitly locking, tween the shield from the top
The curtain should appear to be an overlay on top of the system,
and since it is lifted by dragging up, it makes sense to slide it
down on lock.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-07 21:26:17 +02:00
12a71be076 Updated Spanish translation 2012-08-07 21:05:25 +02:00
855f0dbcad UnlockDialog: place the prompt above the entry, rather than on the side
As indicated in the mockups

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-07 20:35:54 +02:00
03db0d630e UnlockDialog: Move "Login as another user" at the bottom
The Unlock button is more logically related to the entry than
this link, and having the latter in the middle breaks the workflow.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-07 20:35:29 +02:00
5a35c57866 ModalDialog: make dialogLayout public
ModalDialog subclasses may want to add content outside contentLayout
(in particular, UnlockDialog wants to have it after the buttons)
2012-08-07 20:35:29 +02:00
d11027e8c8 util: Don't pass too many arguments to GLib.spawn_async 2012-08-07 15:09:28 -03:00
aa733b5e53 Only show new notifications in the screen shield
Rework the count system in Source, to distinguish between the
normal notification count and the count of unseen/unacknowledged
notification. (A notification is considered unacknowledged until
shown, as a banner or inside the summary box pointer).
Includes some code cleanups and a test for multiple notifications
in the same source.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-07 18:10:49 +02:00
355ec9ceca UserMenu: fix disconnecting a signal that was never connected
If a disabled account is removed, we receive account-removed without
ever seeing account-enabled, and thus _changingId is undefined.

https://bugzilla.gnome.org/show_bug.cgi?id=681382
2012-08-07 17:44:17 +02:00
aa30c6a323 loginDialog: Remove manual insensitive tracking
StWidget does this for us now
2012-08-07 11:51:12 -03:00
ad5572f275 tests: Remove JHBUILD_TYPELIBDIR
It's unused and crufty, and potentially security leak.
2012-08-07 11:51:12 -03:00
9082b4df48 keyboard: _showLayoutItem is only defined if allowSettings.
Check Main.sessionMode.allowSettings is true before accessing the
actor item of _showLayoutItem.

https://bugzilla.gnome.org/show_bug.cgi?id=681101
2012-08-07 16:50:07 +02:00
c3179583c3 Assamese translation updated 2012-08-07 15:03:43 +05:30
4db87839a6 Updated gujarati file 2012-08-07 15:02:59 +05:30
b018d49dc3 Updated Slovenian translation 2012-08-07 08:44:36 +02:00
83362226cf Updated Serbian translation 2012-08-07 00:24:59 +02:00
1e3796967e NotificationDaemon: don't override the title for app notifications
If a source is associated with an app, ignore the app name provided
by libnotify, as that is often garbage.
This fixes the "XChat-GNOME OSD" problem.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-06 23:07:11 +02:00
8d7fa54af4 ScreenShield: fix spacing of notifications and sources
Reduce padding around persistent sources, and ensure that spacing
around resident notifications is only applied once.
Also, add some padding to the clock.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-06 23:02:34 +02:00
59cd9b4220 ScreenSheild: make notification view scrollable
Place a maximum height on the notification view, and show scrollbars
if the list of persistent sources would overflow.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-06 23:02:34 +02:00
59dfb5866d ScreenShield: update the displayed title when the source changes
Notifications in the lock screen need to watch signals on source
and react accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-06 23:02:31 +02:00
208 changed files with 54174 additions and 46913 deletions

2
.gitignore vendored
View File

@ -16,6 +16,7 @@ config.log
config.status
config
configure
data/50-gnome-shell-*.xml
data/gnome-shell.desktop
data/gnome-shell.desktop.in
data/gnome-shell-extension-prefs.desktop
@ -44,6 +45,7 @@ intltool-merge.in
intltool-update.in
libtool
m4/
man/gnome-shell.1
omf.make
po/*.gmo
po/gnome-shell.pot

331
HACKING Normal file
View File

@ -0,0 +1,331 @@
Coding guide
============
Our goal is to have all JavaScript code in GNOME follow a consistent style. In
a dynamic language like JavaScript, it is essential to be rigorous about style
(and unit tests), or you rapidly end up with a spaghetti-code mess.
A quick note
------------
Life isn't fun if you can't break the rules. If a rule seems unnecessarily
restrictive while you're coding, ignore it, and let the patch reviewer decide
what to do.
Indentation and whitespace
--------------------------
Use four-space indents. Braces are on the same line as their associated
statements. You should only omit braces if *both* sides of the statement are
on one line.
* One space after the `function` keyword. No space between the function name
* in a declaration or a call. One space before the parens in the `if`
* statements, or `while`, or `for` loops.
function foo(a, b) {
let bar;
if (a > b)
bar = do_thing(a);
else
bar = do_thing(b);
if (var == 5) {
for (let i = 0; i < 10; i++) {
print(i);
}
} else {
print(20);
}
}
Semicolons
----------
JavaScript allows omitting semicolons at the end of lines, but don't. Always
end statements with a semicolon.
js2-mode
--------
If using Emacs, do not use js2-mode. It is outdated and hasn't worked for a
while. emacs now has a built-in JavaScript mode, js-mode, based on
espresso-mode. It is the de facto emacs mode for JavaScript.
File naming and creation
------------------------
For JavaScript files, use lowerCamelCase-style names, with a `.js` extension.
We only use C where gjs/gobject-introspection is not available for the task, or
where C would be cleaner. To work around limitations in
gjs/gobject-introspection itself, add a new method in `shell-util.[ch]`.
Like many other GNOME projects, we prefix our C source filenames with the
library name followed by a dash, e.g. `shell-app-system.c`. Create a
`-private.h` header when you want to share code internally in the
library. These headers are not installed, distributed or introspected.
Imports
-------
Use UpperCamelCase when importing modules to distinguish them from ordinary
variables, e.g.
const GLib = imports.gi.GLib;
Imports should be categorized into one of two places. The top-most import block
should contain only "environment imports". These are either modules from
gobject-introspection or modules added by gjs itself.
The second block of imports should contain only "application imports". These
are the JS code that is in the gnome-shell codebase,
e.g. `imports.ui.popupMenu`.
Each import block should be sorted alphabetically. Don't import modules you
don't use.
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const St = imports.gi.St;
const Main = imports.ui.main;
const Params = imports.misc.params;
const Tweener = imports.ui.tweener;
const Util = imports.misc.util;
The alphabetical ordering should be done independently of the location of the
location. Never reference `imports` in actual code.
Constants
---------
We use CONSTANTS_CASE to define constants. All constants should be directly
under the imports:
const MY_DBUS_INTERFACE = 'org.my.Interface';
Variable declaration
--------------------
Always use either `const` or `let` when defining a variable.
// Iterating over an array
for (let i = 0; i < arr.length; ++i) {
let item = arr[i];
}
// Iterating over an object's properties
for (let prop in someobj) {
...
}
If you use "var" then the variable is added to function scope, not block scope.
See [What's new in JavaScript 1.7](https://developer.mozilla.org/en/JavaScript/New_in_JavaScript/1.7#Block_scope_with_let_%28Merge_into_let_Statement%29)
Classes
-------
There are many approaches to classes in JavaScript. We use our own class framework
(sigh), which is built in gjs. The advantage is that it supports inheriting from
GObjects, although this feature isn't used very often in the Shell itself.
const IconLabelMenuItem = new Lang.Class({
Name: 'IconLabelMenuItem',
Extends: PopupMenu.PopupMenuBaseItem,
_init: function(icon, label) {
this.parent({ reactive: false });
this.addActor(icon);
this.addActor(label);
},
open: function() {
log("menu opened!");
}
});
* 'Name' is required. 'Extends' is optional. If you leave it out, you will
automatically inherit from Object.
* Leave a blank line between the "class header" (Name, Extends, and other
things) and the "class body" (methods). Leave a blank line between each
method.
* No space before the colon, one space after.
* No trailing comma after the last item.
* Make sure to use a semicolon after the closing paren to the class. It's
still a giant function call, even though it may resemble a more
conventional syntax.
GObject Introspection
---------------------
GObject Introspection is a powerful feature that allows us to have native
bindings for almost any library built around GObject. If a library requires
you to inherit from a type to use it, you can do so:
const MyClutterActor = new Lang.Class({
Name: 'MyClutterActor',
Extends: Clutter.Actor,
vfunc_get_preferred_width: function(actor, forHeight) {
return [100, 100];
},
vfunc_get_preferred_height: function(actor, forWidth) {
return [100, 100];
},
vfunc_paint: function(actor) {
let alloc = this.get_allocation_box();
Cogl.set_source_color4ub(255, 0, 0, 255);
Cogl.rectangle(alloc.x1, alloc.y1,
alloc.x2, alloc.y2);
}
});
Translatable strings, `environment.js`
--------------------------------------
We use gettext to translate the GNOME Shell into all the languages that GNOME
supports. The `gettext` function is aliased globally as `_`, you do not need to
explicitly import it. This is done through some magic in the
[environment.js](http://git.gnome.org/browse/gnome-shell/tree/js/ui/environment.js)
file. If you can't find a method that's used, it's probably either in gjs itself
or installed on the global object from the Environment.
Use 'single quotes' for programming strings that should not be translated
and "double quotes" for strings that the user may see. This allows us to
quickly find untranslated or mistranslated strings by grepping through the
sources for double quotes without a gettext call around them.
`actor` and `_delegate`
-----------------------
gjs allows us to set so-called "expando properties" on introspected objects,
allowing us to treat them like any other. Because the Shell was built before
you could inherit from GTypes natively in JS, we usually have a wrapper class
that has a property called `actor`. We call this wrapper class the "delegate".
We sometimes use expando properties to set a property called `_delegate` on
the actor itself:
const MyClass = new Lang.Class({
Name: 'MyClass',
_init: function() {
this.actor = new St.Button({ text: "This is a button" });
this.actor._delegate = this;
this.actor.connect('clicked', Lang.bind(this, this._onClicked));
},
_onClicked: function(actor) {
actor.set_label("You clicked the button!");
}
});
The 'delegate' property is important for anything which trying to get the
delegate object from an associated actor. For instance, the drag and drop
system calls the `handleDragOver` function on the delegate of a "drop target"
when the user drags an item over it. If you do not set the `_delegate`
property, your actor will not be able to be dropped onto.
Functional style
----------------
JavaScript Array objects offer a lot of common functional programming
capabilities such as forEach, map, filter and so on. You can use these when
they make sense, but please don't have a spaghetti mess of function programming
messed in a procedural style. Use your best judgment.
Closures
--------
`this` will not be captured in a closure, it is relative to how the closure is
invoked, not to the value of this where the closure is created, because "this"
is a keyword with a value passed in at function invocation time, it is not a
variable that can be captured in closures.
All closures should be wrapped with a Lang.bind.
const Lang = imports.lang;
let closure = Lang.bind(this, function() { this._fnorbate(); });
A more realistic example would be connecting to a signal on a method of a
prototype:
const Lang = imports.lang;
const FnorbLib = imports.fborbLib;
const MyClass = new Lang.Class({
_init: function() {
let fnorb = new FnorbLib.Fnorb();
fnorb.connect('frobate', Lang.bind(this, this._onFnorbFrobate));
},
_onFnorbFrobate: function(fnorb) {
this._updateFnorb();
}
});
Object literal syntax
---------------------
In JavaScript, these are equivalent:
foo = { 'bar': 42 };
foo = { bar: 42 };
and so are these:
var b = foo['bar'];
var b = foo.bar;
If your usage of an object is like an object, then you're defining "member
variables." For member variables, use the no-quotes no-brackets syntax: `{ bar:
42 }` `foo.bar`.
If your usage of an object is like a hash table (and thus conceptually the keys
can have special chars in them), don't use quotes, but use brackets: `{ bar: 42
}`, `foo['bar']`.
Getters, setters, and Tweener
-----------------------------
Getters and setters should be used when you are dealing with an API that is
designed around setting properties, like Tweener. If you want to animate an
arbitrary property, create a getter and setter, and use Tweener to animate the
property.
const ANIMATION_TIME = 2000;
const MyClass = new Lang.Class({
Name: 'MyClass',
_init: function() {
this.actor = new St.BoxLayout();
this._position = 0;
},
get position() {
return this._position;
},
set position(value) {
this._position = value;
this.actor.set_position(value, value);
}
});
let myThing = new MyClass();
Tweener.addTween(myThing,
{ position: 100,
time: ANIMATION_TIME,
transition: 'easeOutQuad' });

View File

@ -1,7 +1,11 @@
# Point to our macro directory and pick up user flags from the environment
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = data js src browser-plugin tests po man docs
SUBDIRS = data js src browser-plugin tests po docs
if ENABLE_MAN
SUBDIRS += man
endif
EXTRA_DIST = \
.project \
@ -13,6 +17,7 @@ EXTRA_DIST = \
DIST_EXCLUDE = \
.gitignore \
gnome-shell.doap \
HACKING \
MAINTAINERS \
tools/build/*
@ -20,4 +25,4 @@ distcheck-hook:
@echo "Checking disted files against files in git"
@$(srcdir)/tools/check-for-missing.py $(srcdir) $(distdir) $(DIST_EXCLUDE)
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man

324
NEWS
View File

@ -1,3 +1,327 @@
3.7.1
=====
* Add shortcut to open application view directly [Jeremy; #685738]
* Expose '<Super>F10' shortcut in System Settings [Florian; #672909]
* Clean up timestamp format in chat notifications [Carlos; #680989]
* loginScreen: Add support for 'disable-restart-buttons' [Florian; #686247]
* Update textures automatically on file changes [Florian; #679268]
* Implement org.gnome.ScreenSaver.GetActiveTime [Giovanni; #686064]
* Add missing translations for GSetting schema [Giovanni; #686413]
* Hide workspace switcher completely when it's not necessary [Seif; #686483]
* Explicitly load gnome-screensaver when not running GDM [Tim; #683060]
* Port to GnomeIdleMonitor [Jasper; #682224]
* Set Empathy as preferred handler when delegating channels [Xavier; #686296]
* Allow testing GDM login dialog from the session [Giovanni; #683725]
* Use all available space for windows in window picker [Jasper, Pierre-Eric;
#582650]
* Use logind for suspend if available [Florian; #686482]
* Misc. fixes and cleanups [Jasper, Florian, Adel, Rui; #677426, #680426,
#686233, #686241, #686318, #686240, #686484, #686002, #684650, #686487]
Contributors:
Jeremy Bicha, Giovanni Campagna, Xavier Claessens, Adel Gadllah, Seif Lotfy,
Tim Lunn, Rui Matos, Florian Müllner, Pierre-Eric Pelloux-Prayer,
Carlos Soriano, Jasper St. Pierre
Translations:
Andika Triwidada [id], Matej Urbančič [sl], Ihar Hrachyshka [be],
Daniel Mustieles [es], Fran Diéguez [gl], Takayuki KUSANO [ja],
Мирослав Николић [sr, sr@latin], Dušan Kazik [sk], Tom Tryfonidis [el]
3.6.1
=====
* dash: Make padding even on the top/bottom of the dash [Jasper; #684619]
* Fix a crash when dragging search results [Jasper; #684888]
* workspaceThumbnail: Fix dragging with static workspaces [Jasper; #684641]
* Really hide 'Show Keyboard Layout' on the lock screen [Matthias]
* Misc. improvements to jhbuild setup [Owen; #685352, #685353, #685354, #685355]
* Show message tray in Ctrl+Alt+Tab outside of the overview [Jasper, Florian;
#684633, #685914]
* Disable hotplug sniffer on remote filesystems [Jasper; #684093]
* userMenu: Remove 'Switch Session' item [Florian; #685062]
* unlockDialog: Make prompt entry insensitive while logging in [Jasper; #685444]
* messageTray: Don't animate desktop clone for failed grabs [Jasper; #685342]
* Fix crash on dragging windows between workspaces [Ryan; #681399]
* userMenu: Ignore 'lock-enabled' setting for user switching [Florian; #685536]
* gdm: Fix key-focus on first user [Adel; #684650]
* Make grid button insensitive when dragging non-favorites [Jasper; #685313]
* Calendar: hide all actions when on the login screen [Matthias; #685142]
* Adapt unlock dialog layout for the login screen [Florian; #685201]
* Make focus-follows-mouse work better with Shell UI [Florian; #678169]
* Improve look of screen shield [Jasper; #685919]
* Fix keynav in the login screen [Florian; #684730]
* dateMenu: Hide "Open Calendar" item if calendar unavailable [Florian; #686050]
* unlockDialog: Reset UI on verification failure [Giovanni; #685441]
* Show unlock dialog on primary monitor when using keynav [Giovanni; #685855]
* Fix height changes of entries when entering text [Florian; #685534]
* Fix show-apps label after successful drags [Florian; #684627]
* Misc. bugfixes and cleanups [Jasper, Olivier, Florian, Owen, Adel, Tanner, Tim, Matthias; #685434, #685511, #685466, #685341, #685156, #681159, #673189, #686016, 684869, #686079, #686063
Contributors:
Jasper St. Pierre
Matthias Clasen
Owen Taylor
Olivier Blin
Florian Müllner
Ryan Lortie
Adel Gadllah
Tanner Doshier
Tim Lunn
Giovanni Campagna
Translations:
Tobias Endrigkeit [de], Rudolfs Mazurs [lv], Ask H. Larsen [da],
Shankar Prasad [kn], Changwoo Ryu [ko], Chris Leonard [en_GB],
Arash Mousavi [fa], Theppitak Karoonboonyanan [th], Seán de Búrca [ga],
Yaron Shahrabani [he], Alexander Shopov [bg], Žygimantas Beručka [lt],
Milo Casagrande [it], Kjartan Maraas [nb], Kris Thomsen [da],
Aurimas Černius [lt], Yuri Myasoedov [ru], Мирослав Николић [sr],
Marek Černocký [cs], Gabor Kelemen [hu], Ihar Hrachyshka [be],
Chao-Hsiung Liao [zh_HK, zh_TW], Eleanor Chen [zh_CN],
Carles Ferrando [ca@valencia], Vicent Cubells [ca], Daniel Korostil [uk],
Alexandre Franke [fr], Piotr Drąg [pl]
3.6.0
=====
* keyboard: Make input source items accessible [Florian; #684462]
* Don't show network dialogs in the lock screen [Giovanni; #684384]
* popupMenu: Fix initial visibility of settings items [Florian; #684473]
* userMenu: Close menu immediately on user/session switch [Florian; #684459]
* Fix alignment of search section headers in RTL locales [Florian; #684379]
* screenShield: Fix unlock animation [Florian; #684591]
* Don't open the tray from a dwell while in a modal grab [Jasper; #684458]
* userMenu: Fix texture updates on icon changes [Florian; #679268]
* Fix a11y support in the login screen [Florian, Ray; #684727, #684728, #684748]
* Make On-Screen-Keyboard usable with new message tray [Giovanni, Florian;
#683546]
* Fix initial visibility of input volume in lock-screen [Florian; #684611]
Contributors:
Giovanni Campagna, Florian Müllner, Jasper St. Pierre, Ray Strode
Translations:
Matej Urbančič [sl], Dr.T.Vasudevan [ta], Piotr Drąg [pl], A S Alam [pa],
Alexander Shopov [bg], Nilamdyuti Goswami [as], Chandan Kumar [hi],
Khaled Hosny [ar], Ibrahim Saed [ar], Sandeep Sheshrao Shedmake [mr],
Tom Tryfonidis [el], Theppitak Karoonboonyanan [th], Alexandre Franke [fr],
Fran Diéguez [gl], Gabor Kelemen [hu], Ani Peter [ml], Daniel Mustieles [es],
Мирослав Николић [sr, sr@latin], Duarte Loreto [pt], ManojKumar Giri [or],
Ihar Hrachyshka [be], Aurimas Černius [lt], Djavan Fagundes [pt_BR],
Changwoo Ryu [ko], Bruce Cowan [en_GB], Kris Thomsen [da], Gil Forcada [ca],
Yaron Shahrabani [he], Milo Casagrande [it], Ville-Pekka Vainio [fi],
YunQiang Su [zh_CN], Carles Ferrando [ca@valencia], Mario Blättermann [de],
Rajesh Ranjan [hi], Yuri Myasoedov [ru], Rūdolfs Mazurs [lv],
Jiro Matsuzawa [ja], Mattias Põldaru [et], Timur Zhamakeev [ky],
Petr Kovar [cs], Chao-Hsiung Liao [zh_HK,zh_TW], Andika Triwidada [id]
3.5.92
======
* Login/UnlockDialog: Don't reset immediately if auth fails [Giovanni; #682544]
* Allow changing session mode at runtime [Jasper, Giovanni; #683156]
* Add zoom out animation on login [Jasper; #683170]
* Bluetooth: don't restrict the length of non numeric PINs [Giovanni; #683356]
* Force chat notification to stay open when focusing entry [Debarshi; #682236]
* Make sure the screen is fully locked before suspending [Giovanni; #683448]
* st-texture-cache: Fix a case of distorted textures [Florian; #683483]
* popupSubMenu: Fix padding for non-scrolled submenus [Florian; #683009]
* popupMenu: Fix width changes on submenu open/close [Florian; #683485]
* boxpointer: Avoid malformed boxpointer arrow [Debarshi; #680077]
* Change stage background color to grey [Adel; #683514]
* messageTray: Update style of summary counters [Debarshi; #682891]
* Don't fail if a legacy tray icon has no WM_CLASS [Giovanni; #683724]
* PolkitAgent: Fix a crash if there is no avatar [Giovanni; #683707]
* Hide the a11y menu in the lock screen, but show it in the login screen
[Giovanni; #682542]
* Fix show-apps button dropping off the dash [Florian; #683340]
* Fix committing strings to shell entries from input method [Florian; #658325]
* Make IBus display strings consistent with control-center [Rui; #683124]
* Fix missing short codes for some input sources [Rui; #683613]
* Remove support for long-press from entry context menus [Jasper; #683509]
* screenShield: Add box-shadow to the shield [Florian]
* Don't show a right-click menu for the hotplug source [Jasper; #683438]
* Fix extension styling [Giovanni; #682128]
* Fix on-screen keyboard not working with system-modal dialogs
[Giovanni; #664309]
* Fix insensitive styling for popup menu items [Giovanni; #683988]
* Disable the message tray dwell when the user is interacting [Owen; #683811]
* Animate going from the unlock dialog to the lock screen [Giovanni; #681143]
* Autostart fprintd when necessary [Ray; #683131]
* UnlockDialog: Allow typing before the first PAM question [Giovanni; #681576]
* Make Return key dismiss screenshield [Ray; #683889]
* Fix keyboard navigation in the message tray [Florian; #682243]
* Remove the places & devices search provider [Giovanni; #683506]
* Enable hot corner while the message tray is up [Florian; #682255]
* Port screen recorder to new GStreamer vp8enc API [Adel; #684206]
* Fix fish flickering [Giovanni; #684154]
* Fix extension ordering with !important [Jasper; #684163]
* Allow the shell to run without the screenshield [Giovanni; #683060]
* Add menu items for IBus Anthy's InputMode, TypingMode [Rui; #682314]
* Improve transition to the login dialog [Jasper; #682428]
* Keep unlock dialog around until shield animation ends [Florian; #684342]
* Expose shell keybindings in System Settings [Florian; #671010]
* Misc. bugfixes and cleanups [Debarshi, Florian, Giovanni, Jasper, Rico, Rui;
#672790, #677434, #683305, #683357, #683369, #683377, #683378, #683400,
#683449, #683472, #683482, #683487, #683488, #683526, #683529, #683546,
#683583, #683628, #683705, #683982, #683989, #684035, #684036, #684040,
#684162, #684214, #684343]
Contributors:
Giovanni Campagna, Adel Gadllah, Rui Matos, Florian Müllner, Debarshi Ray,
Jasper St. Pierre, Ray Strode, Owen Taylor, Rico Tzschichholz
Translations:
Gabor Kelemen [hu], Piotr Drąg [pl], Khaled Hosny [ar],
Мирослав Николић [sr, sr@latin], Chao-Hsiung Liao [zh_HK, zh_TW],
Bruce Cowan [en_GB], Dirgita [id], Tom Tryfonidis [el], Timo Jyrinki [fi],
Adorilson Bezerra [pt_BR], Arash Mousavi [fa], Matej Urbančič [sl],
Christian Kirbach [de], Yaron Shahrabani [he], Ihar Hrachyshka [be],
Changwoo Ryu [ko], Duarte Loreto [pt], Theppitak Karoonboonyanan [th],
Nilamdyuti Goswami [as], Sandeep Sheshrao Shedmake [mr],
Alexandre Franke [fr], Ivaylo Valkov [bg], tuhaihe [zh_CN],
Yuri Myasoedov [ru], Aurimas Černius [lt], Andika Triwidada [id],
Rajesh Ranjan [hi], Sweta Kothari [gu], Daniel Mustieles [es],
Fran Diéguez [gl], Praveen Illa [te]
3.5.91
======
* Improve modal dialog styling of network secret prompts [Jasper; #682412]
* Fix visibility of non-active workspaces during overview transition
[Florian; #682002]
* Improve scrollbar theming [Cosimo; #682476]
* Make sure the app menu remains hidden in locked state [Florian; #682475]
* Add tooltip to show-applications icon [Jasper; #682445]
* Do not add duplicate remote search providers [Florian; #682470]
* Handle 'popup-menu' signal on summary items [Florian; #682486]
* Fix dwelling during mouse-down [Owen; #682385]
* Set label actor for endSessionDialog.ListItem [Alejandro; #677503]
* Don't match on comments when searching applications [Florian; #682529]
* Make workspace selector more similar to the mockup [Stefano; #662087]
* Fix extension installation and reloading [Jasper; #682578]
* Hide removable devices in the lock screen [Giovanni; #681143]
* Reset cancellable after hitting Escape on login screen [Alban; #681537]
* Fix suspend from the user menu [Giovanni; #682746]
* Set label actor for summary items in message tray [Alejandro; #677229]
* Set label for the "Show applications" dash button [Alejandro; #682366]
* Load extensions as late as possible [Jasper; #682822]
* Improve mount operation dialogs [Jon; #682645]
* Remove "Connect to ..." item from places search [Florian; #682817]
* Don't auto-expand notifications with actions [Giovanni; #682738]
* Add a new lock screen menu to combine volume network and power
[Giovanni; #682540]
* Add support for pre-edit to StIMText [Daiki; #664041]
* Remove StIconType [Jasper, Florian, Rui, Giovanni, Debarshi; #682540]
* Use monitor geometry for dwelling [Florian; #683044]
* Add support for surrounding-text to StIMText [Daiki; #683015]
* Improve the placement and style of the "No results" text [Jasper; #683135]
* Remove broken network device activation policy [Giovanni; #683136]
* Hide power status icon when no battery is present [Tim; #683080]
* Ensure summary items are square and have spacing [Debarshi; #682248]
* Fix close buttons overlapping screen edge [Debarshi; #682343]
* Escape the tray when a legacy icon is clicked [Giovanni; #682244]
* Update arrow in the screen shield to match latest mockups [Giovanni; #682285]
* Allow lifting the screen shield with the mouse wheel [Giovanni; #683164]
* Make sure to show the app menu after unlocking the screen [Jasper; #683154]
* Misc bug fixes and cleanups [Debarshi, Florian, Giovanni, Jasper, Rui;
#582650, #667439, #682238, #682268, #682429, #682455, #682544, #682546,
#682683, #682710, #682998, #683073, #683137, #683156]
Contributors:
Alban Browaeys, Giovanni Campagna, Cosimo Cecchi, Stefano Facchini,
Adel Gadllah, Tim Lunn, Rui Matos, William Jon McCann, Florian Müllner,
Alejandro Piñeiro, Debarshi Ray, Jasper St. Pierre, Owen Taylor, Daiki Ueno
Translations:
Piotr Drąg [pl], Takayuki KUSANO [ja], Kjartan Maraas [nb],
Aurimas Černius [lt], Daniel Mustieles [es], Yuri Myasoedov [ru],
Khaled Hosny [ar], Yaron Shahrabani [he], Tom Tryfonidis [el],
Nilamdyuti Goswami [as], Fran Diéguez [gl], Nguyễn Thái Ngọc Duy [vi],
A S Alam [pa], Dr.T.Vasudevan [ta], Luca Ferretti [it]
3.5.90
======
* Use symbolic icons for workspace switch OSD [Jon; #680738]
* Lock screen improvements:
- Hide user menu and a11y menu in the screen lock [Giovanni; #681143]
- Bump the lock screen slightly when pressing a key [Giovanni; #681143]
- Constrain vertical movement of the screen shield [Giovanni; #681143]
- Return to lock screen on idle [Giovanni; #682041]
- Unlock screen automatically after fast-user switching [Giovanni; #682096]
- Fix "other user" label [Ray; #681750]
* Constrain content of system modals to primary monitor [#681743]
* Respect automatic lock setting on suspend/user-switch [Giovanni; #680231]
* Improve styling of keyring prompt [Jasper; #681821]
* Do not hard-code <super> as overlay-key [Florian; #665547]
* Update style of attached modal dialogs [Florian; #681601]
* a11y: allow navigation on non reactive items [Alejandro; #667439, #667439]
* Implement mode-less overview design [Joost, Florian; #682109]
* Implement message-tray redesign:
- Restyle the message tray [Ana, Allan, Florian; #677213, #682342]
- Move the desktop upwards when showing the tray [Debarshi; #681392]
- Add a close button to notifications [Ana, Jasper; #682253]
- Add a keybinding to toggle the tray [Debarshi; #681392]
- Make the tray keyboard navigable [Debarshi; #681519]
- Add dwelling at the bottom of the screen to open the tray [Owen; #682310]
- Don't time out banners when the user is inactive [Marina, Jasper]
- Misc fixes and cleanups [Jasper, Marina]
* Fix showing "Next Week" on Sundays [Sebastian; #682198]
* Delay restoring IM presence until the network comes up [Florian; #677982]
* Display enterprise login hint [Ray; #681975]
* Ignore unrecognized/irrelevant network devices/connections [Dan; #682364]
* Misc bug fixes and cleanups: [Dan, Florian, Jasper, Jiro, Piotr, Rico;
#643687, #682045, #682189]
Contributors:
Giovanni Campagna, Allan Day, Piotr Drąg, William Jon McCann,
Sebastian Keller, Jiro Matsuzawa, Florian Müllner, Alejandro Piñeiro,
Debarshi Ray, Ana Risteska, Jasper St. Pierre, Ray Strode, Owen Taylor,
Rico Tzschichholz, Joost Verdoorn, Dan Winship, Marina Zhurakhinskaya
Translations:
Nilamdyuti Goswami [as], Daniel Mustieles [es], Yaron Shahrabani [he],
Chao-Hsiung Liao [zh_HK, zh_TW], Tobias Endrigkeit [de], A S Alam [pa],
Sandeep Sheshrao Shedmake [mr], Fran Diéguez [gl],
Мирослав Николић [sr, sr@latin]
3.5.5
=====
* Update style to match mockups [Allan]
- improve calendar layout and legibility
- update notifications and menus
- use a common style for entries
- update scrollbars to match GTK+
- improve clock/unlock button in lock screen
- update polkit dialogs [Jasper]
* Fix login dialog growing when selecting different users [Florian; #675076]
* Implement screen lock in the shell [Giovanni]
- restructure login code to be shared with session unlock [#619955]
- add initial screen shield / unlock dialog implementation [#619955]
- implement (optional) notification list on lock shield [#619955]
- update login dialog style to match lock screen [#619955]
- filter notifications to only show new ones on the screen lock [#681143]
- make notifications scrollable if necessary [#681143]
- use correct application names in notifications [#681143]
- allow to return to the shield by pressing Escape [#681143]
* Minor login dialog improvements [Florian]
- update style to match the overall visuals [#660913]
- indicate whether users are logged in [#658185]
* Add support for background-repeat CSS property [Jasper; #680801]
* Add :active pseudo class on scroll handles [Florian]
* Remove markup from translated strings [Matthias; #681270]
* Misc bug fixes and cleanups: [Alban, Florian, Giovanni, Jasper, Jeremy,
Matthias, Piotr; #677893, #679944, #680064, #680170, #680216, #680426,
#681101, #681382]
Contributors:
Jeremy Bicha, Alban Browaeys, Giovanni Campagna, Matthias Clasen, Allan Day,
Piotr Drąg , Florian Müllner, Jasper St. Pierre
Translations:
Matej Urbančič [sl], Tom Tryfonidis [el], Yaron Shahrabani [he],
Kjartan Maraas [nb], Baurzhan Muftakhidinov [kk], Praveen Illa [te],
Khaled Hosny [ar], Daniel Mustieles [es], Gabor Kelemen [hu],
Fran Diéguez [gl], Sweta Kothari [gu], Aleksej Kabanov [ru],
Nilamdyuti Goswami [as], Arash Mousavi [fa], Мирослав Николић [sr, sr@latin]
3.5.4
=====
* Fix wrong result handling of remote calls [Florian; #678852]

View File

@ -153,8 +153,6 @@ NP_Initialize(NPNetscapeFuncs *pfuncs, NPPluginFuncs *plugin)
/* global initialization routine, called once when plugin
is loaded */
g_type_init ();
g_debug ("plugin loaded");
memcpy (&funcs, pfuncs, sizeof (funcs));

View File

@ -1,5 +1,5 @@
AC_PREREQ(2.63)
AC_INIT([gnome-shell],[3.5.4],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
AC_INIT([gnome-shell],[3.7.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/shell-global.c])
@ -36,6 +36,8 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
PKG_PROG_PKG_CONFIG([0.22])
AC_PATH_PROG([XSLTPROC], [xsltproc])
GLIB_GSETTINGS
# Get a value to substitute into gnome-shell.in
@ -52,7 +54,7 @@ AC_MSG_CHECKING([for GStreamer (needed for recording functionality)])
if $PKG_CONFIG --exists gstreamer-1.0 '>=' $GSTREAMER_MIN_VERSION ; then
AC_MSG_RESULT(yes)
build_recorder=true
recorder_modules="gstreamer-1.0 gstreamer-base-1.0 x11"
recorder_modules="gstreamer-1.0 gstreamer-base-1.0 x11 gtk+-3.0"
PKG_CHECK_MODULES(TEST_SHELL_RECORDER, $recorder_modules clutter-1.0 xfixes gl)
else
AC_MSG_RESULT(no)
@ -60,12 +62,12 @@ fi
AM_CONDITIONAL(BUILD_RECORDER, $build_recorder)
CLUTTER_MIN_VERSION=1.9.16
CLUTTER_MIN_VERSION=1.11.11
GOBJECT_INTROSPECTION_MIN_VERSION=0.10.1
GJS_MIN_VERSION=1.33.2
MUTTER_MIN_VERSION=3.5.4
MUTTER_MIN_VERSION=3.7.1
GTK_MIN_VERSION=3.3.9
GIO_MIN_VERSION=2.31.6
GIO_MIN_VERSION=2.35.0
LIBECAL_MIN_VERSION=3.5.3
LIBEDATASERVER_MIN_VERSION=3.5.3
LIBEDATASERVERUI_MIN_VERSION=3.5.3
@ -74,7 +76,7 @@ TELEPATHY_LOGGER_MIN_VERSION=0.2.4
POLKIT_MIN_VERSION=0.100
STARTUP_NOTIFICATION_MIN_VERSION=0.11
GCR_MIN_VERSION=3.3.90
GNOME_DESKTOP_REQUIRED_VERSION=3.5.1
GNOME_DESKTOP_REQUIRED_VERSION=3.7.1
GNOME_MENUS_REQUIRED_VERSION=3.5.3
# Collect more than 20 libraries for a prize!
@ -97,8 +99,7 @@ PKG_CHECK_MODULES(GNOME_SHELL, gio-unix-2.0 >= $GIO_MIN_VERSION
telepathy-logger-0.2 >= $TELEPATHY_LOGGER_MIN_VERSION
polkit-agent-1 >= $POLKIT_MIN_VERSION xfixes
libnm-glib libnm-util gnome-keyring-1
gcr-3 >= $GCR_MIN_VERSION
gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION)
gcr-3 >= $GCR_MIN_VERSION)
PKG_CHECK_MODULES(SHELL_PERF_HELPER, gtk+-3.0 gio-2.0)
@ -106,6 +107,9 @@ PKG_CHECK_MODULES(SHELL_HOTPLUG_SNIFFER, gio-2.0 gdk-pixbuf-2.0)
PKG_CHECK_MODULES(BROWSER_PLUGIN, gio-2.0 >= $GIO_MIN_VERSION json-glib-1.0 >= 0.13.2)
GNOME_KEYBINDINGS_KEYSDIR=`$PKG_CONFIG --variable keysdir gnome-keybindings`
AC_SUBST([GNOME_KEYBINDINGS_KEYSDIR])
GOBJECT_INTROSPECTION_CHECK([$GOBJECT_INTROSPECTION_MIN_VERSION])
saved_CFLAGS=$CFLAGS
@ -117,7 +121,7 @@ CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
PKG_CHECK_MODULES(GNOME_SHELL_JS, gio-2.0 gjs-internals-1.0 >= $GJS_MIN_VERSION)
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.2 x11)
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.8 x11)
PKG_CHECK_MODULES(TRAY, gtk+-3.0)
PKG_CHECK_MODULES(GVC, libpulse libpulse-mainloop-glib gobject-2.0)
PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.5.4)
@ -136,7 +140,7 @@ PKG_CHECK_EXISTS([gnome-bluetooth-1.0 >= 3.1.0],
AC_SUBST([HAVE_BLUETOOTH],[0])
AC_MSG_RESULT([no])])
PKG_CHECK_MODULES(CALENDAR_SERVER, libecal-1.2 >= $LIBECAL_MIN_VERSION libedataserver-1.2 >= $LIBEDATASERVER_MIN_VERSION libedataserverui-3.0 >= $LIBEDATASERVERUI_MIN_VERSION gio-2.0)
PKG_CHECK_MODULES(CALENDAR_SERVER, libecal-1.2 >= $LIBECAL_MIN_VERSION libedataserver-1.2 >= $LIBEDATASERVER_MIN_VERSION gio-2.0)
AC_SUBST(CALENDAR_SERVER_CFLAGS)
AC_SUBST(CALENDAR_SERVER_LIBS)
@ -205,6 +209,18 @@ AC_SUBST(TYPELIBDIR)
GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
AC_ARG_ENABLE(man,
[AS_HELP_STRING([--enable-man],
[generate man pages [default=yes]])],,
enable_man=yes)
if test "$enable_man" != no; then
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
AC_MSG_ERROR([xsltproc is required for --enable-man])
fi
fi
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
# Stay command-line compatible with the gnome-common configure option. Here
# minimum/yes/maximum are the same, however.
AC_ARG_ENABLE(compile_warnings,

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries schema="org.gnome.shell.keybindings"
group="system"
_name="Screenshots"
wm_name="GNOME Shell"
package="gnome-shell">
<KeyListEntry name="toggle-recording"
_description="Record a screencast"/>
</KeyListEntries>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries schema="org.gnome.shell.keybindings"
group="system"
_name="System"
wm_name="GNOME Shell"
package="gnome-shell">
<KeyListEntry name="toggle-message-tray"
_description="Show the message tray"/>
<KeyListEntry name="focus-active-notification"
_description="Focus the active notification"/>
<KeyListEntry name="toggle-application-view"
_description="Show all applications"/>
<KeyListEntry name="open-application-menu"
_description="Open the application menu"/>
</KeyListEntries>

View File

@ -10,11 +10,6 @@ desktop_DATA = gnome-shell.desktop gnome-shell-extension-prefs.desktop
@INTLTOOL_DESKTOP_RULE@
searchprovidersdir = $(pkgdatadir)/open-search-providers
dist_searchproviders_DATA = \
open-search-providers/google.xml \
open-search-providers/wikipedia.xml
introspectiondir = $(datadir)/dbus-1/interfaces
introspection_DATA = org.gnome.ShellSearchProvider.xml
@ -36,6 +31,7 @@ dist_theme_DATA = \
theme/filter-selected-rtl.svg \
theme/gnome-shell.css \
theme/logged-in-indicator.svg \
theme/message-tray-background.png \
theme/noise-texture.png \
theme/panel-button-border.svg \
theme/panel-button-highlight-narrow.svg \
@ -43,12 +39,20 @@ dist_theme_DATA = \
theme/process-working.svg \
theme/running-indicator.svg \
theme/source-button-border.svg \
theme/summary-counter.svg \
theme/toggle-off-us.svg \
theme/toggle-off-intl.svg \
theme/toggle-on-us.svg \
theme/toggle-on-intl.svg \
theme/ws-switch-arrow-up.svg \
theme/ws-switch-arrow-down.svg
theme/ws-switch-arrow-up.png \
theme/ws-switch-arrow-down.png
keysdir = @GNOME_KEYBINDINGS_KEYSDIR@
keys_in_files = \
50-gnome-shell-screenshot.xml.in \
50-gnome-shell-system.xml.in \
$(NULL)
keys_DATA = $(keys_in_files:.xml.in=.xml)
gsettings_SCHEMAS = org.gnome.shell.gschema.xml
@ -76,12 +80,14 @@ EXTRA_DIST = \
$(introspection_DATA) \
$(menu_DATA) \
$(convert_DATA) \
$(keys_in_files) \
org.gnome.shell.gschema.xml.in.in
CLEANFILES = \
gnome-shell.desktop.in \
gnome-shell-extension-prefs.in \
$(desktop_DATA) \
$(keys_DATA) \
$(gsettings_SCHEMAS) \
gschemas.compiled \
org.gnome.shell.gschema.valid \

View File

@ -1,7 +0,0 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Google</ShortName>
<Description>Google Search</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image>
<Url type="text/html" method="GET" template="http://www.google.com/search?q={searchTerms}"/>
</OpenSearchDescription>

View File

@ -1,44 +0,0 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Wikipedia</ShortName>
<Description>Wikipedia, the free encyclopedia</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAEAgQAhIOEAMjHyABIR0gA6ejpAGlqaQCpqKkAKCgoAPz9%2FAAZGBkAmJiYANjZ2ABXWFcAent6ALm6uQA8OjwAiIiIiIiIiIiIiI4oiL6IiIiIgzuIV4iIiIhndo53KIiIiB%2FWvXoYiIiIfEZfWBSIiIEGi%2FfoqoiIgzuL84i9iIjpGIoMiEHoiMkos3FojmiLlUipYliEWIF%2BiDe0GoRa7D6GPbjcu1yIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</Image>
<Url type="text/html" method="GET" template="http://{language}.wikipedia.org/wiki/Special:Search?search={searchTerms}"/>
<!-- The criterion for being below is being listed with more than 100,000
articles on http://meta.wikimedia.org/wiki/List_of_Wikipedias -->
<Language>ar</Language>
<Language>bg</Language>
<Language>ca</Language>
<Language>cs</Language>
<Language>da</Language>
<Language>de</Language>
<Language>en</Language>
<Language>eo</Language>
<Language>es</Language>
<Language>fa</Language>
<Language>fi</Language>
<Language>fr</Language>
<Language>he</Language>
<Language>hu</Language>
<Language>id</Language>
<Language>it</Language>
<Language>ja</Language>
<Language>ko</Language>
<Language>lt</Language>
<Language>nl</Language>
<Language>no</Language>
<Language>pl</Language>
<Language>pt</Language>
<Language>ro</Language>
<Language>ru</Language>
<Language>sk</Language>
<Language>sl</Language>
<Language>sr</Language>
<Language>sv</Language>
<Language>tr</Language>
<Language>uk</Language>
<Language>vi</Language>
<Language>vo</Language>
<Language>war</Language>
<Language>zh</Language>
</OpenSearchDescription>

View File

@ -108,7 +108,7 @@
</doc:summary>
</doc:doc>
</arg>
<arg type="a{sv}" direction="out">
<arg type="aa{sv}" direction="out">
<doc:doc>
<doc:summary>
<doc:para>

View File

@ -39,10 +39,6 @@
will be displayed in the favorites area.
</_description>
</key>
<key name="disabled-open-search-providers" type="as">
<default>[]</default>
<_summary>disabled OpenSearch providers</_summary>
</key>
<key name="command-history" type="as">
<default>[]</default>
<_summary>History for command (Alt-F2) dialog</_summary>
@ -61,6 +57,14 @@ value here is from the TpConnectionPresenceType enumeration.</_summary>
<_summary>Internally used to store the last session presence status for the user. The
value here is from the GsmPresenceStatus enumeration.</_summary>
</key>
<key name="always-show-log-out" type="b">
<default>false</default>
<_summary>Always show the 'Log out' menuitem in the user menu.</_summary>
<_description>
This key overrides the automatic hiding of the 'Log out'
menuitem in single-user, single-session situations.
</_description>
</key>
<child name="calendar" schema="org.gnome.shell.calendar"/>
<child name="recorder" schema="org.gnome.shell.recorder"/>
<child name="keybindings" schema="org.gnome.shell.keybindings"/>
@ -87,6 +91,28 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
Keybinding to open the application menu.
</_description>
</key>
<key name="toggle-application-view" type="as">
<default>["&lt;Super&gt;a"]</default>
<_summary>Keybinding to open the "Show Applications" view</_summary>
<_description>
Keybinding to open the "Show Applications" view of the Activities
Overview.
</_description>
</key>
<key name="toggle-message-tray" type="as">
<default>["&lt;Super&gt;m"]</default>
<_summary>Keybinding to toggle the visibility of the message tray</_summary>
<_description>
Keybinding to toggle the visibility of the message tray.
</_description>
</key>
<key name="focus-active-notification" type="as">
<default>["&lt;Super&gt;n"]</default>
<_summary>Keybinding to focus the active notification</_summary>
<_description>
Keybinding to focus the active notification.
</_description>
</key>
<key name="toggle-recording" type="as">
<default><![CDATA[['<Control><Shift><Alt>r']]]></default>
<_summary>Keybinding to toggle the screen recorder</_summary>
@ -129,7 +155,7 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
take care of its own output - this might be used to send the output
to an icecast server via shout2send or similar. When unset or set
to an empty value, the default pipeline will be used. This is currently
'vp8enc quality=8 speed=6 threads=%T ! queue ! webmmux'
'vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! webmmux'
and records to WEBM using the VP8 codec. %T is used as a placeholder
for a guess at the optimal thread count on the system.
</_description>
@ -145,44 +171,53 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
</key>
</schema>
<schema id="org.gnome.shell.overrides" path="/org/gnome/shell/overrides/">
<schema id="org.gnome.shell.overrides" path="/org/gnome/shell/overrides/"
gettext-domain="@GETTEXT_PACKAGE@">
<key name="attach-modal-dialogs" type="b">
<default>true</default>
<summary>Attach modal dialog to the parent window</summary>
<description>
<_summary>Attach modal dialog to the parent window</_summary>
<_description>
This key overrides the key in org.gnome.mutter when running
GNOME Shell.
</description>
</_description>
</key>
<key name="button-layout" type="s">
<default>":close"</default>
<summary>Arrangement of buttons on the titlebar</summary>
<description>
<_summary>Arrangement of buttons on the titlebar</_summary>
<_description>
This key overrides the key in org.gnome.desktop.wm.preferences when
running GNOME Shell.
</description>
</_description>
</key>
<key name="edge-tiling" type="b">
<default>true</default>
<summary>Enable edge tiling when dropping windows on screen edges</summary>
<description>
<_summary>Enable edge tiling when dropping windows on screen edges</_summary>
<_description>
This key overrides the key in org.gnome.mutter when running GNOME Shell.
</description>
</_description>
</key>
<key name="dynamic-workspaces" type="b">
<default>true</default>
<summary>Workspaces are managed dynamically</summary>
<description>
<_summary>Workspaces are managed dynamically</_summary>
<_description>
This key overrides the key in org.gnome.mutter when running GNOME Shell.
</description>
</_description>
</key>
<key name="workspaces-only-on-primary" type="b">
<default>true</default>
<summary>Workspaces only on primary monitor</summary>
<_summary>Workspaces only on primary monitor</_summary>
<_description>
This key overrides the key in org.gnome.mutter when running GNOME Shell.
</_description>
</key>
<key name="focus-change-on-pointer-rest" type="b">
<default>true</default>
<summary>Delay focus changes in mouse mode until the pointer stops moving</summary>
<description>
This key overrides the key in org.gnome.mutter when running GNOME Shell.
</description>

View File

@ -39,7 +39,6 @@ stage {
/* small */
.app-well-menu,
.contact-details-status,
.run-dialog-label,
.run-dialog-error-label {
font-size: 9pt;
}
@ -48,9 +47,8 @@ stage {
.dash-label,
.window-caption,
.switcher-list,
.source-title,
.app-well-app > .overview-icon,
.remove-favorite > .overview-icon,
.show-apps > .overview-icon,
.search-result-content > .overview-icon {
font-size: 9pt;
font-weight: bold;
@ -81,25 +79,25 @@ StScrollBar StBin#trough {
}
StScrollBar StButton#vhandle {
background-color: #959797;
background-color: #5d6464;
border: 2px solid #242424;
border-radius: 8px;
}
StScrollBar StButton#hhandle {
background-color: #959797;
background-color: #5d6464;
border: 2px solid #242424;
border-radius: 8px;
}
StScrollBar StButton#hhandle:hover,
StScrollBar StButton#vhandle:hover {
background-color: #c2c3c3;
background-color: #777d7c;
}
StScrollBar StButton#hhandle:active,
StScrollBar StButton#vhandle:active {
background-color: #729fcf;
background-color: #3465a4;
}
/* Check Boxes */
@ -152,11 +150,11 @@ StScrollBar StButton#vhandle:active {
box-shadow: inset 0px 2px 4px rgba(0,0,0,0.9);
}
.popup-sub-menu .popup-menu-item:ltr {
.popup-sub-menu:scrolled .popup-menu-item:ltr {
padding-right: 0em;
}
.popup-sub-menu .popup-menu-item:rtl {
.popup-sub-menu:scrolled .popup-menu-item:rtl {
padding-left: 0em;
}
@ -196,7 +194,7 @@ StScrollBar StButton#vhandle:active {
background-color: #4c4c4c;
}
StButton.popup-menu-item:insensitive {
.popup-menu-item:insensitive {
color: #9f9f9f;
}
@ -235,13 +233,18 @@ StButton.popup-menu-item:insensitive {
spacing: .5em;
}
.popup-inactive-menu-item {
.popup-status-menu-item {
font-weight: normal;
color: #999;
}
.popup-subtitle-menu-item {
.popup-inactive-menu-item, .popup-inactive-menu-item:insensitive {
color: white;
}
.popup-subtitle-menu-item, .popup-subtitle-menu-item:insensitive {
font-weight: bold;
color: white;
}
.popup-menu-icon {
@ -307,7 +310,7 @@ StButton.popup-menu-item:insensitive {
.notification-icon-button:focus,
.hotplug-notification-item:focus,
.modal-dialog-button:focus {
border: 2px solid #8b8b8b;
border-width: 2px;
}
.dash-search-button:active,
@ -322,26 +325,30 @@ StButton.popup-menu-item:insensitive {
background-gradient-end: rgba(255, 255, 255, 0.2);
}
.notification-button:insensitive,
.notification-icon-button:insensitive,
.notification-button:insensitive {
.modal-dialog-button:insensitive {
border-color: #666666;
color: #9f9f9f;
background-gradient-direction: none;
background-color: rgba(102, 102, 102, 0.15);
}
/* Entries */
#searchEntry,
.notification StEntry,
.login-dialog-prompt-entry,
.prompt-dialog-password-entry {
.modal-dialog StEntry {
color: rgb(64, 64, 64);
caret-color: rgb(64, 64, 64);
font-size: 12pt;
caret-size: 1px;
selected-color: black;
selected-color: white;
padding: 4px 12px;
}
#searchEntry,
.run-dialog-entry,
.notification StEntry {
border: 2px solid rgba(245,245,245,0.2);
background-gradient-start: rgba(5,5,6,0.1);
@ -354,8 +361,7 @@ StButton.popup-menu-item:insensitive {
#searchEntry:focus,
#searchEntry:hover,
.notification StEntry:focus,
.login-dialog-prompt-entry,
.prompt-dialog-password-entry {
.modal-dialog StEntry {
border: 2px solid rgb(136,138,133);
background-gradient-start: rgb(200,200,200);
background-gradient-end: white;
@ -364,12 +370,17 @@ StButton.popup-menu-item:insensitive {
}
.notification StEntry:focus,
.prompt-dialog-password-entry:focus,
.login-dialog-prompt-entry:focus {
.modal-dialog StEntry:focus {
border: 2px solid #3465a4;
}
#searchEntry {
border-color: rgba(245,245,245,0.3);
color: rgb(192, 192, 192);
caret-color: rgb(192, 192, 192);
}
#searchEntry:hover {
color: rgb(128, 128, 128);
caret-color: rgb(128, 128, 128);
}
@ -382,8 +393,7 @@ StButton.popup-menu-item:insensitive {
}
.notification StEntry,
.prompt-dialog-password-entry,
.login-dialog-prompt-entry {
.modal-dialog StEntry {
border-radius: 5px;
padding: 4px 4px;
}
@ -398,6 +408,8 @@ StButton.popup-menu-item:insensitive {
.login-dialog-prompt-entry:insensitive {
color: rgba(0,0,0,0.7);
border: 2px solid #565656;
background-gradient-start: rgb(200,200,200);
background-gradient-end: rgb(210,210,210);
}
/* Panel */
@ -503,7 +515,7 @@ StButton.popup-menu-item:insensitive {
-boxpointer-gap: 4px
}
#networkMenu {
.panel-status-button-box {
spacing: 4px;
}
@ -545,7 +557,6 @@ StButton.popup-menu-item:insensitive {
}
.status-chooser-combo.popup-combo-menu {
background-color: rgba(0,0,0,0.7);
padding: .4em 0em;
border-radius: 4px;
border: 1px solid #5f5f5f;
@ -563,7 +574,7 @@ StButton.popup-menu-item:insensitive {
/* Overview */
#overview {
spacing: 12px;
spacing: 40px;
}
.window-caption {
@ -579,22 +590,24 @@ StButton.popup-menu-item:insensitive {
border-right: 0px;
border-radius: 9px 0px 0px 9px;
background-color: rgba(0, 0, 0, 0.5);
padding: 8px;
padding: 11px 7px 11px 11px;
}
.workspace-thumbnails-background:rtl {
border-right: 1px;
border-left: 0px;
border-radius: 0px 9px 9px 0px;
padding: 11px 11px 11px 7px;
}
.workspace-thumbnails {
spacing: 7px;
spacing: 11px;
}
.workspace-thumbnail-indicator {
outline: 2px solid white;
border: 1px solid #888;
border: 4px solid rgba(255,255,255,0.7);
border-radius: 4px;
padding: 1px;
}
.window-caption {
@ -604,18 +617,46 @@ StButton.popup-menu-item:insensitive {
-shell-caption-spacing: 12px;
}
.window-close {
.window-close, .notification-close {
background-image: url("close-window.svg");
background-size: 34px;
height: 34px;
width: 34px;
background-size: 32px;
height: 32px;
width: 32px;
}
.window-close {
-shell-close-overlap: 20px;
}
.notification-close {
/* we start out in the top right of the
* notification, inset.
*
* center is 32px/2 = 16px
*
* adjust left 2px
* adjust down 8px */
-shell-close-overlap-x: 14px;
-shell-close-overlap-y: -12px;
}
.notification-close:rtl {
/* as above, but starting out in the top left of the
* notification. */
-shell-close-overlap-x: -14px;
}
.window-close:rtl {
-st-background-image-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}
.window-picker {
-horizontal-spacing: 40px;
-vertical-spacing: 40px;
}
/* Dash */
#dash {
@ -634,11 +675,6 @@ StButton.popup-menu-item:insensitive {
border-radius: 9px 0px 0px 9px;
}
#dash:empty {
height: 100px;
width: 60px;
}
.placeholder {
background-image: url("dash-placeholder.svg");
background-size: contain;
@ -649,46 +685,23 @@ StButton.popup-menu-item:insensitive {
spacing: 1em;
}
#viewSelectorTabBar {
padding: 1em;
}
/* Search Box */
#searchArea {
padding: 0px 24px;
}
#searchEntry {
border-radius: 17px;
width: 250px;
width: 320px;
}
.search-entry-icon {
icon-size: 1em;
color: #c0c0c0;
}
#searchEntry:hover .search-entry-icon,
#searchEntry:focus .search-entry-icon {
color: #8d8f8a;
}
/* View Tabs */
.view-tab-title {
color: #888a85;
font-size: 12pt;
font-weight: bold;
padding: 0px 0.75em;
height: 1.5em;
}
.view-tab-title:hover {
color: #bbb;
}
.view-tab-title:selected {
color: #000000;
background-color: #c2c7cd;
border-radius: 0.25em;
}
/* Search Results */
#searchResults {
@ -706,7 +719,6 @@ StButton.popup-menu-item:insensitive {
padding-left: 20px;
}
.search-statustext,
.search-section-header {
padding: 4px 12px;
spacing: 4px;
@ -714,6 +726,12 @@ StButton.popup-menu-item:insensitive {
font-size: .8em;
}
.search-statustext {
color: #efefef;
font-size: 2em;
font-weight: bold;
}
.search-section-results {
padding: 6px;
}
@ -726,10 +744,6 @@ StButton.popup-menu-item:insensitive {
spacing: 4px;
}
.search-providers-box {
spacing: 12px;
}
/* Text labels are an odd number of pixels tall. The uneven top and bottom
* padding compensates for this and ensures that the label is vertically
* centered */
@ -804,21 +818,12 @@ StButton.popup-menu-item:insensitive {
outline: 1px solid #aaa;
}
.dash-item-container > .app-well-app {
.dash-item-container > StButton {
padding: 4px 8px;
}
.remove-favorite-icon {
color: #a0a0a0;
}
.remove-favorite-icon:hover {
color: white;
icon-shadow: black 0px 2px 2px;
}
.app-well-app > .overview-icon,
.remove-favorite > .overview-icon,
.show-apps > .overview-icon,
.search-result-content > .overview-icon {
border-radius: 4px;
padding: 3px;
@ -834,15 +839,44 @@ StButton.popup-menu-item:insensitive {
}
.app-well-app:hover > .overview-icon,
.remove-favorite:hover > .overview-icon,
.show-apps:hover > .overview-icon,
.search-result-content:hover > .overview-icon {
background-color: rgba(255,255,255,0.1);
text-shadow: black 0px 2px 2px;
transition-duration: 100;
color:white;
}
.show-apps {
padding: 4px 0;
}
.show-apps-icon {
color: #a0a0a0;
}
.show-apps:hover .show-apps-icon {
color: white;
}
.show-apps:checked > .overview-icon {
background-gradient-start: rgba(255, 255, 255, .05);
background-gradient-end: rgba(255, 255, 255, .15);
background-gradient-direction: vertical;
border-radius: 4px;
box-shadow: inset 0px 1px 2px 0px rgba(0, 0, 0, 1);
transition-duration: 100;
}
.show-apps:checked .show-apps-icon,
.show-apps:focus .show-apps-icon {
color: white;
transition-duration: 100;
}
.app-well-app:focus > .overview-icon,
.search-result-content:focus > .overview-icon,
.show-apps:focus > .overview-icon,
.app-well-app:selected > .overview-icon,
.search-result-content:selected > .overview-icon {
background-color: rgba(255,255,255,0.33);
@ -1173,19 +1207,31 @@ StButton.popup-menu-item:insensitive {
/* Message Tray */
#message-tray {
background-gradient-direction: vertical;
background-gradient-start: rgba(0,0,0,0.01);
background-gradient-end: rgba(0,0,0,0.82);
height: 36px;
background: #2e3436 url(message-tray-background.png);
background-repeat: repeat;
transition-duration: 250;
}
#message-tray:keyboard {
/* Same as the OSK */
background: rgba(0, 0, 0, 0.8);
}
#message-tray:overview {
background: rgba(0, 0, 0, 0.1);
outline: 1px solid rgba(128, 128, 128, 0.3);
}
.notification {
font-size: 11pt;
border-radius: 10px 10px 0px 0px;
background: rgba(0,0,0,0.8);
padding: 8px 8px 4px 8px;
spacing-rows: 10px;
spacing-columns: 10px;
}
.notification, #notification-container {
font-size: 11pt;
width: 34em;
}
@ -1193,6 +1239,13 @@ StButton.popup-menu-item:insensitive {
padding-bottom: 8px;
}
.notification-unexpanded {
/* We want to force the actor at a specific size, irrespective
of its minimum and preferred size, so we override both */
min-height: 36px;
height: 36px;
}
/* We use row-span = 2 for the image cell, which prevents its height preferences to be
taken into account during allocation, so its height ends up being limited by the height
of the content in the other rows. To avoid showing a stretched image, we set the minimum
@ -1207,6 +1260,7 @@ StButton.popup-menu-item:insensitive {
-arrow-base: 36px;
-arrow-rise: 18px;
color: white;
-boxpointer-gap: 4px;
}
.summary-boxpointer .notification {
@ -1220,17 +1274,17 @@ StButton.popup-menu-item:insensitive {
padding-bottom: 12px;
}
#summary-notification-stack-scrollview {
.summary-notification-stack-scrollview {
max-height: 18em;
padding-top: 6px;
padding-bottom: 6px;
}
#summary-notification-stack-scrollview:ltr {
.summary-notification-stack-scrollview:ltr {
padding-right: 8px;
}
#summary-notification-stack-scrollview:rtl {
.summary-notification-stack-scrollview:rtl {
padding-left: 8px;
}
@ -1378,6 +1432,10 @@ StButton.popup-menu-item:insensitive {
padding-right: 4px;
}
.chat-notification-scrollview{
max-height: 22em;
}
.subscription-message {
font-style: italic;
}
@ -1386,87 +1444,46 @@ StButton.popup-menu-item:insensitive {
border-radius: 4px;
}
/* The spacing and padding on the summary is tricky; we want to keep
* the icons from touching each other or the edges of the screen, but
* we also want them to be "Fitts"-y with respect to the edges, so the
* summary area's bottom and right padding must actually be part of
* the icons. However, we can't put *all* of the padding into the
* icons, because then the summary would be 0x0 when there were no
* icons in it, and so you wouldn't be able to hover over it to
* activate it.
*
* Also, the spacing between a summary-source's icon and title is
* actually specified as padding-left in source-title, because we
* want the spacing to collapse along with the title.
*/
#summary-mode {
padding: 2px 0px 0px 4px;
height: 36px;
}
#summary-mode:rtl {
padding: 2px 4px 0px 0px;
height: 72px;
}
.summary-source-button {
text-shadow: black 0px 2px 2px;
}
.summary-source-button:ltr {
padding-right: 12px;
}
.summary-source-button:selected .summary-source {
background-image: url("panel-button-highlight-narrow.svg");
background-size: contain;
border-image: url("source-button-border.svg") 10 10 0 1;
}
.summary-source-button:expanded:selected .summary-source {
background-image: none;
border-image: none;
}
.summary-source-button:expanded:selected {
background-image: url("panel-button-highlight-wide.svg");
background-size: contain;
border-image: url("source-button-border.svg") 10 10 0 1;
}
.summary-source-button:rtl {
padding-left: 12px;
padding: 6px 3px 6px 3px;
}
.summary-source-button:last-child:ltr {
padding-right: 12px;
padding-right: 6px;
}
.summary-source-button:last-child:rtl {
padding-left: 12px;
padding-left: 6px;
}
.summary-source-button:hover .summary-source {
background-color: rgba(255,255,255,0.1);
}
.summary-source-button:focus .summary-source,
.summary-source-button:selected .summary-source {
background-color: rgba(255,255,255,0.33);
}
.summary-source {
padding-right: 4px;
padding-left: 4px;
border-radius: 4px;
padding: 0 6px 0 6px;
transition-duration: 100;
}
.summary-source-counter {
color: white;
background-color: #3465A4;
text-shadow: black 1px 1px 0;
font-size: 9pt;
border-radius: 1em;
min-height: 1em;
min-width: 1em;
}
.source-title {
padding-left: 4px;
}
.source-title:rtl {
padding-left: 0px;
padding-right: 4px;
background-image: url("summary-counter.svg");
background-size: 2.5em;
font-size: 10pt;
font-weight: bold;
height: 2.5em;
width: 2.5em;
-shell-counter-overlap-x: 4px;
-shell-counter-overlap-y: 4px;
}
/* App Switcher */
@ -1579,7 +1596,7 @@ StButton.popup-menu-item:insensitive {
height: 100px;
border: 0px;
background: rgba(255,255,255,0.5);
background-image: url("ws-switch-arrow-up.svg");
background-image: url("ws-switch-arrow-up.png");
border-radius: 8px;
}
@ -1587,7 +1604,7 @@ StButton.popup-menu-item:insensitive {
height: 100px;
border: 0px;
background: rgba(255,255,255,0.5);
background-image: url("ws-switch-arrow-down.svg");
background-image: url("ws-switch-arrow-down.png");
border-radius: 8px;
}
@ -1633,35 +1650,26 @@ StButton.popup-menu-item:insensitive {
padding: 4px 32px 5px;
}
.modal-dialog-button:insensitive {
color: rgb(60, 60, 60);
}
.modal-dialog-button:focus {
padding: 3px 31px 4px;
}
/* Run Dialog */
.run-dialog-label {
font-size: 12pt;
font-weight: bold;
color: #999999;
padding-bottom: .4em;
}
.run-dialog-error-box {
padding-top: 15px;
spacing: 5px;
}
.run-dialog-entry {
font-weight: bold;
width: 23em;
selection-background-color: white;
selected-color: black;
}
.run-dialog {
border-radius: 16px;
padding-right: 21px;
padding-left: 21px;
padding-bottom: 15px;
padding-top: 15px;
.modal-dialog .run-dialog-entry {
width: 20em;
}
.lightbox {
@ -1701,6 +1709,7 @@ StButton.popup-menu-item:insensitive {
border-radius: 5px;
width: 32px;
height: 32px;
background-size: contain;
}
.end-session-dialog-shutdown-icon {
@ -1861,6 +1870,7 @@ StButton.popup-menu-item:insensitive {
.prompt-dialog-password-box {
spacing: 1em;
padding-bottom: 1em;
}
.prompt-dialog-error-label {
@ -1899,14 +1909,24 @@ StButton.popup-menu-item:insensitive {
color: #ff0000;
}
.polkit-dialog-user-icon {
border: 2px solid #8b8b8b;
border-radius: 5px;
background-size: contain;
width: 48px;
height: 48px;
}
/* Network Agent Dialog */
.network-dialog-secret-table {
spacing-rows: 15px;
spacing-columns: 1em;
}
.keyring-dialog-control-table {
spacing-rows: 15px;
spacing-columns: 1em;
}
/* Magnifier */
@ -2016,7 +2036,7 @@ StButton.popup-menu-item:insensitive {
min-width: 350px;
}
.login-dialog-prompt-fingerprint-message {
.login-dialog-prompt-login-hint-message {
font-size: 10.5pt;
}
@ -2030,7 +2050,6 @@ StButton.popup-menu-item:insensitive {
}
.login-dialog-user-list-item {
color: #666666;
border-radius: 10px;
padding: .2em;
}
@ -2048,6 +2067,11 @@ StButton.popup-menu-item:insensitive {
padding-left: 1em;
}
.login-dialog-user-list:expanded .login-dialog-user-list-item {
color: #666666;
}
.login-dialog-user-list-item,
.login-dialog-user-list-item:hover .login-dialog-user-list-item-name,
.login-dialog-user-list:expanded .login-dialog-user-list-item:focus .login-dialog-user-list-item-name,
.login-dialog-user-list:expanded .login-dialog-user-list-item:logged-in {
@ -2092,8 +2116,10 @@ StButton.popup-menu-item:insensitive {
font-size: 10.5pt;
font-weight: bold;
color: #666666;
padding-top: 1em;
}
.login-dialog-not-listed-button:focus .login-dialog-not-listed-label,
.login-dialog-not-listed-button:hover .login-dialog-not-listed-label {
color: #E8E8E8;
}
@ -2169,46 +2195,78 @@ StButton.popup-menu-item:insensitive {
height: .75em;
}
.login-dialog .modal-dialog-button {
border: 1px solid white;
border-radius: 5px;
padding: 3px 18px;
}
.login-dialog .modal-dialog-button:focus {
padding: 2px 17px;
}
.login-dialog .modal-dialog-button:default {
background-gradient-start: #6793c4;
background-gradient-end: #335d8f;
background-gradient-direction: vertical;
border: 2px solid #16335d;
border-color: #16335d;
}
.login-dialog .modal-dialog-button:hover {
.login-dialog .modal-dialog-button:default:focus {
border: 2px solid #377fe7;
}
.login-dialog .modal-dialog-button:default:hover {
background-gradient-start: #74a0d0;
background-gradient-end: #436d9f;
}
.login-dialog .modal-dialog-button:active,
.login-dialog .modal-dialog-button:pressed {
.login-dialog .modal-dialog-button:default:active,
.login-dialog .modal-dialog-button:default:pressed {
background-gradient-start: #436d9f;
background-gradient-end: #74a0d0;
}
.login-dialog .modal-dialog-button:default:insensitive {
border-color: #666666;
color: #9f9f9f;
background-gradient-direction: none;
background-color: rgba(102, 102, 102, 0.15);
}
.login-dialog-message-warning {
color: orange;
}
.unlock-dialog-user-name-container {
spacing: .4em;
}
/* Screen shield */
#screenShieldGroup {
.screen-shield-background {
background: black;
box-shadow: 0px 4px 8px rgba(0,0,0,0.9);
}
#lockDialogGroup {
background: #2e3436 url(noise-texture.png);
background-repeat: repeat;
}
#screenShieldGroup .arrow {
color: #333333;
width: 100px;
height: 50px;
.screen-shield-arrows {
padding-bottom: 3em;
}
.screen-shield-arrows Gjs_Arrow {
color: white;
width: 80px;
height: 48px;
-arrow-thickness: 12px;
-arrow-shadow: 0 1px 1px rgba(0,0,0,0.4);
}
.screen-shield-contents-box {
spacing: 48px;
}
.screen-shield-clock {
@ -2216,35 +2274,40 @@ StButton.popup-menu-item:insensitive {
text-shadow: 0px 1px 2px rgba(0,0,0,0.6);
font-weight: bold;
text-align: center;
padding-bottom: 1.5em;
}
.screen-shield-clock-time {
font-size: 86px;
font-size: 72pt;
text-shadow: 0px 2px 2px rgba(0,0,0,0.4);
}
.screen-shield-clock-date {
font-size: 48px;
font-size: 28pt;
}
#screenShieldNotifications {
border-radius: 24px;
border-radius: 8px;
background-color: rgba(0.0, 0.0, 0.0, 0.9);
border: 2px solid #868686;
max-height: 500px;
padding: 18px 0;
box-shadow: .5em .5em 20px rgba(0, 0, 0, 0.5);
}
#screenShieldNotifications, .screen-shield-notifications-box {
spacing: 8px;
.screen-shield-notifications-box {
spacing: 18px;
}
.screen-shield-notification-source {
padding: 24px 8px;
padding: 0 24px;
spacing: 5px;
}
.screen-shield-notification-label {
font-size: 1.2em;
font-weight: bold;
color: #babdb6;
}
/* Remove background from notifications, otherwise
@ -2253,3 +2316,26 @@ StButton.popup-menu-item:insensitive {
.screen-shield-notifications-box .notification {
background-color: transparent;
}
/* Override padding on resident notifications, since
the notifications box has its own spacing
*/
.screen-shield-notifications-box .summary-notification-stack-scrollview {
padding-top: 0px;
padding-bottom: 0px;
}
.osd-window {
color: #ededed;
background-color: rgba(33, 37, 38, 0.80);
border-radius: 15px;
text-shadow: 0 1px rgba(0, 0, 0, 0.75);
padding: 40px;
spacing: 5px;
}
.osd-progress-bar {
height: 0.8em;
border: 1px solid;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
id="Foreground"
x="0px"
y="0px"
width="32"
height="32"
viewBox="0 0 23.272727 23.272727"
enable-background="new 0 0 16 16"
xml:space="preserve"
sodipodi:version="0.32"
inkscape:version="0.48.2 r9819"
sodipodi:docname="summary-counter.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
id="metadata2399"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs2397"><linearGradient
id="linearGradient3173"><stop
style="stop-color:#c4c4c4;stop-opacity:1;"
offset="0"
id="stop3175" /><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="1"
id="stop3177" /></linearGradient><inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 8 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16 : 8 : 1"
inkscape:persp3d-origin="8 : 5.3333333 : 1"
id="perspective2401" /><filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter16494-4"
x="-0.20989846"
width="1.4197969"
y="-0.20903821"
height="1.4180764"><feGaussianBlur
inkscape:collect="always"
stdDeviation="1.3282637"
id="feGaussianBlur16496-8" /></filter><radialGradient
inkscape:collect="always"
xlink:href="#linearGradient16498-6"
id="radialGradient16504-1"
cx="7.6582627"
cy="5.8191104"
fx="7.6582627"
fy="5.8191104"
r="8.6928644"
gradientTransform="matrix(1.0474339,0,0,1.0517402,-0.3632615,-0.42032492)"
gradientUnits="userSpaceOnUse" /><linearGradient
inkscape:collect="always"
id="linearGradient16498-6"><stop
style="stop-color:#9FD0FF;stop-opacity:1"
offset="0"
id="stop16500-8" /><stop
style="stop-color:#3465A4;stop-opacity:1"
offset="1"
id="stop16502-0" /></linearGradient></defs><sodipodi:namedview
inkscape:window-height="709"
inkscape:window-width="1366"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10.0"
gridtolerance="10.0"
objecttolerance="10.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#000000"
id="base"
showgrid="false"
inkscape:zoom="11.313708"
inkscape:cx="15.386407"
inkscape:cy="13.739577"
inkscape:window-x="0"
inkscape:window-y="1179"
inkscape:current-layer="g16402-8"
showguides="true"
inkscape:guide-bbox="true"
borderlayer="true"
inkscape:showpageshadow="false"
inkscape:window-maximized="1"><inkscape:grid
type="xygrid"
id="grid11246"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" /></sodipodi:namedview><g
style="display:inline"
id="g16402-8"
transform="translate(4.7533483,2.8238929)"><g
id="g3175-4"
transform="translate(-0.89995416,0.94028614)"><path
sodipodi:type="inkscape:offset"
inkscape:radius="0"
inkscape:original="M 7.65625 0.125 C 3.2589349 0.125 -0.3125 3.7070002 -0.3125 8.125 C -0.3125 12.543001 3.2589349 16.125 7.65625 16.125 C 12.053566 16.125 15.625 12.543001 15.625 8.125 C 15.625 3.7070002 12.053566 0.125 7.65625 0.125 z "
xlink:href="#path2394-32"
style="opacity:0.52994014;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.18181825;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter16494-4);enable-background:accumulate"
id="path16480-5"
inkscape:href="#path2394-32"
d="m 7.65625,0.125 c -4.3973151,0 -7.96875,3.5820002 -7.96875,8 0,4.418001 3.5714349,8 7.96875,8 4.397316,0 7.96875,-3.581999 7.96875,-8 0,-4.4179998 -3.571434,-8 -7.96875,-8 z"
transform="translate(0,1.028519)" /><path
clip-rule="evenodd"
d="m -0.30428257,8.1237596 c 0,-4.4179998 3.56522987,-7.9999996 7.96254497,-7.9999996 4.3973156,0 7.9625456,3.5819998 7.9625456,7.9999996 0,4.4180014 -3.56523,8.0000004 -7.9625456,8.0000004 -4.3973151,0 -7.96254497,-3.581999 -7.96254497,-8.0000004 z"
id="path2394-32"
style="color:#000000;fill:url(#radialGradient16504-1);fill-opacity:1;fill-rule:nonzero;stroke:#eeeeec;stroke-width:1.4545455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:nodetypes="csssc"
inkscape:connector-curvature="0" /><g
id="g3172-6" /></g></g></svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

View File

@ -1,376 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="96"
height="96"
id="svg25070"
inkscape:version="0.48.0 r9654"
sodipodi:docname="ws-switch-arrow-down.svg">
<metadata
id="metadata3353">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="718"
inkscape:window-height="480"
id="namedview3351"
showgrid="false"
inkscape:zoom="2.6979167"
inkscape:cx="48"
inkscape:cy="48"
inkscape:window-x="0"
inkscape:window-y="26"
inkscape:window-maximized="0"
inkscape:current-layer="svg25070" />
<defs
id="defs25072">
<linearGradient
x1="-86.552246"
y1="185.439"
x2="-83.37072"
y2="197.31261"
id="linearGradient24957"
xlink:href="#linearGradient4034-0-4"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(6,0)" />
<linearGradient
id="linearGradient4034-0-4">
<stop
id="stop4036-5-7"
style="stop-color:#eeeeec;stop-opacity:1"
offset="0" />
<stop
id="stop4038-9-6"
style="stop-color:#babdb6;stop-opacity:1"
offset="1" />
</linearGradient>
<filter
x="0"
y="0"
width="1"
height="1"
color-interpolation-filters="sRGB"
id="filter24765">
<feColorMatrix
result="fbSourceGraphic"
values="1"
type="saturate"
id="feColorMatrix24767" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
in="fbSourceGraphic"
id="feColorMatrix24769" />
</filter>
<linearGradient
x1="-74.520325"
y1="169.06032"
x2="-74.520325"
y2="205.94189"
id="linearGradient24955"
xlink:href="#linearGradient4632-1-3-9-3-2"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-5,0)" />
<linearGradient
id="linearGradient4632-1-3-9-3-2">
<stop
id="stop4634-1-8-3-9-0"
style="stop-color:#eeeeec;stop-opacity:1"
offset="0" />
<stop
id="stop4636-1-9-9-8-8"
style="stop-color:#ffffff;stop-opacity:1"
offset="0.0274937" />
<stop
id="stop4638-8-3-9-6-6"
style="stop-color:#f2f2f2;stop-opacity:1"
offset="0.274937" />
<stop
id="stop4640-8-5-7-8-9"
style="stop-color:#eeeeec;stop-opacity:1"
offset="0.38707438" />
<stop
id="stop4642-5-41-9-6-9"
style="stop-color:#d9dad8;stop-opacity:1"
offset="0.66528589" />
<stop
id="stop4644-5-2-7-9-2"
style="stop-color:#dfe0dd;stop-opacity:1"
offset="0.76745707" />
<stop
id="stop4646-3-2-3-7-3"
style="stop-color:#f0f0f0;stop-opacity:1"
offset="1" />
</linearGradient>
<radialGradient
cx="-33.412369"
cy="185.74171"
r="2.3554697"
fx="-33.412369"
fy="185.74171"
id="radialGradient24959"
xlink:href="#linearGradient4869-4-1"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0075,0,0,1.0075,-5.4544,-1.25141)" />
<linearGradient
id="linearGradient4869-4-1">
<stop
id="stop4871-6-2"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop4879-7-4"
style="stop-color:#eeeeec;stop-opacity:1"
offset="0.31807542" />
<stop
id="stop4877-6-1"
style="stop-color:#c8c9c6;stop-opacity:1"
offset="0.74691135" />
<stop
id="stop4873-1-0"
style="stop-color:#d3d7cf;stop-opacity:1"
offset="1" />
</linearGradient>
<filter
x="0"
y="0"
width="1"
height="1"
color-interpolation-filters="sRGB"
id="filter25011">
<feColorMatrix
result="fbSourceGraphic"
values="1"
type="saturate"
id="feColorMatrix25013" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
in="fbSourceGraphic"
id="feColorMatrix25015" />
</filter>
<radialGradient
cx="-33.412369"
cy="185.74171"
r="2.3554697"
fx="-33.412369"
fy="185.74171"
id="radialGradient24961"
xlink:href="#linearGradient4869-4-0"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0075,0,0,1.0075,-5.4544,-1.25141)" />
<linearGradient
id="linearGradient4869-4-0">
<stop
id="stop4871-6-8"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop4879-7-5"
style="stop-color:#eeeeec;stop-opacity:1"
offset="0.31807542" />
<stop
id="stop4877-6-5"
style="stop-color:#c8c9c6;stop-opacity:1"
offset="0.74691135" />
<stop
id="stop4873-1-4"
style="stop-color:#d3d7cf;stop-opacity:1"
offset="1" />
</linearGradient>
<filter
x="0"
y="0"
width="1"
height="1"
color-interpolation-filters="sRGB"
id="filter25023">
<feColorMatrix
result="fbSourceGraphic"
values="1"
type="saturate"
id="feColorMatrix25025" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
in="fbSourceGraphic"
id="feColorMatrix25027" />
</filter>
<linearGradient
x1="-39.858727"
y1="184.61784"
x2="-38.244785"
y2="188.84898"
id="linearGradient24963"
xlink:href="#linearGradient4941"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient4941">
<stop
id="stop4943"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop4945"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<filter
x="0"
y="0"
width="1"
height="1"
color-interpolation-filters="sRGB"
id="filter25033">
<feColorMatrix
result="fbSourceGraphic"
values="1"
type="saturate"
id="feColorMatrix25035" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
in="fbSourceGraphic"
id="feColorMatrix25037" />
</filter>
<linearGradient
x1="-39.858727"
y1="184.61784"
x2="-38.244785"
y2="188.84898"
id="linearGradient24965"
xlink:href="#linearGradient4941-7"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient4941-7">
<stop
id="stop4943-2"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop4945-5"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<filter
x="0"
y="0"
width="1"
height="1"
color-interpolation-filters="sRGB"
id="filter25043">
<feColorMatrix
result="fbSourceGraphic"
values="1"
type="saturate"
id="feColorMatrix25045" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
in="fbSourceGraphic"
id="feColorMatrix25047" />
</filter>
<filter
x="0"
y="0"
width="1"
height="1"
color-interpolation-filters="sRGB"
id="filter25049">
<feColorMatrix
result="fbSourceGraphic"
values="1"
type="saturate"
id="feColorMatrix25051" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
in="fbSourceGraphic"
id="feColorMatrix25053" />
</filter>
<filter
x="0"
y="0"
width="1"
height="1"
color-interpolation-filters="sRGB"
id="filter25055">
<feColorMatrix
result="fbSourceGraphic"
values="1"
type="saturate"
id="feColorMatrix25057" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
in="fbSourceGraphic"
id="feColorMatrix25059" />
</filter>
</defs>
<g
transform="matrix(0,1,-1,0,48.0003,4.1307112e-7)"
id="layer1">
<g
transform="matrix(-2,0,0,2,-97.2497,-374.967)"
id="g4030-1-8"
style="stroke:#000000;stroke-opacity:1;display:inline">
<path
d="m -72.5,173.5 -14,14 14,14"
id="path3165-7-3"
style="color:#000000;fill:none;stroke:#000000;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
inkscape:connector-curvature="0" />
</g>
<path
d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
transform="matrix(-3.34328,0,0,3.34328,-89.2797,-623.176)"
id="path4050-2-7-9-4"
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible"
inkscape:connector-curvature="0" />
<path
d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
transform="matrix(-3.34328,0,0,3.34328,-111.2797,-623.176)"
id="path4050-2-7-9-4-8"
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible"
inkscape:connector-curvature="0" />
<path
d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
transform="matrix(-2.86565,0,0,2.86565,-70.8457,-534.143)"
id="path4050-2-7-9-4-0"
style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
inkscape:connector-curvature="0" />
<path
d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
transform="matrix(-2.86565,0,0,2.86565,-92.8457,-534.143)"
id="path4050-2-7-9-4-0-9"
style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
inkscape:connector-curvature="0" />
<path
d="m 47.87528,-34.0295 c 1.53896,0.0448 3.0511,0.70928 4.125,1.8125 l 32.25,32.25 -32.25,32.25 c -2.2253,2.2253 -6.2747,2.2253 -8.5,0 -2.2253,-2.22528 -2.2253,-6.2747 0,-8.5 l 23.75,-23.75 -23.75,-23.75 c -1.73168,-1.6731 -2.295,-4.44228 -1.3546,-6.65894 0.94042,-2.21668 3.32312,-3.73604 5.7296,-3.65356 z"
id="path3165-7-3-1"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;opacity:0.35;color:#000000;fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans"
inkscape:connector-curvature="0" />
<path
d="m 41.8316,28.09418 c -0.014,-1.58898 0.54158,-3.18406 1.66868,-4.31118 l 23.75,-23.75 m -25.1046,-30.40894 c 0.94042,-2.21668 3.32312,-3.73604 5.7296,-3.65356 1.53896,0.0448 3.0511,0.70928 4.125,1.8125 l 32.25,32.25"
id="path3165-7-3-1-9"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;color:#000000;fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans"
inkscape:connector-curvature="0" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

View File

@ -1,447 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96"
height="96"
id="svg25070"
version="1.1"
inkscape:version="0.48.0 r9654"
sodipodi:docname="ws-switch-arrow-up.svg">
<defs
id="defs25072">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 24 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="48 : 24 : 1"
inkscape:persp3d-origin="24 : 16 : 1"
id="perspective25078" />
<inkscape:perspective
id="perspective24985"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4034-0-4"
id="linearGradient24957"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(6)"
x1="-86.552246"
y1="185.439"
x2="-83.37072"
y2="197.31261" />
<linearGradient
inkscape:collect="always"
id="linearGradient4034-0-4">
<stop
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;"
offset="0"
id="stop4036-5-7" />
<stop
style="stop-color: rgb(186, 189, 182); stop-opacity: 1;"
offset="1"
id="stop4038-9-6" />
</linearGradient>
<filter
id="filter24765"
inkscape:label="Invert"
x="0"
y="0"
width="1"
height="1"
inkscape:menu="Color"
inkscape:menu-tooltip="Invert colors"
color-interpolation-filters="sRGB">
<feColorMatrix
id="feColorMatrix24767"
type="saturate"
values="1"
result="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix24769"
in="fbSourceGraphic"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4632-1-3-9-3-2"
id="linearGradient24955"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-5)"
x1="-74.520325"
y1="169.06032"
x2="-74.520325"
y2="205.94189" />
<linearGradient
id="linearGradient4632-1-3-9-3-2">
<stop
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;"
offset="0"
id="stop4634-1-8-3-9-0" />
<stop
id="stop4636-1-9-9-8-8"
offset="0.0274937"
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" />
<stop
id="stop4638-8-3-9-6-6"
offset="0.274937"
style="stop-color: rgb(242, 242, 242); stop-opacity: 1;" />
<stop
id="stop4640-8-5-7-8-9"
offset="0.38707438"
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" />
<stop
id="stop4642-5-41-9-6-9"
offset="0.66528589"
style="stop-color: rgb(217, 218, 216); stop-opacity: 1;" />
<stop
id="stop4644-5-2-7-9-2"
offset="0.76745707"
style="stop-color: rgb(223, 224, 221); stop-opacity: 1;" />
<stop
style="stop-color: rgb(240, 240, 240); stop-opacity: 1;"
offset="1"
id="stop4646-3-2-3-7-3" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4869-4-1"
id="radialGradient24959"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0075, 0, 0, 1.0075, -5.4544, -1.25141)"
cx="-33.412369"
cy="185.74171"
fx="-33.412369"
fy="185.74171"
r="2.3554697" />
<linearGradient
id="linearGradient4869-4-1">
<stop
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
offset="0"
id="stop4871-6-2" />
<stop
id="stop4879-7-4"
offset="0.31807542"
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" />
<stop
id="stop4877-6-1"
offset="0.74691135"
style="stop-color: rgb(200, 201, 198); stop-opacity: 1;" />
<stop
style="stop-color: rgb(211, 215, 207); stop-opacity: 1;"
offset="1"
id="stop4873-1-0" />
</linearGradient>
<filter
id="filter25011"
inkscape:label="Invert"
x="0"
y="0"
width="1"
height="1"
inkscape:menu="Color"
inkscape:menu-tooltip="Invert colors"
color-interpolation-filters="sRGB">
<feColorMatrix
id="feColorMatrix25013"
type="saturate"
values="1"
result="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix25015"
in="fbSourceGraphic"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
</filter>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4869-4-0"
id="radialGradient24961"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0075, 0, 0, 1.0075, -5.4544, -1.25141)"
cx="-33.412369"
cy="185.74171"
fx="-33.412369"
fy="185.74171"
r="2.3554697" />
<linearGradient
id="linearGradient4869-4-0">
<stop
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
offset="0"
id="stop4871-6-8" />
<stop
id="stop4879-7-5"
offset="0.31807542"
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" />
<stop
id="stop4877-6-5"
offset="0.74691135"
style="stop-color: rgb(200, 201, 198); stop-opacity: 1;" />
<stop
style="stop-color: rgb(211, 215, 207); stop-opacity: 1;"
offset="1"
id="stop4873-1-4" />
</linearGradient>
<filter
id="filter25023"
inkscape:label="Invert"
x="0"
y="0"
width="1"
height="1"
inkscape:menu="Color"
inkscape:menu-tooltip="Invert colors"
color-interpolation-filters="sRGB">
<feColorMatrix
id="feColorMatrix25025"
type="saturate"
values="1"
result="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix25027"
in="fbSourceGraphic"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4941"
id="linearGradient24963"
gradientUnits="userSpaceOnUse"
x1="-39.858727"
y1="184.61784"
x2="-38.244785"
y2="188.84898" />
<linearGradient
inkscape:collect="always"
id="linearGradient4941">
<stop
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
offset="0"
id="stop4943" />
<stop
style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
offset="1"
id="stop4945" />
</linearGradient>
<filter
id="filter25033"
inkscape:label="Invert"
x="0"
y="0"
width="1"
height="1"
inkscape:menu="Color"
inkscape:menu-tooltip="Invert colors"
color-interpolation-filters="sRGB">
<feColorMatrix
id="feColorMatrix25035"
type="saturate"
values="1"
result="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix25037"
in="fbSourceGraphic"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4941-7"
id="linearGradient24965"
gradientUnits="userSpaceOnUse"
x1="-39.858727"
y1="184.61784"
x2="-38.244785"
y2="188.84898" />
<linearGradient
inkscape:collect="always"
id="linearGradient4941-7">
<stop
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
offset="0"
id="stop4943-2" />
<stop
style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
offset="1"
id="stop4945-5" />
</linearGradient>
<filter
id="filter25043"
inkscape:label="Invert"
x="0"
y="0"
width="1"
height="1"
inkscape:menu="Color"
inkscape:menu-tooltip="Invert colors"
color-interpolation-filters="sRGB">
<feColorMatrix
id="feColorMatrix25045"
type="saturate"
values="1"
result="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix25047"
in="fbSourceGraphic"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
</filter>
<filter
id="filter25049"
inkscape:label="Invert"
x="0"
y="0"
width="1"
height="1"
inkscape:menu="Color"
inkscape:menu-tooltip="Invert colors"
color-interpolation-filters="sRGB">
<feColorMatrix
id="feColorMatrix25051"
type="saturate"
values="1"
result="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix25053"
in="fbSourceGraphic"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
</filter>
<filter
id="filter25055"
inkscape:label="Invert"
x="0"
y="0"
width="1"
height="1"
inkscape:menu="Color"
inkscape:menu-tooltip="Invert colors"
color-interpolation-filters="sRGB">
<feColorMatrix
id="feColorMatrix25057"
type="saturate"
values="1"
result="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix25059"
in="fbSourceGraphic"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="-12.356322"
inkscape:cy="57.536221"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1200"
inkscape:window-height="840"
inkscape:window-x="0"
inkscape:window-y="26"
inkscape:window-maximized="0" />
<metadata
id="metadata25075">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(0, 48)">
<g
id="g3181"
transform="matrix(0,1,-1,0,48.0003,-48)">
<g
style="stroke:#000000;stroke-opacity:1;display:inline"
transform="matrix(2,0,0,2,193.25,-374.967)"
id="g4030-1-8">
<path
style="color:#000000;fill:none;stroke:#000000;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
d="m -72.5,173.5 -14,14 14,14"
id="path3165-7-3"
sodipodi:nodetypes="ccc"
inkscape:connector-curvature="0" />
</g>
<path
transform="matrix(3.34328,0,0,3.34328,185.28,-623.176)"
d="m -36.5,186.40625 c 0,1.15635 -0.937404,2.09375 -2.09375,2.09375 -1.156346,0 -2.09375,-0.9374 -2.09375,-2.09375 0,-1.15635 0.937404,-2.09375 2.09375,-2.09375 1.156346,0 2.09375,0.9374 2.09375,2.09375 z"
sodipodi:ry="2.09375"
sodipodi:rx="2.09375"
sodipodi:cy="186.40625"
sodipodi:cx="-38.59375"
id="path4050-2-7-9-4"
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
transform="matrix(3.34328,0,0,3.34328,207.28,-623.176)"
d="m -36.5,186.40625 c 0,1.15635 -0.937404,2.09375 -2.09375,2.09375 -1.156346,0 -2.09375,-0.9374 -2.09375,-2.09375 0,-1.15635 0.937404,-2.09375 2.09375,-2.09375 1.156346,0 2.09375,0.9374 2.09375,2.09375 z"
sodipodi:ry="2.09375"
sodipodi:rx="2.09375"
sodipodi:cy="186.40625"
sodipodi:cx="-38.59375"
id="path4050-2-7-9-4-8"
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
transform="matrix(2.86565,0,0,2.86565,166.846,-534.143)"
d="m -36.5,186.40625 c 0,1.15635 -0.937404,2.09375 -2.09375,2.09375 -1.156346,0 -2.09375,-0.9374 -2.09375,-2.09375 0,-1.15635 0.937404,-2.09375 2.09375,-2.09375 1.156346,0 2.09375,0.9374 2.09375,2.09375 z"
sodipodi:ry="2.09375"
sodipodi:rx="2.09375"
sodipodi:cy="186.40625"
sodipodi:cx="-38.59375"
id="path4050-2-7-9-4-0"
style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
transform="matrix(2.86565,0,0,2.86565,188.846,-534.143)"
d="m -36.5,186.40625 c 0,1.15635 -0.937404,2.09375 -2.09375,2.09375 -1.156346,0 -2.09375,-0.9374 -2.09375,-2.09375 0,-1.15635 0.937404,-2.09375 2.09375,-2.09375 1.156346,0 2.09375,0.9374 2.09375,2.09375 z"
sodipodi:ry="2.09375"
sodipodi:rx="2.09375"
sodipodi:cy="186.40625"
sodipodi:cx="-38.59375"
id="path4050-2-7-9-4-0-9"
style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
transform="matrix(2,0,0,2,-586,-765.967)"
sodipodi:nodetypes="ccccscccsc"
id="path3165-7-3-1"
d="m 317.06251,365.96875 c -0.76948,0.0224 -1.52555,0.35464 -2.0625,0.90625 l -16.125,16.125 16.125,16.125 c 1.11265,1.11265 3.13735,1.11265 4.25,0 1.11265,-1.11264 1.11265,-3.13735 0,-4.25 l -11.875,-11.875 11.875,-11.875 c 0.86584,-0.83655 1.1475,-2.22114 0.6773,-3.32947 -0.47021,-1.10834 -1.66156,-1.86802 -2.8648,-1.82678 z"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;opacity:0.35;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans"
inkscape:connector-curvature="0" />
<path
transform="matrix(2,0,0,2,-586,-765.967)"
sodipodi:nodetypes="ccccccc"
id="path3165-7-3-1-9"
d="m 320.08435,397.03059 c 0.007,-0.79449 -0.27079,-1.59203 -0.83434,-2.15559 L 307.37501,383 m 12.5523,-15.20447 c -0.47021,-1.10834 -1.66156,-1.86802 -2.8648,-1.82678 -0.76948,0.0224 -1.52555,0.35464 -2.0625,0.90625 L 298.87501,383"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@ -29,8 +29,6 @@
<chapter>
<title>Search</title>
<xi:include href="xml/shell-app-system.xml"/>
<xi:include href="xml/shell-contact-system.xml"/>
<xi:include href="xml/shell-doc-system.xml"/>
</chapter>
<chapter>
<title>Tray Icons</title>
@ -42,7 +40,6 @@
<chapter>
<title>Recorder</title>
<xi:include href="xml/shell-recorder.xml"/>
<xi:include href="xml/shell-recorder-src.xml"/>
</chapter>
<chapter>
<title>Integration helpers and utilities</title>

View File

@ -1,3 +1,4 @@
NULL =
EXTRA_DIST = misc/config.js.in
CLEANFILES = misc/config.js
@ -17,11 +18,10 @@ jsdir = $(pkgdatadir)/js
nobase_dist_js_DATA = \
gdm/batch.js \
gdm/consoleKit.js \
gdm/fingerprint.js \
gdm/loginDialog.js \
gdm/powerMenu.js \
gdm/systemd.js \
gdm/realmd.js \
gdm/util.js \
extensionPrefs/main.js \
misc/config.js \
@ -30,6 +30,7 @@ nobase_dist_js_DATA = \
misc/gnomeSession.js \
misc/history.js \
misc/jsParse.js \
misc/loginManager.js \
misc/modemManager.js \
misc/params.js \
misc/util.js \
@ -37,8 +38,6 @@ nobase_dist_js_DATA = \
ui/altTab.js \
ui/appDisplay.js \
ui/appFavorites.js \
ui/automountManager.js \
ui/autorunManager.js \
ui/boxpointer.js \
ui/calendar.js \
ui/checkBox.js \
@ -47,14 +46,14 @@ nobase_dist_js_DATA = \
ui/dateMenu.js \
ui/dnd.js \
ui/endSessionDialog.js \
ui/environment.js \
ui/extensionSystem.js \
ui/extensionDownloader.js \
ui/environment.js \
ui/flashspot.js \
ui/ibusCandidatePopup.js\
ui/grabHelper.js \
ui/iconGrid.js \
ui/keyboard.js \
ui/keyringPrompt.js \
ui/layout.js \
ui/lightbox.js \
ui/lookingGlass.js \
@ -63,7 +62,6 @@ nobase_dist_js_DATA = \
ui/main.js \
ui/messageTray.js \
ui/modalDialog.js \
ui/networkAgent.js \
ui/sessionMode.js \
ui/shellEntry.js \
ui/shellMountOperation.js \
@ -71,8 +69,7 @@ nobase_dist_js_DATA = \
ui/overview.js \
ui/panel.js \
ui/panelMenu.js \
ui/placeDisplay.js \
ui/polkitAuthenticationAgent.js \
ui/pointerWatcher.js \
ui/popupMenu.js \
ui/remoteSearch.js \
ui/runDialog.js \
@ -83,11 +80,11 @@ nobase_dist_js_DATA = \
ui/shellDBus.js \
ui/status/accessibility.js \
ui/status/keyboard.js \
ui/status/lockScreenMenu.js \
ui/status/network.js \
ui/status/power.js \
ui/status/volume.js \
ui/status/bluetooth.js \
ui/telepathyClient.js \
ui/tweener.js \
ui/unlockDialog.js \
ui/userMenu.js \
@ -99,4 +96,14 @@ nobase_dist_js_DATA = \
ui/workspaceThumbnail.js \
ui/workspacesView.js \
ui/workspaceSwitcherPopup.js \
ui/xdndHandler.js
ui/xdndHandler.js \
ui/components/__init__.js \
ui/components/autorunManager.js \
ui/components/automountManager.js \
ui/components/mediaKeysManager.js \
ui/components/networkAgent.js \
ui/components/polkitAgent.js \
ui/components/recorder.js \
ui/components/telepathyClient.js \
ui/components/keyring.js \
$(NULL)

View File

@ -174,7 +174,7 @@ const Application = new Lang.Class({
let renderer = new Gtk.CellRendererText();
this._extensionSelector.pack_start(renderer, true);
this._extensionSelector.add_attribute(renderer, 'text', 1);
this._extensionSelector.set_cell_data_func(renderer, Lang.bind(this, this._setExtensionInsensitive), null);
this._extensionSelector.set_cell_data_func(renderer, Lang.bind(this, this._setExtensionInsensitive));
this._extensionSelector.connect('changed', Lang.bind(this, this._extensionSelected));
toolitem = new Gtk.ToolItem({ child: this._extensionSelector });

View File

@ -1,22 +0,0 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const ConsoleKitManagerIface = <interface name='org.freedesktop.ConsoleKit.Manager'>
<method name='CanRestart'>
<arg type='b' direction='out'/>
</method>
<method name='CanStop'>
<arg type='b' direction='out'/>
</method>
<method name='Restart' />
<method name='Stop' />
</interface>;
const ConsoleKitProxy = Gio.DBusProxy.makeProxyWrapper(ConsoleKitManagerIface);
function ConsoleKitManager() {
return new ConsoleKitProxy(Gio.DBus.system,
'org.freedesktop.ConsoleKit',
'/org/freedesktop/ConsoleKit/Manager');
};

View File

@ -19,8 +19,7 @@ function FprintManager() {
g_interface_info: FprintManagerInfo,
g_name: 'net.reactivated.Fprint',
g_object_path: '/net/reactivated/Fprint/Manager',
g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START |
Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
g_flags: (Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
self.init(null);
return self;

View File

@ -25,6 +25,7 @@ const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
const Lang = imports.lang;
const Pango = imports.gi.Pango;
const Signals = imports.signals;
@ -38,12 +39,14 @@ const GdmUtil = imports.gdm.util;
const Lightbox = imports.ui.lightbox;
const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
const PanelMenu = imports.ui.panelMenu;
const Tweener = imports.ui.tweener;
const UserMenu = imports.ui.userMenu;
const _RESIZE_ANIMATION_TIME = 0.25;
const _SCROLL_ANIMATION_TIME = 0.5;
const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0;
const _LOGO_ICON_NAME_SIZE = 48;
const _LOGO_ICON_HEIGHT = 16;
let _loginDialog = null;
@ -80,6 +83,36 @@ function _smoothlyResizeActor(actor, width, height) {
return hold;
}
const LogoMenuButton = new Lang.Class({
Name: 'LogoMenuButton',
Extends: PanelMenu.Button,
_init: function() {
this.parent(0.0, null, true);
this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed::' + GdmUtil.LOGO_KEY,
Lang.bind(this, this._updateLogo));
this._iconBin = new St.Bin();
this.actor.add_actor(this._iconBin);
this._updateLogo();
},
_updateLogo: function() {
let path = this._settings.get_string(GdmUtil.LOGO_KEY);
let icon = null;
if (path) {
let file = Gio.file_new_for_path(path);
let cache = St.TextureCache.get_default();
icon = cache.load_uri_async(file.get_uri(), -1, _LOGO_ICON_HEIGHT);
}
this._iconBin.set_child(icon);
}
});
const UserListItem = new Lang.Class({
Name: 'UserListItem',
@ -96,14 +129,15 @@ const UserListItem = new Lang.Class({
x_align: St.Align.START,
x_fill: true });
this._iconBin = new St.Bin();
layout.add(this._iconBin);
this._userAvatar = new UserMenu.UserAvatarWidget(this.user,
{ styleClass: 'login-dialog-user-list-item-icon' });
layout.add(this._userAvatar.actor);
let textLayout = new St.BoxLayout({ style_class: 'login-dialog-user-list-item-text-box',
vertical: true });
layout.add(textLayout, { expand: true });
this._nameLabel = new St.Label({ text: this.user.get_real_name(),
style_class: 'login-dialog-user-list-item-name' });
this._nameLabel = new St.Label({ style_class: 'login-dialog-user-list-item-name' });
this.actor.label_actor = this._nameLabel;
textLayout.add(this._nameLabel,
{ y_fill: false,
y_align: St.Align.MIDDLE,
@ -117,63 +151,16 @@ const UserListItem = new Lang.Class({
y_fill: false,
y_align: St.Align.END });
this._updateIcon();
this._updateLoggedIn();
this.actor.connect('clicked', Lang.bind(this, this._onClicked));
this._onUserChanged();
},
_onUserChanged: function() {
this._nameLabel.set_text(this.user.get_real_name());
this._updateIcon();
this._userAvatar.update();
this._updateLoggedIn();
},
_setIconFromFile: function(iconFile, styleClass) {
if (styleClass)
this._iconBin.set_style_class_name(styleClass);
this._iconBin.set_style(null);
this._iconBin.child = null;
if (iconFile) {
this._iconBin.show();
// We use background-image instead of, say, St.TextureCache
// so the theme writers can add a rounded frame around the image
// and so theme writers can pick the icon size.
this._iconBin.set_style('background-image: url("' + iconFile + '");' +
'background-size: contain;');
} else {
this._iconBin.hide();
}
},
_setIconFromName: function(iconName, styleClass) {
if (styleClass)
this._iconBin.set_style_class_name(styleClass);
this._iconBin.set_style(null);
if (iconName != null) {
let icon = new St.Icon();
icon.set_icon_name(iconName)
this._iconBin.child = icon;
this._iconBin.show();
} else {
this._iconBin.child = null;
this._iconBin.hide();
}
},
_updateIcon: function() {
let iconFileName = this.user.get_icon_file();
let gicon = null;
if (GLib.file_test(iconFileName, GLib.FileTest.EXISTS))
this._setIconFromFile(iconFileName, 'login-dialog-user-list-item-icon');
else
this._setIconFromName('avatar-default', 'login-dialog-user-list-item-icon');
},
syncStyleClasses: function() {
this._updateLoggedIn();
@ -194,14 +181,6 @@ const UserListItem = new Lang.Class({
this.emit('activate');
},
fadeOutName: function() {
return GdmUtil.fadeOutActor(this._nameLabel);
},
fadeInName: function() {
return GdmUtil.fadeInActor(this._nameLabel);
},
showTimedLoginIndicator: function(time) {
let hold = new Batch.Hold();
@ -252,16 +231,18 @@ const UserList = new Lang.Class({
if (global.stage.get_key_focus() != this.actor)
return;
this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
let focusSet = this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
if (!focusSet) {
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
this._moveFocusToItems();
return false;
}));
}
},
_showItem: function(item) {
let tasks = [function() {
return GdmUtil.fadeInActor(item.actor);
},
function() {
return item.fadeInName();
}];
let batch = new Batch.ConsecutiveBatch(this, tasks);
@ -325,13 +306,16 @@ const UserList = new Lang.Class({
});
}
this._box.remove_style_pseudo_class('expanded');
let batch = new Batch.ConsecutiveBatch(this,
[function() {
return GdmUtil.fadeOutActor(this.actor.vscroll);
},
new Batch.ConcurrentBatch(this, tasks)
new Batch.ConcurrentBatch(this, tasks),
function() {
this._box.remove_style_pseudo_class('expanded');
}
]);
return batch.run();
@ -381,7 +365,6 @@ const UserList = new Lang.Class({
});
}
this._box.add_style_pseudo_class('expanded');
let batch = new Batch.ConsecutiveBatch(this,
[function() {
this.takeOverWhitespace();
@ -392,6 +375,10 @@ const UserList = new Lang.Class({
return _smoothlyResizeActor(this._box, -1, fullHeight);
},
function() {
this._box.add_style_pseudo_class('expanded');
},
new Batch.ConcurrentBatch(this, tasks),
function() {
@ -517,6 +504,7 @@ const SessionListItem = new Lang.Class({
let label = new St.Label({ style_class: 'login-dialog-session-list-item-label',
text: name });
this.actor.label_actor = label;
this._box.add_actor(label);
},
@ -671,8 +659,8 @@ const LoginDialog = new Lang.Class({
_init: function(parentActor) {
this.parent({ shellReactive: true,
styleClass: 'login-dialog',
parentActor: parentActor
});
parentActor: parentActor,
shouldFadeIn: false });
this.connect('destroy',
Lang.bind(this, this._onDestroy));
this.connect('opened',
@ -681,36 +669,34 @@ const LoginDialog = new Lang.Class({
this._userManager = AccountsService.UserManager.get_default()
this._greeterClient = new Gdm.Client();
this._greeter = this._greeterClient.get_greeter_sync(null);
if (GLib.getenv('GDM_GREETER_TEST') != '1') {
this._greeter = this._greeterClient.get_greeter_sync(null);
this._greeter.connect('default-session-name-changed',
Lang.bind(this, this._onDefaultSessionChanged));
this._greeter.connect('default-session-name-changed',
Lang.bind(this, this._onDefaultSessionChanged));
this._greeter.connect('session-opened',
Lang.bind(this, this._onSessionOpened));
this._greeter.connect('timed-login-requested',
Lang.bind(this, this._onTimedLoginRequested));
this._greeter.connect('session-opened',
Lang.bind(this, this._onSessionOpened));
this._greeter.connect('timed-login-requested',
Lang.bind(this, this._onTimedLoginRequested));
}
this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient);
this._userVerifier.connect('ask-question', Lang.bind(this, this._askQuestion));
this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
this._userVerifier.connect('show-fingerprint-prompt', Lang.bind(this, this._showFingerprintPrompt));
this._userVerifier.connect('hide-fingerprint-prompt', Lang.bind(this, this._hideFingerprintPrompt));
this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
this._userVerifier.connect('reset', Lang.bind(this, this._reset));
this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
this._verifyingUser = false;
this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed::' + GdmUtil.LOGO_KEY,
Lang.bind(this, this._updateLogo));
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_KEY,
Lang.bind(this, this._updateBanner));
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_TEXT_KEY,
Lang.bind(this, this._updateBanner));
this._logoBox = new St.Bin({ style_class: 'login-dialog-logo-box' });
this.contentLayout.add(this._logoBox);
this._updateLogo();
this._settings.connect('changed::' + GdmUtil.DISABLE_USER_LIST_KEY,
Lang.bind(this, this._updateDisableUserList));
this._bannerLabel = new St.Label({ style_class: 'login-dialog-banner',
text: '' });
@ -718,37 +704,30 @@ const LoginDialog = new Lang.Class({
this._updateBanner();
this._titleLabel = new St.Label({ style_class: 'login-dialog-title',
text: C_("title", "Sign In") });
text: C_("title", "Sign In"),
visible: false });
this.contentLayout.add(this._titleLabel,
{ y_fill: false,
y_align: St.Align.START });
let mainContentBox = new St.BoxLayout({ vertical: false });
this.contentLayout.add(mainContentBox,
this._userList = new UserList();
this.contentLayout.add(this._userList.actor,
{ expand: true,
x_fill: true,
y_fill: false });
this._userList = new UserList();
mainContentBox.add(this._userList.actor,
{ expand: true,
x_fill: true,
y_fill: true });
y_fill: true });
this.setInitialKeyFocus(this._userList.actor);
this._promptBox = new St.BoxLayout({ style_class: 'login-dialog-prompt-layout',
vertical: true });
mainContentBox.add(this._promptBox,
{ expand: true,
x_fill: true,
y_fill: true,
x_align: St.Align.START });
this.contentLayout.add(this._promptBox,
{ expand: true,
x_fill: true,
y_fill: true,
x_align: St.Align.START });
this._promptLabel = new St.Label({ style_class: 'login-dialog-prompt-label' });
this._mainContentBox = mainContentBox;
this._promptBox.add(this._promptLabel,
{ expand: true,
x_fill: true,
@ -756,17 +735,19 @@ const LoginDialog = new Lang.Class({
x_align: St.Align.START });
this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
can_focus: true });
this._promptEntryTextChangedId = 0;
this._promptBox.add(this._promptEntry,
{ expand: true,
x_fill: true,
y_fill: false,
x_align: St.Align.START });
// Translators: this message is shown below the password entry field
// to indicate the user can swipe their finger instead
this._promptFingerprintMessage = new St.Label({ text: _("(or swipe finger)"),
style_class: 'login-dialog-prompt-fingerprint-message' });
this._promptFingerprintMessage.hide();
this._promptBox.add(this._promptFingerprintMessage);
this._promptMessage = new St.Label({ visible: false });
this._promptBox.add(this._promptMessage, { x_fill: true });
this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint-message' });
this._promptLoginHint.hide();
this._promptBox.add(this._promptLoginHint);
this._sessionList = new SessionList();
this._sessionList.connect('session-activated',
@ -793,7 +774,7 @@ const LoginDialog = new Lang.Class({
x_align: St.Align.START,
x_fill: true });
this._notListedButton.connect('clicked', Lang.bind(this, this._onNotListedClicked));
this._notListedButton.connect('clicked', Lang.bind(this, this._hideUserListAndLogIn));
this.contentLayout.add(this._notListedButton,
{ expand: false,
@ -819,18 +800,19 @@ const LoginDialog = new Lang.Class({
},
_updateLogo: function() {
this._logoBox.child = null;
let path = this._settings.get_string(GdmUtil.LOGO_KEY);
_updateDisableUserList: function() {
let disableUserList = this._settings.get_boolean(GdmUtil.DISABLE_USER_LIST_KEY);
if (path) {
let file = Gio.file_new_for_path(path);
let uri = file.get_uri();
// If this is the first time around, set initial focus
if (this._disableUserList == undefined && disableUserList)
this.setInitialKeyFocus(this._promptEntry);
let textureCache = St.TextureCache.get_default();
this._logoBox.child = textureCache.load_uri_async(uri, -1, _LOGO_ICON_NAME_SIZE);
if (disableUserList != this._disableUserList) {
this._disableUserList = disableUserList;
if (!this._verifyingUser)
this._reset();
}
},
_updateBanner: function() {
@ -845,42 +827,39 @@ const LoginDialog = new Lang.Class({
}
},
_onReset: function(client, serviceName) {
let tasks = [this._hidePrompt,
new Batch.ConcurrentBatch(this, [this._fadeInTitleLabel,
this._fadeInNotListedButton,
this._fadeInLogo]),
function() {
this._sessionList.close();
this._promptFingerprintMessage.hide();
this._userList.actor.show();
this._userList.actor.opacity = 255;
return this._userList.showItems();
},
function() {
this._userList.actor.reactive = true;
this._userList.actor.grab_key_focus();
}];
_reset: function() {
this._promptMessage.hide();
this._user = null;
this._verifyingUser = false;
let batch = new Batch.ConsecutiveBatch(this, tasks);
batch.run();
if (this._disableUserList)
this._hideUserListAndLogIn();
else
this._showUserList();
},
_onDefaultSessionChanged: function(client, sessionId) {
this._sessionList.setActiveSession(sessionId);
},
_showFingerprintPrompt: function() {
GdmUtil.fadeInActor(this._promptFingerprintMessage);
_showMessage: function(userVerifier, message, styleClass) {
if (message) {
this._promptMessage.text = message;
this._promptMessage.styleClass = styleClass;
GdmUtil.fadeInActor(this._promptMessage);
} else {
GdmUtil.fadeOutActor(this._promptMessage);
}
},
_hideFingerprintPrompt: function() {
GdmUtil.fadeOutActor(this._promptFingerprintMessage);
_showLoginHint: function(verifier, message) {
this._promptLoginHint.set_text(message)
GdmUtil.fadeInActor(this._promptLoginHint);
},
_hideLoginHint: function() {
GdmUtil.fadeOutActor(this._promptLoginHint);
this._promptLoginHint.set_text('');
},
cancel: function() {
@ -899,8 +878,8 @@ const LoginDialog = new Lang.Class({
function() {
// Show it with 0 opacity so we preallocate space for it
// in the event we need to fade in the message
this._promptFingerprintMessage.opacity = 0;
this._promptFingerprintMessage.show();
this._promptLoginHint.opacity = 0;
this._promptLoginHint.show();
},
function() {
@ -911,6 +890,9 @@ const LoginDialog = new Lang.Class({
if (this._user && this._user.is_logged_in())
return null;
if (!this._verifyingUser)
return null;
return GdmUtil.fadeInActor(this._sessionList.actor);
},
@ -923,26 +905,21 @@ const LoginDialog = new Lang.Class({
return batch.run();
},
_showPrompt: function() {
_showPrompt: function(forSecret) {
let hold = new Batch.Hold();
let buttons = [{ action: Lang.bind(this, this.cancel),
label: _("Cancel"),
key: Clutter.Escape },
{ action: Lang.bind(this, function() {
hold.release();
}),
label: C_("button", "Sign In"),
default: true }];
this._promptEntryActivateCallbackId = this._promptEntry.clutter_text.connect('activate',
Lang.bind(this, function() {
hold.release();
}));
hold.connect('release', Lang.bind(this, function() {
this._promptEntry.clutter_text.disconnect(this._promptEntryActivateCallbackId);
this._promptEntryActivateCallbackId = null;
}));
let cancelButtonInfo = { action: Lang.bind(this, this.cancel),
label: _("Cancel"),
key: Clutter.Escape };
let okButtonInfo = { action: Lang.bind(this, function() {
hold.release();
}),
label: forSecret ? C_("button", "Sign In") : _("Next"),
default: true };
let buttons = [];
if (!this._disableUserList || this._verifyingUser)
buttons.push(cancelButtonInfo);
buttons.push(okButtonInfo);
let tasks = [function() {
return this._fadeInPrompt();
@ -950,6 +927,16 @@ const LoginDialog = new Lang.Class({
function() {
this.setButtons(buttons);
let updateOkButtonEnabled = Lang.bind(this, function() {
let sensitive = this._promptEntry.text.length > 0;
okButtonInfo.button.reactive = sensitive;
okButtonInfo.button.can_focus = sensitive;
});
updateOkButtonEnabled();
this._promptEntryTextChangedId = this._promptEntry.clutter_text.connect('text-changed', updateOkButtonEnabled);
},
hold];
@ -960,21 +947,20 @@ const LoginDialog = new Lang.Class({
},
_hidePrompt: function() {
if (this._promptEntryActivateCallbackId) {
this._promptEntry.clutter_text.disconnect(this._promptEntryActivateCallbackId);
this._promptEntryActivateCallbackId = null;
}
this.setButtons([]);
if (this._promptEntryTextChangedId > 0) {
this._promptEntry.clutter_text.disconnect(this._promptEntryTextChangedId);
this._promptEntryTextChangedId = 0;
}
let tasks = [function() {
return GdmUtil.fadeOutActor(this._promptBox);
},
function() {
this._promptFingerprintMessage.hide();
this._promptLoginHint.hide();
this._promptEntry.reactive = true;
this._promptEntry.remove_style_pseudo_class('insensitive');
this._promptEntry.set_text('');
}];
@ -989,12 +975,13 @@ const LoginDialog = new Lang.Class({
this._promptEntry.set_text('');
this._promptEntry.clutter_text.set_password_char(passwordChar);
let tasks = [this._showPrompt,
let tasks = [function() {
return this._showPrompt(!!passwordChar);
},
function() {
let _text = this._promptEntry.get_text();
this._promptEntry.reactive = false;
this._promptEntry.add_style_pseudo_class('insensitive');
this._userVerifier.answerQuery(serviceName, _text);
}];
@ -1002,6 +989,23 @@ const LoginDialog = new Lang.Class({
return batch.run();
},
_askForUsernameAndLogIn: function() {
this._promptLabel.set_text(_("Username: "));
this._promptEntry.set_text('');
this._promptEntry.clutter_text.set_password_char('');
let tasks = [this._showPrompt,
function() {
let userName = this._promptEntry.get_text();
this._promptEntry.reactive = false;
return this._beginVerificationForUser(userName);
}];
let batch = new Batch.ConsecutiveBatch(this, tasks);
return batch.run();
},
_onSessionOpened: function(client, serviceName) {
this._greeter.call_start_session_when_ready_sync(serviceName, true, null);
},
@ -1130,11 +1134,7 @@ const LoginDialog = new Lang.Class({
}));
},
_onVerificationFailed: function() {
this._userVerifier.cancel();
},
_onNotListedClicked: function(user) {
_hideUserListAndLogIn: function() {
let tasks = [function() {
return this._userList.hideItems();
},
@ -1148,26 +1148,37 @@ const LoginDialog = new Lang.Class({
},
new Batch.ConcurrentBatch(this, [this._fadeOutTitleLabel,
this._fadeOutNotListedButton,
this._fadeOutLogo]),
this._fadeOutNotListedButton]),
function() {
let hold = new Batch.Hold();
this._userVerifier.begin(null, hold);
return hold;
return this._askForUsernameAndLogIn();
}];
let batch = new Batch.ConsecutiveBatch(this, tasks);
batch.run();
},
_fadeInLogo: function() {
return GdmUtil.fadeInActor(this._logoBox);
},
_showUserList: function() {
let tasks = [this._hidePrompt,
_fadeOutLogo: function() {
return GdmUtil.fadeOutActor(this._logoBox);
new Batch.ConcurrentBatch(this, [this._fadeInTitleLabel,
this._fadeInNotListedButton]),
function() {
this._sessionList.close();
this._promptLoginHint.hide();
this._userList.actor.show();
this._userList.actor.opacity = 255;
return this._userList.showItems();
},
function() {
this._userList.actor.reactive = true;
this._userList.actor.grab_key_focus();
}];
let batch = new Batch.ConsecutiveBatch(this, tasks);
batch.run();
},
_fadeInBanner: function() {
@ -1198,6 +1209,7 @@ const LoginDialog = new Lang.Class({
let hold = new Batch.Hold();
this._userVerifier.begin(userName, hold);
this._verifyingUser = true;
return hold;
},
@ -1217,13 +1229,8 @@ const LoginDialog = new Lang.Class({
return this._userList.giveUpWhitespace();
},
function() {
return activatedItem.fadeOutName();
},
new Batch.ConcurrentBatch(this, [this._fadeOutTitleLabel,
this._fadeOutNotListedButton,
this._fadeOutLogo]),
this._fadeOutNotListedButton]),
function() {
return this._userList.shrinkToNaturalHeight();
@ -1255,6 +1262,8 @@ const LoginDialog = new Lang.Class({
this._userList.addUser(users[i]);
}
this._updateDisableUserList();
this._userManager.connect('user-added',
Lang.bind(this, function(userManager, user) {
this._userList.addUser(user);
@ -1276,7 +1285,7 @@ const LoginDialog = new Lang.Class({
},
_onOpened: function() {
Main.ctrlAltTabManager.addGroup(this._mainContentBox,
Main.ctrlAltTabManager.addGroup(this.dialogLayout,
_("Login Window"),
'dialog-password',
{ sortGroup: CtrlAltTab.SortGroup.MIDDLE });

View File

@ -18,12 +18,12 @@
* 02111-1307, USA.
*/
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const UPowerGlib = imports.gi.UPowerGlib;
const ConsoleKit = imports.gdm.consoleKit;
const Systemd = imports.gdm.systemd;
const LoginManager = imports.misc.loginManager;
const GdmUtil = imports.gdm.util;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
@ -32,20 +32,17 @@ const PowerMenuButton = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent('system-shutdown', null);
this._upClient = new UPowerGlib.Client();
/* Translators: accessible name of the power menu in the login screen */
this.parent('system-shutdown-symbolic', _("Power"));
if (Systemd.haveSystemd())
this._systemdLoginManager = new Systemd.SystemdLoginManager();
else
this._consoleKitManager = new ConsoleKit.ConsoleKitManager();
this._loginManager = LoginManager.getLoginManager();
this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed::disable-restart-buttons',
Lang.bind(this, this._updateVisibility));
this._createSubMenu();
this._upClient.connect('notify::can-suspend',
Lang.bind(this, this._updateHaveSuspend));
this._updateHaveSuspend();
// ConsoleKit doesn't send notifications when shutdown/reboot
// are disabled, so we update the menu item each time the menu opens
this.menu.connect('open-state-changed', Lang.bind(this,
@ -53,75 +50,41 @@ const PowerMenuButton = new Lang.Class({
if (open) {
this._updateHaveShutdown();
this._updateHaveRestart();
this._updateHaveSuspend();
}
}));
this._updateHaveShutdown();
this._updateHaveRestart();
this._updateHaveSuspend();
},
_updateVisibility: function() {
let shouldBeVisible = (this._haveSuspend || this._haveShutdown || this._haveRestart);
this.actor.visible = shouldBeVisible;
this.actor.visible = shouldBeVisible && !this._settings.get_boolean('disable-restart-buttons');
},
_updateHaveShutdown: function() {
if (Systemd.haveSystemd()) {
this._systemdLoginManager.CanPowerOffRemote(Lang.bind(this,
function(result, error) {
if (!error)
this._haveShutdown = result[0] != 'no';
else
this._haveShutdown = false;
this._powerOffItem.actor.visible = this._haveShutdown;
this._updateVisibility();
}));
} else {
this._consoleKitManager.CanStopRemote(Lang.bind(this,
function(result, error) {
if (!error)
this._haveShutdown = result[0];
else
this._haveShutdown = false;
this._powerOffItem.actor.visible = this._haveShutdown;
this._updateVisibility();
}));
}
this._loginManager.canPowerOff(Lang.bind(this, function(result) {
this._haveShutdown = result;
this._powerOffItem.actor.visible = this._haveShutdown;
this._updateVisibility();
}));
},
_updateHaveRestart: function() {
if (Systemd.haveSystemd()) {
this._systemdLoginManager.CanRebootRemote(Lang.bind(this,
function(result, error) {
if (!error)
this._haveRestart = result[0] != 'no';
else
this._haveRestart = false;
this._restartItem.actor.visible = this._haveRestart;
this._updateVisibility();
}));
} else {
this._consoleKitManager.CanRestartRemote(Lang.bind(this,
function(result, error) {
if (!error)
this._haveRestart = result[0];
else
this._haveRestart = false;
this._restartItem.actor.visible = this._haveRestart;
this._updateVisibility();
}));
}
this._loginManager.canReboot(Lang.bind(this, function(result) {
this._haveRestart = result;
this._restartItem.actor.visible = this._haveRestart;
this._updateVisibility();
}));
},
_updateHaveSuspend: function() {
this._haveSuspend = this._upClient.get_can_suspend();
this._suspendItem.actor.visible = this._haveSuspend;
this._updateVisibility();
this._loginManager.canSuspend(Lang.bind(this, function(result) {
this._haveSuspend = result;
this._suspendItem.actor.visible = this._haveSuspend;
this._updateVisibility();
}));
},
_createSubMenu: function() {
@ -144,27 +107,23 @@ const PowerMenuButton = new Lang.Class({
},
_onActivateSuspend: function() {
if (this._haveSuspend)
this._upClient.suspend_sync(null);
if (!this._haveSuspend)
return;
this._loginManager.suspend();
},
_onActivateRestart: function() {
if (!this._haveRestart)
return;
if (Systemd.haveSystemd())
this._systemdLoginManager.RebootRemote(true);
else
this._consoleKitManager.RestartRemote();
this._loginManager.reboot();
},
_onActivatePowerOff: function() {
if (!this._haveShutdown)
return;
if (Systemd.haveSystemd())
this._systemdLoginManager.PowerOffRemote(true);
else
this._consoleKitManager.StopRemote();
this._loginManager.powerOff();
}
});

139
js/gdm/realmd.js Normal file
View File

@ -0,0 +1,139 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const Signals = imports.signals;
const ProviderIface = <interface name='org.freedesktop.realmd.Provider'>
<property name="Name" type="s" access="read"/>
<property name="Version" type="s" access="read"/>
<property name="Realms" type="ao" access="read"/>
<method name="Discover">
<arg name="string" type="s" direction="in"/>
<arg name="options" type="a{sv}" direction="in"/>
<arg name="relevance" type="i" direction="out"/>
<arg name="realm" type="ao" direction="out"/>
</method>
</interface>;
const Provider = Gio.DBusProxy.makeProxyWrapper(ProviderIface);
const ServiceIface = <interface name="org.freedesktop.realmd.Service">
<method name="Cancel">
<arg name="operation" type="s" direction="in"/>
</method>
<method name="Release" />
<method name="SetLocale">
<arg name="locale" type="s" direction="in"/>
</method>
<signal name="Diagnostics">
<arg name="data" type="s"/>
<arg name="operation" type="s"/>
</signal>
</interface>;
const Service = Gio.DBusProxy.makeProxyWrapper(ServiceIface);
const RealmIface = <interface name="org.freedesktop.realmd.Realm">
<property name="Name" type="s" access="read"/>
<property name="Configured" type="s" access="read"/>
<property name="Details" type="a(ss)" access="read"/>
<property name="LoginFormats" type="as" access="read"/>
<property name="LoginPolicy" type="s" access="read"/>
<property name="PermittedLogins" type="as" access="read"/>
<property name="SupportedInterfaces" type="as" access="read"/>
<method name="ChangeLoginPolicy">
<arg name="login_policy" type="s" direction="in"/>
<arg name="permitted_add" type="as" direction="in"/>
<arg name="permitted_remove" type="as" direction="in"/>
<arg name="options" type="a{sv}" direction="in"/>
</method>
<method name="Deconfigure">
<arg name="options" type="a{sv}" direction="in"/>
</method>
</interface>;
const Realm = Gio.DBusProxy.makeProxyWrapper(RealmIface);
const Manager = new Lang.Class({
Name: 'Manager',
_init: function(parentActor) {
this._aggregateProvider = Provider(Gio.DBus.system,
'org.freedesktop.realmd',
'/org/freedesktop/realmd',
Lang.bind(this, this._reloadRealms))
this._realms = {};
this._aggregateProvider.connect('g-properties-changed',
Lang.bind(this, function(proxy, properties) {
if ('Realms' in properties.deep_unpack())
this._reloadRealms();
}));
},
_reloadRealms: function() {
let realmPaths = this._aggregateProvider.Realms;
if (!realmPaths)
return;
for (let i = 0; i < realmPaths.length; i++) {
let realm = Realm(Gio.DBus.system,
'org.freedesktop.realmd',
realmPaths[i],
Lang.bind(this, this._onRealmLoaded));
}
},
_reloadRealm: function(realm) {
if (!realm.Configured) {
if (this._realms[realm.get_object_path()])
delete this._realms[realm.get_object_path()];
return;
}
this._realms[realm.get_object_path()] = realm;
this._updateLoginFormat();
},
_onRealmLoaded: function(realm, error) {
if (error)
return;
this._reloadRealm(realm);
realm.connect('g-properties-changed',
Lang.bind(this, function(proxy, properties) {
if ('Configured' in properties.deep_unpack())
this._reloadRealm();
}));
},
_updateLoginFormat: function() {
let newLoginFormat;
for (let realmPath in this._realms) {
let realm = this._realms[realmPath];
if (realm.LoginFormats && realm.LoginFormats.length > 0) {
newLoginFormat = realm.LoginFormats[0];
break;
}
}
if (this._loginFormat != newLoginFormat) {
this._loginFormat = newLoginFormat;
this.emit('login-format-changed', newLoginFormat);
}
},
get loginFormat() {
if (this._loginFormat !== undefined)
return this._loginFormat;
this._updateLoginFormat();
return this._loginFormat;
}
});
Signals.addSignalMethods(Manager.prototype)

View File

@ -1,31 +0,0 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const SystemdLoginManagerIface = <interface name='org.freedesktop.login1.Manager'>
<method name='PowerOff'>
<arg type='b' direction='in'/>
</method>
<method name='Reboot'>
<arg type='b' direction='in'/>
</method>
<method name='CanPowerOff'>
<arg type='s' direction='out'/>
</method>
<method name='CanReboot'>
<arg type='s' direction='out'/>
</method>
</interface>;
const SystemdLoginManagerProxy = Gio.DBusProxy.makeProxyWrapper(SystemdLoginManagerIface);
function SystemdLoginManager() {
return new SystemdLoginManagerProxy(Gio.DBus.system,
'org.freedesktop.login1',
'/org/freedesktop/login1');
};
function haveSystemd() {
return GLib.access("/sys/fs/cgroup/systemd", 0) >= 0;
}

View File

@ -2,10 +2,12 @@
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
const Batch = imports.gdm.batch;
const Fprint = imports.gdm.fingerprint;
const Realmd = imports.gdm.realmd;
const Main = imports.ui.main;
const Params = imports.misc.params;
const Tweener = imports.ui.tweener;
@ -18,8 +20,10 @@ const LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen';
const FINGERPRINT_AUTHENTICATION_KEY = 'enable-fingerprint-authentication';
const BANNER_MESSAGE_KEY = 'banner-message-enable';
const BANNER_MESSAGE_TEXT_KEY = 'banner-message-text';
const ALLOWED_FAILURES_KEY = 'allowed-failures';
const LOGO_KEY = 'logo';
const DISABLE_USER_LIST_KEY = 'disable-user-list';
function fadeInActor(actor) {
if (actor.opacity == 255 && actor.visible)
@ -78,16 +82,19 @@ const ShellUserVerifier = new Lang.Class({
this._settings = new Gio.Settings({ schema: LOGIN_SCREEN_SCHEMA });
this._cancellable = new Gio.Cancellable();
this._fprintManager = new Fprint.FprintManager();
this._checkForFingerprintReader();
this._realmManager = new Realmd.Manager();
this._failCounter = 0;
},
begin: function(userName, hold) {
this._cancellable = new Gio.Cancellable();
this._hold = hold;
this._userName = userName;
this._checkForFingerprintReader();
if (userName) {
// If possible, reauthenticate an already running session,
// so any session specific credentials get updated appropriately
@ -99,14 +106,18 @@ const ShellUserVerifier = new Lang.Class({
},
cancel: function() {
this._cancellable.cancel();
if (this._cancellable)
this._cancellable.cancel();
if (this._userVerifier)
this._userVerifier.call_cancel_sync(null);
},
clear: function() {
this._cancellable.cancel();
if (this._cancellable) {
this._cancellable.cancel();
this._cancellable = null;
}
if (this._userVerifier) {
this._userVerifier.run_dispose();
@ -115,6 +126,9 @@ const ShellUserVerifier = new Lang.Class({
},
answerQuery: function(serviceName, answer) {
// Clear any previous message
this.emit('show-message', null, null);
this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null);
},
@ -131,34 +145,48 @@ const ShellUserVerifier = new Lang.Class({
}));
},
_reportInitError: function(where, error) {
logError(error, where);
this._hold.release();
this.emit('show-message', _("Authentication error"), 'login-dialog-message-warning');
this._verificationFailed(false);
},
_reauthenticationChannelOpened: function(client, result) {
try {
this._userVerifier = client.open_reauthentication_channel_finish(result);
this._connectSignals();
this._beginVerification();
this._hold.release();
} catch (e) {
if (this._reauthOnly) {
logError(e, 'Failed to open reauthentication channel');
this._hold.release();
this.emit('verification-failed');
return;
}
// If there's no session running, or it otherwise fails, then fall back
// to performing verification from this login session
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
return;
} catch(e if e.matches(Gio.DBusError, Gio.DBusError.ACCESS_DENIED) &&
!this._reauthOnly) {
// Gdm emits org.freedesktop.DBus.Error.AccessDenied when there is
// no session to reauthenticate. Fall back to performing verification
// from this login session
client.get_user_verifier(this._cancellable, Lang.bind(this, this._userVerifierGot));
return;
} catch(e) {
this._reportInitError('Failed to open reauthentication channel', e);
return;
}
this._connectSignals();
this._beginVerification();
this._hold.release();
},
_userVerifierGot: function(client, result) {
this._userVerifier = client.get_user_verifier_finish(result);
try {
this._userVerifier = client.get_user_verifier_finish(result);
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
return;
} catch(e) {
this._reportInitError('Failed to obtain user verifier', e);
return;
}
this._connectSignals();
this._beginVerification();
this._hold.release();
},
@ -180,7 +208,15 @@ const ShellUserVerifier = new Lang.Class({
this._userName,
this._cancellable,
Lang.bind(this, function(obj, result) {
obj.call_begin_verification_for_user_finish(result);
try {
obj.call_begin_verification_for_user_finish(result);
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
return;
} catch(e) {
this._reportInitError('Failed to start verification for user', e);
return;
}
this._hold.release();
}));
@ -191,7 +227,15 @@ const ShellUserVerifier = new Lang.Class({
this._userName,
this._cancellable,
Lang.bind(this, function(obj, result) {
obj.call_begin_verification_for_user_finish(result);
try {
obj.call_begin_verification_for_user_finish(result);
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
return;
} catch(e) {
this._reportInitError('Failed to start fingerprint verification for user', e);
return;
}
this._hold.release();
}));
}
@ -199,7 +243,15 @@ const ShellUserVerifier = new Lang.Class({
this._userVerifier.call_begin_verification(PASSWORD_SERVICE_NAME,
this._cancellable,
Lang.bind(this, function(obj, result) {
obj.call_begin_verification_finish(result);
try {
obj.call_begin_verification_finish(result);
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
return;
} catch(e) {
this._reportInitError('Failed to start verification', e);
return;
}
this._hold.release();
}));
}
@ -211,9 +263,12 @@ const ShellUserVerifier = new Lang.Class({
// as a cue to display our own message.
if (serviceName == FINGERPRINT_SERVICE_NAME &&
this._haveFingerprintReader) {
this.emit('show-fingerprint-prompt');
// Translators: this message is shown below the password entry field
// to indicate the user can swipe their finger instead
this.emit('show-login-hint', _("(or swipe finger)"));
} else if (serviceName == PASSWORD_SERVICE_NAME) {
Main.notifyError(info);
this.emit('show-message', info, 'login-dialog-message-info');
}
},
@ -222,7 +277,22 @@ const ShellUserVerifier = new Lang.Class({
// users who haven't enrolled their fingerprint.
if (serviceName != PASSWORD_SERVICE_NAME)
return;
Main.notifyError(problem);
this.emit('show-message', problem, 'login-dialog-message-warning');
},
_showRealmLoginHint: function() {
if (this._realmManager.loginFormat) {
let hint = this._realmManager.loginFormat;
hint = hint.replace(/%U/g, 'user');
hint = hint.replace(/%D/g, 'DOMAIN');
hint = hint.replace(/%[^UD]/g, '');
// Translators: this message is shown below the username entry field
// to clue the user in on how to login to the local network realm
this.emit('show-login-hint',
_("(e.g., user or %s)").format(hint));
}
},
_onInfoQuery: function(client, serviceName, question) {
@ -230,6 +300,10 @@ const ShellUserVerifier = new Lang.Class({
if (serviceName != PASSWORD_SERVICE_NAME)
return;
this._showRealmLoginHint();
this._realmLoginHintSignalId = this._realmManager.connect('login-format-changed',
Lang.bind(this, this._showRealmLoginHint));
this.emit('ask-question', serviceName, question, '');
},
@ -242,10 +316,10 @@ const ShellUserVerifier = new Lang.Class({
},
_onReset: function() {
this._userVerifier.run_dispose();
this._userVerifier = null;
this.clear();
this._checkForFingerprintReader();
// Clear previous attempts to authenticate
this._failCounter = 0;
this.emit('reset');
},
@ -254,14 +328,44 @@ const ShellUserVerifier = new Lang.Class({
this.emit('verification-complete');
},
_verificationFailed: function(retry) {
// For Not Listed / enterprise logins, immediately reset
// the dialog
// Otherwise, we allow ALLOWED_FAILURES attempts. After that, we
// go back to the welcome screen.
this._failCounter++;
let canRetry = retry && this._userName &&
this._failCounter < this._settings.get_int(ALLOWED_FAILURES_KEY);
if (canRetry) {
this.clear();
this.begin(this._userName, new Batch.Hold());
} else {
// Allow some time to see the message, then reset everything
Mainloop.timeout_add(3000, Lang.bind(this, function() {
this.cancel();
this._onReset();
}));
}
this.emit('verification-failed');
},
_onConversationStopped: function(client, serviceName) {
// if the password service fails, then cancel everything.
// But if, e.g., fingerprint fails, still give
// password authentication a chance to succeed
if (serviceName == PASSWORD_SERVICE_NAME) {
this.emit('verification-failed');
} else if (serviceName == FINGERPRINT_SERVICE_NAME) {
this.emit('hide-fingerprint-prompt');
this._verificationFailed(true);
}
this.emit('hide-login-hint');
if (this._realmLoginHintSignalId) {
this._realmManager.disconnect(this._realmLoginHintSignalId);
this._realmLoginHintSignalId = 0;
}
},
});

View File

@ -120,11 +120,6 @@ function createExtensionObject(uuid, dir, type) {
}
}
// Encourage people to add this
if (!meta.url) {
log('Warning: Missing "url" property in %s/metadata.json'.format(uuid));
}
if (uuid != meta.uuid) {
throw new Error('uuid "' + meta.uuid + '" from metadata.json does not match directory name "' + uuid + '"');
}
@ -161,7 +156,8 @@ const ExtensionFinder = new Lang.Class({
try {
fileEnum = dir.enumerate_children('standard::*', Gio.FileQueryInfoFlags.NONE, null);
} catch(e) {
logError(e, 'Could not enumerate extensions directory');
if (e.domain != Gio.io_error_quark() || e.code != Gio.IOErrorEnum.NOT_FOUND)
logError(e, 'Could not enumerate extensions directory');
return;
}

View File

@ -41,24 +41,26 @@ const HistoryManager = new Lang.Class({
this._historyIndex = this._history.length;
},
prevItem: function(text) {
_setPrevItem: function(text) {
if (this._historyIndex <= 0)
return text;
return false;
if (text)
this._history[this._historyIndex] = text;
this._historyIndex--;
return this._indexChanged();
this._indexChanged();
return true;
},
nextItem: function(text) {
_setNextItem: function(text) {
if (this._historyIndex >= this._history.length)
return text;
return false;
if (text)
this._history[this._historyIndex] = text;
this._historyIndex++;
return this._indexChanged();
this._indexChanged();
return true;
},
lastItem: function() {
@ -83,11 +85,9 @@ const HistoryManager = new Lang.Class({
_onEntryKeyPress: function(entry, event) {
let symbol = event.get_key_symbol();
if (symbol == Clutter.KEY_Up) {
this.prevItem(entry.get_text());
return true;
return this._setPrevItem(entry.get_text());
} else if (symbol == Clutter.KEY_Down) {
this.nextItem(entry.get_text());
return true;
return this._setNextItem(entry.get_text());
}
return false;
},
@ -98,8 +98,6 @@ const HistoryManager = new Lang.Class({
if (this._entry)
this._entry.set_text(current);
return current;
},
_save: function() {

259
js/misc/loginManager.js Normal file
View File

@ -0,0 +1,259 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Shell = imports.gi.Shell;
const UPowerGlib = imports.gi.UPowerGlib;
const SystemdLoginManagerIface = <interface name='org.freedesktop.login1.Manager'>
<method name='PowerOff'>
<arg type='b' direction='in'/>
</method>
<method name='Reboot'>
<arg type='b' direction='in'/>
</method>
<method name='Suspend'>
<arg type='b' direction='in'/>
</method>
<method name='Hibernate'>
<arg type='b' direction='in'/>
</method>
<method name='CanPowerOff'>
<arg type='s' direction='out'/>
</method>
<method name='CanReboot'>
<arg type='s' direction='out'/>
</method>
<method name='CanSuspend'>
<arg type='s' direction='out'/>
</method>
<method name='CanHibernate'>
<arg type='s' direction='out'/>
</method>
</interface>;
const SystemdLoginSessionIface = <interface name='org.freedesktop.login1.Session'>
<signal name='Lock' />
<signal name='Unlock' />
</interface>;
const SystemdLoginManager = Gio.DBusProxy.makeProxyWrapper(SystemdLoginManagerIface);
const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIface);
const ConsoleKitManagerIface = <interface name='org.freedesktop.ConsoleKit.Manager'>
<method name='CanRestart'>
<arg type='b' direction='out'/>
</method>
<method name='CanStop'>
<arg type='b' direction='out'/>
</method>
<method name='Restart' />
<method name='Stop' />
<method name='GetCurrentSession'>
<arg type='o' direction='out' />
</method>
</interface>;
const ConsoleKitSessionIface = <interface name='org.freedesktop.ConsoleKit.Session'>
<method name='IsActive'>
<arg type='b' direction='out' />
</method>
<signal name='ActiveChanged'>
<arg type='b' direction='out' />
</signal>
<signal name='Lock' />
<signal name='Unlock' />
</interface>;
const ConsoleKitSession = Gio.DBusProxy.makeProxyWrapper(ConsoleKitSessionIface);
const ConsoleKitManager = Gio.DBusProxy.makeProxyWrapper(ConsoleKitManagerIface);
function haveSystemd() {
return GLib.access("/sys/fs/cgroup/systemd", 0) >= 0;
}
let _loginManager = null;
/**
* LoginManager:
* An abstraction over systemd/logind and ConsoleKit.
*
*/
function getLoginManager() {
if (_loginManager == null) {
if (haveSystemd())
_loginManager = new LoginManagerSystemd();
else
_loginManager = new LoginManagerConsoleKit();
}
return _loginManager;
}
const LoginManagerSystemd = new Lang.Class({
Name: 'LoginManagerSystemd',
_init: function() {
this._proxy = new SystemdLoginManager(Gio.DBus.system,
'org.freedesktop.login1',
'/org/freedesktop/login1');
},
// Having this function is a bit of a hack since the Systemd and ConsoleKit
// session objects have different interfaces - but in both cases there are
// Lock/Unlock signals, and that's all we count upon at the moment.
getCurrentSessionProxy: function() {
if (!this._currentSession) {
this._currentSession = new SystemdLoginSession(Gio.DBus.system,
'org.freedesktop.login1',
'/org/freedesktop/login1/session/' +
GLib.getenv('XDG_SESSION_ID'));
}
return this._currentSession;
},
get sessionActive() {
return Shell.session_is_active_for_systemd();
},
canPowerOff: function(asyncCallback) {
this._proxy.CanPowerOffRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0] != 'no');
});
},
canReboot: function(asyncCallback) {
this._proxy.CanRebootRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0] != 'no');
});
},
canSuspend: function(asyncCallback) {
this._proxy.CanSuspendRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0] != 'no');
});
},
canHibernate: function(asyncCallback) {
this._proxy.CanSuspendRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0] != 'no');
});
},
powerOff: function() {
this._proxy.PowerOffRemote(true);
},
reboot: function() {
this._proxy.RebootRemote(true);
},
suspend: function() {
this._proxy.SuspendRemote(true);
},
hibernate: function() {
this._proxy.HibernateRemote(true);
}
});
const LoginManagerConsoleKit = new Lang.Class({
Name: 'LoginManagerConsoleKit',
_init: function() {
this._proxy = new ConsoleKitManager(Gio.DBus.system,
'org.freedesktop.ConsoleKit',
'/org/freedesktop/ConsoleKit/Manager');
this._upClient = new UPowerGlib.Client();
},
// Having this function is a bit of a hack since the Systemd and ConsoleKit
// session objects have different interfaces - but in both cases there are
// Lock/Unlock signals, and that's all we count upon at the moment.
getCurrentSessionProxy: function() {
if (!this._currentSession) {
let [currentSessionId] = this._proxy.GetCurrentSessionSync();
this._currentSession = new ConsoleKitSession(Gio.DBus.system,
'org.freedesktop.ConsoleKit',
currentSessionId);
}
return this._currentSession;
},
get sessionActive() {
if (this._sessionActive !== undefined)
return this._sessionActive;
let session = this.getCurrentSessionProxy();
session.connectSignal('ActiveChanged', Lang.bind(this, function(object, senderName, [isActive]) {
this._sessionActive = isActive;
}));
[this._sessionActive] = session.IsActiveSync();
return this._sessionActive;
},
canPowerOff: function(asyncCallback) {
this._proxy.CanStopRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0]);
});
},
canReboot: function(asyncCallback) {
this._proxy.CanRestartRemote(function(result, error) {
if (error)
asyncCallback(false);
else
asyncCallback(result[0]);
});
},
canSuspend: function(asyncCallback) {
Mainloop.idle_add(Lang.bind(this, function() {
asyncCallback(this._upClient.get_can_suspend());
return false;
}));
},
canHibernate: function(asyncCallback) {
Mainloop.idle_add(Lang.bind(this, function() {
asyncCallback(this._upClient.get_can_hibernate());
return false;
}));
},
powerOff: function() {
this._proxy.StopRemote();
},
reboot: function() {
this._proxy.RestartRemote();
},
suspend: function() {
this._upClient.suspend_sync(null);
},
hibernate: function() {
this._upClient.hibernate_sync(null);
}
});

View File

@ -46,8 +46,70 @@ let _providersTable;
function _getProvidersTable() {
if (_providersTable)
return _providersTable;
let [providers, countryCodes] = Shell.mobile_providers_parse();
return _providersTable = providers;
return _providersTable = Shell.mobile_providers_parse(null,null);
}
function findProviderForMCCMNC(table, needle) {
let needlemcc = needle.substring(0, 3);
let needlemnc = needle.substring(3, needle.length);
let name2, name3;
for (let iter in table) {
let country = table[iter];
let providers = country.get_providers();
// Search through each country's providers
for (let i = 0; i < providers.length; i++) {
let provider = providers[i];
// Search through MCC/MNC list
let list = provider.get_gsm_mcc_mnc();
for (let j = 0; j < list.length; j++) {
let mccmnc = list[j];
// Match both 2-digit and 3-digit MNC; prefer a
// 3-digit match if found, otherwise a 2-digit one.
if (mccmnc.mcc != needlemcc)
continue; // MCC was wrong
if (!name3 && needle.length == 6 && needlemnc == mccmnc.mnc)
name3 = provider.name;
if (!name2 && needlemnc.substring(0, 2) == mccmnc.mnc.substring(0, 2))
name2 = provider.name;
if (name2 && name3)
break;
}
}
}
return name3 || name2 || null;
}
function findProviderForSid(table, sid) {
if (sid == 0)
return null;
// Search through each country
for (let iter in table) {
let country = table[iter];
let providers = country.get_providers();
// Search through each country's providers
for (let i = 0; i < providers.length; i++) {
let provider = providers[i];
let cdma_sid = provider.get_cdma_sid();
// Search through CDMA SID list
for (let j = 0; j < cdma_sid.length; j++) {
if (cdma_sid[j] == sid)
return provider.name;
}
}
}
return null;
}
const ModemGsm = new Lang.Class({
@ -91,64 +153,29 @@ const ModemGsm = new Lang.Class({
},
_findOperatorName: function(name, opCode) {
if (name.length != 0 && (name.length > 6 || name.length < 5)) {
// this looks like a valid name, i.e. not an MCCMNC (that some
// devices return when not yet connected
return name;
}
if (isNaN(parseInt(name))) {
// name is definitely not a MCCMNC, so it may be a name
// after all; return that
return name;
if (name) {
if (name && name.length != 0 && (name.length > 6 || name.length < 5)) {
// this looks like a valid name, i.e. not an MCCMNC (that some
// devices return when not yet connected
return name;
}
if (isNaN(parseInt(name))) {
// name is definitely not a MCCMNC, so it may be a name
// after all; return that
return name;
}
}
let needle;
if (name.length == 0 && opCode)
if ((name == null || name.length == 0) && opCode)
needle = opCode;
else if (name.length == 6 || name.length == 5)
needle = name;
else // nothing to search
return null;
return this._findProviderForMCCMNC(needle);
},
_findProviderForMCCMNC: function(needle) {
let table = _getProvidersTable();
let needlemcc = needle.substring(0, 3);
let needlemnc = needle.substring(3, needle.length);
let name2, name3;
for (let iter in table) {
let providers = table[iter];
// Search through each country's providers
for (let i = 0; i < providers.length; i++) {
let provider = providers[i];
// Search through MCC/MNC list
let list = provider.get_gsm_mcc_mnc();
for (let j = 0; j < list.length; j++) {
let mccmnc = list[j];
// Match both 2-digit and 3-digit MNC; prefer a
// 3-digit match if found, otherwise a 2-digit one.
if (mccmnc.mcc != needlemcc)
continue; // MCC was wrong
if (!name3 && needle.length == 6 && needlemnc == mccmnc.mnc)
name3 = provider.name;
if (!name2 && needlemnc.substring(0, 2) == mccmnc.mnc.substring(0, 2))
name2 = provider.name;
if (name2 && name3)
break;
}
}
}
return name3 || name2 || null;
return findProviderForMCCMNC(table, needle);
}
});
Signals.addSignalMethods(ModemGsm.prototype);
@ -189,39 +216,14 @@ const ModemCdma = new Lang.Class({
this.operator_name = null;
} else {
let [bandClass, band, id] = result;
if (name.length > 0)
this.operator_name = this._findProviderForSid(id);
else
if (name.length > 0) {
let table = _getProvidersTable();
this.operator_name = findProviderForSid(table, id);
} else
this.operator_name = null;
}
this.emit('notify::operator-name');
}));
},
_findProviderForSid: function(sid) {
if (sid == 0)
return null;
let table = _getProvidersTable();
// Search through each country
for (let iter in table) {
let providers = table[iter];
// Search through each country's providers
for (let i = 0; i < providers.length; i++) {
let provider = providers[i];
let cdma_sid = provider.get_cdma_sid();
// Search through CDMA SID list
for (let j = 0; j < cdma_sid.length; j++) {
if (cdma_sid[j] == sid)
return provider.name;
}
}
}
return null;
}
});
Signals.addSignalMethods(ModemCdma.prototype);

View File

@ -84,7 +84,7 @@ function trySpawn(argv)
try {
[success, pid] = GLib.spawn_async(null, argv, null,
GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
null, null);
null);
} catch (err) {
/* Rewrite the error in case of ENOENT */
if (err.matches(GLib.SpawnError, GLib.SpawnError.NOENT)) {
@ -288,3 +288,31 @@ function insertSorted(array, val, cmp) {
return pos;
}
/**
* wrapKeybinding:
*
* Wrap a keybinding handler so that
* it ignores an invocation if the shell is modal, but
* not when the overview is active, or when global
* keybindings are allowed by session mode.
* This function is only useful for keybindings installed
* with Meta.KeybindingFlags.HANDLE_WHEN_GRABBED
*/
function wrapKeybinding(handler, onlyInOverview) {
return function() {
let handle;
if (onlyInOverview) {
handle = Main.sessionMode.allowKeybindingsWhenModal ||
Main.modalCount == (Main.overview.visible ? 1 : 0);
} else {
handle = true;
}
if (handle)
return handler.apply(this, arguments);
else
return false;
}
}

View File

@ -115,10 +115,10 @@ function run() {
for (let i = 0; i < 2; i++) {
Scripting.scriptEvent('applicationsShowStart');
Main.overview._viewSelector.switchTab('applications');
Main.overview._dash.showAppsButton.checked = true;
yield Scripting.waitLeisure();
Scripting.scriptEvent('applicationsShowDone');
Main.overview._viewSelector.switchTab('windows');
Main.overview._dash.showAppsButton.checked = false;
yield Scripting.waitLeisure();
}
}

View File

@ -199,7 +199,7 @@ const AltTabPopup = new Lang.Class({
this.actor.get_allocation_box();
// Make the initial selection
if (binding == 'switch-group') {
if (binding == 'internal-keybinding-switch-group') {
if (backward) {
this._select(0, this._appIcons[0].cachedWindows.length - 1);
} else {
@ -208,9 +208,9 @@ const AltTabPopup = new Lang.Class({
else
this._select(0, 0);
}
} else if (binding == 'switch-group-backward') {
} else if (binding == 'internal-keybinding-switch-group-backward') {
this._select(0, this._appIcons[0].cachedWindows.length - 1);
} else if (binding == 'switch-windows-backward') {
} else if (binding == 'internal-keybinding-switch-windows-backward') {
this._select(this._appIcons.length - 1);
} else if (this._appIcons.length == 1) {
this._select(0);

View File

@ -479,7 +479,6 @@ const AppWellIcon = new Lang.Class({
Lang.bind(this,
this._onStateChanged));
this._onStateChanged();
this.isMenuUp = false;
},
_onDestroy: function() {
@ -561,7 +560,8 @@ const AppWellIcon = new Lang.Class({
this._menuManager.addMenu(this._menu);
}
this.isMenuUp = true;
this.emit('menu-state-changed', true);
this.actor.set_hover(true);
this._menu.popup();
@ -578,7 +578,7 @@ const AppWellIcon = new Lang.Class({
_onMenuPoppedDown: function() {
this.actor.sync_hover();
this.isMenuUp = false;
this.emit('menu-state-changed', false);
},
_onActivate: function (event) {

View File

@ -84,9 +84,12 @@ const AppFavorites = new Lang.Class({
let app = Shell.AppSystem.get_default().lookup_app(appId);
Main.overview.setMessage(_("%s has been added to your favorites.").format(app.get_name()), Lang.bind(this, function () {
this._removeFavorite(appId);
}));
Main.overview.setMessage(_("%s has been added to your favorites.").format(app.get_name()),
{ forFeedback: true,
undoCallback: Lang.bind(this, function () {
this._removeFavorite(appId);
})
});
},
addFavorite: function(appId) {
@ -116,9 +119,11 @@ const AppFavorites = new Lang.Class({
return;
Main.overview.setMessage(_("%s has been removed from your favorites.").format(app.get_name()),
Lang.bind(this, function () {
this._addFavorite(appId, pos);
}));
{ forFeedback: true,
undoCallback: Lang.bind(this, function () {
this._addFavorite(appId, pos);
})
});
}
});
Signals.addSignalMethods(AppFavorites.prototype);

View File

@ -141,6 +141,7 @@ const BoxPointer = new Lang.Class({
this._muteInput();
Tweener.removeTweens(this);
Tweener.addTween(this, { opacity: fade ? 0 : 255,
xOffset: xOffset,
yOffset: yOffset,
@ -274,14 +275,51 @@ const BoxPointer = new Lang.Class({
let [x1, y1] = [halfBorder, halfBorder];
let [x2, y2] = [boxWidth - halfBorder, boxHeight - halfBorder];
let skipTopLeft = false;
let skipTopRight = false;
let skipBottomLeft = false;
let skipBottomRight = false;
switch (this._arrowSide) {
case St.Side.TOP:
if (this._arrowOrigin == x1)
skipTopLeft = true;
else if (this._arrowOrigin == x2)
skipTopRight = true;
break;
case St.Side.RIGHT:
if (this._arrowOrigin == y1)
skipTopRight = true;
else if (this._arrowOrigin == y2)
skipBottomRight = true;
break;
case St.Side.BOTTOM:
if (this._arrowOrigin == x1)
skipBottomLeft = true;
else if (this._arrowOrigin == x2)
skipBottomRight = true;
break;
case St.Side.LEFT:
if (this._arrowOrigin == y1)
skipTopLeft = true;
else if (this._arrowOrigin == y2)
skipBottomLeft = true;
break;
}
cr.moveTo(x1 + borderRadius, y1);
if (this._arrowSide == St.Side.TOP) {
if (this._arrowOrigin < (x1 + (borderRadius + halfBase))) {
cr.lineTo(this._arrowOrigin, y1 - rise);
cr.lineTo(Math.max(x1 + borderRadius, this._arrowOrigin) + halfBase, y1);
} else if (this._arrowOrigin > (x2 - (borderRadius + halfBase))) {
cr.lineTo(Math.min(x2 - borderRadius, this._arrowOrigin) - halfBase, y1);
cr.lineTo(this._arrowOrigin, y1 - rise);
if (skipTopLeft) {
cr.moveTo(x1, y2 - borderRadius);
cr.lineTo(x1, y1 - rise);
cr.lineTo(x1 + halfBase, y1);
} else if (skipTopRight) {
cr.lineTo(x2 - halfBase, y1);
cr.lineTo(x2, y1 - rise);
cr.lineTo(x2, y1 + borderRadius);
} else {
cr.lineTo(this._arrowOrigin - halfBase, y1);
cr.lineTo(this._arrowOrigin, y1 - rise);
@ -289,19 +327,20 @@ const BoxPointer = new Lang.Class({
}
}
cr.lineTo(x2 - borderRadius, y1);
// top-right corner
cr.arc(x2 - borderRadius, y1 + borderRadius, borderRadius,
3*Math.PI/2, Math.PI*2);
if (!skipTopRight) {
cr.lineTo(x2 - borderRadius, y1);
cr.arc(x2 - borderRadius, y1 + borderRadius, borderRadius,
3*Math.PI/2, Math.PI*2);
}
if (this._arrowSide == St.Side.RIGHT) {
if (this._arrowOrigin < (y1 + (borderRadius + halfBase))) {
cr.lineTo(x2 + rise, this._arrowOrigin);
cr.lineTo(x2, Math.max(y1 + borderRadius, this._arrowOrigin) + halfBase);
} else if (this._arrowOrigin > (y2 - (borderRadius + halfBase))) {
cr.lineTo(x2, Math.min(y2 - borderRadius, this._arrowOrigin) - halfBase);
cr.lineTo(x2 + rise, this._arrowOrigin);
if (skipTopRight) {
cr.lineTo(x2 + rise, y1);
cr.lineTo(x2 + rise, y1 + halfBase);
} else if (skipBottomRight) {
cr.lineTo(x2, y2 - halfBase);
cr.lineTo(x2 + rise, y2);
cr.lineTo(x2 - borderRadius, y2);
} else {
cr.lineTo(x2, this._arrowOrigin - halfBase);
cr.lineTo(x2 + rise, this._arrowOrigin);
@ -309,19 +348,20 @@ const BoxPointer = new Lang.Class({
}
}
cr.lineTo(x2, y2 - borderRadius);
// bottom-right corner
cr.arc(x2 - borderRadius, y2 - borderRadius, borderRadius,
0, Math.PI/2);
if (!skipBottomRight) {
cr.lineTo(x2, y2 - borderRadius);
cr.arc(x2 - borderRadius, y2 - borderRadius, borderRadius,
0, Math.PI/2);
}
if (this._arrowSide == St.Side.BOTTOM) {
if (this._arrowOrigin < (x1 + (borderRadius + halfBase))) {
cr.lineTo(Math.max(x1 + borderRadius, this._arrowOrigin) + halfBase, y2);
cr.lineTo(this._arrowOrigin, y2 + rise);
} else if (this._arrowOrigin > (x2 - (borderRadius + halfBase))) {
cr.lineTo(this._arrowOrigin, y2 + rise);
cr.lineTo(Math.min(x2 - borderRadius, this._arrowOrigin) - halfBase, y2);
if (skipBottomLeft) {
cr.lineTo(x1 + halfBase, y2);
cr.lineTo(x1, y2 + rise);
cr.lineTo(x1, y2 - borderRadius);
} else if (skipBottomRight) {
cr.lineTo(x2, y2 + rise);
cr.lineTo(x2 - halfBase, y2);
} else {
cr.lineTo(this._arrowOrigin + halfBase, y2);
cr.lineTo(this._arrowOrigin, y2 + rise);
@ -329,19 +369,20 @@ const BoxPointer = new Lang.Class({
}
}
cr.lineTo(x1 + borderRadius, y2);
// bottom-left corner
cr.arc(x1 + borderRadius, y2 - borderRadius, borderRadius,
Math.PI/2, Math.PI);
if (!skipBottomLeft) {
cr.lineTo(x1 + borderRadius, y2);
cr.arc(x1 + borderRadius, y2 - borderRadius, borderRadius,
Math.PI/2, Math.PI);
}
if (this._arrowSide == St.Side.LEFT) {
if (this._arrowOrigin < (y1 + (borderRadius + halfBase))) {
cr.lineTo(x1, Math.max(y1 + borderRadius, this._arrowOrigin) + halfBase);
cr.lineTo(x1 - rise, this._arrowOrigin);
} else if (this._arrowOrigin > (y2 - (borderRadius + halfBase))) {
cr.lineTo(x1 - rise, this._arrowOrigin);
cr.lineTo(x1, Math.min(y2 - borderRadius, this._arrowOrigin) - halfBase);
if (skipTopLeft) {
cr.lineTo(x1, y1 + halfBase);
cr.lineTo(x1 - rise, y1);
cr.lineTo(x1 + borderRadius, y1);
} else if (skipBottomLeft) {
cr.lineTo(x1 - rise, y2)
cr.lineTo(x1 - rise, y2 - halfBase);
} else {
cr.lineTo(x1, this._arrowOrigin + halfBase);
cr.lineTo(x1 - rise, this._arrowOrigin);
@ -349,11 +390,11 @@ const BoxPointer = new Lang.Class({
}
}
cr.lineTo(x1, y1 + borderRadius);
// top-left corner
cr.arc(x1 + borderRadius, y1 + borderRadius, borderRadius,
Math.PI, 3*Math.PI/2);
if (!skipTopLeft) {
cr.lineTo(x1, y1 + borderRadius);
cr.arc(x1 + borderRadius, y1 + borderRadius, borderRadius,
Math.PI, 3*Math.PI/2);
}
Clutter.cairo_set_source_color(cr, backgroundColor);
cr.fillPreserve();
@ -406,10 +447,9 @@ const BoxPointer = new Lang.Class({
let arrowBase = themeNode.get_length('-arrow-base');
let borderRadius = themeNode.get_length('-arrow-border-radius');
let margin = (4 * borderRadius + borderWidth + arrowBase);
let halfMargin = margin / 2;
let themeNode = this.actor.get_theme_node();
let gap = themeNode.get_length('-boxpointer-gap');
let padding = themeNode.get_length('-arrow-rise');
let resX, resY;
@ -428,29 +468,66 @@ const BoxPointer = new Lang.Class({
break;
}
// Now align and position the pointing axis, making sure
// it fits on screen
// Now align and position the pointing axis, making sure it fits on
// screen. If the arrowOrigin is so close to the edge that the arrow
// will not be isosceles, we try to compensate as follows:
// - We skip the rounded corner and settle for a right angled arrow
// as shown below. See _drawBorder for further details.
// |\_____
// |
// |
// - If the arrow was going to be acute angled, we move the position
// of the box to maintain the arrow's accuracy.
let arrowOrigin;
let halfBase = Math.floor(arrowBase/2);
let halfBorder = borderWidth / 2;
let halfMargin = margin / 2;
let [x1, y1] = [halfBorder, halfBorder];
let [x2, y2] = [natWidth - halfBorder, natHeight - halfBorder];
switch (this._arrowSide) {
case St.Side.TOP:
case St.Side.BOTTOM:
resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
resX = Math.max(resX, monitor.x + 10);
resX = Math.min(resX, monitor.x + monitor.width - (10 + natWidth));
this.setArrowOrigin(sourceCenterX - resX);
resX = Math.max(resX, monitor.x + padding);
resX = Math.min(resX, monitor.x + monitor.width - (padding + natWidth));
arrowOrigin = sourceCenterX - resX;
if (arrowOrigin <= (x1 + (borderRadius + halfBase))) {
if (arrowOrigin > x1)
resX += (arrowOrigin - x1);
arrowOrigin = x1;
} else if (arrowOrigin >= (x2 - (borderRadius + halfBase))) {
if (arrowOrigin < x2)
resX -= (x2 - arrowOrigin);
arrowOrigin = x2;
}
break;
case St.Side.LEFT:
case St.Side.RIGHT:
resY = sourceCenterY - (halfMargin + (natHeight - margin) * alignment);
resY = Math.max(resY, monitor.y + 10);
resY = Math.min(resY, monitor.y + monitor.height - (10 + natHeight));
resY = Math.max(resY, monitor.y + padding);
resY = Math.min(resY, monitor.y + monitor.height - (padding + natHeight));
this.setArrowOrigin(sourceCenterY - resY);
arrowOrigin = sourceCenterY - resY;
if (arrowOrigin <= (y1 + (borderRadius + halfBase))) {
if (arrowOrigin > y1)
resY += (arrowOrigin - y1);
arrowOrigin = y1;
} else if (arrowOrigin >= (y2 - (borderRadius + halfBase))) {
if (arrowOrigin < y2)
resX -= (y2 - arrowOrigin);
arrowOrigin = y2;
}
break;
}
this.setArrowOrigin(arrowOrigin);
let parent = this.actor.get_parent();
let success, x, y;
while (!success) {

View File

@ -204,12 +204,11 @@ const CalendarServerInfo = Gio.DBusInterfaceInfo.new_for_xml(CalendarServerIfac
function CalendarServer() {
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
g_interface_name: CalendarServerInfo.name,
g_interface_info: CalendarServerInfo,
g_name: 'org.gnome.Shell.CalendarServer',
g_object_path: '/org/gnome/Shell/CalendarServer',
g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START |
Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
g_interface_name: CalendarServerInfo.name,
g_interface_info: CalendarServerInfo,
g_name: 'org.gnome.Shell.CalendarServer',
g_object_path: '/org/gnome/Shell/CalendarServer',
g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES });
self.init(null);
return self;
@ -271,8 +270,9 @@ const DBusEventSource = new Lang.Class({
this._loadEvents(false);
},
_onEventsReceived: function([appointments]) {
_onEventsReceived: function(results, error) {
let newEvents = [];
let appointments = results ? results[0] : null;
if (appointments != null) {
for (let n = 0; n < appointments.length; n++) {
let a = appointments[n];
@ -340,22 +340,10 @@ const DBusEventSource = new Lang.Class({
});
Signals.addSignalMethods(DBusEventSource.prototype);
// Calendar:
// @eventSource: is an object implementing the EventSource API, e.g. the
// requestRange(), getEvents(), hasEvents() methods and the ::changed signal.
const Calendar = new Lang.Class({
Name: 'Calendar',
_init: function(eventSource) {
if (eventSource) {
this._eventSource = eventSource;
this._eventSource.connect('changed', Lang.bind(this,
function() {
this._update(false);
}));
}
_init: function() {
this._weekStart = Shell.util_get_week_start();
this._weekdate = NaN;
this._digitWidth = NaN;
@ -392,6 +380,24 @@ const Calendar = new Lang.Class({
this._buildHeader ();
},
// @eventSource: is an object implementing the EventSource API, e.g. the
// requestRange(), getEvents(), hasEvents() methods and the ::changed signal.
setEventSource: function(eventSource) {
if (this._eventSource) {
this._eventSource.disconnect(this._eventSourceChangedId);
this._eventSource = null;
}
this._eventSource = eventSource;
if (this._eventSource) {
this._eventSourceChangedId = this._eventSource.connect('changed', Lang.bind(this, function() {
this._update(false);
}));
this._update(true);
}
},
// Sets the calendar to show a specific date
setDate: function(date, forceReload) {
if (!_sameDay(date, this._selectedDate)) {
@ -622,16 +628,25 @@ Signals.addSignalMethods(Calendar.prototype);
const EventsList = new Lang.Class({
Name: 'EventsList',
_init: function(eventSource) {
_init: function() {
this.actor = new St.BoxLayout({ vertical: true, style_class: 'events-header-vbox'});
this._date = new Date();
this._eventSource = eventSource;
this._eventSource.connect('changed', Lang.bind(this, this._update));
this._desktopSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' });
this._desktopSettings.connect('changed', Lang.bind(this, this._update));
this._weekStart = Shell.util_get_week_start();
},
this._update();
setEventSource: function(eventSource) {
if (this._eventSource) {
this._eventSource.disconnect(this._eventSourceChangedId);
this._eventSource = null;
}
this._eventSource = eventSource;
if (this._eventSource) {
this._eventSourceChangedId = this._eventSource.connect('changed', Lang.bind(this, this._update));
}
},
_addEvent: function(dayNameBox, timeBox, eventTitleBox, includeDayName, day, time, desc) {
@ -717,13 +732,15 @@ const EventsList = new Lang.Class({
let tomorrowEnd = new Date(dayEnd.getTime() + 86400 * 1000);
this._addPeriod(_("Tomorrow"), tomorrowBegin, tomorrowEnd, false, true);
if (dayEnd.getDay() <= 4 + this._weekStart) {
let dayInWeek = (dayEnd.getDay() - this._weekStart + 7) % 7;
if (dayInWeek < 5) {
/* If now is within the first 5 days we show "This week" and
* include events up until and including Saturday/Sunday
* (depending on whether a week starts on Sunday/Monday).
*/
let thisWeekBegin = new Date(dayBegin.getTime() + 2 * 86400 * 1000);
let thisWeekEnd = new Date(dayEnd.getTime() + (6 + this._weekStart - dayEnd.getDay()) * 86400 * 1000);
let thisWeekEnd = new Date(dayEnd.getTime() + (6 - dayInWeek) * 86400 * 1000);
this._addPeriod(_("This week"), thisWeekBegin, thisWeekEnd, true, false);
} else {
/* otherwise it's one of the two last days of the week ... show
@ -731,7 +748,7 @@ const EventsList = new Lang.Class({
* Saturday/Sunday
*/
let nextWeekBegin = new Date(dayBegin.getTime() + 2 * 86400 * 1000);
let nextWeekEnd = new Date(dayEnd.getTime() + (13 + this._weekStart - dayEnd.getDay()) * 86400 * 1000);
let nextWeekEnd = new Date(dayEnd.getTime() + (13 - dayInWeek) * 86400 * 1000);
this._addPeriod(_("Next week"), nextWeekBegin, nextWeekEnd, true, false);
}
},

View File

@ -0,0 +1,65 @@
const Lang = imports.lang;
const Main = imports.ui.main;
const ComponentManager = new Lang.Class({
Name: 'ComponentManager',
_init: function() {
this._allComponents = {};
this._enabledComponents = [];
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._sessionUpdated();
},
_sessionUpdated: function() {
let newEnabledComponents = Main.sessionMode.components;
newEnabledComponents.filter(Lang.bind(this, function(name) {
return this._enabledComponents.indexOf(name) == -1;
})).forEach(Lang.bind(this, function(name) {
this._enableComponent(name);
}));
this._enabledComponents.filter(Lang.bind(this, function(name) {
return newEnabledComponents.indexOf(name) == -1;
})).forEach(Lang.bind(this, function(name) {
this._disableComponent(name);
}));
this._enabledComponents = newEnabledComponents;
},
_importComponent: function(name) {
let module = imports.ui.components[name];
return module.Component;
},
_ensureComponent: function(name) {
let component = this._allComponents[name];
if (component)
return component;
if (Main.sessionMode.isLocked)
return null;
let constructor = this._importComponent(name);
component = new constructor();
this._allComponents[name] = component;
return component;
},
_enableComponent: function(name) {
let component = this._ensureComponent(name);
if (component)
component.enable();
},
_disableComponent: function(name) {
let component = this._allComponents[name];
if (component == null)
return;
component.disable();
}
});

View File

@ -5,11 +5,12 @@ const Mainloop = imports.mainloop;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Params = imports.misc.params;
const Shell = imports.gi.Shell;
const GnomeSession = imports.misc.gnomeSession;
const LoginManager = imports.misc.loginManager;
const Main = imports.ui.main;
const ShellMountOperation = imports.ui.shellMountOperation;
const GnomeSession = imports.misc.gnomeSession;
const GNOME_SESSION_AUTOMOUNT_INHIBIT = 16;
@ -19,62 +20,6 @@ const SETTING_ENABLE_AUTOMOUNT = 'automount';
const AUTORUN_EXPIRE_TIMEOUT_SECS = 10;
const ConsoleKitSessionIface = <interface name="org.freedesktop.ConsoleKit.Session">
<method name="IsActive">
<arg type="b" direction="out" />
</method>
<signal name="ActiveChanged">
<arg type="b" direction="out" />
</signal>
</interface>;
const ConsoleKitSessionProxy = Gio.DBusProxy.makeProxyWrapper(ConsoleKitSessionIface);
const ConsoleKitManagerIface = <interface name="org.freedesktop.ConsoleKit.Manager">
<method name="GetCurrentSession">
<arg type="o" direction="out" />
</method>
</interface>;
const ConsoleKitManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(ConsoleKitManagerIface);
function ConsoleKitManager() {
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.system,
g_interface_name: ConsoleKitManagerInfo.name,
g_interface_info: ConsoleKitManagerInfo,
g_name: 'org.freedesktop.ConsoleKit',
g_object_path: '/org/freedesktop/ConsoleKit/Manager',
g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START |
Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
self._updateSessionActive = function() {
if (self.g_name_owner) {
self.GetCurrentSessionRemote(function([session]) {
self._ckSession = new ConsoleKitSessionProxy(Gio.DBus.system, 'org.freedesktop.ConsoleKit', session);
self._ckSession.connectSignal('ActiveChanged', function(object, senderName, [isActive]) {
self.sessionActive = isActive;
});
self._ckSession.IsActiveRemote(function([isActive]) {
self.sessionActive = isActive;
});
});
} else {
self.sessionActive = true;
}
};
self.connect('notify::g-name-owner',
Lang.bind(self, self._updateSessionActive));
self._updateSessionActive();
self.init(null);
return self;
}
function haveSystemd() {
return GLib.access("/sys/fs/cgroup/systemd", 0) >= 0;
}
const AutomountManager = new Lang.Class({
Name: 'AutomountManager',
@ -88,30 +33,31 @@ const AutomountManager = new Lang.Class({
Lang.bind(this, this._InhibitorsChanged));
this._inhibited = false;
if (!haveSystemd())
this.ckListener = new ConsoleKitManager();
Main.screenShield.connect('lock-status-changed', Lang.bind(this, this._lockStatusChanged));
this._loginManager = LoginManager.getLoginManager();
this._volumeMonitor = Gio.VolumeMonitor.get();
},
this._volumeMonitor.connect('volume-added',
Lang.bind(this,
this._onVolumeAdded));
this._volumeMonitor.connect('volume-removed',
Lang.bind(this,
this._onVolumeRemoved));
this._volumeMonitor.connect('drive-connected',
Lang.bind(this,
this._onDriveConnected));
this._volumeMonitor.connect('drive-disconnected',
Lang.bind(this,
this._onDriveDisconnected));
this._volumeMonitor.connect('drive-eject-button',
Lang.bind(this,
this._onDriveEjectButton));
enable: function() {
this._volumeAddedId = this._volumeMonitor.connect('volume-added', Lang.bind(this, this._onVolumeAdded));
this._volumeRemovedId = this._volumeMonitor.connect('volume-removed', Lang.bind(this, this._onVolumeRemoved));
this._driveConnectedId = this._volumeMonitor.connect('drive-connected', Lang.bind(this, this._onDriveConnected));
this._driveDisconnectedId = this._volumeMonitor.connect('drive-disconnected', Lang.bind(this, this._onDriveDisconnected));
this._driveEjectButtonId = this._volumeMonitor.connect('drive-eject-button', Lang.bind(this, this._onDriveEjectButton));
Mainloop.idle_add(Lang.bind(this, this._startupMountAll));
this._mountAllId = Mainloop.idle_add(Lang.bind(this, this._startupMountAll));
},
disable: function() {
this._volumeMonitor.disconnect(this._volumeAddedId);
this._volumeMonitor.disconnect(this._volumeRemovedId);
this._volumeMonitor.disconnect(this._driveConnectedId);
this._volumeMonitor.disconnect(this._driveDisconnectedId);
this._volumeMonitor.disconnect(this._driveEjectButtonId);
if (this._mountAllId > 0) {
Mainloop.source_remove(this._mountAllId);
this._mountAllId = 0;
}
},
_InhibitorsChanged: function(object, senderName, [inhibtor]) {
@ -124,17 +70,6 @@ const AutomountManager = new Lang.Class({
}));
},
_lockStatusChanged: function(shield, locked) {
if (!locked) {
this._volumeQueue.forEach(Lang.bind(this, function(volume) {
this._checkAndMountVolume(volume);
}));
}
// clear the queue anyway
this._volumeQueue = [];
},
_startupMountAll: function() {
let volumes = this._volumeMonitor.get_volumes();
volumes.forEach(Lang.bind(this, function(volume) {
@ -143,27 +78,14 @@ const AutomountManager = new Lang.Class({
allowAutorun: false });
}));
this._mountAllId = 0;
return false;
},
isSessionActive: function() {
// Return whether the current session is active, using the
// right mechanism: either systemd if available or ConsoleKit
// as fallback.
if (haveSystemd())
return Shell.session_is_active_for_systemd();
return this.ckListener.sessionActive;
},
_onDriveConnected: function() {
// if we're not in the current ConsoleKit session,
// or screensaver is active, don't play sounds
if (!this.isSessionActive())
return;
if (Main.screenShield.locked)
if (!this._loginManager.sessionActive)
return;
global.play_theme_sound(0, 'device-added-media');
@ -172,10 +94,7 @@ const AutomountManager = new Lang.Class({
_onDriveDisconnected: function() {
// if we're not in the current ConsoleKit session,
// or screensaver is active, don't play sounds
if (!this.isSessionActive())
return;
if (Main.screenShield.locked)
if (!this._loginManager.sessionActive)
return;
global.play_theme_sound(0, 'device-removed-media');
@ -184,7 +103,7 @@ const AutomountManager = new Lang.Class({
_onDriveEjectButton: function(monitor, drive) {
// TODO: this code path is not tested, as the GVfs volume monitor
// doesn't emit this signal just yet.
if (!this.isSessionActive())
if (!this._loginManager.sessionActive)
return;
// we force stop/eject in this case, so we don't have to pass a
@ -224,15 +143,8 @@ const AutomountManager = new Lang.Class({
if (params.checkSession) {
// if we're not in the current ConsoleKit session,
// don't attempt automount
if (!this.isSessionActive())
if (!this._loginManager.sessionActive)
return;
if (Main.screenShield.locked) {
if (this._volumeQueue.indexOf(volume) == -1)
this._volumeQueue.push(volume);
return;
}
}
if (this._inhibited)
@ -326,3 +238,4 @@ const AutomountManager = new Lang.Class({
});
}
});
const Component = AutomountManager;

View File

@ -4,6 +4,7 @@ const Lang = imports.lang;
const Gio = imports.gi.Gio;
const St = imports.gi.St;
const LoginManager = imports.misc.loginManager;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const ShellMountOperation = imports.ui.shellMountOperation;
@ -43,6 +44,17 @@ function isMountRootHidden(root) {
return (path.indexOf('/.') != -1);
}
function isMountNonLocal(mount) {
// If the mount doesn't have an associated volume, that means it's
// an uninteresting filesystem. Most devices that we care about will
// have a mount, like media players and USB sticks.
let volume = mount.get_volume();
if (volume == null)
return true;
return (volume.get_identifier("class") == "network");
}
function startAppForMount(app, mount) {
let files = [];
let root = mount.get_root();
@ -82,13 +94,21 @@ const ContentTypeDiscoverer = new Lang.Class({
_init: function(callback) {
this._callback = callback;
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
},
guessContentTypes: function(mount) {
// guess mount's content types using GIO
mount.guess_content_type(false, null,
Lang.bind(this,
this._onContentTypeGuessed));
let autorunEnabled = !this._settings.get_boolean(SETTING_DISABLE_AUTORUN);
let shouldScan = autorunEnabled && !isMountNonLocal(mount);
if (shouldScan) {
// guess mount's content types using GIO
mount.guess_content_type(false, null,
Lang.bind(this,
this._onContentTypeGuessed));
} else {
this._emitCallback(mount, []);
}
},
_onContentTypeGuessed: function(mount, res) {
@ -142,55 +162,69 @@ const AutorunManager = new Lang.Class({
Name: 'AutorunManager',
_init: function() {
this._loginManager = LoginManager.getLoginManager();
this._volumeMonitor = Gio.VolumeMonitor.get();
this._volumeMonitor.connect('mount-added',
Lang.bind(this,
this._onMountAdded));
this._volumeMonitor.connect('mount-removed',
Lang.bind(this,
this._onMountRemoved));
this._transDispatcher = new AutorunTransientDispatcher(this);
},
this._transDispatcher = new AutorunTransientDispatcher();
this._createResidentSource();
_ensureResidentSource: function() {
if (this._residentSource)
return;
let mounts = this._volumeMonitor.get_mounts();
mounts.forEach(Lang.bind(this, function (mount) {
let discoverer = new ContentTypeDiscoverer(Lang.bind (this,
function (mount, apps) {
this._residentSource.addMount(mount, apps);
}));
discoverer.guessContentTypes(mount);
this._residentSource = new AutorunResidentSource(this);
let destroyId = this._residentSource.connect('destroy', Lang.bind(this, function() {
this._residentSource.disconnect(destroyId);
this._residentSource = null;
}));
},
_createResidentSource: function() {
this._residentSource = new AutorunResidentSource();
this._residentSource.connect('destroy',
Lang.bind(this,
this._createResidentSource));
enable: function() {
this._scanMounts();
this._mountAddedId = this._volumeMonitor.connect('mount-added', Lang.bind(this, this._onMountAdded));
this._mountRemovedId = this._volumeMonitor.connect('mount-removed', Lang.bind(this, this._onMountRemoved));
},
disable: function() {
if (this._residentSource)
this._residentSource.destroy();
this._volumeMonitor.disconnect(this._mountAddedId);
this._volumeMonitor.disconnect(this._mountRemovedId);
},
_processMount: function(mount, hotplug) {
let discoverer = new ContentTypeDiscoverer(Lang.bind(this, function(mount, apps, contentTypes) {
this._ensureResidentSource();
this._residentSource.addMount(mount, apps);
if (hotplug)
this._transDispatcher.addMount(mount, apps, contentTypes);
}));
discoverer.guessContentTypes(mount);
},
_scanMounts: function() {
let mounts = this._volumeMonitor.get_mounts();
mounts.forEach(Lang.bind(this, function(mount) {
this._processMount(mount, false);
}));
},
_onMountAdded: function(monitor, mount) {
// don't do anything if our session is not the currently
// active one
if (!Main.automountManager.isSessionActive())
if (!this._loginManager.sessionActive)
return;
let discoverer = new ContentTypeDiscoverer(Lang.bind (this,
function (mount, apps, contentTypes) {
this._transDispatcher.addMount(mount, apps, contentTypes);
this._residentSource.addMount(mount, apps);
}));
discoverer.guessContentTypes(mount);
this._processMount(mount, true);
},
_onMountRemoved: function(monitor, mount) {
this._transDispatcher.removeMount(mount);
this._residentSource.removeMount(mount);
if (this._residentSource)
this._residentSource.removeMount(mount);
},
ejectMount: function(mount) {
@ -257,12 +291,18 @@ const AutorunResidentSource = new Lang.Class({
Name: 'AutorunResidentSource',
Extends: MessageTray.Source,
_init: function() {
this.parent(_("Removable Devices"), 'media-removable', St.IconType.FULLCOLOR);
_init: function(manager) {
this.parent(_("Removable Devices"), 'media-removable');
this.showInLockScreen = false;
this._mounts = [];
this._notification = new AutorunResidentNotification(this);
this._manager = manager;
this._notification = new AutorunResidentNotification(this._manager, this);
},
buildRightClickMenu: function() {
return null;
},
addMount: function(mount, apps) {
@ -312,7 +352,7 @@ const AutorunResidentNotification = new Lang.Class({
Name: 'AutorunResidentNotification',
Extends: MessageTray.Notification,
_init: function(source) {
_init: function(manager, source) {
this.parent(source, source.title, null, { customContent: true });
// set the notification as resident
@ -320,6 +360,7 @@ const AutorunResidentNotification = new Lang.Class({
this._layout = new St.BoxLayout ({ style_class: 'hotplug-resident-box',
vertical: true });
this._manager = manager;
this.addActor(this._layout,
{ x_expand: true,
@ -367,7 +408,7 @@ const AutorunResidentNotification = new Lang.Class({
expand: true });
let ejectIcon =
new St.Icon({ icon_name: 'media-eject',
new St.Icon({ icon_name: 'media-eject-symbolic',
style_class: 'hotplug-resident-eject-icon' });
let ejectButton =
@ -382,7 +423,7 @@ const AutorunResidentNotification = new Lang.Class({
}));
ejectButton.connect('clicked', Lang.bind(this, function() {
Main.autorunManager.ejectMount(mount);
this._manager.ejectMount(mount);
}));
return item;
@ -392,7 +433,8 @@ const AutorunResidentNotification = new Lang.Class({
const AutorunTransientDispatcher = new Lang.Class({
Name: 'AutorunTransientDispatcher',
_init: function() {
_init: function(manager) {
this._manager = manager;
this._sources = [];
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
},
@ -435,7 +477,7 @@ const AutorunTransientDispatcher = new Lang.Class({
return;
// add a new source
this._sources.push(new AutorunTransientSource(mount, apps));
this._sources.push(new AutorunTransientSource(this._manager, mount, apps));
},
addMount: function(mount, apps, contentTypes) {
@ -488,22 +530,22 @@ const AutorunTransientSource = new Lang.Class({
Name: 'AutorunTransientSource',
Extends: MessageTray.Source,
_init: function(mount, apps) {
_init: function(manager, mount, apps) {
this._manager = manager;
this.mount = mount;
this.apps = apps;
this.parent(mount.get_name());
this._notification = new AutorunTransientNotification(this);
this._notification = new AutorunTransientNotification(this._manager, this);
// add ourselves as a source, and popup the notification
Main.messageTray.add(this);
this.notify(this._notification);
},
createIcon: function(size) {
return new St.Icon({ gicon: this.mount.get_icon(),
icon_size: size });
getIcon: function() {
return this.mount.get_icon();
}
});
@ -511,9 +553,10 @@ const AutorunTransientNotification = new Lang.Class({
Name: 'AutorunTransientNotification',
Extends: MessageTray.Notification,
_init: function(source) {
_init: function(manager, source) {
this.parent(source, source.title, null, { customContent: true });
this._manager = manager;
this._box = new St.BoxLayout({ style_class: 'hotplug-transient-box',
vertical: true });
this.addActor(this._box);
@ -565,7 +608,7 @@ const AutorunTransientNotification = new Lang.Class({
_buttonForEject: function() {
let box = new St.BoxLayout();
let icon = new St.Icon({ icon_name: 'media-eject',
let icon = new St.Icon({ icon_name: 'media-eject-symbolic',
style_class: 'hotplug-notification-item-icon' });
box.add(icon);
@ -582,10 +625,11 @@ const AutorunTransientNotification = new Lang.Class({
style_class: 'hotplug-notification-item' });
button.connect('clicked', Lang.bind(this, function() {
Main.autorunManager.ejectMount(this._mount);
this._manager.ejectMount(this._mount);
}));
return button;
}
});
const Component = AutorunManager;

View File

@ -84,7 +84,10 @@ const KeyringDialog = new Lang.Class({
if (this.prompt.password_visible) {
let label = new St.Label(({ style_class: 'prompt-dialog-password-label' }));
label.set_text(_("Password:"));
table.add(label, { row: row, col: 0, x_expand: false, x_fill: true, x_align: St.Align.START });
table.add(label, { row: row, col: 0,
x_expand: false, x_fill: true,
x_align: St.Align.START,
y_fill: false, y_align: St.Align.MIDDLE });
this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
text: '',
can_focus: true});
@ -100,7 +103,10 @@ const KeyringDialog = new Lang.Class({
if (this.prompt.confirm_visible) {
var label = new St.Label(({ style_class: 'prompt-dialog-password-label' }));
label.set_text(_("Type again:"));
table.add(label, { row: row, col: 0, x_expand: false, x_fill: true, x_align: St.Align.START });
table.add(label, { row: row, col: 0,
x_expand: false, x_fill: true,
x_align: St.Align.START,
y_fill: false, y_align: St.Align.MIDDLE });
this._confirmEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
text: '',
can_focus: true});
@ -186,23 +192,36 @@ const KeyringDialog = new Lang.Class({
},
_onContinueButton: function() {
this.prompt.complete()
this.prompt.complete();
},
_onCancelButton: function() {
this.prompt.cancel()
this.prompt.cancel();
},
});
function init() {
prompter = new Gcr.SystemPrompter();
prompter.connect('new-prompt', function(prompter) {
let dialog = new KeyringDialog();
return dialog.prompt;
});
const KeyringPrompter = new Lang.Class({
Name: 'KeyringPrompter',
let connection = Gio.DBus.session;
prompter.register(connection);
Gio.bus_own_name_on_connection (connection, 'org.gnome.keyring.SystemPrompter',
Gio.BusNameOwnerFlags.REPLACE, null, null);
}
_init: function() {
this._prompter = new Gcr.SystemPrompter();
this._prompter.connect('new-prompt', function(prompter) {
let dialog = new KeyringDialog();
return dialog.prompt;
});
this._dbusId = null;
},
enable: function() {
this._prompter.register(Gio.DBus.session);
this._dbusId = Gio.DBus.session.own_name('org.gnome.keyring.SystemPrompter',
Gio.BusNameOwnerFlags.REPLACE, null, null);
},
disable: function() {
this._prompter.unregister(false);
Gio.DBus.session.unown_name(this._dbusId);
}
});
const Component = KeyringPrompter;

View File

@ -0,0 +1,647 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Gdk = imports.gi.Gdk;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const ShellMountOperation = imports.ui.shellMountOperation;
const Tweener = imports.ui.tweener;
const Util = imports.misc.util;
const INTERFACE_SETTINGS = 'org.gnome.desktop.interface';
const POWER_SETTINGS = 'org.gnome.settings-daemon.plugins.power';
const XSETTINGS_SETTINGS = 'org.gnome.settings-daemon.plugins.xsettings';
const TOUCHPAD_SETTINGS = 'org.gnome.settings-daemon.peripherals.touchpad';
const KEYBINDING_SETTINGS = 'org.gnome.settings-daemon.plugins.media-keys';
const CUSTOM_KEYBINDING_SETTINGS = 'org.gnome.settings-daemon.plugins.media-keys.custom-keybinding';
const A11Y_SETTINGS = 'org.gnome.desktop.a11y.applications';
const MAGNIFIER_SETTINGS = 'org.gnome.desktop.a11y.magnifier';
const INPUT_SOURCE_SETTINGS = 'org.gnome.desktop.input-sources';
const MediaKeysInterface = <interface name='org.gnome.SettingsDaemon.MediaKeys'>
<method name='GrabMediaPlayerKeys'>
<arg name='application' direction='in' type='s'/>
<arg name='time' direction='in' type='u'/>
</method>
<method name='ReleaseMediaPlayerKeys'>
<arg name='application' direction='in' type='s'/>
</method>
<signal name='MediaPlayerKeyPressed'>
<arg name='application' type='s'/>
<arg name='key' type='s'/>
</signal>
</interface>;
/* [ actionName, setting, hardcodedKeysym, overviewOnly, args ] */
/* (overviewOnly means that the keybinding is handled when the shell is not
modal, or when the overview is active, but not when other modal operations
are active; otherwise the keybinding is always handled) */
const DEFAULT_KEYBINDINGS = [
[ 'doTouchpadToggle', null, 'XF86TouchpadToggle', false ],
[ 'doTouchpadSet', null, 'XF86TouchpadOn', false, [ true ] ],
[ 'doTouchpadSet', null, 'XF86TouchpadOff', false, [ false ] ],
[ 'doMute', 'volume-mute', null, false, [ false ] ],
[ 'doVolumeAdjust', 'volume-down', null, false, [ Clutter.ScrollDirection.DOWN, false ] ],
[ 'doVolumeAdjust', 'volume-up', null, false, [ Clutter.ScrollDirection.UP, false ] ],
[ 'doMute', null, '<Alt>XF86AudioMute', false, [ true ] ],
[ 'doVolumeAdjust', null, '<Alt>XF86AudioLowerVolume', false, [ Clutter.ScrollDirection.DOWN, true ] ],
[ 'doVolumeAdjust', null, '<Alt>XF86AudioRaiseVolume', false, [ Clutter.ScrollDirection.UP, true ] ],
[ 'doLogout', 'logout', null, true ],
[ 'doEject', 'eject', null, false ],
[ 'doHome', 'home', null, true ],
[ 'doLaunchMimeHandler', 'media', null, true, [ 'application/x-vorbis+ogg' ] ],
[ 'doLaunchApp', 'calculator', null, true, [ 'gcalcltool.desktop' ] ],
[ 'doLaunchApp', 'search', null, true, [ 'tracker-needle.desktop' ] ],
[ 'doLaunchMimeHandler', 'email', null, true, [ 'x-scheme-handler/mailto' ] ],
[ 'doScreensaver', 'screensaver', null, true ],
[ 'doScreensaver', null, 'XF86ScreenSaver', true ],
[ 'doLaunchApp', 'help', null, true, [ 'yelp.desktop' ] ],
[ 'doSpawn', 'screenshot', null, true, [ ['gnome-screenshot'] ] ],
[ 'doSpawn', 'window-screenshot', null, true, [ ['gnome-screenshot', '--window'] ] ],
[ 'doSpawn', 'area-screenshot', null, true, [ ['gnome-screenshot', '--area'] ] ],
[ 'doSpawn', 'screenshot-clip', null, true, [ ['gnome-screenshot', '--clipboard'] ] ],
[ 'doSpawn', 'window-screenshot-clip', null, true, [ ['gnome-screenshot', '--window', '--clipboard'] ] ],
[ 'doSpawn', 'area-screenshot-clip', null, true, [ ['gnome-screenshot', '--area', '--clipboard'] ] ],
[ 'doLaunchMimeHandler', 'www', null, true, [ 'x-scheme-handler/http' ] ],
[ 'doMediaKey', 'play', null, true, [ 'Play' ] ],
[ 'doMediaKey', 'pause', null, true, [ 'Pause' ] ],
[ 'doMediaKey', 'stop', null, true, [ 'Stop' ] ],
[ 'doMediaKey', 'previous', null, true, [ 'Previous' ] ],
[ 'doMediaKey', 'next', null, true, [ 'Next' ] ],
[ 'doMediaKey', null, 'XF86AudioRewind', true, [ 'Rewind' ] ],
[ 'doMediaKey', null, 'XF86AudioForward', true, [ 'FastForward' ] ],
[ 'doMediaKey', null, 'XF86AudioRepeat', true, [ 'Repeat' ] ],
[ 'doMediaKey', null, 'XF86AudioRandomPlay', true, [ 'Shuffle' ] ],
[ 'doXRandRAction', null, '<Super>p', false, [ 'VideoModeSwitch' ] ],
/* Key code of the XF86Display key (Fn-F7 on Thinkpads, Fn-F4 on HP machines, etc.) */
[ 'doXRandRAction', null, 'XF86Display', false, [ 'VideoModeSwitch' ] ],
/* Key code of the XF86RotateWindows key (present on some tablets) */
[ 'doXRandRAction', null, 'XF86RotateWindows', false, [ 'Rotate' ] ],
[ 'doA11yAction', 'magnifier', null, true, [ 'screen-magnifier-enabled' ] ],
[ 'doA11yAction', 'screenreader', null, true, [ 'screen-reader-enabled' ] ],
[ 'doA11yAction', 'on-screen-keyboard', null, true, [ 'screen-keyboard-enabled' ] ],
[ 'doTextSize', 'increase-text-size', null, true, [ 1 ] ],
[ 'doTextSize', 'decrease-text-size', null, true, [ -1 ] ],
[ 'doToggleContrast', 'toggle-contrast', null, true ],
[ 'doMagnifierZoom', 'magnifier-zoom-in', null, true, [ 1 ] ],
[ 'doMagnifierZoom', 'magnifier-zoom-out', null, true, [ -1 ] ],
[ 'doPowerAction', null, 'XF86PowerOff', true, [ 'button-power' ] ],
/* the kernel / Xorg names really are like this... */
[ 'doPowerAction', null, 'XF86Suspend', false, [ 'button-sleep' ] ],
[ 'doPowerAction', null, 'XF86Sleep', false, [ 'button-suspend' ] ],
[ 'doPowerAction', null, 'XF86Hibernate', false, [ 'button-hibernate' ] ],
[ 'doBrightness', null, 'XF86MonBrightnessUp', false, [ 'Screen', 'StepUp' ] ],
[ 'doBrightness', null, 'XF86MonBrightnessDown', false, [ 'Screen', 'StepDown' ] ],
[ 'doBrightness', null, 'XF86KbdBrightnessUp', false, [ 'Keyboard', 'StepUp' ] ],
[ 'doBrightness', null, 'XF86KbdBrightnessDown', false, [ 'Keyboard', 'StepDown' ] ],
[ 'doBrightnessToggle', null, 'XF86KbdLightOnOff', false, ],
[ 'doInputSource', 'switch-input-source', null, false, [ +1 ] ],
[ 'doInputSource', 'switch-input-source-backward', null, false, [ -1 ] ],
[ 'doLaunchApp', null, 'XF86Battery', true, [ 'gnome-power-statistics.desktop' ] ]
];
var osdWin;
const OSDWindow = new Lang.Class({
Name: 'OSDWindow',
FADE_TIMEOUT: 1500,
FADE_DURATION: 100,
_init: function(iconName, value) {
/* assume 130x130 on a 640x480 display and scale from there */
let monitor = Main.layoutManager.primaryMonitor;
let scalew = monitor.width / 640.0;
let scaleh = monitor.height / 480.0;
let scale = Math.min(scalew, scaleh);
let size = 130 * Math.max(1, scale);
this.actor = new St.BoxLayout({ style_class: 'osd-window',
vertical: true,
reactive: false,
visible: false,
width: size,
height: size,
});
this._icon = new St.Icon({ icon_name: iconName,
icon_size: size / 2,
});
this.actor.add(this._icon, { expand: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.MIDDLE });
this._value = value;
this._progressBar = new St.DrawingArea({ style_class: 'osd-progress-bar' });
this._progressBar.connect('repaint', Lang.bind(this, this._drawProgress));
this.actor.add(this._progressBar, { expand: true, x_fill: true, y_fill: false });
this._progressBar.visible = value !== undefined;
Main.layoutManager.addChrome(this.actor);
/* Position in the middle of primary monitor */
let [width, height] = this.actor.get_size();
this.actor.x = ((monitor.width - width) / 2) + monitor.x;
this.actor.y = monitor.y + (monitor.height / 2) + (monitor.height / 2 - height) / 2;
},
show: function() {
this.actor.show();
Tweener.addTween(this.actor,
{ opacity: 255,
time: this.FADE_DURATION / 1000,
transition: 'easeInQuad' });
if (this._timeoutId)
GLib.source_remove(this._timeoutId);
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this.FADE_TIMEOUT, Lang.bind(this, this.hide));
},
hide: function() {
Tweener.addTween(this.actor,
{ opacity: 0,
time: this.FADE_DURATION / 1000,
transition: 'easeOutQuad',
onComplete: function() {
this.actor.destroy();
this.actor = null;
osdWin = null;
},
onCompleteScope: this });
return false;
},
setIcon: function(name) {
this._icon.icon_name = name;
},
setValue: function(value) {
if (value == this._value)
return;
this._value = value;
this._progressBar.visible = value !== undefined;
this._progressBar.queue_repaint();
},
_drawProgress: function(area) {
let cr = area.get_context();
let themeNode = this.actor.get_theme_node();
let color = themeNode.get_foreground_color();
Clutter.cairo_set_source_color(cr, color);
let [width, height] = area.get_surface_size();
width = width * this._value;
cr.moveTo(0,0);
cr.lineTo(width, 0);
cr.lineTo(width, height);
cr.lineTo(0, height);
cr.fill();
}
});
function showOSD(icon, value) {
if (osdWin) {
osdWin.setIcon(icon);
osdWin.setValue(value);
} else {
osdWin = new OSDWindow(icon, value);
}
osdWin.show();
}
const MediaKeysGrabber = new Lang.Class({
Name: 'MediaKeysGrabber',
_init: function() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(MediaKeysInterface, this);
this._apps = [];
},
enable: function() {
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SettingsDaemon/MediaKeys');
},
disable: function() {
this._dbusImpl.unexport();
},
GrabMediaPlayerKeysAsync: function(parameters, invocation) {
let [appName, time] = parameters;
/* I'm not sure of this code, but it is in gnome-settings-daemon
(letting alone that the introspection is wrong in glib...)
*/
if (time == Gdk.CURRENT_TIME) {
let tv = new GLib.TimeVal;
GLib.get_current_time(tv);
time = tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
let pos = -1;
for (let i = 0; i < this._apps.length; i++) {
if (this._apps[i].appName == appName) {
pos = i;
break;
}
}
if (pos != -1)
this._freeMediaPlayer(pos);
let app = {
appName: appName,
name: invocation.get_sender(),
time: time,
watchId: Gio.DBus.session.watch_name(invocation.get_sender(),
Gio.BusNameWatcherFlags.NONE,
null,
Lang.bind(this, this._onNameVanished)),
};
Util.insertSorted(this._apps, app, function(a, b) {
return b.time-a.time;
});
invocation.return_value(GLib.Variant.new('()', []));
},
ReleaseMediaPlayerAsync: function(parameters, invocation) {
let name = invocation.get_sender();
let [appName] = parameters;
let pos = -1;
for (let i = 0; i < this._apps.length; i++) {
if (this._apps[i].appName == appName) {
pos = i;
break;
}
}
if (pos == -1) {
for (let i = 0; i < this._apps.length; i++) {
if (this._apps[i].name == name) {
pos = i;
break;
}
}
}
if (pos != -1)
this._freeMediaPlayer(pos);
invocation.return_value(GLib.Variant.new('()', []));
},
_freeMediaPlayer: function(pos) {
let app = this._apps[pos];
Gio.bus_unwatch_name(app.watchId)
this._apps.splice(pos, 1);
},
mediaKeyPressed: function(key) {
if (this._apps.length == 0) {
showOSD('action-unavailable-symbolic');
return;
}
let app = this._apps[0];
Gio.DBus.session.emit_signal(app.name,
'/org/gnome/SettingsDaemon/MediaKeys',
'org.gnome.SettingsDaemon.MediaKeys',
'MediaPlayerKeyPressed',
GLib.Variant.new('(ss)', [app.appName || '',
key]));
},
});
const MediaKeysManager = new Lang.Class({
Name: 'MediaKeysManager',
_init: function() {
this._a11yControl = Main.panel.statusArea.a11y;
this._volumeControl = Main.panel.statusArea.volume;
this._userMenu = Main.panel.statusArea.userMenu;
this._mediaPlayerKeys = new MediaKeysGrabber();
this._keybindingSettings = new Gio.Settings({ schema: KEYBINDING_SETTINGS });
},
enable: function() {
for (let i = 0; i < DEFAULT_KEYBINDINGS.length; i++) {
let [action, setting, keyval, overviewOnly, args] = DEFAULT_KEYBINDINGS[i];
let func = this[action];
if (!func) {
log('Keybinding action %s is missing'.format(action));
continue;
}
let name = setting ? setting : 'media-keys-keybindings-%d'.format(i);
let ok;
func = Util.wrapKeybinding(Lang.bind.apply(null, [this, func].concat(args)), overviewOnly);
if (setting)
ok = global.display.add_keybinding(setting, this._keybindingSettings,
Meta.KeyBindingFlags.BUILTIN |
Meta.KeyBindingFlags.IS_SINGLE |
Meta.KeyBindingFlags.HANDLE_WHEN_GRABBED, func);
else
ok = global.display.add_grabbed_key(name, keyval,
Meta.KeyBindingFlags.HANDLE_WHEN_GRABBED, func);
if (!ok)
log('Installing keybinding %s failed'.format(name));
}
this._customKeybindings = [];
this._changedId = this._keybindingSettings.connect('changed::custom-keybindings',
Lang.bind(this, this._reloadCustomKeybindings));
this._reloadCustomKeybindings();
this._mediaPlayerKeys.enable();
},
disable: function() {
for (let i = 0; i < DEFAULT_KEYBINDINGS.length; i++) {
let [action, setting, keyval, overviewOnly, args] = DEFAULT_KEYBINDINGS[i];
let name = setting ? setting : 'media-keys-keybindings-%d'.format(i);
if (setting)
global.display.remove_keybinding(setting, this._keybindingSettings);
else
global.display.remove_grabbed_key(name);
}
this._clearCustomKeybindings();
this._keybindingSettings.disconnect(this._changedId);
this._mediaPlayerKeys.disable();
},
_clearCustomKeybindings: function() {
for (let i = 0; i < this._customKeybindings.length; i++)
global.display.remove_keybinding('binding', this._customKeybindings[i]);
this._customKeybindings = [];
},
_reloadCustomKeybindings: function() {
this._clearCustomKeybindings();
let paths = this._keybindingSettings.get_strv('custom-keybindings');
for (let i = 0; i < paths.length; i++) {
let setting = new Gio.Settings({ schema: CUSTOM_KEYBINDING_SETTINGS,
path: paths[i] });
let func = Util.wrapKeybinding(Lang.bind(this, this.doCustom, setting), true);
global.display.add_keybinding('binding', setting,
Meta.KeyBindingFlags.IS_SINGLE |
Meta.KeyBindingFlags.HANDLE_WHEN_GRABBED, func);
this._customKeybindings.push(setting);
}
},
doCustom: function(display, screen, window, binding, settings) {
let command = settings.get_string('command');
Util.spawnCommandLine(command);
},
doTouchpadToggle: function(display, screen, window, binding) {
let settings = new Gio.Settings({ schema: TOUCHPAD_SETTINGS });
let enabled = settings.get_boolean('touchpad-enabled');
this.doTouchpadSet(display, screen, window, binding, !enabled);
settings.set_boolean(!enabled);
return true;
},
doTouchpadSet: function(display, screen, window, binding, enabled) {
showOSD(enabled ? 'input-touchpad-symbolic' : 'touchpad-disabled-symbolic');
return true;
},
doMute: function(display, screen, window, binding, quiet) {
let [icon, value] = this._volumeControl.volumeMenu.toggleMute(quiet);
showOSD(icon, value);
return true;
},
doVolumeAdjust: function(display, screen, window, binding, direction, quiet) {
let [icon, value] = this._volumeControl.volumeMenu.scroll(direction, quiet);
showOSD(icon, value);
return true;
},
doLogout: function(display, screen, window, binding) {
this._userMenu.logOut();
return true;
},
doEject: function(display, screen, window, binding) {
let volumeMonitor = Gio.VolumeMonitor.get();
let drives = volumeMonitor.get_connected_drives();
let score = 0, drive;
for (let i = 0; i < drives.length; i++) {
if (!drives[i].can_eject())
continue;
if (!drives[i].is_media_removable())
continue;
if (score < 1) {
drive = drives[i];
score = 1;
}
if (!drives[i].has_media())
continue;
if (score < 2) {
drive = drives[i];
score = 2;
break;
}
}
showOSD('media-eject-custom-symbolic');
if (!drive)
return true;
let mountOp = new ShellMountOperation.ShellMountOperation(drive);
drive.eject_with_operation(Gio.MountUnmountFlags.FORCE,
mountOp.mountOp, null, null);
return true;
},
doHome: function() {
let homeFile = Gio.file_new_for_path (GLib.get_home_dir());
let homeUri = homeFile.get_uri();
Gio.app_info_launch_default_for_uri(homeUri, null);
return true;
},
doLaunchMimeHandler: function(display, screen, window, binding, mimeType) {
let gioApp = Gio.AppInfo.get_default_for_type(mimeType, false);
if (gioApp != null) {
let app = Shell.AppSystem.get_default().lookup_app(gioApp.get_id());
app.open_new_window(-1);
} else {
log('Could not find default application for \'%s\' mime-type'.format(mimeType));
}
return true;
},
doLaunchApp: function(display, screen, window, binding, appId) {
let app = Shell.AppSystem.get_default().lookup_app(appId);
app.open_new_window(-1);
return true;
},
doScreensaver: function() {
// FIXME: handled in house, to the screenshield!
return true;
},
doSpawn: function(display, screen, window, binding, argv) {
Util.spawn(argv);
return true;
},
doMediaKey: function(display, screen, window, binding, key) {
this._mediaPlayerKeys.mediaKeyPressed(key);
},
_onXRandRFinished: function(connection, result) {
connection.call_finish(result);
this._XRandRCancellable = null;
},
doXRandRAction: function(display, screen, window, binding, action) {
if (this._XRandRCancellable)
this._XRandRCancellable.cancel();
this._XRandRCancellable = new Gio.Cancellable();
Gio.DBus.session.call('org.gnome.SettingsDaemon',
'/org/gnome/SettingsDaemon/XRANDR',
'org.gnome.SettingsDaemon.XRANDR_2',
action,
GLib.Variant.new('(x)', [global.get_current_time()]),
null, /* reply type */
Gio.DBusCallFlags.NONE,
-1,
this._XRandRCancellable,
Lang.bind(this, this._onXRandRFinished));
},
doA11yAction: function(display, screen, window, binding, key) {
let settings = new Gio.Settings({ schema: A11Y_SETTINGS });
let enabled = settings.get_boolean(key);
settings.set_boolean(key, !enabled);
},
doTextSize: function(display, screen, window, binding, multiplier) {
// Same values used in the Seeing tab of the Universal Access panel
const FACTORS = [ 0.75, 1.0, 1.25, 1.5 ];
// Figure out the current DPI scaling factor
let settings = new Gio.Settings({ schema: INTERFACE_SETTINGS });
let factor = settings.get_double('text-scaling-factor');
factor += multiplier * 0.25;
/* Try to find a matching value */
let distance = 1e6;
let best = 1.0;
for (let i = 0; i < FACTORS.length; i++) {
let d = Math.abs(factor - FACTORS[i]);
if (d < distance) {
best = factors[i];
distance = d;
}
}
if (best == 1.0)
settings.reset('text-scaling-factor');
else
settings.set_double('text-scaling-factor', best);
},
doToggleContrast: function(display, screen, window, binding) {
this._a11yControl.toggleHighContrast();
},
doMagnifierZoom: function(display, screen, window, binding, offset) {
let settings = new Gio.Settings({ schema: MAGNIFIER_SETTINGS });
let value = settings.get_value('mag-factor');
value = Math.round(value + offset);
settings.set_value('mag-factor', value);
},
doPowerAction: function(display, screen, window, binding, action) {
let settings = new Gio.Settings({ schema: POWER_SETTINGS });
switch (settings.get_string(action)) {
case 'suspend':
this._userMenu.suspend();
break;
case 'interactive':
case 'shutdown':
this._userMenu.shutdown();
break;
case 'hibernate':
this._userMenu.hibernate();
break;
case 'blank':
case 'default':
default:
break;
}
},
_onBrightnessFinished: function(connection, result, kind) {
let [percentage] = connection.call_finish(result).deep_unpack();
let icon = kind == 'Keyboard' ? 'keyboard-brightness-symbolic' : 'display-brightness-symbolic';
showOSD(icon, percentage / 100);
},
doBrightness: function(display, screen, window, binding, kind, action) {
let iface = 'org.gnome.SettingsDaemon.Power.' + kind;
let objectPath = '/org/gnome/SettingsDaemon/Power';
Gio.DBus.session.call('org.gnome.SettingsDaemon',
objectPath, iface, action,
null, null, /* parameters, reply type */
Gio.DBusCallFlags.NONE, -1, null,
Lang.bind(this, this._onBrightnessFinished, kind));
},
doInputSource: function(display, screen, window, binding, offset) {
let settings = new Gio.Settings({ schema: INPUT_SOURCE_SETTINGS });
let current = settings.get_uint('current');
let max = settings.get_strv('sources').length - 1;
current += offset;
if (current < 0)
current = 0;
else if (current > max)
current = max;
settings.set_uint('current', current);
},
});
const Component = MediaKeysManager;

View File

@ -1,23 +1,4 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/*
* Copyright 2011 Giovanni Campagna <scampa.giovanni@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
@ -135,7 +116,10 @@ const NetworkSecretDialog = new Lang.Class({
} else
secret.valid = true;
secretTable.add(label, { row: pos, col: 0, x_expand: false, x_fill: true, x_align: St.Align.START, y_align: St.Align.START });
secretTable.add(label, { row: pos, col: 0,
x_expand: false, x_fill: true,
x_align: St.Align.START,
y_fill: false, y_align: St.Align.MIDDLE });
secretTable.add(secret.entry, { row: pos, col: 1, x_expand: true, x_fill: true, y_align: St.Align.END });
pos++;
@ -165,6 +149,7 @@ const NetworkSecretDialog = new Lang.Class({
}
this._okButton.button.reactive = valid;
this._okButton.button.can_focus = valid;
},
_onOk: function() {
@ -423,7 +408,10 @@ const VPNRequestHandler = new Lang.Class({
}
},
cancel: function() {
cancel: function(respond) {
if (respond)
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.USER_CANCELED);
if (this._newStylePlugin && this._shellDialog) {
this._shellDialog.close(global.get_current_time());
this._shellDialog.destroy();
@ -599,7 +587,7 @@ const NetworkAgent = new Lang.Class({
Name: 'NetworkAgent',
_init: function() {
this._native = new Shell.NetworkAgent({ auto_register: true,
this._native = new Shell.NetworkAgent({ auto_register: false,
identifier: 'org.gnome.Shell.NetworkAgent' });
this._dialogs = { };
@ -609,6 +597,24 @@ const NetworkAgent = new Lang.Class({
this._native.connect('cancel-request', Lang.bind(this, this._cancelRequest));
},
enable: function() {
this._native.register();
},
disable: function() {
let requestId;
for (requestId in this._dialogs)
this._dialogs[requestId].cancel();
this._dialogs = { };
for (requestId in this._vpnRequests)
this._vpnRequests[requestId].cancel(true);
this._vpnRequests = { };
this._native.unregister();
},
_newRequest: function(agent, requestId, connection, settingName, hints, flags) {
if (settingName == 'vpn') {
this._vpnRequest(requestId, connection, hints, flags);
@ -629,7 +635,7 @@ const NetworkAgent = new Lang.Class({
this._dialogs[requestId].destroy();
delete this._dialogs[requestId];
} else if (this._vpnRequests[requestId]) {
this._vpnRequests[requestId].cancel();
this._vpnRequests[requestId].cancel(false);
delete this._vpnRequests[requestId];
}
},
@ -698,3 +704,4 @@ const NetworkAgent = new Lang.Class({
}
}
});
const Component = NetworkAgent;

View File

@ -1,24 +1,4 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/*
* Copyright 2010 Red Hat, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: David Zeuthen <davidz@redhat.com>
*/
const Lang = imports.lang;
const Signals = imports.signals;
@ -33,8 +13,12 @@ const Mainloop = imports.mainloop;
const Polkit = imports.gi.Polkit;
const PolkitAgent = imports.gi.PolkitAgent;
const Components = imports.ui.components;
const ModalDialog = imports.ui.modalDialog;
const ShellEntry = imports.ui.shellEntry;
const UserMenu = imports.ui.userMenu;
const DIALOG_ICON_SIZE = 48;
const AuthenticationDialog = new Lang.Class({
Name: 'AuthenticationDialog',
@ -117,9 +101,11 @@ const AuthenticationDialog = new Lang.Class({
let userBox = new St.BoxLayout({ style_class: 'polkit-dialog-user-layout',
vertical: false });
messageBox.add(userBox);
this._userIcon = new St.Icon();
this._userIcon.hide();
userBox.add(this._userIcon,
this._userAvatar = new UserMenu.UserAvatarWidget(this._user,
{ iconSize: DIALOG_ICON_SIZE,
styleClass: 'polkit-dialog-user-icon' });
this._userAvatar.actor.hide();
userBox.add(this._userAvatar.actor,
{ x_fill: true,
y_fill: false,
x_align: St.Align.END,
@ -313,19 +299,9 @@ const AuthenticationDialog = new Lang.Class({
},
_onUserChanged: function() {
if (this._user.is_loaded) {
if (this._userIcon) {
let iconFileName = this._user.get_icon_file();
let iconFile = Gio.file_new_for_path(iconFileName);
let icon;
if (iconFile.query_exists(null)) {
icon = new Gio.FileIcon({file: iconFile});
} else {
icon = new Gio.ThemedIcon({name: 'avatar-default'});
}
this._userIcon.set_gicon (icon);
this._userIcon.show();
}
if (this._user.is_loaded && this._userAvatar) {
this._userAvatar.update();
this._userAvatar.actor.show();
}
},
@ -341,11 +317,20 @@ const AuthenticationAgent = new Lang.Class({
Name: 'AuthenticationAgent',
_init: function() {
this._currentDialog = null;
this._isCompleting = false;
this._handle = null;
this._native = new Shell.PolkitAuthenticationAgent();
this._native.connect('initiate', Lang.bind(this, this._onInitiate));
this._native.connect('cancel', Lang.bind(this, this._onCancel));
this._currentDialog = null;
this._isCompleting = false;
},
enable: function() {
this._native.register();
},
disable: function() {
this._native.unregister();
},
_onInitiate: function(nativeAgent, actionId, message, iconName, cookie, userNames) {
@ -403,6 +388,4 @@ const AuthenticationAgent = new Lang.Class({
}
});
function init() {
let agent = new AuthenticationAgent();
}
const Component = AuthenticationAgent;

View File

@ -0,0 +1,60 @@
const Lang = imports.lang;
const Gio = imports.gi.Gio;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const Recorder = new Lang.Class({
Name: 'Recorder',
_init: function() {
this._recorderSettings = new Gio.Settings({ schema: 'org.gnome.shell.recorder' });
this._desktopLockdownSettings = new Gio.Settings({ schema: 'org.gnome.desktop.lockdown' });
this._bindingSettings = new Gio.Settings({ schema: 'org.gnome.shell.keybindings' });
this._recorder = null;
},
enable: function() {
global.display.add_keybinding('toggle-recording',
this._bindingSettings,
Meta.KeyBindingFlags.NONE, Lang.bind(this, this._toggleRecorder));
},
disable: function() {
global.display.remove_keybinding('toggle-recording');
},
_ensureRecorder: function() {
if (this._recorder == null)
this._recorder = new Shell.Recorder({ stage: global.stage });
return this._recorder;
},
_toggleRecorder: function() {
let recorder = this._ensureRecorder();
if (recorder.is_recording()) {
recorder.close();
Meta.enable_unredirect_for_screen(global.screen);
} else if (!this._desktopLockdownSettings.get_boolean('disable-save-to-disk')) {
// read the parameters from GSettings always in case they have changed
recorder.set_framerate(this._recorderSettings.get_int('framerate'));
/* Translators: this is a filename used for screencast recording */
// xgettext:no-c-format
recorder.set_file_template(_("Screencast from %d %t") + '.' + this._recorderSettings.get_string('file-extension'));
let pipeline = this._recorderSettings.get_string('pipeline');
if (!pipeline.match(/^\s*$/))
recorder.set_pipeline(pipeline);
else
recorder.set_pipeline(null);
Meta.disable_unredirect_for_screen(global.screen);
recorder.record();
}
return true;
}
});
const Component = Recorder;

View File

@ -11,10 +11,10 @@ const Tpl = imports.gi.TelepathyLogger;
const Tp = imports.gi.TelepathyGLib;
const History = imports.misc.history;
const Params = imports.misc.params;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const Params = imports.misc.params;
const PopupMenu = imports.ui.popupMenu;
// See Notification.appendMessage
const SCROLLBACK_IMMEDIATE_TIME = 60; // 1 minute
@ -63,10 +63,10 @@ function makeMessageFromTplEvent(event) {
};
}
const Client = new Lang.Class({
Name: 'Client',
const TelepathyClient = new Lang.Class({
Name: 'TelepathyClient',
_init : function() {
_init: function() {
// channel path -> ChatSource
this._chatSources = {};
this._chatState = Tp.ChannelChatState.ACTIVE;
@ -89,9 +89,9 @@ const Client = new Lang.Class({
// channel matching its filters is detected.
// The second argument, recover, means _observeChannels will be run
// for any existing channel as well.
this._tpClient = new Shell.TpClient({ 'account-manager': this._accountManager,
'name': 'GnomeShell',
'uniquify-name': true })
this._tpClient = new Shell.TpClient({ name: 'GnomeShell',
account_manager: this._accountManager,
uniquify_name: true });
this._tpClient.set_observe_channels_func(
Lang.bind(this, this._observeChannels));
this._tpClient.set_approve_channels_func(
@ -99,6 +99,10 @@ const Client = new Lang.Class({
this._tpClient.set_handle_channels_func(
Lang.bind(this, this._handleChannels));
// Watch subscription requests and connection errors
this._subscriptionSource = null;
this._accountSource = null;
// Workaround for gjs not supporting GPtrArray in signals.
// See BGO bug #653941 for context.
this._tpClient.set_contact_list_changed_func(
@ -108,21 +112,26 @@ const Client = new Lang.Class({
// needed
this._tpClient.set_delegated_channels_callback(
Lang.bind(this, this._delegatedChannelsCb));
},
enable: function() {
try {
this._tpClient.register();
} catch (e) {
throw new Error('Couldn\'t register Telepathy client. Error: \n' + e);
}
// Watch subscription requests and connection errors
this._subscriptionSource = null;
this._accountSource = null;
this._accountManagerValidityChangedId = this._accountManager.connect('account-validity-changed',
Lang.bind(this, this._accountValidityChanged));
this._accountManager.connect('account-validity-changed',
Lang.bind(this, this._accountValidityChanged));
if (!this._accountManager.is_prepared(Tp.AccountManager.get_feature_quark_core()))
this._accountManager.prepare_async(null, Lang.bind(this, this._accountManagerPrepared));
},
this._accountManager.prepare_async(null, Lang.bind(this, this._accountManagerPrepared));
disable: function() {
this._tpClient.unregister();
this._accountManager.disconnect(this._accountManagerValidityChangedId);
this._accountManagerValidityChangedId = 0;
},
_observeChannels: function(observer, account, conn, channels,
@ -132,7 +141,7 @@ const Client = new Lang.Class({
let channel = channels[i];
let [targetHandle, targetHandleType] = channel.get_handle();
if (Shell.is_channel_invalidated(channel))
if (channel.get_invalidated())
continue;
/* Only observe contact text channels */
@ -184,7 +193,7 @@ const Client = new Lang.Class({
continue;
}
if (Shell.is_channel_invalidated(channel))
if (channel.get_invalidated())
continue;
// 'notify' will be true when coming from an actual HandleChannels
@ -211,13 +220,15 @@ const Client = new Lang.Class({
// We can only approve the rooms if we have been invited to it
let selfContact = channel.group_get_self_contact();
if (selfContact == null) {
Shell.decline_dispatch_op(context, 'Not invited to the room');
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
message: 'Not invited to the room' }));
return;
}
let [invited, inviter, reason, msg] = channel.group_get_local_pending_contact_info(selfContact);
if (!invited) {
Shell.decline_dispatch_op(context, 'Not invited to the room');
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
message: 'Not invited to the room' }));
return;
}
@ -237,8 +248,9 @@ const Client = new Lang.Class({
let channel = channels[0];
let chanType = channel.get_channel_type();
if (Shell.is_channel_invalidated(channel)) {
Shell.decline_dispatch_op(context, 'Channel is invalidated');
if (channel.get_invalidated()) {
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
message: 'Channel is invalidated' }));
return;
}
@ -249,7 +261,8 @@ const Client = new Lang.Class({
else if (chanType == Tp.IFACE_CHANNEL_TYPE_FILE_TRANSFER)
this._approveFileTransfer(account, conn, channel, dispatchOp, context);
else
Shell.decline_dispatch_op(context, 'Unsupported channel type');
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
message: 'Unsupported channel type' }));
},
_approveTextChannel: function(account, conn, channel, dispatchOp, context) {
@ -379,8 +392,7 @@ const Client = new Lang.Class({
_ensureSubscriptionSource: function() {
if (this._subscriptionSource == null) {
this._subscriptionSource = new MessageTray.Source(_("Subscription request"),
'gtk-dialog-question',
St.IconType.FULLCOLOR);
'gtk-dialog-question');
Main.messageTray.add(this._subscriptionSource);
this._subscriptionSource.connect('destroy', Lang.bind(this, function () {
this._subscriptionSource = null;
@ -416,8 +428,7 @@ const Client = new Lang.Class({
_ensureAccountSource: function() {
if (this._accountSource == null) {
this._accountSource = new MessageTray.Source(_("Connection error"),
'gtk-dialog-error',
St.IconType.FULLCOLOR);
'gtk-dialog-error');
Main.messageTray.add(this._accountSource);
this._accountSource.connect('destroy', Lang.bind(this, function () {
this._accountSource = null;
@ -471,6 +482,22 @@ const ChatSource = new Lang.Class({
this._getLogMessages();
},
buildRightClickMenu: function() {
let item;
let rightClickMenu = this.parent();
item = new PopupMenu.PopupMenuItem('');
item.actor.connect('notify::mapped', Lang.bind(this, function() {
item.label.set_text(this.isMuted ? _("Unmute") : _("Mute"));
}));
item.connect('activate', Lang.bind(this, function() {
this.setMuted(!this.isMuted);
this.emit('done-displaying-content');
}));
rightClickMenu.add(item.actor);
return rightClickMenu;
},
_updateAlias: function() {
let oldAlias = this.title;
let newAlias = this._contact.get_alias();
@ -482,64 +509,55 @@ const ChatSource = new Lang.Class({
this._notification.appendAliasChange(oldAlias, newAlias);
},
createIcon: function(size) {
this._iconBox = new St.Bin({ style_class: 'avatar-box' });
this._iconBox._size = size;
let textureCache = St.TextureCache.get_default();
getIcon: function() {
let file = this._contact.get_avatar_file();
if (file) {
let uri = file.get_uri();
this._iconBox.child = textureCache.load_uri_async(uri, this._iconBox._size, this._iconBox._size);
return new Gio.FileIcon({ file: file });
} else {
this._iconBox.child = new St.Icon({ icon_name: 'avatar-default',
icon_type: St.IconType.FULLCOLOR,
icon_size: this._iconBox._size });
return new Gio.ThemedIcon({ name: 'avatar-default' });
}
return this._iconBox;
},
createSecondaryIcon: function() {
let iconBox = new St.Bin();
iconBox.child = new St.Icon({ style_class: 'secondary-icon',
icon_type: St.IconType.FULLCOLOR });
getSecondaryIcon: function() {
let iconName;
let presenceType = this._contact.get_presence_type();
switch (presenceType) {
case Tp.ConnectionPresenceType.AVAILABLE:
iconBox.child.icon_name = 'user-available';
iconName = 'user-available';
break;
case Tp.ConnectionPresenceType.BUSY:
iconBox.child.icon_name = 'user-busy';
iconName = 'user-busy';
break;
case Tp.ConnectionPresenceType.OFFLINE:
iconBox.child.icon_name = 'user-offline';
iconName = 'user-offline';
break;
case Tp.ConnectionPresenceType.HIDDEN:
iconBox.child.icon_name = 'user-invisible';
iconName = 'user-invisible';
break;
case Tp.ConnectionPresenceType.AWAY:
iconBox.child.icon_name = 'user-away';
iconName = 'user-away';
break;
case Tp.ConnectionPresenceType.EXTENDED_AWAY:
iconBox.child.icon_name = 'user-idle';
iconName = 'user-idle';
break;
default:
iconBox.child.icon_name = 'user-offline';
iconName = 'user-offline';
}
return iconBox;
return new Gio.ThemedIcon({ name: iconName });
},
_updateAvatarIcon: function() {
this._setSummaryIcon(this.createIcon(this.ICON_SIZE));
this.iconUpdated();
this._notification.update(this._notification.title, null, { customContent: true });
},
open: function(notification) {
if (this._client.is_handling_channel(this._channel)) {
// We are handling the channel, try to pass it to Empathy
this._client.delegate_channels_async([this._channel], global.get_current_time(), '', null);
this._client.delegate_channels_async([this._channel],
global.get_current_time(),
'org.freedesktop.Telepathy.Client.Empathy.Chat', null);
}
else {
// We are not the handler, just ask to present the channel
@ -578,7 +596,7 @@ const ChatSource = new Lang.Class({
this._pendingMessages.push(message);
}
this._updateCount();
this.countUpdated();
let showTimestamp = false;
@ -624,8 +642,17 @@ const ChatSource = new Lang.Class({
this.destroy();
},
_updateCount: function() {
this._setCount(this._pendingMessages.length, this._pendingMessages.length > 0);
/* All messages are new messages for Telepathy sources */
get count() {
return this._pendingMessages.length;
},
get unseenCount() {
return this.count;
},
get countVisible() {
return this.count > 0;
},
_messageReceived: function(channel, message) {
@ -633,7 +660,7 @@ const ChatSource = new Lang.Class({
return;
this._pendingMessages.push(message);
this._updateCount();
this.countUpdated();
message = makeMessageFromTpMessage(message, NotificationDirection.RECEIVED);
this._notification.appendMessage(message);
@ -699,7 +726,7 @@ const ChatSource = new Lang.Class({
title = GLib.markup_escape_text(this.title, -1);
this._notification.update(this._notification.title, null, { customContent: true, secondaryIcon: this.createSecondaryIcon() });
this._notification.update(this._notification.title, null, { customContent: true, secondaryGIcon: this.getSecondaryIcon() });
if (message)
msg += ' <i>(' + GLib.markup_escape_text(message, -1) + ')</i>';
@ -710,10 +737,8 @@ const ChatSource = new Lang.Class({
if (idx >= 0) {
this._pendingMessages.splice(idx, 1);
this._updateCount();
this.countUpdated();
}
else
throw new Error('Message not in our pending list: ' + message);
},
_ackMessages: function() {
@ -729,7 +754,7 @@ const ChatNotification = new Lang.Class({
Extends: MessageTray.Notification,
_init: function(source) {
this.parent(source, source.title, null, { customContent: true, secondaryIcon: source.createSecondaryIcon() });
this.parent(source, source.title, null, { customContent: true, secondaryGIcon: source.getSecondaryIcon() });
this.setResident(true);
this._responseEntry = new St.Entry({ style_class: 'chat-response',
@ -738,16 +763,27 @@ const ChatNotification = new Lang.Class({
this._responseEntry.clutter_text.connect('text-changed', Lang.bind(this, this._onEntryChanged));
this.setActionArea(this._responseEntry);
this._oldMaxScrollAdjustment = 0;
this._responseEntry.clutter_text.connect('key-focus-in', Lang.bind(this, function() {
this.focused = true;
}));
this._responseEntry.clutter_text.connect('key-focus-out', Lang.bind(this, function() {
this.focused = false;
this.emit('unfocused');
}));
this._createScrollArea();
this._lastGroup = null;
this._lastGroupActor = null;
// Keep track of the bottom position for the current adjustment and
// force a scroll to the bottom if things change while we were at the
// bottom
this._oldMaxScrollValue = this._scrollArea.vscroll.adjustment.value;
this._scrollArea.add_style_class_name('chat-notification-scrollview');
this._scrollArea.vscroll.adjustment.connect('changed', Lang.bind(this, function(adjustment) {
let currentValue = adjustment.value + adjustment.page_size;
if (currentValue == this._oldMaxScrollAdjustment)
if (adjustment.value == this._oldMaxScrollValue)
this.scrollTo(St.Side.BOTTOM);
this._oldMaxScrollAdjustment = adjustment.upper;
this._oldMaxScrollValue = Math.max(adjustment.lower, adjustment.upper - adjustment.page_size);
}));
this._inputHistory = new History.HistoryManager({ entry: this._responseEntry.clutter_text });
@ -899,24 +935,32 @@ const ChatNotification = new Lang.Class({
let format;
// Show a week day and time if date is in the last week
if (daysAgo < 1 || (daysAgo < 7 && now.getDay() != date.getDay())) {
/* Translators: this is a time format string followed by a date.
If applicable, replace %X with a strftime format valid for your
locale, without seconds. */
// Show only the hour if date is on today
if(daysAgo < 1){
format = "<b>%H:%M</b>";
}
// Show the word "Yesterday" and time if date is on yesterday
else if(daysAgo <2){
/* Translators: this is a time format string followed by the word "Yesterday". i.e. "14:30 on Yesterday"*/
// xgettext:no-c-format
format = _("Sent at <b>%X</b> on <b>%A</b>");
format = _("<b>%H:%M</b> on Yesterday");
}
// Show a week day and time if date is in the last week
else if (daysAgo < 7) {
/* Translators: this is a time format string followed by a week day name. i.e. "14:30 on Monday*/
// xgettext:no-c-format
format = _("<b>%H:%M</b> on <b>%A</b>");
} else if (date.getYear() == now.getYear()) {
/* Translators: this is a time format in the style of "Wednesday, May 25",
shown when you get a chat message in the same year. */
/* Translators: this is a time format in the style of "14:30 on Wednesday, May 25",
shown when you get a chat message in the same year */
// xgettext:no-c-format
format = _("Sent on <b>%A</b>, <b>%B %d</b>");
format = _("<b>%H:%M</b> on <b>%A</b>, <b>%B</b> <b>%d</b>");
} else {
/* Translators: this is a time format in the style of "Wednesday, May 25, 2012",
shown when you get a chat message in a different year. */
/* Translators: this is a time format in the style of "14:30 on Wednesday, May 25, 2012",
shown when you get a chat message in a different year */
// xgettext:no-c-format
format = _("Sent on <b>%A</b>, <b>%B %d</b>, %Y");
format = _("<b>%H:%M</b> on <b>%A</b>, <b>%B</b> <b>%d</b>, %Y");
}
return date.toLocaleFormat(format);
@ -929,8 +973,7 @@ const ChatNotification = new Lang.Class({
let timeLabel = this._append({ body: this._formatTimestamp(lastMessageDate),
group: 'meta',
styles: ['chat-meta-message'],
childProps: { expand: true, x_fill: false,
x_align: St.Align.END },
childProps: { expand: true, x_fill: false },
noTimestamp: true,
timestamp: lastMessageTime });
@ -1031,9 +1074,8 @@ const ApproverSource = new Lang.Class({
this.parent();
},
createIcon: function(size) {
return new St.Icon({ gicon: this._gicon,
icon_size: size });
getIcon: function() {
return this._gicon;
}
});
@ -1094,7 +1136,7 @@ const AudioVideoNotification = new Lang.Class({
this.parent(source, title, null, { customContent: true });
this.setResident(true);
this.addButton('reject', _("Reject"));
this.addButton('reject', _("Decline"));
/* translators: this is a button label (verb), not a noun */
this.addButton('answer', _("Answer"));
@ -1184,7 +1226,6 @@ const SubscriptionRequestNotification = new Lang.Class({
}
else {
iconBox.child = new St.Icon({ icon_name: 'avatar-default',
icon_type: St.IconType.FULLCOLOR,
icon_size: iconBox._size });
}
@ -1329,15 +1370,14 @@ const AccountNotification = new Lang.Class({
case 'reconnect':
// If it fails again, a new notification should pop up with the
// new error.
account.reconnect_async(null, null);
account.reconnect_async(null);
break;
case 'edit':
let cmd = '/usr/bin/empathy-accounts'
+ ' --select-account=%s'
.format(account.get_path_suffix());
let app_info = Gio.app_info_create_from_commandline(cmd, null, 0,
null);
app_info.launch([], null, null);
let app_info = Gio.app_info_create_from_commandline(cmd, null, 0);
app_info.launch([], global.create_app_launch_context());
break;
}
this.destroy();
@ -1392,3 +1432,4 @@ const AccountNotification = new Lang.Class({
this.parent();
}
});
const Component = TelepathyClient;

View File

@ -27,7 +27,6 @@ const CtrlAltTabManager = new Lang.Class({
_init: function() {
this._items = [];
this._focusManager = St.FocusManager.get_for_stage(global.stage);
},
addGroup: function(root, name, icon, params) {
@ -41,11 +40,11 @@ const CtrlAltTabManager = new Lang.Class({
this._items.push(item);
root.connect('destroy', Lang.bind(this, function() { this.removeGroup(root); }));
this._focusManager.add_group(root);
global.focus_manager.add_group(root);
},
removeGroup: function(root) {
this._focusManager.remove_group(root);
global.focus_manager.remove_group(root);
for (let i = 0; i < this._items.length; i++) {
if (this._items[i].root == root) {
this._items.splice(i, 1);
@ -55,16 +54,17 @@ const CtrlAltTabManager = new Lang.Class({
},
focusGroup: function(item) {
if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
global.stage_input_mode == Shell.StageInputMode.NORMAL)
global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
if (item.window)
if (item.window) {
Main.activateWindow(item.window);
else if (item.focusCallback)
} else if (item.focusCallback) {
item.focusCallback();
else
} else {
if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
global.stage_input_mode == Shell.StageInputMode.NORMAL)
global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
item.root.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
}
},
// Sort the items into a consistent order; panel first, tray last,
@ -319,7 +319,6 @@ const CtrlAltTabSwitcher = new Lang.Class({
let icon = item.iconActor;
if (!icon) {
icon = new St.Icon({ icon_name: item.iconName,
icon_type: St.IconType.SYMBOLIC,
icon_size: POPUP_APPICON_SIZE });
}
box.add(icon, { x_fill: false, y_fill: false } );

View File

@ -21,6 +21,17 @@ const DASH_ITEM_LABEL_SHOW_TIME = 0.15;
const DASH_ITEM_LABEL_HIDE_TIME = 0.1;
const DASH_ITEM_HOVER_TIMEOUT = 300;
function getAppFromSource(source) {
if (source instanceof AppDisplay.AppWellIcon) {
return source.app;
} else if (source.metaWindow) {
let tracker = Shell.WindowTracker.get_default();
return tracker.get_window_app(source.metaWindow);
} else {
return null;
}
}
// A container like StBin, but taking the child's scale into account
// when requesting a size
const DashItemContainer = new Lang.Class({
@ -36,7 +47,11 @@ const DashItemContainer = new Lang.Class({
Lang.bind(this, this._allocate));
this.actor._delegate = this;
this.label = null;
this._labelText = "";
this.label = new St.Label({ style_class: 'dash-label'});
this.label.hide();
Main.layoutManager.addChrome(this.label);
this.actor.label_actor = this.label;
this.child = null;
this._childScale = 1;
@ -91,9 +106,10 @@ const DashItemContainer = new Lang.Class({
},
showLabel: function() {
if (this.label == null)
if (!this._labelText)
return;
this.label.set_text(this._labelText);
this.label.opacity = 0;
this.label.show();
@ -124,12 +140,8 @@ const DashItemContainer = new Lang.Class({
},
setLabelText: function(text) {
if (this.label == null)
this.label = new St.Label({ style_class: 'dash-label'});
this.label.set_text(text);
Main.layoutManager.addChrome(this.label);
this.label.hide();
this._labelText = text;
this.child.accessible_name = text;
},
hideLabel: function () {
@ -226,52 +238,76 @@ const DashItemContainer = new Lang.Class({
}
});
const RemoveFavoriteIcon = new Lang.Class({
Name: 'RemoveFavoriteIcon',
const ShowAppsIcon = new Lang.Class({
Name: 'ShowAppsIcon',
Extends: DashItemContainer,
_init: function() {
this.parent();
this._iconBin = new St.Bin({ style_class: 'remove-favorite' });
this.toggleButton = new St.Button({ style_class: 'show-apps',
track_hover: true,
can_focus: true,
toggle_mode: true });
this._iconActor = null;
this.icon = new IconGrid.BaseIcon(_("Remove"),
this.icon = new IconGrid.BaseIcon(_("Show Applications"),
{ setSizeManually: true,
showLabel: false,
createIcon: Lang.bind(this, this._createIcon) });
this._iconBin.set_child(this.icon.actor);
this._iconBin._delegate = this;
this.toggleButton.add_actor(this.icon.actor);
this.toggleButton._delegate = this;
this.setChild(this._iconBin);
this.setChild(this.toggleButton);
this.setDragApp(null);
},
_createIcon: function(size) {
this._iconActor = new St.Icon({ icon_name: 'user-trash',
style_class: 'remove-favorite-icon',
icon_size: size });
this._iconActor = new St.Icon({ icon_name: 'view-grid-symbolic',
icon_size: size,
style_class: 'show-apps-icon',
track_hover: true });
return this._iconActor;
},
setHover: function(hovered) {
this._iconBin.set_hover(hovered);
if (this._iconActor)
this._iconActor.set_hover(hovered);
_canRemoveApp: function(app) {
if (app == null)
return false;
let id = app.get_id();
let isFavorite = AppFavorites.getAppFavorites().isFavorite(id);
return isFavorite;
},
setDragApp: function(app) {
let canRemove = this._canRemoveApp(app);
this.toggleButton.set_hover(canRemove);
if (this._iconActor)
this._iconActor.set_hover(canRemove);
if (canRemove)
this.setLabelText(_("Remove from Favorites"));
else
this.setLabelText(_("Show Applications"));
},
// Rely on the dragged item being a favorite
handleDragOver: function(source, actor, x, y, time) {
let app = getAppFromSource(source);
if (app == null)
return DND.DragMotionResult.NO_DROP;
let id = app.get_id();
let isFavorite = AppFavorites.getAppFavorites().isFavorite(id);
if (!isFavorite)
return DND.DragMotionResult.NO_DROP;
return DND.DragMotionResult.MOVE_DROP;
},
acceptDrop: function(source, actor, x, y, time) {
let app = null;
if (source instanceof AppDisplay.AppWellIcon) {
let appSystem = Shell.AppSystem.get_default();
app = appSystem.lookup_app(source.getId());
} else if (source.metaWindow) {
let tracker = Shell.WindowTracker.get_default();
app = tracker.get_window_app(source.metaWindow);
}
let app = getAppFromSource(source);
if (app == null)
return false;
let id = app.get_id();
@ -295,6 +331,39 @@ const DragPlaceholderItem = new Lang.Class({
}
});
const DashActor = new Lang.Class({
Name: 'DashActor',
Extends: St.Widget,
_init: function() {
let layout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.VERTICAL });
this.parent({ name: 'dash',
layout_manager: layout,
clip_to_allocation: true });
},
vfunc_allocate: function(box, flags) {
let contentBox = this.get_theme_node().get_content_box(box);
let availWidth = contentBox.x2 - contentBox.x1;
this.set_allocation(box, flags);
let [appIcons, showAppsButton] = this.get_children();
let [showAppsMinHeight, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth);
let childBox = new Clutter.ActorBox();
childBox.x1 = contentBox.x1;
childBox.y1 = contentBox.y1;
childBox.x2 = contentBox.x2;
childBox.y2 = contentBox.y2 - showAppsNatHeight;
appIcons.allocate(childBox, flags);
childBox.y1 = contentBox.y2 - showAppsNatHeight;
childBox.y2 = contentBox.y2;
showAppsButton.allocate(childBox, flags);
}
});
const Dash = new Lang.Class({
Name: 'Dash',
@ -306,17 +375,25 @@ const Dash = new Lang.Class({
this._dragPlaceholder = null;
this._dragPlaceholderPos = -1;
this._animatingPlaceholdersCount = 0;
this._favRemoveTarget = null;
this._showLabelTimeoutId = 0;
this._resetHoverTimeoutId = 0;
this._labelShowing = false;
this._box = new St.BoxLayout({ name: 'dash',
vertical: true,
this._container = new DashActor();
this._box = new St.BoxLayout({ vertical: true,
clip_to_allocation: true });
this._box._delegate = this;
this._container.add_actor(this._box);
this.actor = new St.Bin({ y_align: St.Align.START, child: this._box });
this._showAppsIcon = new ShowAppsIcon();
this._showAppsIcon.icon.setIconSize(this.iconSize);
this._hookUpLabel(this._showAppsIcon);
this.showAppsButton = this._showAppsIcon.toggleButton;
this._container.add_actor(this._showAppsIcon.actor);
this.actor = new St.Bin({ child: this._container });
this.actor.connect('notify::height', Lang.bind(this,
function() {
if (this._maxHeight != this.actor.height)
@ -326,7 +403,6 @@ const Dash = new Lang.Class({
this._workId = Main.initializeDeferredWork(this._box, Lang.bind(this, this._redisplay));
this._tracker = Shell.WindowTracker.get_default();
this._appSystem = Shell.AppSystem.get_default();
this._appSystem.connect('installed-changed', Lang.bind(this, this._queueRedisplay));
@ -369,54 +445,25 @@ const Dash = new Lang.Class({
_endDrag: function() {
this._clearDragPlaceholder();
if (this._favRemoveTarget) {
this._favRemoveTarget.animateOutAndDestroy();
this._favRemoveTarget.actor.connect('destroy', Lang.bind(this,
function() {
this._favRemoveTarget = null;
}));
this._adjustIconSize();
}
this._showAppsIcon.setDragApp(null);
DND.removeDragMonitor(this._dragMonitor);
},
_onDragMotion: function(dragEvent) {
let app = null;
if (dragEvent.source instanceof AppDisplay.AppWellIcon)
app = this._appSystem.lookup_app(dragEvent.source.getId());
else if (dragEvent.source.metaWindow)
app = this._tracker.get_window_app(dragEvent.source.metaWindow);
else
let app = getAppFromSource(dragEvent.source);
if (app == null)
return DND.DragMotionResult.CONTINUE;
let id = app.get_id();
let showAppsHovered =
this._showAppsIcon.actor.contains(dragEvent.targetActor);
let favorites = AppFavorites.getAppFavorites().getFavoriteMap();
let srcIsFavorite = (id in favorites);
if (srcIsFavorite &&
app.get_state() != Shell.AppState.RUNNING &&
dragEvent.source.actor &&
this.actor.contains (dragEvent.source.actor) &&
this._favRemoveTarget == null) {
this._favRemoveTarget = new RemoveFavoriteIcon();
this._favRemoveTarget.icon.setIconSize(this.iconSize);
this._box.add(this._favRemoveTarget.actor);
this._adjustIconSize();
this._favRemoveTarget.animateIn();
}
let favRemoveHovered = false;
if (this._favRemoveTarget)
favRemoveHovered =
this._favRemoveTarget.actor.contains(dragEvent.targetActor);
if (!this._box.contains(dragEvent.targetActor) || favRemoveHovered)
if (!this._box.contains(dragEvent.targetActor) || showAppsHovered)
this._clearDragPlaceholder();
if (this._favRemoveTarget)
this._favRemoveTarget.setHover(favRemoveHovered);
if (showAppsHovered)
this._showAppsIcon.setDragApp(app);
else
this._showAppsIcon.setDragApp(null);
return DND.DragMotionResult.CONTINUE;
},
@ -432,44 +479,63 @@ const Dash = new Lang.Class({
Main.queueDeferredWork(this._workId);
},
_hookUpLabel: function(item) {
item.child.connect('notify::hover', Lang.bind(this, function() {
this._onHover(item);
}));
Main.overview.connect('hiding', Lang.bind(this, function() {
this._labelShowing = false;
item.hideLabel();
}));
},
_createAppItem: function(app) {
let display = new AppDisplay.AppWellIcon(app,
let appIcon = new AppDisplay.AppWellIcon(app,
{ setSizeManually: true,
showLabel: false });
display._draggable.connect('drag-begin',
appIcon._draggable.connect('drag-begin',
Lang.bind(this, function() {
display.actor.opacity = 50;
appIcon.actor.opacity = 50;
}));
display._draggable.connect('drag-end',
appIcon._draggable.connect('drag-end',
Lang.bind(this, function() {
display.actor.opacity = 255;
appIcon.actor.opacity = 255;
}));
appIcon.connect('menu-state-changed',
Lang.bind(this, function(appIcon, opened) {
this._itemMenuStateChanged(item, opened);
}));
let item = new DashItemContainer();
item.setChild(display.actor);
item.setChild(appIcon.actor);
// Override default AppWellIcon label_actor, now the
// accessible_name is set at DashItemContainer.setLabelText
appIcon.actor.label_actor = null;
item.setLabelText(app.get_name());
// Override default AppWellIcon label_actor
display.actor.label_actor = item.label;
display.icon.setIconSize(this.iconSize);
display.actor.connect('notify::hover',
Lang.bind(this, function() {
this._onHover(item, display)
}));
Main.overview.connect('hiding',
Lang.bind(this, function() {
this._labelShowing = false;
item.hideLabel();
}));
appIcon.icon.setIconSize(this.iconSize);
this._hookUpLabel(item);
return item;
},
_onHover: function (item, display) {
if (display.actor.get_hover() && !display.isMenuUp) {
_itemMenuStateChanged: function(item, opened) {
// When the menu closes, it calls sync_hover, which means
// that the notify::hover handler does everything we need to.
if (opened) {
if (this._showLabelTimeoutId > 0) {
Mainloop.source_remove(this._showLabelTimeoutId);
this._showLabelTimeoutId = 0;
}
item.hideLabel();
}
},
_onHover: function (item) {
if (item.child.get_hover()) {
if (this._showLabelTimeoutId == 0) {
let timeout = this._labelShowing ? 0 : DASH_ITEM_HOVER_TIMEOUT;
this._showLabelTimeoutId = Mainloop.timeout_add(timeout,
@ -510,18 +576,12 @@ const Dash = new Lang.Class({
!actor._delegate.animatingOut;
});
if (iconChildren.length == 0) {
this._box.add_style_pseudo_class('empty');
return;
}
this._box.remove_style_pseudo_class('empty');
iconChildren.push(this._showAppsIcon.actor);
if (this._maxHeight == -1)
return;
let themeNode = this._box.get_theme_node();
let themeNode = this._container.get_theme_node();
let maxAllocation = new Clutter.ActorBox({ x1: 0, y1: 0,
x2: 42 /* whatever */,
y2: this._maxHeight });
@ -547,7 +607,6 @@ const Dash = new Lang.Class({
[minHeight, natHeight] = iconChildren[0].get_preferred_height(-1);
}
// Subtract icon padding and box spacing from the available height
availHeight -= iconChildren.length * (natHeight - this.iconSize) +
(iconChildren.length - 1) * spacing;
@ -736,11 +795,7 @@ const Dash = new Lang.Class({
},
handleDragOver : function(source, actor, x, y, time) {
let app = null;
if (source instanceof AppDisplay.AppWellIcon)
app = this._appSystem.lookup_app(source.getId());
else if (source.metaWindow)
app = this._tracker.get_window_app(source.metaWindow);
let app = getAppFromSource(source);
// Don't allow favoriting of transient apps
if (app == null || app.is_window_backed())
@ -821,12 +876,7 @@ const Dash = new Lang.Class({
// Draggable target interface
acceptDrop : function(source, actor, x, y, time) {
let app = null;
if (source instanceof AppDisplay.AppWellIcon) {
app = this._appSystem.lookup_app(source.getId());
} else if (source.metaWindow) {
app = this._tracker.get_window_app(source.metaWindow);
}
let app = getAppFromSource(source);
// Don't allow favoriting of transient apps
if (app == null || app.is_window_backed()) {

View File

@ -70,16 +70,8 @@ const DateMenuButton = new Lang.Class({
this._date.style_class = 'datemenu-date-label';
vbox.add(this._date);
if (Main.sessionMode.showCalendarEvents) {
this._eventSource = new Calendar.DBusEventSource();
this._eventList = new Calendar.EventsList(this._eventSource);
} else {
this._eventSource = null;
this._eventList = null;
}
// Calendar
this._calendar = new Calendar.Calendar(this._eventSource);
this._eventList = new Calendar.EventsList();
this._calendar = new Calendar.Calendar();
this._calendar.connect('selected-date-changed',
Lang.bind(this, function(calendar, date) {
@ -97,31 +89,34 @@ const DateMenuButton = new Lang.Class({
separator.setColumnWidths(1);
vbox.add(separator.actor, {y_align: St.Align.END, expand: true, y_fill: false});
item.actor.show_on_set_parent = false;
item.actor.can_focus = false;
item.actor.reparent(vbox);
this._dateAndTimeSeparator = separator;
}
if (Main.sessionMode.showCalendarEvents) {
// Add vertical separator
this._separator = new St.DrawingArea({ style_class: 'calendar-vertical-separator',
pseudo_class: 'highlighted' });
this._separator.connect('repaint', Lang.bind(this, _onVertSepRepaint));
hbox.add(this._separator);
item = new St.DrawingArea({ style_class: 'calendar-vertical-separator',
pseudo_class: 'highlighted' });
item.connect('repaint', Lang.bind(this, _onVertSepRepaint));
hbox.add(item);
// Fill up the second column
vbox = new St.BoxLayout({ name: 'calendarEventsArea',
vertical: true });
hbox.add(vbox, { expand: true });
// Fill up the second column
vbox = new St.BoxLayout({name: 'calendarEventsArea',
vertical: true});
hbox.add(vbox, { expand: true });
// Event list
vbox.add(this._eventList.actor, { expand: true });
// Event list
vbox.add(this._eventList.actor, { expand: true });
this._openCalendarItem = new PopupMenu.PopupMenuItem(_("Open Calendar"));
this._openCalendarItem.connect('activate', Lang.bind(this, this._onOpenCalendarActivate));
this._openCalendarItem.actor.can_focus = false;
vbox.add(this._openCalendarItem.actor, {y_align: St.Align.END, expand: true, y_fill: false});
item = new PopupMenu.PopupMenuItem(_("Open Calendar"));
item.connect('activate', Lang.bind(this, this._onOpenCalendarActivate));
item.actor.can_focus = false;
vbox.add(item.actor, {y_align: St.Align.END, expand: true, y_fill: false});
}
this._calendarSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.office.calendar' });
this._calendarSettings.connect('changed::exec',
Lang.bind(this, this._calendarSettingsChanged));
this._calendarSettingsChanged();
// Whenever the menu is opened, select today
this.menu.connect('open-state-changed', Lang.bind(this, function(menu, isOpen) {
@ -151,6 +146,51 @@ const DateMenuButton = new Lang.Class({
this._clock = new GnomeDesktop.WallClock();
this._clock.connect('notify::clock', Lang.bind(this, this._updateClockAndDate));
this._updateClockAndDate();
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._sessionUpdated();
},
_calendarSettingsChanged: function() {
let exec = this._calendarSettings.get_string('exec');
let fullExec = GLib.find_program_in_path(exec);
this._openCalendarItem.actor.visible = fullExec != null;
},
_setEventsVisibility: function(visible) {
this._openCalendarItem.actor.visible = visible;
this._separator.visible = visible;
if (visible) {
let alignment = 0.25;
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
alignment = 1.0 - alignment;
this.menu._arrowAlignment = alignment;
this._eventList.actor.get_parent().show();
} else {
this.menu._arrowAlignment = 0.5;
this._eventList.actor.get_parent().hide();
}
},
_setEventSource: function(eventSource) {
this._calendar.setEventSource(eventSource);
this._eventList.setEventSource(eventSource);
},
_sessionUpdated: function() {
let eventSource;
let showEvents = Main.sessionMode.showCalendarEvents;
if (showEvents) {
eventSource = new Calendar.DBusEventSource();
} else {
eventSource = null;
}
this._setEventSource(eventSource);
this._setEventsVisibility(showEvents);
// This needs to be handled manually, as the code to
// autohide separators doesn't work across the vbox
this._dateAndTimeSeparator.actor.visible = Main.sessionMode.allowSettings;
},
_updateClockAndDate: function() {
@ -165,14 +205,13 @@ const DateMenuButton = new Lang.Class({
_onOpenCalendarActivate: function() {
this.menu.close();
let calendarSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.office.calendar' });
let tool = calendarSettings.get_string('exec');
let tool = this._calendarSettings.get_string('exec');
if (tool.length == 0 || tool.substr(0, 9) == 'evolution') {
// TODO: pass the selected day
let app = Shell.AppSystem.get_default().lookup_app('evolution-calendar.desktop');
app.activate();
} else {
let needTerm = calendarSettings.get_boolean('needs-term');
let needTerm = this._calendarSettings.get_boolean('needs-term');
if (needTerm) {
let terminalSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.terminal' });
let term = terminalSettings.get_string('exec');

View File

@ -235,6 +235,10 @@ const _Draggable = new Lang.Class({
if (this.actor._delegate && this.actor._delegate.getDragActor) {
this._dragActor = this.actor._delegate.getDragActor(this._dragStartX, this._dragStartY);
this._dragActor.reparent(Main.uiGroup);
this._dragActor.raise_top();
Shell.util_set_hidden_from_pick(this._dragActor, true);
// Drag actor does not always have to be the same as actor. For example drag actor
// can be an image that's part of the actor. So to perform "snap back" correctly we need
// to know what was the drag actor source.
@ -263,12 +267,17 @@ const _Draggable = new Lang.Class({
this._dragOffsetY = this._dragActor.y - this._dragStartY;
} else {
this._dragActor = this.actor;
this._dragActorSource = undefined;
this._dragOrigParent = this.actor.get_parent();
this._dragOrigX = this._dragActor.x;
this._dragOrigY = this._dragActor.y;
this._dragOrigScale = this._dragActor.scale_x;
this._dragActor.reparent(Main.uiGroup);
this._dragActor.raise_top();
Shell.util_set_hidden_from_pick(this._dragActor, true);
let [actorStageX, actorStageY] = this.actor.get_transformed_position();
this._dragOffsetX = actorStageX - this._dragStartX;
this._dragOffsetY = actorStageY - this._dragStartY;
@ -280,10 +289,6 @@ const _Draggable = new Lang.Class({
scaledHeight / this.actor.height);
}
this._dragActor.reparent(Main.uiGroup);
this._dragActor.raise_top();
Shell.util_set_hidden_from_pick(this._dragActor, true);
this._dragOrigOpacity = this._dragActor.opacity;
if (this._dragActorOpacity != undefined)
this._dragActor.opacity = this._dragActorOpacity;

View File

@ -34,6 +34,7 @@ const GnomeSession = imports.misc.gnomeSession;
const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
const Tweener = imports.ui.tweener;
const UserMenu = imports.ui.userMenu;
let _endSessionDialog = null;
@ -89,7 +90,7 @@ const shutdownDialogContent = {
label: C_("button", "Restart") },
{ signal: 'ConfirmedShutdown',
label: C_("button", "Power Off") }],
iconName: 'system-shutdown',
iconName: 'system-shutdown-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon'
};
@ -104,7 +105,7 @@ const restartDialogContent = {
endDescription: _("Restarting the system."),
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart") }],
iconName: 'system-shutdown',
iconName: 'view-refresh-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon'
};
@ -160,6 +161,7 @@ const ListItem = new Lang.Class({
this._descriptionLabel = new St.Label({ text: this._reason,
style_class: 'end-session-dialog-app-list-item-description' });
this.actor.label_actor = this._nameLabel;
textLayout.add(this._descriptionLabel,
{ expand: true,
x_fill: true });
@ -302,41 +304,6 @@ const EndSessionDialog = new Lang.Class({
this._user.disconnect(this._userChangedId);
},
_setIconFromFile: function(iconFile, styleClass) {
if (styleClass)
this._iconBin.set_style_class_name(styleClass);
this._iconBin.set_style(null);
this._iconBin.child = null;
if (iconFile) {
this._iconBin.show();
this._iconBin.set_style('background-image: url("' + iconFile + '");' +
'background-size: contain;');
} else {
this._iconBin.hide();
}
},
_setIconFromName: function(iconName, styleClass) {
if (styleClass)
this._iconBin.set_style_class_name(styleClass);
this._iconBin.set_style(null);
if (iconName != null) {
let textureCache = St.TextureCache.get_default();
let icon = textureCache.load_icon_name(this._iconBin.get_theme_node(),
iconName,
St.IconType.SYMBOLIC,
_DIALOG_ICON_SIZE);
this._iconBin.child = icon;
this._iconBin.show();
} else {
this._iconBin.child = null;
this._iconBin.hide();
}
},
_updateDescription: function() {
if (this.state != ModalDialog.State.OPENING &&
this.state != ModalDialog.State.OPENED)
@ -385,16 +352,16 @@ const EndSessionDialog = new Lang.Class({
return;
let dialogContent = DialogContent[this._type];
if (this._user.is_loaded && !dialogContent.iconName) {
let iconFile = this._user.get_icon_file();
if (GLib.file_test(iconFile, GLib.FileTest.EXISTS))
this._setIconFromFile(iconFile, dialogContent.iconStyleClass);
else
this._setIconFromName('avatar-default', dialogContent.iconStyleClass);
} else if (dialogContent.iconName) {
this._setIconFromName(dialogContent.iconName,
dialogContent.iconStyleClass);
if (dialogContent.iconName) {
this._iconBin.child = new St.Icon({ icon_name: dialogContent.iconName,
icon_size: _DIALOG_ICON_SIZE,
style_class: dialogContent.iconStyleClass });
} else {
let avatarWidget = new UserMenu.UserAvatarWidget(this._user,
{ iconSize: _DIALOG_ICON_SIZE,
styleClass: dialogContent.iconStyleClass });
this._iconBin.child = avatarWidget.actor;
avatarWidget.update();
}
this._updateDescription();

View File

@ -60,7 +60,7 @@ function uninstallExtension(uuid) {
if (extension.type != ExtensionUtils.ExtensionType.PER_USER)
return false;
if (!ExtensionSystem.unloadExtension(uuid))
if (!ExtensionSystem.unloadExtension(extension))
return false;
FileUtils.recursivelyDeleteDir(extension.dir, true);
@ -82,7 +82,7 @@ function gotExtensionZipFile(session, message, uuid, dir, callback, errback) {
}
let [file, stream] = Gio.File.new_tmp('XXXXXX.shell-extension.zip');
let contents = message.response_body.flatten().as_bytes();
let contents = message.response_body.flatten().get_as_bytes();
stream.output_stream.write_bytes(contents, null);
stream.close(null);
let [success, pid] = GLib.spawn_async(null,
@ -124,7 +124,7 @@ function updateExtension(uuid) {
let oldExtension = ExtensionUtils.extensions[uuid];
let extensionDir = oldExtension.dir;
if (!ExtensionSystem.unloadExtension(uuid))
if (!ExtensionSystem.unloadExtension(oldExtension))
return;
FileUtils.recursivelyMoveDir(extensionDir, oldExtensionTmpDir);
@ -135,7 +135,7 @@ function updateExtension(uuid) {
try {
ExtensionSystem.loadExtension(extension);
} catch(e) {
ExtensionSystem.unloadExtension(uuid);
ExtensionSystem.unloadExtension(extension);
logError(e, 'Error loading extension %s'.format(uuid));

View File

@ -8,6 +8,7 @@ const Gio = imports.gi.Gio;
const St = imports.gi.St;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
const ExtensionState = {
ENABLED: 1,
@ -38,6 +39,9 @@ const disconnect = Lang.bind(_signals, _signals.disconnect);
const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
var initted = false;
var enabled;
function disableExtension(uuid) {
let extension = ExtensionUtils.extensions[uuid];
if (!extension)
@ -102,8 +106,6 @@ function enableExtension(uuid) {
extensionOrder.push(uuid);
extension.stateObj.enable();
let stylesheetFile = extension.dir.get_child('stylesheet.css');
if (stylesheetFile.query_exists(null)) {
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
@ -111,6 +113,8 @@ function enableExtension(uuid) {
extension.stylesheet = stylesheetFile;
}
extension.stateObj.enable();
extension.state = ExtensionState.ENABLED;
_signals.emit('extension-state-changed', extension);
}
@ -158,23 +162,32 @@ function loadExtension(extension) {
_signals.emit('extension-state-changed', extension);
}
function unloadExtension(uuid) {
let extension = ExtensionUtils.extensions[uuid];
if (!extension)
return false;
function unloadExtension(extension) {
// Try to disable it -- if it's ERROR'd, we can't guarantee that,
// but it will be removed on next reboot, and hopefully nothing
// broke too much.
disableExtension(uuid);
disableExtension(extension.uuid);
extension.state = ExtensionState.UNINSTALLED;
_signals.emit('extension-state-changed', extension);
delete ExtensionUtils.extensions[uuid];
delete ExtensionUtils.extensions[extension.uuid];
return true;
}
function reloadExtension(oldExtension) {
// Grab the things we'll need to pass to createExtensionObject
// to reload it.
let { uuid: uuid, dir: dir, type: type } = oldExtension;
// Then unload the old extension.
unloadExtension(oldExtension);
// Now, recreate the extension and load it.
let newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
loadExtension(newExtension);
}
function initExtension(uuid) {
let extension = ExtensionUtils.extensions[uuid];
let dir = extension.dir;
@ -207,6 +220,9 @@ function initExtension(uuid) {
function onEnabledExtensionsChanged() {
let newEnabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
if (!enabled)
return;
// Find and enable all the newly enabled extensions: UUIDs found in the
// new setting, but not in the old one.
newEnabledExtensions.filter(function(uuid) {
@ -234,7 +250,7 @@ function onEnabledExtensionsChanged() {
enabledExtensions = newEnabledExtensions;
}
function loadExtensions() {
function _loadExtensions() {
global.settings.connect('changed::' + ENABLED_EXTENSIONS_KEY, onEnabledExtensionsChanged);
enabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
@ -248,3 +264,43 @@ function loadExtensions() {
});
finder.scanExtensions();
}
function enableAllExtensions() {
if (enabled)
return;
if (!initted) {
_loadExtensions();
initted = true;
} else {
enabledExtensions.forEach(function(uuid) {
enableExtension(uuid);
});
}
enabled = true;
}
function disableAllExtensions() {
if (!enabled)
return;
if (initted) {
enabledExtensions.forEach(function(uuid) {
disableExtension(uuid);
});
}
enabled = false;
}
function _sessionUpdated() {
if (Main.sessionMode.allowExtensions)
enableAllExtensions();
else
disableAllExtensions();
}
function init() {
Main.sessionMode.connect('updated', _sessionUpdated);
_sessionUpdated();
}

358
js/ui/grabHelper.js Normal file
View File

@ -0,0 +1,358 @@
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
const Clutter = imports.gi.Clutter;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Main = imports.ui.main;
const Params = imports.misc.params;
function _navigateActor(actor) {
if (!actor)
return;
let needsGrab = true;
if (actor instanceof St.Widget)
needsGrab = !actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
if (needsGrab)
actor.grab_key_focus();
}
// GrabHelper:
// @owner: the actor that owns the GrabHelper
//
// Creates a new GrabHelper object, for dealing with keyboard and pointer grabs
// associated with a set of actors.
//
// Note that the grab can be automatically dropped at any time by the user, and
// your code just needs to deal with it; you shouldn't adjust behavior directly
// after you call ungrab(), but instead pass an 'onUngrab' callback when you
// call grab().
const GrabHelper = new Lang.Class({
Name: 'GrabHelper',
_init: function(owner) {
this._owner = owner;
this._grabStack = [];
this._actors = [];
this._capturedEventId = 0;
this._eventId = 0;
this._keyFocusNotifyId = 0;
this._focusWindowChangedId = 0;
this._ignoreRelease = false;
this._modalCount = 0;
this._grabFocusCount = 0;
},
// addActor:
// @actor: an actor
//
// Adds @actor to the set of actors that are allowed to process events
// during a grab.
addActor: function(actor) {
actor.__grabHelperDestroyId = actor.connect('destroy', Lang.bind(this, function() { this.removeActor(actor); }));
this._actors.push(actor);
},
// removeActor:
// @actor: an actor
//
// Removes @actor from the set of actors that are allowed to
// process events during a grab.
removeActor: function(actor) {
let index = this._actors.indexOf(actor);
if (index != -1)
this._actors.splice(index, 1);
if (actor.__grabHelperDestroyId) {
actor.disconnect(actor.__grabHelperDestroyId);
delete actor.__grabHelperDestroyId;
}
},
_isWithinGrabbedActor: function(actor) {
while (actor) {
if (this._actors.indexOf(actor) != -1)
return true;
actor = actor.get_parent();
}
return false;
},
get currentGrab() {
return this._grabStack[this._grabStack.length - 1] || {};
},
_findStackIndex: function(actor) {
if (!actor)
return -1;
for (let i = 0; i < this._grabStack.length; i++) {
if (this._grabStack[i].actor === actor)
return i;
}
return -1;
},
isActorGrabbed: function(actor) {
return this._findStackIndex(actor) >= 0;
},
// grab:
// @params: A bunch of parameters, see below
//
// Grabs the mouse and keyboard, according to the GrabHelper's
// parameters. If @newFocus is not %null, then the keyboard focus
// is moved to the first #StWidget:can-focus widget inside it.
//
// The grab will automatically be dropped if:
// - The user clicks outside the grabbed actors
// - The user types Escape
// - The keyboard focus is moved outside the grabbed actors
// - A window is focused
//
// If @params.actor is not null, then it will be focused as the
// new actor. If you attempt to grab an already focused actor, the
// request to be focused will be ignored. The actor will not be
// added to the grab stack, so do not call a paired ungrab().
//
// If @params contains { modal: true }, then grab() will push a modal
// on the owner of the GrabHelper. As long as there is at least one
// { modal: true } actor on the grab stack, the grab will be kept.
// When the last { modal: true } actor is ungrabbed, then the modal
// will be dropped. A modal grab can fail if there is already a grab
// in effect from aother application; in this case the function returns
// false and nothing happens. Non-modal grabs can never fail.
//
// If @params contains { grabFocus: true }, then if you call grab()
// while the shell is outside the overview, it will set the stage
// input mode to %Shell.StageInputMode.FOCUSED, and ungrab() will
// revert it back, and re-focus the previously-focused window (if
// another window hasn't been explicitly focused before then).
grab: function(params) {
params = Params.parse(params, { actor: null,
modal: false,
grabFocus: false,
onUngrab: null });
let focus = global.stage.key_focus;
let hadFocus = focus && this._isWithinGrabbedActor(focus);
let newFocus = params.actor;
if (this.isActorGrabbed(params.actor))
return true;
params.savedFocus = focus;
if (params.modal && !this._takeModalGrab())
return false;
if (params.grabFocus && !this._takeFocusGrab(hadFocus))
return false;
if (hadFocus || params.grabFocus)
_navigateActor(newFocus);
this._grabStack.push(params);
return true;
},
_takeModalGrab: function() {
let firstGrab = (this._modalCount == 0);
if (firstGrab) {
if (!Main.pushModal(this._owner))
return false;
this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
this._eventId = global.stage.connect('event', Lang.bind(this, this._onEvent));
}
this._modalCount++;
return true;
},
_releaseModalGrab: function() {
this._modalCount--;
if (this._modalCount > 0)
return;
if (this._capturedEventId > 0) {
global.stage.disconnect(this._capturedEventId);
this._capturedEventId = 0;
}
if (this._eventId > 0) {
global.stage.disconnect(this._eventId);
this._eventId = 0;
}
Main.popModal(this._owner);
global.sync_pointer();
},
_takeFocusGrab: function(hadFocus) {
let firstGrab = (this._grabFocusCount == 0);
if (firstGrab) {
let metaDisplay = global.screen.get_display();
this._grabbedFromKeynav = hadFocus;
this._preGrabInputMode = global.stage_input_mode;
this._prevFocusedWindow = metaDisplay.focus_window;
if (this._preGrabInputMode == Shell.StageInputMode.NONREACTIVE ||
this._preGrabInputMode == Shell.StageInputMode.NORMAL) {
global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
}
this._keyFocusNotifyId = global.stage.connect('notify::key-focus', Lang.bind(this, this._onKeyFocusChanged));
this._focusWindowChangedId = metaDisplay.connect('notify::focus-window', Lang.bind(this, this._focusWindowChanged));
}
this._grabFocusCount++;
return true;
},
_releaseFocusGrab: function() {
this._grabFocusCount--;
if (this._grabFocusCount > 0)
return;
if (this._keyFocusNotifyId > 0) {
global.stage.disconnect(this._keyFocusNotifyId);
this._keyFocusNotifyId = 0;
}
if (!this._focusWindowChanged > 0) {
let metaDisplay = global.screen.get_display();
metaDisplay.disconnect(this._focusWindowChangedId);
this._focusWindowChangedId = 0;
}
let prePopInputMode = global.stage_input_mode;
if (this._grabbedFromKeynav) {
if (this._preGrabInputMode == Shell.StageInputMode.FOCUSED &&
prePopInputMode != Shell.StageInputMode.FULLSCREEN)
global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
}
if (this._prevFocusedWindow) {
let metaDisplay = global.screen.get_display();
if (!metaDisplay.focus_window) {
metaDisplay.set_input_focus_window(this._prevFocusedWindow,
false, global.get_current_time());
}
}
},
// ignoreRelease:
//
// Make sure that the next button release event evaluated by the
// capture event handler returns false. This is designed for things
// like the ComboBoxMenu that go away on press, but need to eat
// the next release event.
ignoreRelease: function() {
this._ignoreRelease = true;
},
// ungrab:
// @params: The parameters for the grab; see below.
//
// Pops an actor from the grab stack, potentially dropping the grab.
//
// If the actor that was popped from the grab stack was not the actor
// That was passed in, this call is ignored.
ungrab: function(params) {
params = Params.parse(params, { actor: this.currentGrab.actor });
let grabStackIndex = this._findStackIndex(params.actor);
if (grabStackIndex < 0)
return;
let focus = global.stage.key_focus;
let hadFocus = focus && this._isWithinGrabbedActor(focus);
let poppedGrabs = this._grabStack.slice(grabStackIndex);
// "Pop" all newly ungrabbed actors off the grab stack
// by truncating the array.
this._grabStack.length = grabStackIndex;
for (let i = poppedGrabs.length - 1; i >= 0; i--) {
let poppedGrab = poppedGrabs[i];
if (poppedGrab.onUngrab)
poppedGrab.onUngrab();
if (poppedGrab.modal)
this._releaseModalGrab();
if (poppedGrab.grabFocus)
this._releaseFocusGrab();
}
if (hadFocus) {
let poppedGrab = poppedGrabs[0];
_navigateActor(poppedGrab.savedFocus);
}
},
_onCapturedEvent: function(actor, event) {
let type = event.type();
let press = type == Clutter.EventType.BUTTON_PRESS;
let release = type == Clutter.EventType.BUTTON_RELEASE;
let button = press || release;
if (release && this._ignoreRelease) {
this._ignoreRelease = false;
return false;
}
if (!button && this._modalCount == 0)
return false;
if (this._isWithinGrabbedActor(event.get_source()))
return false;
if (Main.keyboard.shouldTakeEvent(event))
return false;
if (button) {
// If we have a press event, ignore the next event,
// which should be a release event.
if (press)
this._ignoreRelease = true;
this.ungrab({ actor: this._grabStack[0].actor });
}
return this._modalCount > 0;
},
// We catch 'event' rather than 'key-press-event' so that we get
// a chance to run before the overview's own Escape check
_onEvent: function(actor, event) {
if (event.type() == Clutter.EventType.KEY_PRESS &&
event.get_key_symbol() == Clutter.KEY_Escape) {
this.ungrab();
return true;
}
return false;
},
_onKeyFocusChanged: function() {
let focus = global.stage.key_focus;
if (!focus || !this._isWithinGrabbedActor(focus))
this.ungrab();
},
_focusWindowChanged: function() {
let metaDisplay = global.screen.get_display();
if (metaDisplay.focus_window != null)
this.ungrab();
}
});

View File

@ -20,25 +20,6 @@ const KEYBOARD_TYPE = 'keyboard-type';
const A11Y_APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
const SHOW_KEYBOARD = 'screen-keyboard-enabled';
// Key constants taken from Antler
// FIXME: ought to be moved into libcaribou
const PRETTY_KEYS = {
'BackSpace': '\u232b',
'space': ' ',
'Return': '\u23ce',
'Caribou_Prefs': '\u2328',
'Caribou_ShiftUp': '\u2b06',
'Caribou_ShiftDown': '\u2b07',
'Caribou_Emoticons': '\u263a',
'Caribou_Symbols': '123',
'Caribou_Symbols_More': '{#*',
'Caribou_Alpha': 'Abc',
'Tab': 'Tab',
'Escape': 'Esc',
'Control_L': 'Ctrl',
'Alt_L': 'Alt'
};
const CaribouKeyboardIface = <interface name='org.gnome.Caribou.Keyboard'>
<method name='Show'>
<arg type='u' direction='in' />
@ -98,17 +79,7 @@ const Key = new Lang.Class({
},
_makeKey: function () {
let label = this._key.name;
if (label.length > 1) {
let pretty = PRETTY_KEYS[label];
if (pretty)
label = pretty;
else
label = this._getUnichar(this._key);
}
label = GLib.markup_escape_text(label, -1);
let label = GLib.markup_escape_text(this._key.label, -1);
let button = new St.Button ({ label: label,
style_class: 'keyboard-key' });
@ -200,8 +171,10 @@ const Keyboard = new Lang.Class({
this._impl.export(Gio.DBus.session, '/org/gnome/Caribou/Keyboard');
this.actor = null;
this._focusInTray = false;
this._focusInExtendedKeys = false;
this._timestamp = global.get_current_time();
this._timestamp = global.display.get_current_time_roundtrip();
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._redraw));
this._keyboardSettings = new Gio.Settings({ schema: KEYBOARD_SCHEMA });
@ -288,7 +261,15 @@ const Keyboard = new Lang.Class({
// Showing an extended key popup and clicking a key from the extended keys
// will grab focus, but ignore that
if (focus && (focus._extended_keys || (focus._key && focus._key.extended_key)))
let extendedKeysWereFocused = this._focusInExtendedKeys;
this._focusInExtendedKeys = focus && (focus._extended_keys || focus.extended_key);
if (this._focusInExtendedKeys || extendedKeysWereFocused)
return;
// Ignore focus changes caused by message tray showing/hiding
let trayWasFocused = this._focusInTray;
this._focusInTray = (focus && Main.messageTray.actor.contains(focus));
if (this._focusInTray || trayWasFocused)
return;
let time = global.get_current_time();
@ -339,6 +320,13 @@ const Keyboard = new Lang.Class({
trayButton.reactive = true;
trayButton.remove_style_pseudo_class('grayed');
}));
Main.sessionMode.connect('updated', Lang.bind(this, function() {
trayButton.reactive = !Main.sessionMode.isLocked;
if (Main.sessionMode.isLocked)
trayButton.add_style_pseudo_class('grayed');
else
trayButton.remove_style_pseudo_class('grayed');
}));
return trayButton;
},
@ -468,6 +456,12 @@ const Keyboard = new Lang.Class({
}
},
shouldTakeEvent: function(event) {
let actor = event.get_source();
return Main.layoutManager.keyboardBox.contains(actor) ||
actor._extended_keys || actor.extended_key;
},
show: function () {
this._redraw();
@ -494,15 +488,30 @@ const Keyboard = new Lang.Class({
this._moveTemporarily();
},
// _compareTimestamp:
//
// Compare two timestamps taking into account
// CURRENT_TIME (0)
_compareTimestamp: function(one, two) {
if (one == two)
return 0;
if (one == Clutter.CURRENT_TIME)
return 1;
if (two == Clutter.CURRENT_TIME)
return -1;
return one - two;
},
// D-Bus methods
Show: function(timestamp) {
if (!this._enableKeyboard)
return;
if (timestamp - this._timestamp < 0)
if (this._compareTimestamp(timestamp, this._timestamp) < 0)
return;
this._timestamp = timestamp;
if (timestamp != Clutter.CURRENT_TIME)
this._timestamp = timestamp;
this.show();
},
@ -510,10 +519,11 @@ const Keyboard = new Lang.Class({
if (!this._enableKeyboard)
return;
if (timestamp - this._timestamp < 0)
if (this._compareTimestamp(timestamp, this._timestamp) < 0)
return;
this._timestamp = timestamp;
if (timestamp != Clutter.CURRENT_TIME)
this._timestamp = timestamp;
this.hide();
},
@ -542,7 +552,8 @@ const KeyboardSource = new Lang.Class({
_init: function(keyboard) {
this._keyboard = keyboard;
this.parent(_("Keyboard"), 'input-keyboard', St.IconType.SYMBOLIC);
this.parent(_("Keyboard"), 'input-keyboard-symbolic');
this.keepTrayOnSummaryClick = true;
},
handleSummaryClick: function() {

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const GObject = imports.gi.GObject;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
@ -16,6 +17,83 @@ const Tweener = imports.ui.tweener;
const HOT_CORNER_ACTIVATION_TIMEOUT = 0.5;
const STARTUP_ANIMATION_TIME = 0.2;
const KEYBOARD_ANIMATION_TIME = 0.5;
const PLYMOUTH_TRANSITION_TIME = 1;
const MonitorConstraint = new Lang.Class({
Name: 'MonitorConstraint',
Extends: Clutter.Constraint,
Properties: {'primary': GObject.ParamSpec.boolean('primary',
'Primary', 'Track primary monitor',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
false),
'index': GObject.ParamSpec.int('index',
'Monitor index', 'Track specific monitor',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
-1, 64, -1)},
_init: function(props) {
this._primary = false;
this._index = -1;
this.parent(props);
},
get primary() {
return this._primary;
},
set primary(v) {
if (v)
this._index = -1;
this._primary = v;
if (this.actor)
this.actor.queue_relayout();
this.notify('primary');
},
get index() {
return this._index;
},
set index(v) {
this._primary = false;
this._index = v;
if (this.actor)
this.actor.queue_relayout();
this.notify('index');
},
vfunc_set_actor: function(actor) {
if (actor) {
if (!this._monitorsChangedId) {
this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', Lang.bind(this, function() {
this.actor.queue_relayout();
}));
}
} else {
if (this._monitorsChangedId)
Main.layoutManager.disconnect(this._monitorsChangedId);
this._monitorsChangedId = 0;
}
this.parent(actor);
},
vfunc_update_allocation: function(actor, actorBox) {
if (!this._primary && this._index < 0)
return;
let monitor;
if (this._primary) {
monitor = Main.layoutManager.primaryMonitor;
} else {
let index = Math.min(this._index, Main.layoutManager.monitors.length - 1);
monitor = Main.layoutManager.monitors[index];
}
actorBox.init_rect(monitor.x, monitor.y, monitor.width, monitor.height);
}
});
const LayoutManager = new Lang.Class({
Name: 'LayoutManager',
@ -26,6 +104,7 @@ const LayoutManager = new Lang.Class({
this.primaryMonitor = null;
this.primaryIndex = -1;
this._hotCorners = [];
this._background = null;
this._leftPanelBarrier = 0;
this._rightPanelBarrier = 0;
this._trayBarrier = 0;
@ -35,6 +114,7 @@ const LayoutManager = new Lang.Class({
this.screenShieldGroup = new St.Widget({ name: 'screenShieldGroup',
visible: false,
clip_to_allocation: true,
layout_manager: new Clutter.BinLayout(),
});
this.addChrome(this.screenShieldGroup);
@ -45,10 +125,9 @@ const LayoutManager = new Lang.Class({
this.panelBox.connect('allocation-changed',
Lang.bind(this, this._updatePanelBarriers));
this.trayBox = new St.BoxLayout({ name: 'trayBox' });
this.trayBox = new St.Widget({ name: 'trayBox',
layout_manager: new Clutter.BinLayout() });
this.addChrome(this.trayBox);
this.trayBox.connect('allocation-changed',
Lang.bind(this, this._updateTrayBarrier));
this.keyboardBox = new St.BoxLayout({ name: 'keyboardBox',
reactive: true,
@ -199,22 +278,6 @@ const LayoutManager = new Lang.Class({
}
},
_updateTrayBarrier: function() {
let monitor = this.bottomMonitor;
if (this._trayBarrier)
global.destroy_pointer_barrier(this._trayBarrier);
if (Main.messageTray) {
this._trayBarrier =
global.create_pointer_barrier(monitor.x + monitor.width, monitor.y + monitor.height - Main.messageTray.actor.height,
monitor.x + monitor.width, monitor.y + monitor.height,
4 /* BarrierNegativeX */);
} else {
this._trayBarrier = 0;
}
},
_monitorsChanged: function() {
this._updateMonitors();
this._updateBoxes();
@ -239,14 +302,45 @@ const LayoutManager = new Lang.Class({
get currentMonitor() {
let index = global.screen.get_current_monitor();
return Main.layoutManager.monitors[index];
return this.monitors[index];
},
_startupAnimation: function() {
this.panelBox.anchor_y = this.panelBox.height;
let plymouthTransitionRunning = false;
// If we're the greeter, put up the xrootpmap actor
// and fade it out to have a nice transition from plymouth
// to the greeter. Otherwise, we'll just animate the panel,
// as usual.
if (Main.sessionMode.isGreeter) {
this._background = Meta.BackgroundActor.new_for_screen(global.screen);
if (this._background != null) {
Main.uiGroup.add_actor(this._background);
Tweener.addTween(this._background,
{ opacity: 0,
time: PLYMOUTH_TRANSITION_TIME,
transition: 'linear',
onComplete: this._fadeBackgroundComplete,
onCompleteScope: this });
plymouthTransitionRunning = true;
}
}
if (!plymouthTransitionRunning)
this._fadeBackgroundComplete();
},
_fadeBackgroundComplete: function() {
// Don't animate the strut
this._chrome.freezeUpdateRegions();
this.panelBox.anchor_y = this.panelBox.height;
if (this._background != null) {
this._background.destroy();
this._background = null;
}
Tweener.addTween(this.panelBox,
{ anchor_y: 0,
time: STARTUP_ANIMATION_TIME,
@ -261,7 +355,6 @@ const LayoutManager = new Lang.Class({
},
showKeyboard: function () {
Main.messageTray.hide();
this.keyboardBox.raise_top();
Tweener.addTween(this.keyboardBox,
{ anchor_y: this.keyboardBox.height,
@ -275,6 +368,8 @@ const LayoutManager = new Lang.Class({
time: KEYBOARD_ANIMATION_TIME,
transition: 'easeOutQuad'
});
this.emit('keyboard-visible-changed', true);
},
_showKeyboardComplete: function() {
@ -289,7 +384,6 @@ const LayoutManager = new Lang.Class({
},
hideKeyboard: function (immediate) {
Main.messageTray.hide();
if (this._keyboardHeightNotifyId) {
this.keyboardBox.disconnect(this._keyboardHeightNotifyId);
this._keyboardHeightNotifyId = 0;
@ -306,6 +400,8 @@ const LayoutManager = new Lang.Class({
time: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
transition: 'easeOutQuad'
});
this.emit('keyboard-visible-changed', false);
},
_hideKeyboardComplete: function() {
@ -564,7 +660,6 @@ const Chrome = new Lang.Class({
this._monitors = [];
this._inOverview = false;
this._isLocked = false;
this._updateRegionIdle = 0;
this._freezeUpdateCount = 0;
@ -583,12 +678,9 @@ const Chrome = new Lang.Class({
},
init: function() {
Main.overview.connect('showing',
Lang.bind(this, this._overviewShowing));
Main.overview.connect('hidden',
Lang.bind(this, this._overviewHidden));
Main.screenShield.connect('lock-status-changed',
Lang.bind(this, this._lockStatusChanged));
Main.overview.connect('showing', Lang.bind(this, this._overviewShowing));
Main.overview.connect('hidden', Lang.bind(this, this._overviewHidden));
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
},
addActor: function(actor, params) {
@ -674,10 +766,13 @@ const Chrome = new Lang.Class({
_actorReparented: function(actor, oldParent) {
let newParent = actor.get_parent();
if (!newParent)
if (!newParent) {
this._untrackActor(actor);
else
} else {
let i = this._findActor(actor);
let actorData = this._trackedActors[i];
actorData.isToplevel = (newParent == Main.uiGroup);
}
},
_updateVisibility: function() {
@ -688,7 +783,7 @@ const Chrome = new Lang.Class({
if (!actorData.isToplevel)
continue;
if (this._inOverview || this._isLocked)
if (this._inOverview || !Main.sessionMode.hasWindows)
visible = true;
else if (this.findMonitorForActor(actorData.actor).inFullscreen)
visible = false;
@ -710,8 +805,7 @@ const Chrome = new Lang.Class({
this._queueUpdateRegions();
},
_lockStatusChanged: function(shield, locked) {
this._isLocked = locked;
_sessionUpdated: function() {
this._updateVisibility();
this._queueUpdateRegions();
},

View File

@ -38,7 +38,6 @@ var commandHeader = 'const Clutter = imports.gi.Clutter; ' +
/* Utility functions...we should probably be able to use these
* in the shell core code too. */
'const stage = global.stage; ' +
'const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; ' +
/* Special lookingGlass functions */
'const it = Main.lookingGlass.getIt(); ' +
'const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); ';
@ -372,7 +371,8 @@ const ObjInspector = new Lang.Class({
this._parentList = [];
this.actor = new St.ScrollView({ x_fill: true, y_fill: true });
this.actor = new St.ScrollView({ pivot_point: new Clutter.Point({ x: 0.5, y: 0.5 }),
x_fill: true, y_fill: true });
this.actor.get_hscroll_bar().hide();
this._container = new St.BoxLayout({ name: 'LookingGlassPropertyInspector',
style_class: 'lg-dialog',
@ -444,10 +444,6 @@ const ObjInspector = new Lang.Class({
this.actor.show();
if (sourceActor) {
this.actor.set_scale(0, 0);
let [sourceX, sourceY] = sourceActor.get_transformed_position();
let [sourceWidth, sourceHeight] = sourceActor.get_transformed_size();
this.actor.move_anchor_point(Math.floor(sourceX + sourceWidth / 2),
Math.floor(sourceY + sourceHeight / 2));
Tweener.addTween(this.actor, { scale_x: 1, scale_y: 1,
transition: 'easeOutQuad',
time: 0.2 });
@ -869,7 +865,6 @@ const LookingGlass = new Lang.Class({
let toolbar = new St.BoxLayout({ name: 'Toolbar' });
this.actor.add_actor(toolbar);
let inspectIcon = new St.Icon({ icon_name: 'gtk-color-picker',
icon_type: St.IconType.FULLCOLOR,
icon_size: 24 });
toolbar.add_actor(inspectIcon);
inspectIcon.reactive = true;
@ -1094,8 +1089,8 @@ const LookingGlass = new Lang.Class({
this.actor.width = myWidth;
this.actor.height = myHeight;
this._objInspector.actor.set_size(Math.floor(myWidth * 0.8), Math.floor(myHeight * 0.8));
this._objInspector.actor.set_position(this.actor.x + Math.floor(myWidth * 0.1),
this._targetY + Math.floor(myHeight * 0.1));
this._objInspector.actor.set_position(primary.x + this.actor.x + Math.floor(myWidth * 0.1),
primary.y + this._targetY + Math.floor(myHeight * 0.1));
},
insertObject: function(obj) {

View File

@ -12,7 +12,7 @@ const Signals = imports.signals;
const Main = imports.ui.main;
const MagnifierDBus = imports.ui.magnifierDBus;
const Params = imports.misc.params;
const PointerWatcher = imports.ui.pointerWatcher;
const MOUSE_POLL_FREQUENCY = 50;
const CROSSHAIRS_CLIP_SIZE = [100, 100];
@ -56,7 +56,7 @@ const Magnifier = new Lang.Class({
let xfixesCursor = Shell.XFixesCursor.get_for_stage(global.stage);
this._mouseSprite = new Clutter.Texture();
xfixesCursor.update_texture_image(this._mouseSprite);
this._cursorRoot = new Clutter.Group();
this._cursorRoot = new Clutter.Actor();
this._cursorRoot.add_actor(this._mouseSprite);
// Create the first ZoomRegion and initialize it according to the
@ -136,11 +136,8 @@ const Magnifier = new Lang.Class({
* Turn on mouse tracking, if not already doing so.
*/
startTrackingMouse: function() {
if (!this._mouseTrackingId)
this._mouseTrackingId = Mainloop.timeout_add(
MOUSE_POLL_FREQUENCY,
Lang.bind(this, this.scrollToMousePos)
);
if (!this._pointerWatch)
this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(MOUSE_POLL_FREQUENCY, Lang.bind(this, this.scrollToMousePos));
},
/**
@ -148,10 +145,10 @@ const Magnifier = new Lang.Class({
* Turn off mouse tracking, if not already doing so.
*/
stopTrackingMouse: function() {
if (this._mouseTrackingId)
Mainloop.source_remove(this._mouseTrackingId);
if (this._pointerWatch)
this._pointerWatch.remove();
this._mouseTrackingId = null;
this._pointerWatch = null;
},
/**
@ -303,8 +300,7 @@ const Magnifier = new Lang.Class({
*/
setCrosshairsColor: function(color) {
if (this._crossHairs) {
let clutterColor = new Clutter.Color();
clutterColor.from_string(color);
let [res, clutterColor] = Clutter.Color.from_string(color);
this._crossHairs.setColor(clutterColor);
}
},
@ -1081,21 +1077,21 @@ const ZoomRegion = new Lang.Class({
// hide the magnified region from CLUTTER_PICK_ALL
Shell.util_set_hidden_from_pick (this._magView, true);
// Append a Clutter.Group to clip the contents of the magnified view.
let mainGroup = new Clutter.Group({ clip_to_allocation: true });
// Add a group to clip the contents of the magnified view.
let mainGroup = new Clutter.Actor({ clip_to_allocation: true });
this._magView.set_child(mainGroup);
// Add a background for when the magnified uiGroup is scrolled
// out of view (don't want to see desktop showing through).
this._background = new Clutter.Rectangle({ color: Main.DEFAULT_BACKGROUND_COLOR });
this._background = new Clutter.Actor({ background_color: Main.DEFAULT_BACKGROUND_COLOR,
width: global.screen_width,
height: global.screen_height });
mainGroup.add_actor(this._background);
// Clone the group that contains all of UI on the screen. This is the
// chrome, the windows, etc.
this._uiGroupClone = new Clutter.Clone({ source: Main.uiGroup });
mainGroup.add_actor(this._uiGroupClone);
Main.uiGroup.set_size(global.screen_width, global.screen_height);
this._background.set_size(global.screen_width, global.screen_height);
// Add either the given mouseSourceActor to the ZoomRegion, or a clone of
// it.
@ -1329,7 +1325,7 @@ const ZoomRegion = new Lang.Class({
this._mouseActor.set_scale(this._xMagFactor, this._yMagFactor);
let [x, y] = this._screenToViewPort(0, 0);
this._uiGroupClone.set_position(x, y);
this._uiGroupClone.set_position(Math.round(x), Math.round(y));
this._updateMousePosition();
},
@ -1357,7 +1353,6 @@ const ZoomRegion = new Lang.Class({
if (!this.isActive())
return;
Main.uiGroup.set_size(global.screen_width, global.screen_height);
this._background.set_size(global.screen_width, global.screen_height);
if (this._screenPosition == GDesktopEnums.MagnifierScreenPosition.NONE)
@ -1381,15 +1376,15 @@ const Crosshairs = new Lang.Class({
let groupWidth = global.screen_width * 3;
let groupHeight = global.screen_height * 3;
this._actor = new Clutter.Group({
this._actor = new Clutter.Actor({
clip_to_allocation: false,
width: groupWidth,
height: groupHeight
});
this._horizLeftHair = new Clutter.Rectangle();
this._horizRightHair = new Clutter.Rectangle();
this._vertTopHair = new Clutter.Rectangle();
this._vertBottomHair = new Clutter.Rectangle();
this._horizLeftHair = new Clutter.Actor();
this._horizRightHair = new Clutter.Actor();
this._vertTopHair = new Clutter.Actor();
this._vertBottomHair = new Clutter.Actor();
this._actor.add_actor(this._horizLeftHair);
this._actor.add_actor(this._horizRightHair);
this._actor.add_actor(this._vertTopHair);
@ -1460,10 +1455,10 @@ const Crosshairs = new Lang.Class({
* @clutterColor: The color as a Clutter.Color.
*/
setColor: function(clutterColor) {
this._horizLeftHair.set_color(clutterColor);
this._horizRightHair.set_color(clutterColor);
this._vertTopHair.set_color(clutterColor);
this._vertBottomHair.set_color(clutterColor);
this._horizLeftHair.background_color = clutterColor;
this._horizRightHair.background_color = clutterColor;
this._vertTopHair.background_color = clutterColor;
this._vertBottomHair.background_color = clutterColor;
},
/**
@ -1472,9 +1467,7 @@ const Crosshairs = new Lang.Class({
* @color: The color as a Clutter.Color.
*/
getColor: function() {
let clutterColor = new Clutter.Color();
this._horizLeftHair.get_color(clutterColor);
return clutterColor;
return this._horizLeftHair.get_color();
},
/**

View File

@ -10,12 +10,9 @@ const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const AutomountManager = imports.ui.automountManager;
const AutorunManager = imports.ui.autorunManager;
const Components = imports.ui.components;
const CtrlAltTab = imports.ui.ctrlAltTab;
const EndSessionDialog = imports.ui.endSessionDialog;
const PolkitAuthenticationAgent = imports.ui.polkitAuthenticationAgent;
const KeyringPrompt = imports.ui.keyringPrompt;
const Environment = imports.ui.environment;
const ExtensionSystem = imports.ui.extensionSystem;
const ExtensionDownloader = imports.ui.extensionDownloader;
@ -23,11 +20,9 @@ const Keyboard = imports.ui.keyboard;
const MessageTray = imports.ui.messageTray;
const Overview = imports.ui.overview;
const Panel = imports.ui.panel;
const PlaceDisplay = imports.ui.placeDisplay;
const RunDialog = imports.ui.runDialog;
const Layout = imports.ui.layout;
const LookingGlass = imports.ui.lookingGlass;
const NetworkAgent = imports.ui.networkAgent;
const NotificationDaemon = imports.ui.notificationDaemon;
const WindowAttentionHandler = imports.ui.windowAttentionHandler;
const ScreenShield = imports.ui.screenShield;
@ -35,7 +30,6 @@ const Scripting = imports.ui.scripting;
const SessionMode = imports.ui.sessionMode;
const ShellDBus = imports.ui.shellDBus;
const ShellMountOperation = imports.ui.shellMountOperation;
const TelepathyClient = imports.ui.telepathyClient;
const UnlockDialog = imports.ui.unlockDialog;
const WindowManager = imports.ui.windowManager;
const Magnifier = imports.ui.magnifier;
@ -43,13 +37,10 @@ const XdndHandler = imports.ui.xdndHandler;
const Util = imports.misc.util;
const OVERRIDES_SCHEMA = 'org.gnome.shell.overrides';
const DEFAULT_BACKGROUND_COLOR = new Clutter.Color();
DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff);
const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff);
let automountManager = null;
let autorunManager = null;
let componentManager = null;
let panel = null;
let hotCorners = [];
let overview = null;
let runDialog = null;
let lookingGlass = null;
@ -58,9 +49,7 @@ let messageTray = null;
let screenShield = null;
let notificationDaemon = null;
let windowAttentionHandler = null;
let telepathyClient = null;
let ctrlAltTabManager = null;
let recorder = null;
let sessionMode = null;
let shellDBusService = null;
let shellMountOpDBusService = null;
@ -72,7 +61,6 @@ let magnifier = null;
let xdndHandler = null;
let keyboard = null;
let layoutManager = null;
let networkAgent = null;
let _startDate;
let _defaultCssStylesheet = null;
let _cssStylesheet = null;
@ -80,73 +68,10 @@ let _overridesSettings = null;
let background = null;
function createUserSession() {
// Load the calendar server. Note that we are careful about
// not loading any events until the user presses the clock
global.launch_calendar_server();
telepathyClient = new TelepathyClient.Client();
automountManager = new AutomountManager.AutomountManager();
autorunManager = new AutorunManager.AutorunManager();
networkAgent = new NetworkAgent.NetworkAgent();
_initRecorder();
}
function createGDMSession() {
screenShield.showDialog();
}
function createGDMLoginDialog(parentActor) {
// We do this this here instead of at the top to prevent GDM
// related code from getting loaded in normal user sessions
const LoginDialog = imports.gdm.loginDialog;
let loginDialog = new LoginDialog.LoginDialog(parentActor);
return [loginDialog, true];
}
function createSessionUnlockDialog(parentActor) {
let dialog = new UnlockDialog.UnlockDialog(parentActor);
return [dialog, false];
}
function createInitialSetupSession() {
networkAgent = new NetworkAgent.NetworkAgent();
}
function _initRecorder() {
let recorderSettings = new Gio.Settings({ schema: 'org.gnome.shell.recorder' });
let desktopLockdownSettings = new Gio.Settings({ schema: 'org.gnome.desktop.lockdown' });
let bindingSettings = new Gio.Settings({ schema: 'org.gnome.shell.keybindings' });
global.display.add_keybinding('toggle-recording',
bindingSettings,
Meta.KeyBindingFlags.NONE, function() {
if (recorder == null) {
recorder = new Shell.Recorder({ stage: global.stage });
}
if (recorder.is_recording()) {
recorder.close();
Meta.enable_unredirect_for_screen(global.screen);
} else if (!desktopLockdownSettings.get_boolean('disable-save-to-disk')) {
// read the parameters from GSettings always in case they have changed
recorder.set_framerate(recorderSettings.get_int('framerate'));
/* Translators: this is a filename used for screencast recording */
// xgettext:no-c-format
recorder.set_filename(_("Screencast from %d %t") + '.' + recorderSettings.get_string('file-extension'));
let pipeline = recorderSettings.get_string('pipeline');
if (!pipeline.match(/^\s*$/))
recorder.set_pipeline(pipeline);
else
recorder.set_pipeline(null);
Meta.disable_unredirect_for_screen(global.screen);
recorder.record();
}
});
function _sessionUpdated() {
Meta.keybindings_set_custom_handler('internal-keybinding-panel-run-dialog', sessionMode.hasRunDialog ? Util.wrapKeybinding(openRunDialog, true) : null);
if (sessionMode.isGreeter)
screenShield.showDialog();
}
function start() {
@ -212,61 +137,42 @@ function start() {
ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
overview = new Overview.Overview();
magnifier = new Magnifier.Magnifier();
screenShield = new ScreenShield.ScreenShield();
screenSaverDBus = new ShellDBus.ScreenSaverDBus();
if (UnlockDialog.isSupported())
screenShield = new ScreenShield.ScreenShield();
else
screenShield = new ScreenShield.ScreenShieldFallback();
panel = new Panel.Panel();
wm = new WindowManager.WindowManager();
messageTray = new MessageTray.MessageTray();
keyboard = new Keyboard.Keyboard();
notificationDaemon = new NotificationDaemon.NotificationDaemon();
windowAttentionHandler = new WindowAttentionHandler.WindowAttentionHandler();
sessionMode.createSession();
panel.startStatusArea();
componentManager = new Components.ComponentManager();
layoutManager.init();
keyboard.init();
overview.init();
if (sessionMode.hasWorkspaces)
global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,
false, -1, 1);
global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,
false, -1, 1);
Meta.keybindings_set_custom_handler('internal-keybinding-panel-main-menu', Util.wrapKeybinding(Lang.bind(overview, function() {
this.toggle();
return true;
}), true));
global.display.connect('overlay-key', Util.wrapKeybinding(Lang.bind(overview, function() {
this.toggle();
return true;
}), true));
if (sessionMode.allowExtensions) {
ExtensionDownloader.init();
ExtensionSystem.loadExtensions();
}
if (sessionMode.hasRunDialog) {
Meta.keybindings_set_custom_handler('panel-run-dialog', function() {
getRunDialog().open();
});
}
if (sessionMode.hasOverview) {
Meta.keybindings_set_custom_handler('panel-main-menu', function () {
overview.toggle();
});
global.display.connect('overlay-key',
Lang.bind(overview, overview.toggle));
}
sessionMode.connect('update', _sessionUpdated);
_sessionUpdated();
// Provide the bus object for gnome-session to
// initiate logouts.
EndSessionDialog.init();
// Attempt to become a PolicyKit authentication agent
PolkitAuthenticationAgent.init()
// Become a prompter for gnome keyring
KeyringPrompt.init();
_startDate = new Date();
global.stage.connect('captured-event', _globalKeyPressHandler);
log('GNOME Shell started at ' + _startDate);
let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
@ -286,6 +192,9 @@ function start() {
global.screen.connect('restacked', _windowsRestacked);
_nWorkspacesChanged();
ExtensionDownloader.init();
ExtensionSystem.init();
}
let _workspaces = [];
@ -509,9 +418,6 @@ function loadTheme() {
let theme = new St.Theme ({ application_stylesheet: cssStylesheet });
if (sessionMode.extraStylesheet)
theme.load_stylesheet(sessionMode.extraStylesheet);
if (previousTheme) {
let customStylesheets = previousTheme.get_custom_stylesheets();
@ -532,7 +438,6 @@ function notify(msg, details) {
messageTray.add(source);
let notification = new MessageTray.Notification(source, msg, details);
notification.setTransient(true);
notification.setShowWhenLocked(true);
source.notify(notification);
}
@ -564,85 +469,6 @@ function getWindowActorsForWorkspace(workspaceIndex) {
});
}
// This function encapsulates hacks to make certain global keybindings
// work even when we are in one of our modes where global keybindings
// are disabled with a global grab. (When there is a global grab, then
// all key events will be delivered to the stage, so ::captured-event
// on the stage can be used for global keybindings.)
function _globalKeyPressHandler(actor, event) {
if (modalCount == 0)
return false;
if (event.type() != Clutter.EventType.KEY_PRESS)
return false;
if (!sessionMode.allowKeybindingsWhenModal) {
if (modalCount > (overview.visible ? 1 : 0))
return false;
}
let symbol = event.get_key_symbol();
let keyCode = event.get_key_code();
let ignoredModifiers = global.display.get_ignored_modifier_mask();
let modifierState = event.get_state() & ~ignoredModifiers;
// This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType
let action = global.display.get_keybinding_action(keyCode, modifierState);
// This isn't a Meta.KeyBindingAction yet
if (symbol == Clutter.Super_L || symbol == Clutter.Super_R) {
overview.hide();
return true;
}
if (action == Meta.KeyBindingAction.SWITCH_PANELS) {
ctrlAltTabManager.popup(modifierState & Clutter.ModifierType.SHIFT_MASK,
modifierState);
return true;
}
switch (action) {
// left/right would effectively act as synonyms for up/down if we enabled them;
// but that could be considered confusing; we also disable them in the main view.
//
// case Meta.KeyBindingAction.WORKSPACE_LEFT:
// if (!sessionMode.hasWorkspaces)
// return false;
//
// wm.actionMoveWorkspaceLeft();
// return true;
// case Meta.KeyBindingAction.WORKSPACE_RIGHT:
// if (!sessionMode.hasWorkspaces)
// return false;
//
// wm.actionMoveWorkspaceRight();
// return true;
case Meta.KeyBindingAction.WORKSPACE_UP:
if (!sessionMode.hasWorkspaces)
return false;
wm.actionMoveWorkspace(Meta.MotionDirection.UP);
return true;
case Meta.KeyBindingAction.WORKSPACE_DOWN:
if (!sessionMode.hasWorkspaces)
return false;
wm.actionMoveWorkspace(Meta.MotionDirection.DOWN);
return true;
case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
case Meta.KeyBindingAction.COMMAND_2:
if (!sessionMode.hasRunDialog)
return false;
getRunDialog().open();
return true;
case Meta.KeyBindingAction.PANEL_MAIN_MENU:
overview.hide();
return true;
}
return false;
}
function _findModal(actor) {
for (let i = 0; i < modalActorFocusStack.length; i++) {
if (modalActorFocusStack[i].actor == actor)
@ -778,11 +604,13 @@ function createLookingGlass() {
return lookingGlass;
}
function getRunDialog() {
function openRunDialog() {
if (runDialog == null) {
runDialog = new RunDialog.RunDialog();
}
return runDialog;
runDialog.open();
return true;
}
/**

File diff suppressed because it is too large Load Diff

View File

@ -14,12 +14,12 @@ const Atk = imports.gi.Atk;
const Params = imports.misc.params;
const Layout = imports.ui.layout;
const Lightbox = imports.ui.lightbox;
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;
const OPEN_AND_CLOSE_TIME = 0.1;
const FADE_IN_BUTTONS_TIME = 0.33;
const FADE_OUT_DIALOG_TIME = 1.0;
const State = {
@ -36,12 +36,13 @@ const ModalDialog = new Lang.Class({
_init: function(params) {
params = Params.parse(params, { shellReactive: false,
styleClass: null,
parentActor: Main.uiGroup
});
parentActor: Main.uiGroup,
shouldFadeIn: true });
this.state = State.CLOSED;
this._hasModal = false;
this._shellReactive = params.shellReactive;
this._shouldFadeIn = params.shouldFadeIn;
this._group = new St.Widget({ visible: false,
x: 0,
@ -59,12 +60,14 @@ const ModalDialog = new Lang.Class({
this._group.connect('key-release-event', Lang.bind(this, this._onKeyReleaseEvent));
this._backgroundBin = new St.Bin();
this._monitorConstraint = new Layout.MonitorConstraint();
this._backgroundBin.add_constraint(this._monitorConstraint);
this._group.add_actor(this._backgroundBin);
this._dialogLayout = new St.BoxLayout({ style_class: 'modal-dialog',
vertical: true });
this.dialogLayout = new St.BoxLayout({ style_class: 'modal-dialog',
vertical: true });
if (params.styleClass != null) {
this._dialogLayout.add_style_class_name(params.styleClass);
this.dialogLayout.add_style_class_name(params.styleClass);
}
if (!this._shellReactive) {
@ -77,29 +80,29 @@ const ModalDialog = new Lang.Class({
this._eventBlocker = new Clutter.Group({ reactive: true });
stack.add_actor(this._eventBlocker);
stack.add_actor(this._dialogLayout);
stack.add_actor(this.dialogLayout);
} else {
this._backgroundBin.child = this._dialogLayout;
this._backgroundBin.child = this.dialogLayout;
}
this.contentLayout = new St.BoxLayout({ vertical: true });
this._dialogLayout.add(this.contentLayout,
{ x_fill: true,
y_fill: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.START });
this.dialogLayout.add(this.contentLayout,
{ x_fill: true,
y_fill: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.START });
this._buttonLayout = new St.BoxLayout({ style_class: 'modal-dialog-button-box',
visible: false,
vertical: false });
this._dialogLayout.add(this._buttonLayout,
{ expand: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.END });
this.dialogLayout.add(this._buttonLayout,
{ expand: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.END });
global.focus_manager.add_group(this._dialogLayout);
this._initialKeyFocus = this._dialogLayout;
global.focus_manager.add_group(this.dialogLayout);
this._initialKeyFocus = this.dialogLayout;
this._initialKeyFocusDestroyId = 0;
this._savedKeyFocus = null;
},
@ -113,8 +116,6 @@ const ModalDialog = new Lang.Class({
},
setButtons: function(buttons) {
let hadChildren = this._buttonLayout.get_children() > 0;
this._buttonLayout.destroy_all_children();
this._actionKeys = {};
@ -127,8 +128,11 @@ const ModalDialog = new Lang.Class({
let key = buttonInfo['key'];
let isDefault = buttonInfo['default'];
if (isDefault && !key)
if (isDefault && !key) {
this._actionKeys[Clutter.KEY_KP_Enter] = action;
this._actionKeys[Clutter.KEY_ISO_Enter] = action;
key = Clutter.KEY_Return;
}
buttonInfo.button = new St.Button({ style_class: 'modal-dialog-button',
reactive: true,
@ -162,21 +166,7 @@ const ModalDialog = new Lang.Class({
this._actionKeys[key] = action;
}
// Fade in buttons if there weren't any before
if (!hadChildren && buttons.length > 0) {
this._buttonLayout.opacity = 0;
Tweener.addTween(this._buttonLayout,
{ opacity: 255,
time: FADE_IN_BUTTONS_TIME,
transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() {
this.emit('buttons-set');
})
});
} else {
this.emit('buttons-set');
}
this.emit('buttons-set');
},
_onKeyReleaseEvent: function(object, event) {
@ -195,22 +185,22 @@ const ModalDialog = new Lang.Class({
this.emit('destroy');
},
_fadeOpen: function() {
let monitor = Main.layoutManager.currentMonitor;
this._backgroundBin.set_position(monitor.x, monitor.y);
this._backgroundBin.set_size(monitor.width, monitor.height);
_fadeOpen: function(onPrimary) {
if (onPrimary)
this._monitorConstraint.primary = true;
else
this._monitorConstraint.index = global.screen.get_current_monitor();
this.state = State.OPENING;
this._dialogLayout.opacity = 255;
this.dialogLayout.opacity = 255;
if (this._lightbox)
this._lightbox.show();
this._group.opacity = 0;
this._group.show();
Tweener.addTween(this._group,
{ opacity: 255,
time: OPEN_AND_CLOSE_TIME,
time: this._shouldFadeIn ? OPEN_AND_CLOSE_TIME : 0,
transition: 'easeOutQuad',
onComplete: Lang.bind(this,
function() {
@ -227,19 +217,19 @@ const ModalDialog = new Lang.Class({
this._initialKeyFocus = actor;
this._initialKeyFocusDestroyId = actor.connect('destroy', Lang.bind(this, function() {
this._initialKeyFocus = this._dialogLayout;
this._initialKeyFocus = this.dialogLayout;
this._initialKeyFocusDestroyId = 0;
}));
},
open: function(timestamp) {
open: function(timestamp, onPrimary) {
if (this.state == State.OPENED || this.state == State.OPENING)
return true;
if (!this.pushModal(timestamp))
return false;
this._fadeOpen();
this._fadeOpen(onPrimary);
return true;
},
@ -320,7 +310,7 @@ const ModalDialog = new Lang.Class({
return;
this.popModal(timestamp);
Tweener.addTween(this._dialogLayout,
Tweener.addTween(this.dialogLayout,
{ opacity: 0,
time: FADE_OUT_DIALOG_TIME,
transition: 'easeOutQuad',

View File

@ -116,8 +116,8 @@ const NotificationDaemon = new Lang.Class({
this._busProxy = new Bus();
this._trayManager = new Shell.TrayManager();
this._trayManager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
this._trayManager.connect('tray-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
this._trayIconAddedId = this._trayManager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
this._trayIconRemovedId = this._trayManager.connect('tray-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
Shell.WindowTracker.get_default().connect('notify::focus-app',
Lang.bind(this, this._onFocusAppChanged));
@ -256,6 +256,7 @@ const NotificationDaemon = new Lang.Class({
Mainloop.idle_add(Lang.bind(this,
function () {
this._emitNotificationClosed(id, NotificationClosedReason.DISMISSED);
return false;
}));
return invocation.return_value(GLib.Variant.new('(u)', [id]));
}
@ -355,13 +356,10 @@ const NotificationDaemon = new Lang.Class({
ndata.actions, ndata.hints, ndata.notification];
let gicon = this._iconForNotificationData(icon, hints);
let iconActor = new St.Icon({ gicon: gicon,
icon_type: St.IconType.FULLCOLOR,
icon_size: source.ICON_SIZE });
if (notification == null) {
notification = new MessageTray.Notification(source, summary, body,
{ icon: iconActor,
{ gicon: gicon,
bannerMarkup: true });
ndata.notification = notification;
notification.connect('destroy', Lang.bind(this,
@ -386,7 +384,7 @@ const NotificationDaemon = new Lang.Class({
this._emitActionInvoked(ndata.id, actionId);
}));
} else {
notification.update(summary, body, { icon: iconActor,
notification.update(summary, body, { gicon: gicon,
bannerMarkup: true,
clear: true });
}
@ -499,7 +497,7 @@ const NotificationDaemon = new Lang.Class({
},
_onTrayIconAdded: function(o, icon) {
let wmClass = icon.wm_class.toLowerCase();
let wmClass = icon.wm_class ? icon.wm_class.toLowerCase() : '';
if (STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass] !== undefined)
return;
@ -557,7 +555,8 @@ const Source = new Lang.Class({
processNotification: function(notification, gicon) {
if (gicon)
this._gicon = gicon;
this._setSummaryIcon(this.createIcon(this.ICON_SIZE));
if (!this.trayIcon)
this.iconUpdated();
let tracker = Shell.WindowTracker.get_default();
if (notification.resident && this.app && tracker.focus_app == this.app)
@ -582,18 +581,12 @@ const Source = new Lang.Class({
this.notifications.length > 0)
return false;
if (Main.overview.visible) {
// We can't just connect to Main.overview's 'hidden' signal,
// because it's emitted *before* it calls popModal()...
let id = global.connect('notify::stage-input-mode', Lang.bind(this,
function () {
global.disconnect(id);
this.trayIcon.click(event);
}));
Main.overview.hide();
} else {
let id = global.connect('notify::stage-input-mode', Lang.bind(this, function () {
global.disconnect(id);
this.trayIcon.click(event);
}
}));
Main.overview.hide();
return true;
},
@ -625,10 +618,20 @@ const Source = new Lang.Class({
// notification-based icons (ie, not a trayicon) or if it was unset before
if (!this.trayIcon) {
this.useNotificationIcon = false;
this._setSummaryIcon(this.createIcon(this.ICON_SIZE));
this.iconUpdated();
}
},
setTitle: function(title) {
// Do nothing if .app is set, we don't want to override the
// app name with whatever is provided through libnotify (usually
// garbage)
if (this.app)
return;
this.parent(title);
},
open: function(notification) {
this.destroyNonResidentNotifications();
this.openApp();

View File

@ -10,29 +10,42 @@ const St = imports.gi.St;
const Shell = imports.gi.Shell;
const Gdk = imports.gi.Gdk;
const AppDisplay = imports.ui.appDisplay;
const Dash = imports.ui.dash;
const DND = imports.ui.dnd;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const Panel = imports.ui.panel;
const Params = imports.misc.params;
const PlaceDisplay = imports.ui.placeDisplay;
const RemoteSearch = imports.ui.remoteSearch;
const Tweener = imports.ui.tweener;
const ViewSelector = imports.ui.viewSelector;
const Wanda = imports.ui.wanda;
const WorkspacesView = imports.ui.workspacesView;
const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
// Time for initial animation going into Overview mode
const ANIMATION_TIME = 0.25;
// We split the screen vertically between the dash and the view selector.
const DASH_SPLIT_FRACTION = 0.1;
// XXX -- grab this automatically. Hard to do.
const DASH_MAX_WIDTH = 96;
const DND_WINDOW_SWITCH_TIMEOUT = 1250;
const GLSL_DIM_EFFECT_DECLARATIONS = '';
const GLSL_DIM_EFFECT_CODE = '\
vec2 dist = cogl_tex_coord_in[0].xy - vec2(0.5, 0.5); \
float elipse_radius = 0.5; \
/* from https://bugzilla.gnome.org/show_bug.cgi?id=669798: \
the alpha on the gradient goes from 165 at its darkest to 98 at its most transparent. */ \
float y = 165.0 / 255.0; \
float x = 98.0 / 255.0; \
/* interpolate darkening value, based on distance from screen center */ \
float val = min(length(dist), elipse_radius); \
float a = mix(x, y, val / elipse_radius); \
/* dim_factor varies from [1.0 -> 0.5] when overview is showing \
We use it to smooth value, then we clamp it to valid color interval */ \
a = clamp(a - cogl_color_in.r + 0.5, 0.0, 1.0); \
/* We\'re blending between: color and black color (obviously omitted in the equation) */ \
cogl_color_out.xyz = cogl_color_out.xyz * (1.0 - a); \
cogl_color_out.a = 1.0;';
const SwipeScrollDirection = {
NONE: 0,
HORIZONTAL: 1,
@ -62,7 +75,14 @@ const ShellInfo = new Lang.Class({
this._source.destroy();
},
setMessage: function(text, undoCallback, undoLabel) {
setMessage: function(text, options) {
options = Params.parse(options, { undoCallback: null,
forFeedback: false
});
let undoCallback = options.undoCallback;
let forFeedback = options.forFeedback;
if (this._source == null) {
this._source = new MessageTray.SystemNotificationSource();
this._source.connect('destroy', Lang.bind(this,
@ -75,20 +95,17 @@ const ShellInfo = new Lang.Class({
let notification = null;
if (this._source.notifications.length == 0) {
notification = new MessageTray.Notification(this._source, text, null);
notification.setShowWhenLocked(true);
notification.setTransient(true);
notification.setForFeedback(forFeedback);
} else {
notification = this._source.notifications[0];
notification.update(text, null, { clear: true });
}
notification.setTransient(true);
this._undoCallback = undoCallback;
if (undoCallback) {
notification.addButton('system-undo',
undoLabel ? undoLabel : _("Undo"));
notification.connect('action-invoked',
Lang.bind(this, this._onUndoClicked));
notification.addButton('system-undo', _("Undo"));
notification.connect('action-invoked', Lang.bind(this, this._onUndoClicked));
}
this._source.notify(notification);
@ -98,16 +115,21 @@ const ShellInfo = new Lang.Class({
const Overview = new Lang.Class({
Name: 'Overview',
_init : function() {
this.isDummy = !Main.sessionMode.hasOverview;
_init: function() {
this._overviewCreated = false;
// We only have an overview in user sessions, so
// create a dummy overview in other cases
if (this.isDummy) {
this.animationInProgress = false;
this.visible = false;
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._sessionUpdated();
},
_createOverview: function() {
if (this._overviewCreated)
return;
}
if (this.isDummy)
return;
this._overviewCreated = true;
// The main BackgroundActor is inside global.window_group which is
// hidden when displaying the overview, so we create a new
@ -115,6 +137,10 @@ const Overview = new Lang.Class({
// scenes which allows us to show the background with different
// rendering options without duplicating the texture data.
this._background = Meta.BackgroundActor.new_for_screen(global.screen);
this._background.add_glsl_snippet(Meta.SnippetHook.FRAGMENT,
GLSL_DIM_EFFECT_DECLARATIONS,
GLSL_DIM_EFFECT_CODE,
false);
this._background.hide();
global.overlay_group.add_actor(this._background);
@ -144,8 +170,6 @@ const Overview = new Lang.Class({
this._capturedEventId = 0;
this._buttonPressId = 0;
this._workspacesDisplay = null;
this.visible = false; // animating to overview, in overview, animating out
this._shown = false; // show() and not hide()
this._shownTemporarily = false; // showTemporarily() and not hideTemporarily()
@ -182,6 +206,11 @@ const Overview = new Lang.Class({
this._needsFakePointerEvent = false;
},
_sessionUpdated: function() {
this.isDummy = !Main.sessionMode.hasOverview;
this._createOverview();
},
// The members we construct that are implemented in JS might
// want to access the overview as Main.overview to connect
// signal handlers and so forth. So we create them after
@ -192,29 +221,23 @@ const Overview = new Lang.Class({
this._shellInfo = new ShellInfo();
this._viewSelector = new ViewSelector.ViewSelector();
this._searchEntry = new St.Entry({ name: 'searchEntry',
/* Translators: this is the text displayed
in the search entry when no search is
active; it should not exceed ~30
characters. */
hint_text: _("Type to search..."),
track_hover: true,
can_focus: true });
this._group.add_actor(this._searchEntry);
this._dash = new Dash.Dash();
this._viewSelector = new ViewSelector.ViewSelector(this._searchEntry,
this._dash.showAppsButton);
this._group.add_actor(this._viewSelector.actor);
this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
this._viewSelector.addViewTab('windows', _("Windows"), this._workspacesDisplay.actor, 'text-x-generic');
let appView = new AppDisplay.AllAppDisplay();
this._viewSelector.addViewTab('applications', _("Applications"), appView.actor, 'system-run');
// Default search providers
// Wanda comes obviously first
this.addSearchProvider(new Wanda.WandaSearchProvider());
this.addSearchProvider(new AppDisplay.AppSearchProvider());
this.addSearchProvider(new AppDisplay.SettingsSearchProvider());
this.addSearchProvider(new PlaceDisplay.PlaceSearchProvider());
// Load remote search providers provided by applications
RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, this.addSearchProvider));
this._group.add_actor(this._dash.actor);
// TODO - recalculate everything when desktop size changes
this._dash = new Dash.Dash();
this._group.add_actor(this._dash.actor);
this._dash.actor.add_constraint(this._viewSelector.constrainY);
this._dash.actor.add_constraint(this._viewSelector.constrainHeight);
this.dashIconSize = this._dash.iconSize;
this._dash.connect('icon-size-changed',
@ -224,7 +247,7 @@ const Overview = new Lang.Class({
// Translators: this is the name of the dock/favorites area on
// the left of the overview
Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks');
Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks-symbolic');
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
this._relayout();
@ -238,11 +261,16 @@ const Overview = new Lang.Class({
this._viewSelector.removeSearchProvider(provider);
},
setMessage: function(text, undoCallback, undoLabel) {
//
// options:
// - undoCallback (function): the callback to be called if undo support is needed
// - forFeedback (boolean): whether the message is for direct feedback of a user action
//
setMessage: function(text, options) {
if (this.isDummy)
return;
this._shellInfo.setMessage(text, undoCallback, undoLabel);
this._shellInfo.setMessage(text, options);
},
_onDragBegin: function() {
@ -475,7 +503,9 @@ const Overview = new Lang.Class({
if (windows.length == 0)
return null;
let clone = new Clutter.Clone({ source: windows[0].get_texture() });
let window = windows[0];
let clone = new Clutter.Clone({ source: window.get_texture(),
x: window.x, y: window.y });
clone.source.connect('destroy', Lang.bind(this, function() {
clone.destroy();
}));
@ -500,13 +530,13 @@ const Overview = new Lang.Class({
this._coverPane.set_position(0, contentY);
this._coverPane.set_size(primary.width, contentHeight);
let dashWidth = Math.round(DASH_SPLIT_FRACTION * primary.width);
let viewWidth = primary.width - dashWidth - this._spacing;
let viewHeight = contentHeight - 2 * this._spacing;
let viewY = contentY + this._spacing;
let viewX = rtl ? 0 : dashWidth + this._spacing;
let searchWidth = this._searchEntry.get_width();
let searchHeight = this._searchEntry.get_height();
let searchX = (primary.width - searchWidth) / 2;
let searchY = contentY + this._spacing;
// Set the dash's x position - y is handled by a constraint
let dashWidth = DASH_MAX_WIDTH;
let dashY = searchY + searchHeight + this._spacing;
let dashX;
if (rtl) {
this._dash.actor.set_anchor_point_from_gravity(Clutter.Gravity.NORTH_EAST);
@ -514,8 +544,14 @@ const Overview = new Lang.Class({
} else {
dashX = 0;
}
this._dash.actor.set_x(dashX);
let viewX = rtl ? 0 : dashWidth + this._spacing;
let viewY = searchY + searchHeight + this._spacing;
let viewWidth = primary.width - dashWidth - this._spacing;
let viewHeight = contentHeight - this._spacing - viewY;
this._searchEntry.set_position(searchX, searchY);
this._dash.actor.set_position(dashX, dashY);
this._viewSelector.actor.set_position(viewX, viewY);
this._viewSelector.actor.set_size(viewWidth, viewHeight);
},
@ -565,6 +601,28 @@ const Overview = new Lang.Class({
Lang.bind(this, this._onButtonPress));
},
fadeInDesktop: function() {
this._desktopFade.opacity = 0;
this._desktopFade.show();
Tweener.addTween(this._desktopFade,
{ opacity: 255,
time: ANIMATION_TIME,
transition: 'easeOutQuad' });
},
fadeOutDesktop: function() {
if (!this._desktopFade.child)
this._desktopFade.child = this._getDesktopClone();
this._desktopFade.opacity = 255;
this._desktopFade.show();
Tweener.addTween(this._desktopFade,
{ opacity: 0,
time: ANIMATION_TIME,
transition: 'easeOutQuad'
});
},
_animateVisible: function() {
if (this.visible || this.animationInProgress)
return;
@ -585,21 +643,7 @@ const Overview = new Lang.Class({
global.window_group.hide();
this._group.show();
this._background.show();
this._workspacesDisplay.show();
if (!this._desktopFade.child)
this._desktopFade.child = this._getDesktopClone();
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows()) {
this._desktopFade.opacity = 255;
this._desktopFade.show();
Tweener.addTween(this._desktopFade,
{ opacity: 0,
time: ANIMATION_TIME,
transition: 'easeOutQuad'
});
}
this._viewSelector.show();
this._group.opacity = 0;
Tweener.addTween(this._group,
@ -611,7 +655,7 @@ const Overview = new Lang.Class({
});
Tweener.addTween(this._background,
{ dim_factor: 0.4,
{ dim_factor: 0.8,
time: ANIMATION_TIME,
transition: 'easeOutQuad'
});
@ -726,16 +770,7 @@ const Overview = new Lang.Class({
this.animationInProgress = true;
this._hideInProgress = true;
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows()) {
this._desktopFade.opacity = 0;
this._desktopFade.show();
Tweener.addTween(this._desktopFade,
{ opacity: 255,
time: ANIMATION_TIME,
transition: 'easeOutQuad' });
}
this._workspacesDisplay.zoomFromOverview();
this._viewSelector.zoomFromOverview();
// Make other elements fade out.
Tweener.addTween(this._group,
@ -777,8 +812,7 @@ const Overview = new Lang.Class({
global.window_group.show();
this._workspacesDisplay.hide();
this._viewSelector.hide();
this._desktopFade.hide();
this._background.hide();
this._group.hide();

View File

@ -14,13 +14,14 @@ const St = imports.gi.St;
const Signals = imports.signals;
const Atk = imports.gi.Atk;
const Config = imports.misc.config;
const CtrlAltTab = imports.ui.ctrlAltTab;
const DND = imports.ui.dnd;
const Layout = imports.ui.layout;
const Overview = imports.ui.overview;
const PopupMenu = imports.ui.popupMenu;
const PanelMenu = imports.ui.panelMenu;
const DateMenu = imports.ui.dateMenu;
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;
@ -221,14 +222,14 @@ const AppMenuButton = new Lang.Class({
Name: 'AppMenuButton',
Extends: PanelMenu.Button,
_init: function(menuManager) {
_init: function(panel) {
this.parent(0.0, null, true);
this.actor.accessible_role = Atk.Role.MENU;
this._startingApps = [];
this._menuManager = menuManager;
this._menuManager = panel.menuManager;
this._targetApp = null;
this._appMenuNotifyId = 0;
this._actionGroupNotifyId = 0;
@ -246,6 +247,10 @@ const AppMenuButton = new Lang.Class({
this._container.connect('get-preferred-height', Lang.bind(this, this._getContentPreferredHeight));
this._container.connect('allocate', Lang.bind(this, this._contentAllocate));
let textureCache = St.TextureCache.get_default();
textureCache.connect('icon-theme-changed',
Lang.bind(this, this._onIconThemeChanged));
this._iconBox = new Shell.Slicer({ name: 'appMenuIcon' });
this._iconBox.connect('style-changed',
Lang.bind(this, this._onIconBoxStyleChanged));
@ -285,7 +290,7 @@ const AppMenuButton = new Lang.Class({
},
show: function() {
if (this._visible)
if (this._visible || Main.screenShield.locked)
return;
this._visible = true;
@ -331,6 +336,15 @@ const AppMenuButton = new Lang.Class({
this._updateIconBoxClip();
},
_onIconThemeChanged: function() {
if (this._iconBox.child == null)
return;
this._iconBox.child.destroy();
let icon = this._targetApp.get_faded_icon(2 * PANEL_ICON_SIZE);
this._iconBox.set_child(icon);
},
_updateIconBoxClip: function() {
let allocation = this._iconBox.allocation;
if (this._iconBottomClip > 0)
@ -467,13 +481,6 @@ const AppMenuButton = new Lang.Class({
this._sync();
},
setLockedState: function(locked) {
if (locked)
this.hide();
else
this._sync();
},
_sync: function() {
let tracker = Shell.WindowTracker.get_default();
let focusedApp = tracker.focus_app;
@ -607,8 +614,8 @@ const ActivitiesButton = new Lang.Class({
this.actor.label_actor = this._label;
this._hotCorner = new Layout.HotCorner();
container.add_actor(this._hotCorner.actor);
this.hotCorner = new Layout.HotCorner();
container.add_actor(this.hotCorner.actor);
// Hack up our menu...
this.menu.open = Lang.bind(this, this._onMenuOpenRequest);
@ -658,10 +665,10 @@ const ActivitiesButton = new Lang.Class({
}
hotBox.x1 = Math.round(x);
hotBox.x2 = hotBox.x1 + this._hotCorner.actor.width;
hotBox.x2 = hotBox.x1 + this.hotCorner.actor.width;
hotBox.y1 = Math.round(y);
hotBox.y2 = hotBox.y1 + this._hotCorner.actor.height;
this._hotCorner.actor.allocate(hotBox, flags);
hotBox.y2 = hotBox.y1 + this.hotCorner.actor.height;
this.hotCorner.actor.allocate(hotBox, flags);
},
handleDragOver: function(source, actor, x, y, time) {
@ -683,7 +690,7 @@ const ActivitiesButton = new Lang.Class({
_onCapturedEvent: function(actor, event) {
if (event.type() == Clutter.EventType.BUTTON_PRESS) {
if (!this._hotCorner.shouldToggleOverviewOnClick())
if (!this.hotCorner.shouldToggleOverviewOnClick())
return true;
}
return false;
@ -899,6 +906,30 @@ const PanelCorner = new Lang.Class({
}
});
const PANEL_ITEM_IMPLEMENTATIONS = {
'activities': ActivitiesButton,
'appMenu': AppMenuButton,
'dateMenu': imports.ui.dateMenu.DateMenuButton,
'a11y': imports.ui.status.accessibility.ATIndicator,
'volume': imports.ui.status.volume.Indicator,
'battery': imports.ui.status.power.Indicator,
'lockScreen': imports.ui.status.lockScreenMenu.Indicator,
'logo': imports.gdm.loginDialog.LogoMenuButton,
'keyboard': imports.ui.status.keyboard.InputSourceIndicator,
'powerMenu': imports.gdm.powerMenu.PowerMenuButton,
'userMenu': imports.ui.userMenu.UserMenuButton
};
if (Config.HAVE_BLUETOOTH)
PANEL_ITEM_IMPLEMENTATIONS['bluetooth'] =
imports.ui.status.bluetooth.Indicator;
try {
PANEL_ITEM_IMPLEMENTATIONS['network'] =
imports.ui.status.network.NMApplet;
} catch(e) {
log('NMApplet is not supported. It is possible that your NetworkManager version is too old');
}
const Panel = new Lang.Class({
Name: 'Panel',
@ -908,7 +939,7 @@ const Panel = new Lang.Class({
reactive: true });
this.actor._delegate = this;
this._statusArea = {};
this.statusArea = {};
Main.overview.connect('shown', Lang.bind(this, function () {
this.actor.add_style_class_name('in-overview');
@ -917,9 +948,7 @@ const Panel = new Lang.Class({
this.actor.remove_style_class_name('in-overview');
}));
Main.screenShield.connect('lock-status-changed', Lang.bind(this, this._onLockStateChanged));
this._menus = new PopupMenu.PopupMenuManager(this);
this.menuManager = new PopupMenu.PopupMenuManager(this);
this._leftBox = new St.BoxLayout({ name: 'panelLeft' });
this.actor.add_actor(this._leftBox);
@ -946,30 +975,12 @@ const Panel = new Lang.Class({
this.actor.connect('allocate', Lang.bind(this, this._allocate));
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
/* Button on the left side of the panel. */
if (Main.sessionMode.hasOverview) {
this._activitiesButton = new ActivitiesButton();
this._activities = this._activitiesButton.actor;
this._leftBox.add(this._activities);
// The activities button has a pretend menu, so as to integrate
// more cleanly with the rest of the panel
this._menus.addMenu(this._activitiesButton.menu);
}
if (Main.sessionMode.hasAppMenu) {
this._appMenu = new AppMenuButton(this._menus);
this._leftBox.add(this._appMenu.actor);
}
/* center */
this._dateMenu = new DateMenu.DateMenuButton();
this._centerBox.add(this._dateMenu.actor, { y_fill: true });
this._menus.addMenu(this._dateMenu.menu);
Main.layoutManager.panelBox.add(this.actor);
Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar"), 'start-here',
Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar"), 'start-here-symbolic',
{ sortGroup: CtrlAltTab.SortGroup.TOP });
Main.sessionMode.connect('updated', Lang.bind(this, this._updatePanel));
this._updatePanel();
},
_getPreferredWidth: function(actor, forHeight, alloc) {
@ -1029,16 +1040,19 @@ const Panel = new Lang.Class({
}
this._rightBox.allocate(childBox, flags);
let [cornerMinWidth, cornerWidth] = this._leftCorner.actor.get_preferred_width(-1);
let [cornerMinHeight, cornerHeight] = this._leftCorner.actor.get_preferred_width(-1);
let cornerMinWidth, cornerMinHeight;
let cornerWidth, cornerHeight;
[cornerMinWidth, cornerWidth] = this._leftCorner.actor.get_preferred_width(-1);
[cornerMinHeight, cornerHeight] = this._leftCorner.actor.get_preferred_height(-1);
childBox.x1 = 0;
childBox.x2 = cornerWidth;
childBox.y1 = allocHeight;
childBox.y2 = allocHeight + cornerHeight;
this._leftCorner.actor.allocate(childBox, flags);
let [cornerMinWidth, cornerWidth] = this._rightCorner.actor.get_preferred_width(-1);
let [cornerMinHeight, cornerHeight] = this._rightCorner.actor.get_preferred_width(-1);
[cornerMinWidth, cornerWidth] = this._rightCorner.actor.get_preferred_width(-1);
[cornerMinHeight, cornerHeight] = this._rightCorner.actor.get_preferred_height(-1);
childBox.x1 = allocWidth - cornerWidth;
childBox.x2 = allocWidth;
childBox.y1 = allocHeight;
@ -1086,76 +1100,126 @@ const Panel = new Lang.Class({
},
openAppMenu: function() {
let menu = this._appMenu.menu;
if (!this._appMenu.actor.reactive || menu.isOpen)
let indicator = this.statusArea.appMenu;
if (!indicator) // appMenu not supported by current session mode
return;
let menu = indicator.menu;
if (!indicator.actor.reactive || menu.isOpen)
return;
menu.open();
menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
},
startStatusArea: function() {
for (let i = 0; i < Main.sessionMode.statusArea.order.length; i++) {
let role = Main.sessionMode.statusArea.order[i];
let constructor = Main.sessionMode.statusArea.implementation[role];
set boxOpacity(value) {
let isReactive = value > 0;
this._leftBox.opacity = value;
this._leftBox.reactive = isReactive;
this._centerBox.opacity = value;
this._centerBox.reactive = isReactive;
this._rightBox.opacity = value;
this._rightBox.reactive = isReactive;
},
get boxOpacity() {
return this._leftBox.opacity;
},
_updatePanel: function() {
let panel = Main.sessionMode.panel;
this._hideIndicators();
this._updateBox(panel.left, this._leftBox);
this._updateBox(panel.center, this._centerBox);
this._updateBox(panel.right, this._rightBox);
},
_initBox: function(elements, box) {
for (let i = 0; i < elements.length; i++) {
let role = elements[i];
let constructor = PANEL_ITEM_IMPLEMENTATIONS[role];
if (!constructor) {
// This icon is not implemented (this is a bug)
// panel icon is not supported (can happen for
// bluetooth or network)
continue;
}
let indicator = new constructor();
this.addToStatusArea(role, indicator, i);
}
},
_insertStatusItem: function(actor, position) {
let children = this._rightBox.get_children();
let i;
for (i = children.length - 1; i >= 0; i--) {
let rolePosition = children[i]._rolePosition;
if (position > rolePosition) {
this._rightBox.insert_child_at_index(actor, i + 1);
break;
_hideIndicators: function() {
for (let role in PANEL_ITEM_IMPLEMENTATIONS) {
let indicator = this.statusArea[role];
if (!indicator)
continue;
if (indicator.menu)
indicator.menu.close();
indicator.container.hide();
}
},
_ensureIndicator: function(role) {
let indicator = this.statusArea[role];
if (!indicator) {
let constructor = PANEL_ITEM_IMPLEMENTATIONS[role];
if (!constructor) {
// This icon is not implemented (this is a bug)
return null;
}
indicator = new constructor(this);
this.statusArea[role] = indicator;
}
if (i == -1) {
// If we didn't find a position, we must be first
this._rightBox.insert_child_at_index(actor, 0);
}
actor._rolePosition = position;
return indicator;
},
addToStatusArea: function(role, indicator, position) {
if (this._statusArea[role])
_updateBox: function(elements, box) {
let nChildren = box.get_n_children();
for (let i = 0; i < elements.length; i++) {
let role = elements[i];
let indicator = this._ensureIndicator(role);
if (indicator == null)
continue;
this._addToPanelBox(role, indicator, i + nChildren, box);
}
},
_addToPanelBox: function(role, indicator, position, box) {
let container = indicator.container;
container.show();
let parent = container.get_parent();
if (parent)
parent.remove_actor(container);
box.insert_child_at_index(container, position);
if (indicator.menu)
this.menuManager.addMenu(indicator.menu);
this.statusArea[role] = indicator;
let destroyId = indicator.connect('destroy', Lang.bind(this, function(emitter) {
delete this.statusArea[role];
emitter.disconnect(destroyId);
container.destroy();
}));
},
addToStatusArea: function(role, indicator, position, box) {
if (this.statusArea[role])
throw new Error('Extension point conflict: there is already a status indicator for role ' + role);
if (!(indicator instanceof PanelMenu.Button))
throw new TypeError('Status indicator must be an instance of PanelMenu.Button');
if (!position)
position = 0;
this._insertStatusItem(indicator.actor, position);
if (indicator.menu)
this._menus.addMenu(indicator.menu);
this._statusArea[role] = indicator;
let destroyId = indicator.connect('destroy', Lang.bind(this, function(emitter) {
delete this._statusArea[role];
emitter.disconnect(destroyId);
}));
position = position || 0;
let boxes = {
left: this._leftBox,
center: this._centerBox,
right: this._rightBox
};
let boxContainer = boxes[box] || this._rightBox;
this.statusArea[role] = indicator;
this._addToPanelBox(role, indicator, position, boxContainer);
return indicator;
},
_onLockStateChanged: function(shield, locked) {
if (this._activitiesButton)
this._activitiesButton.setLockedState(locked);
if (this._appMenu)
this._appMenu.setLockedState(locked);
if (this._dateMenu)
this._dateMenu.setLockedState(locked);
for (let id in this._statusArea)
this._statusArea[id].setLockedState(locked);
},
}
});

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
@ -20,6 +21,10 @@ const ButtonBox = new Lang.Class({
this.actor = new Shell.GenericContainer(params);
this.actor._delegate = this;
this.container = new St.Bin({ y_fill: true,
x_fill: true,
child: this.actor });
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
this.actor.connect('allocate', Lang.bind(this, this._allocate));
@ -114,6 +119,12 @@ const Button = new Lang.Class({
this.setName(nameText);
},
setSensitive: function(sensitive) {
this.actor.reactive = sensitive;
this.actor.can_focus = sensitive;
this.actor.track_hover = sensitive;
},
setName: function(text) {
if (text != null) {
// This is the easiest way to provide a accessible name to
@ -145,13 +156,6 @@ const Button = new Lang.Class({
}
},
setLockedState: function(locked) {
// default behaviour is to hide completely
if (locked)
this.menu.close();
this.actor.visible = !locked;
},
_onButtonPress: function(actor, event) {
if (!this.menu)
return;
@ -182,8 +186,7 @@ const Button = new Lang.Class({
_onMenuKeyPress: function(actor, event) {
let symbol = event.get_key_symbol();
if (symbol == Clutter.KEY_Left || symbol == Clutter.KEY_Right) {
let focusManager = St.FocusManager.get_for_stage(global.stage);
let group = focusManager.get_group(this.actor);
let group = global.focus_manager.get_group(this.actor);
if (group) {
let direction = (symbol == Clutter.KEY_Left) ? Gtk.DirectionType.LEFT : Gtk.DirectionType.RIGHT;
group.navigate_focus(this.actor, direction, false);
@ -211,7 +214,8 @@ const Button = new Lang.Class({
destroy: function() {
this.actor._delegate = null;
this.menu.destroy();
if (this.menu)
this.menu.destroy();
this.actor.destroy();
this.emit('destroy');
@ -231,19 +235,36 @@ const SystemStatusButton = new Lang.Class({
_init: function(iconName, nameText) {
this.parent(0.0, nameText);
this._iconActor = new St.Icon({ icon_name: iconName,
icon_type: St.IconType.SYMBOLIC,
style_class: 'system-status-icon' });
this.actor.add_actor(this._iconActor);
this.actor.add_style_class_name('panel-status-button');
this._box = new St.BoxLayout({ style_class: 'panel-status-button-box' });
this.actor.add_actor(this._box);
if (iconName)
this.setIcon(iconName);
},
addIcon: function(gicon) {
let icon = new St.Icon({ gicon: gicon,
style_class: 'system-status-icon' });
this._box.add_actor(icon);
return icon;
},
setIcon: function(iconName) {
this._iconActor.icon_name = iconName;
// Need to first add a NULL GIcon and then set icon_name, to ensure
// compatibility with -symbolic fallbacks
if (!this.mainIcon)
this.mainIcon = this.addIcon(null);
this.mainIcon.icon_name = iconName;
},
setGIcon: function(gicon) {
this._iconActor.gicon = gicon;
if (this.mainIcon)
this.mainIcon.gicon = gicon;
else
this.mainIcon = this.addIcon(gicon);
}
});

View File

@ -1,430 +0,0 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Shell = imports.gi.Shell;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
const St = imports.gi.St;
const DND = imports.ui.dnd;
const Main = imports.ui.main;
const Params = imports.misc.params;
const Search = imports.ui.search;
const Util = imports.misc.util;
/**
* Represents a place object, which is most normally a bookmark entry,
* a mount/volume, or a special place like the Home Folder, Computer, and Network.
*
* @name: String title
* @iconFactory: A JavaScript callback which will create an icon texture given a size parameter
* @launch: A JavaScript callback to launch the entry
*/
const PlaceInfo = new Lang.Class({
Name: 'PlaceInfo',
_init: function(id, name, iconFactory, launch) {
this.id = id;
this.name = name;
this._lowerName = name.toLowerCase();
this.iconFactory = iconFactory;
this.launch = launch;
},
matchTerms: function(terms) {
let mtype = Search.MatchType.NONE;
for (let i = 0; i < terms.length; i++) {
let term = terms[i];
let idx = this._lowerName.indexOf(term);
if (idx == 0) {
mtype = Search.MatchType.PREFIX;
} else if (idx > 0) {
if (mtype == Search.MatchType.NONE)
mtype = Search.MatchType.SUBSTRING;
} else {
return Search.MatchType.NONE;
}
}
return mtype;
},
isRemovable: function() {
return false;
}
});
// Helper function to translate launch parameters into a GAppLaunchContext
function _makeLaunchContext(params)
{
params = Params.parse(params, { workspace: -1,
timestamp: 0 });
let launchContext = global.create_app_launch_context();
if (params.workspace != -1)
launchContext.set_desktop(params.workspace);
if (params.timestamp != 0)
launchContext.set_timestamp(params.timestamp);
return launchContext;
}
const PlaceDeviceInfo = new Lang.Class({
Name: 'PlaceDeviceInfo',
Extends: PlaceInfo,
_init: function(mount) {
this._mount = mount;
this.name = mount.get_name();
this._lowerName = this.name.toLowerCase();
this.id = 'mount:' + mount.get_root().get_uri();
},
iconFactory: function(size) {
let icon = this._mount.get_icon();
return St.TextureCache.get_default().load_gicon(null, icon, size);
},
launch: function(params) {
Gio.app_info_launch_default_for_uri(this._mount.get_root().get_uri(),
_makeLaunchContext(params));
},
isRemovable: function() {
return this._mount.can_unmount();
},
remove: function() {
if (!this.isRemovable())
return;
if (this._mount.can_eject())
this._mount.eject(0, null, Lang.bind(this, this._removeFinish));
else
this._mount.unmount(0, null, Lang.bind(this, this._removeFinish));
},
_removeFinish: function(o, res, data) {
try {
if (this._mount.can_eject())
this._mount.eject_finish(res);
else
this._mount.unmount_finish(res);
} catch (e) {
let message = _("Failed to unmount '%s'").format(o.get_name());
Main.overview.setMessage(message,
Lang.bind(this, this.remove),
_("Retry"));
}
}
});
const PlacesManager = new Lang.Class({
Name: 'PlacesManager',
_init: function() {
this._defaultPlaces = [];
this._mounts = [];
this._bookmarks = [];
let homeFile = Gio.file_new_for_path (GLib.get_home_dir());
let homeUri = homeFile.get_uri();
let homeLabel = Shell.util_get_label_for_uri (homeUri);
let homeIcon = Shell.util_get_icon_for_uri (homeUri);
this._home = new PlaceInfo('special:home', homeLabel,
function(size) {
return St.TextureCache.get_default().load_gicon(null, homeIcon, size);
},
function(params) {
Gio.app_info_launch_default_for_uri(homeUri, _makeLaunchContext(params));
});
let desktopPath = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DESKTOP);
let desktopFile = Gio.file_new_for_path (desktopPath);
let desktopUri = desktopFile.get_uri();
let desktopLabel = Shell.util_get_label_for_uri (desktopUri);
let desktopIcon = Shell.util_get_icon_for_uri (desktopUri);
this._desktopMenu = new PlaceInfo('special:desktop', desktopLabel,
function(size) {
return St.TextureCache.get_default().load_gicon(null, desktopIcon, size);
},
function(params) {
Gio.app_info_launch_default_for_uri(desktopUri, _makeLaunchContext(params));
});
this._connect = new PlaceInfo('special:connect', _("Connect to..."),
function (size) {
// do NOT use St.Icon here, it crashes the shell
// see wanda.js for details
return St.TextureCache.get_default().load_icon_name(null,
'applications-internet',
St.IconType.FULLCOLOR,
size);
},
function (params) {
// BUG: nautilus-connect-server doesn't have a desktop file, so we can't
// launch it with the workspace from params. It's probably pretty rare
// and odd to drag this place onto a workspace in any case
Util.spawn(['nautilus-connect-server']);
});
this._defaultPlaces.push(this._home);
this._defaultPlaces.push(this._desktopMenu);
this._defaultPlaces.push(this._connect);
/*
* Show devices, code more or less ported from nautilus-places-sidebar.c
*/
this._volumeMonitor = Gio.VolumeMonitor.get();
this._volumeMonitor.connect('volume-added', Lang.bind(this, this._updateDevices));
this._volumeMonitor.connect('volume-removed',Lang.bind(this, this._updateDevices));
this._volumeMonitor.connect('volume-changed', Lang.bind(this, this._updateDevices));
this._volumeMonitor.connect('mount-added', Lang.bind(this, this._updateDevices));
this._volumeMonitor.connect('mount-removed', Lang.bind(this, this._updateDevices));
this._volumeMonitor.connect('mount-changed', Lang.bind(this, this._updateDevices));
this._volumeMonitor.connect('drive-connected', Lang.bind(this, this._updateDevices));
this._volumeMonitor.connect('drive-disconnected', Lang.bind(this, this._updateDevices));
this._volumeMonitor.connect('drive-changed', Lang.bind(this, this._updateDevices));
this._updateDevices();
this._bookmarksPath = GLib.build_filenamev([GLib.get_user_config_dir(), 'gtk-3.0', 'bookmarks']);
this._bookmarksFile = Gio.file_new_for_path(this._bookmarksPath);
this._monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null);
this._bookmarkTimeoutId = 0;
this._monitor.connect('changed', Lang.bind(this, function () {
if (this._bookmarkTimeoutId > 0)
return;
/* Defensive event compression */
this._bookmarkTimeoutId = Mainloop.timeout_add(100, Lang.bind(this, function () {
this._bookmarkTimeoutId = 0;
this._reloadBookmarks();
return false;
}));
}));
this._reloadBookmarks();
},
_updateDevices: function() {
this._mounts = [];
/* first go through all connected drives */
let drives = this._volumeMonitor.get_connected_drives();
for (let i = 0; i < drives.length; i++) {
let volumes = drives[i].get_volumes();
for(let j = 0; j < volumes.length; j++) {
let mount = volumes[j].get_mount();
if(mount != null) {
this._addMount(mount);
}
}
}
/* add all volumes that is not associated with a drive */
let volumes = this._volumeMonitor.get_volumes();
for(let i = 0; i < volumes.length; i++) {
if(volumes[i].get_drive() != null)
continue;
let mount = volumes[i].get_mount();
if(mount != null) {
this._addMount(mount);
}
}
/* add mounts that have no volume (/etc/mtab mounts, ftp, sftp,...) */
let mounts = this._volumeMonitor.get_mounts();
for(let i = 0; i < mounts.length; i++) {
if(mounts[i].is_shadowed())
continue;
if(mounts[i].get_volume())
continue;
this._addMount(mounts[i]);
}
/* We emit two signals, one for a generic 'all places' update
* and the other for one specific to mounts. We do this because
* clients like PlaceDisplay may only care about places in general
* being updated while clients like DashPlaceDisplay care which
* specific type of place got updated.
*/
this.emit('mounts-updated');
this.emit('places-updated');
},
_reloadBookmarks: function() {
this._bookmarks = [];
if (!GLib.file_test(this._bookmarksPath, GLib.FileTest.EXISTS))
return;
let bookmarksContent = Shell.get_file_contents_utf8_sync(this._bookmarksPath);
let bookmarks = bookmarksContent.split('\n');
let bookmarksToLabel = {};
let bookmarksOrder = [];
for (let i = 0; i < bookmarks.length; i++) {
let bookmarkLine = bookmarks[i];
let components = bookmarkLine.split(' ');
let bookmark = components[0];
if (bookmark in bookmarksToLabel)
continue;
let label = null;
if (components.length > 1)
label = components.slice(1).join(' ');
bookmarksToLabel[bookmark] = label;
bookmarksOrder.push(bookmark);
}
for (let i = 0; i < bookmarksOrder.length; i++) {
let bookmark = bookmarksOrder[i];
let label = bookmarksToLabel[bookmark];
let file = Gio.file_new_for_uri(bookmark);
if (!file.query_exists(null))
continue;
if (label == null)
label = Shell.util_get_label_for_uri(bookmark);
if (label == null)
continue;
let icon = Shell.util_get_icon_for_uri(bookmark);
let item = new PlaceInfo('bookmark:' + bookmark, label,
function(size) {
return St.TextureCache.get_default().load_gicon(null, icon, size);
},
function(params) {
Gio.app_info_launch_default_for_uri(bookmark, _makeLaunchContext(params));
});
this._bookmarks.push(item);
}
/* See comment in _updateDevices for explanation why there are two signals. */
this.emit('bookmarks-updated');
this.emit('places-updated');
},
_addMount: function(mount) {
let devItem = new PlaceDeviceInfo(mount);
this._mounts.push(devItem);
},
getAllPlaces: function () {
return this.getDefaultPlaces().concat(this.getBookmarks(), this.getMounts());
},
getDefaultPlaces: function () {
return this._defaultPlaces;
},
getBookmarks: function () {
return this._bookmarks;
},
getMounts: function () {
return this._mounts;
},
_lookupIndexById: function(sourceArray, id) {
for (let i = 0; i < sourceArray.length; i++) {
let place = sourceArray[i];
if (place.id == id)
return i;
}
return -1;
},
lookupPlaceById: function(id) {
let colonIdx = id.indexOf(':');
let type = id.substring(0, colonIdx);
let sourceArray = null;
if (type == 'special')
sourceArray = this._defaultPlaces;
else if (type == 'mount')
sourceArray = this._mounts;
else if (type == 'bookmark')
sourceArray = this._bookmarks;
return sourceArray[this._lookupIndexById(sourceArray, id)];
},
_removeById: function(sourceArray, id) {
sourceArray.splice(this._lookupIndexById(sourceArray, id), 1);
}
});
Signals.addSignalMethods(PlacesManager.prototype);
const PlaceSearchProvider = new Lang.Class({
Name: 'PlaceSearchProvider',
Extends: Search.SearchProvider,
_init: function() {
this.parent(_("PLACES & DEVICES"));
this.placesManager = new PlacesManager();
},
getResultMetas: function(resultIds, callback) {
let metas = [];
for (let i = 0; i < resultIds.length; i++) {
let placeInfo = this.placesManager.lookupPlaceById(resultIds[i]);
if (!placeInfo)
metas.push(null);
else
metas.push({ 'id': resultIds[i],
'name': placeInfo.name,
'createIcon': function(size) {
return placeInfo.iconFactory(size);
}
});
}
callback(metas);
},
activateResult: function(id, params) {
let placeInfo = this.placesManager.lookupPlaceById(id);
placeInfo.launch(params);
},
_compareResultMeta: function (idA, idB) {
let infoA = this.placesManager.lookupPlaceById(idA);
let infoB = this.placesManager.lookupPlaceById(idB);
return infoA.name.localeCompare(infoB.name);
},
_searchPlaces: function(places, terms) {
let prefixResults = [];
let substringResults = [];
terms = terms.map(String.toLowerCase);
for (let i = 0; i < places.length; i++) {
let place = places[i];
let mtype = place.matchTerms(terms);
if (mtype == Search.MatchType.PREFIX)
prefixResults.push(place.id);
else if (mtype == Search.MatchType.SUBSTRING)
substringResults.push(place.id);
}
prefixResults.sort(Lang.bind(this, this._compareResultMeta));
substringResults.sort(Lang.bind(this, this._compareResultMeta));
this.searchSystem.pushResults(this, prefixResults.concat(substringResults));
},
getInitialResultSet: function(terms) {
let places = this.placesManager.getAllPlaces();
this._searchPlaces(places, terms);
},
getSubsearchResultSet: function(previousResults, terms) {
let places = previousResults.map(Lang.bind(this, function(id) {
return this.placesManager.lookupPlaceById(id);
}));
this._searchPlaces(places, terms);
}
});

130
js/ui/pointerWatcher.js Normal file
View File

@ -0,0 +1,130 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const GnomeDesktop = imports.gi.GnomeDesktop;
const Shell = imports.gi.Shell;
// We stop polling if the user is idle for more than this amount of time
const IDLE_TIME = 1000;
// This file implements a reasonably efficient system for tracking the position
// of the mouse pointer. We simply query the pointer from the X server in a loop,
// but we turn off the polling when the user is idle.
let _pointerWatcher = null;
function getPointerWatcher() {
if (_pointerWatcher == null)
_pointerWatcher = new PointerWatcher();
return _pointerWatcher;
}
const PointerWatch = new Lang.Class({
Name: 'PointerWatch',
_init: function(watcher, interval, callback) {
this.watcher = watcher;
this.interval = interval;
this.callback = callback;
},
// remove:
// remove this watch. This function may safely be called
// while the callback is executing.
remove: function() {
this.watcher._removeWatch(this);
}
});
const PointerWatcher = new Lang.Class({
Name: 'PointerWatcher',
_init: function() {
let idleMonitor = new GnomeDesktop.IdleMonitor();
idleMonitor.connect('became-active', Lang.bind(this, this._onIdleMonitorBecameActive));
idleMonitor.add_watch(IDLE_TIME, Lang.bind(this, this._onIdleMonitorBecameIdle));
this._idle = idleMonitor.get_idletime() > IDLE_TIME;
this._watches = [];
this.pointerX = null;
this.pointerY = null;
},
// addWatch:
// @interval: hint as to the time resolution needed. When the user is
// not idle, the position of the pointer will be queried at least
// once every this many milliseconds.
// @callback: function to call when the pointer position changes - takes
// two arguments, X and Y.
//
// Set up a watch on the position of the mouse pointer. Returns a
// PointerWatch object which has a remove() method to remove the watch.
addWatch: function(interval, callback) {
// Avoid unreliably calling the watch for the current position
this._updatePointer();
let watch = new PointerWatch(this, interval, callback);
this._watches.push(watch);
this._updateTimeout();
return watch;
},
_removeWatch: function(watch) {
for (let i = 0; i < this._watches.length; i++) {
if (this._watches[i] == watch) {
this._watches.splice(i, 1);
this._updateTimeout();
return;
}
}
},
_onIdleMonitorBecameActive: function(monitor) {
this._idle = false;
this._updatePointer();
this._updateTimeout();
},
_onIdleMonitorBecameIdle: function(monitor) {
this._idle = true;
this._updateTimeout();
},
_updateTimeout: function() {
if (this._timeoutId) {
Mainloop.source_remove(this._timeoutId);
this._timeoutId = 0;
}
if (this._idle || this._watches.length == 0)
return;
let minInterval = this._watches[0].interval;
for (let i = 1; i < this._watches.length; i++)
minInterval = Math.min(this._watches[i].interval, minInterval);
this._timeoutId = Mainloop.timeout_add(minInterval,
Lang.bind(this, this._onTimeout));
},
_onTimeout: function() {
this._updatePointer();
return true;
},
_updatePointer: function() {
let [x, y, mods] = global.get_pointer();
if (this.pointerX == x && this.pointerY == y)
return;
this.pointerX = x;
this.pointerY = y;
for (let i = 0; i < this._watches.length;) {
let watch = this._watches[i];
watch.callback(x, y);
if (watch == this._watches[i]) // guard against self-removal
i++;
}
}
});

View File

@ -37,12 +37,13 @@ const PopupBaseMenuItem = new Lang.Class({
activate: true,
hover: true,
sensitive: true,
style_class: null
style_class: null,
can_focus: true
});
this.actor = new Shell.GenericContainer({ style_class: 'popup-menu-item',
reactive: params.reactive,
track_hover: params.reactive,
can_focus: params.reactive,
can_focus: params.can_focus,
accessible_role: Atk.Role.MENU_ITEM});
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
@ -60,6 +61,9 @@ const PopupBaseMenuItem = new Lang.Class({
this.setSensitive(this.sensitive);
if (!this._activatable)
this.actor.add_style_class_name('popup-inactive-menu-item');
if (params.style_class)
this.actor.add_style_class_name(params.style_class);
@ -69,10 +73,9 @@ const PopupBaseMenuItem = new Lang.Class({
}
if (params.reactive && params.hover)
this.actor.connect('notify::hover', Lang.bind(this, this._onHoverChanged));
if (params.reactive) {
this.actor.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
this.actor.connect('key-focus-out', Lang.bind(this, this._onKeyFocusOut));
}
this.actor.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
this.actor.connect('key-focus-out', Lang.bind(this, this._onKeyFocusOut));
},
_onStyleChanged: function (actor) {
@ -134,6 +137,7 @@ const PopupBaseMenuItem = new Lang.Class({
this.sensitive = sensitive;
this.actor.reactive = sensitive;
this.actor.can_focus = sensitive;
this.emit('sensitive-changed', sensitive);
},
@ -179,12 +183,14 @@ const PopupBaseMenuItem = new Lang.Class({
this._dot = new St.DrawingArea({ style_class: 'popup-menu-item-dot' });
this._dot.connect('repaint', Lang.bind(this, this._onRepaintDot));
this.actor.add_actor(this._dot);
this.actor.add_accessible_state (Atk.StateType.CHECKED);
} else {
if (!this._dot)
return;
this._dot.destroy();
this._dot = null;
this.actor.remove_accessible_state (Atk.StateType.CHECKED);
}
},
@ -395,7 +401,8 @@ const PopupSeparatorMenuItem = new Lang.Class({
Extends: PopupBaseMenuItem,
_init: function () {
this.parent({ reactive: false });
this.parent({ reactive: false,
can_focus: false});
this._drawingArea = new St.DrawingArea({ style_class: 'popup-separator-menu-item' });
this.addActor(this._drawingArea, { span: -1, expand: true });
@ -714,7 +721,8 @@ const Switch = new Lang.Class({
_init: function(state) {
this.actor = new St.Bin({ style_class: 'toggle-switch',
accessible_role: Atk.Role.CHECK_BOX});
accessible_role: Atk.Role.CHECK_BOX,
can_focus: true });
// Translators: this MUST be either "toggle-switch-us"
// (for toggle switches containing the English words
// "ON" and "OFF") or "toggle-switch-intl" (for toggle
@ -758,7 +766,7 @@ const PopupSwitchMenuItem = new Lang.Class({
{ expand: true, span: -1, align: St.Align.END });
this._statusLabel = new St.Label({ text: '',
style_class: 'popup-inactive-menu-item'
style_class: 'popup-status-menu-item'
});
this._statusBin.child = this._switch.actor;
},
@ -862,13 +870,15 @@ const PopupMenuBase = new Lang.Class({
// for the menu which causes its prelight state to freeze
this.blockSourceEvents = false;
// Can be set while a menu is up to let all events through without special
// menu handling useful for scrollbars in menus, and probably not otherwise.
this.passEvents = false;
this._activeMenuItem = null;
this._childMenus = [];
this._settingsActions = { };
this._sessionUpdatedId = Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
},
_sessionUpdated: function() {
this._setSettingsVisibility(Main.sessionMode.allowSettings);
},
addAction: function(title, callback) {
@ -882,9 +892,6 @@ const PopupMenuBase = new Lang.Class({
},
addSettingsAction: function(title, desktopFile) {
if (!Main.sessionMode.allowSettings)
return null;
let menuItem = this.addAction(title, function() {
let app = Shell.AppSystem.get_default().lookup_setting(desktopFile);
@ -897,12 +904,13 @@ const PopupMenuBase = new Lang.Class({
app.activate();
});
menuItem.actor.visible = Main.sessionMode.allowSettings;
this._settingsActions[desktopFile] = menuItem;
return menuItem;
},
setSettingsVisibility: function(visible) {
_setSettingsVisibility: function(visible) {
for (let id in this._settingsActions) {
let item = this._settingsActions[id];
item.actor.visible = visible;
@ -1051,14 +1059,17 @@ const PopupMenuBase = new Lang.Class({
if (menuItem instanceof PopupMenuSection) {
this._connectSubMenuSignals(menuItem, menuItem);
menuItem._closingId = this.connect('open-state-changed',
menuItem._parentOpenStateChangedId = this.connect('open-state-changed',
function(self, open) {
if (!open)
menuItem.close(BoxPointer.PopupAnimation.FADE);
if (open)
menuItem.open();
else
menuItem.close();
});
menuItem.connect('destroy', Lang.bind(this, function() {
menuItem.disconnect(menuItem._subMenuActivateId);
menuItem.disconnect(menuItem._subMenuActiveChangeId);
this.disconnect(menuItem._parentOpenStateChangedId);
this.length--;
}));
@ -1093,7 +1104,8 @@ const PopupMenuBase = new Lang.Class({
let columnWidths = [];
let items = this.box.get_children();
for (let i = 0; i < items.length; i++) {
if (!items[i].visible)
if (!items[i].visible &&
!(items[i]._delegate instanceof PopupSubMenu && items[i-1].visible))
continue;
if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof PopupMenuBase) {
let itemColumnWidths = items[i]._delegate.getColumnWidths();
@ -1168,6 +1180,9 @@ const PopupMenuBase = new Lang.Class({
this.actor.destroy();
this.emit('destroy');
Main.sessionMode.disconnect(this._sessionUpdatedId);
this._sessionUpdatedId = 0;
}
});
Signals.addSignalMethods(PopupMenuBase.prototype);
@ -1254,13 +1269,14 @@ const PopupMenu = new Lang.Class({
},
close: function(animate) {
if (!this.isOpen)
return;
if (this._activeMenuItem)
this._activeMenuItem.setActive(false);
this._boxPointer.hide(animate);
if (this._boxPointer.actor.visible)
this._boxPointer.hide(animate);
if (!this.isOpen)
return;
this.isOpen = false;
this.emit('open-state-changed', false);
@ -1284,24 +1300,6 @@ const PopupSubMenu = new Lang.Class({
hscrollbar_policy: Gtk.PolicyType.NEVER,
vscrollbar_policy: Gtk.PolicyType.NEVER });
// StScrollbar plays dirty tricks with events, calling
// clutter_set_motion_events_enabled (FALSE) during the scroll; this
// confuses our event tracking, so we just turn it off during the
// scroll.
let vscroll = this.actor.get_vscroll_bar();
vscroll.connect('scroll-start',
Lang.bind(this, function() {
let topMenu = this._getTopMenu();
if (topMenu)
topMenu.passEvents = true;
}));
vscroll.connect('scroll-stop',
Lang.bind(this, function() {
let topMenu = this._getTopMenu();
if (topMenu)
topMenu.passEvents = false;
}));
this.actor.add_actor(this.box);
this.actor._delegate = this;
this.actor.clip_to_allocation = true;
@ -1351,6 +1349,11 @@ const PopupSubMenu = new Lang.Class({
this.actor.vscrollbar_policy =
needsScrollbar ? Gtk.PolicyType.AUTOMATIC : Gtk.PolicyType.NEVER;
if (needsScrollbar)
this.actor.add_style_pseudo_class('scrolled');
else
this.actor.remove_style_pseudo_class('scrolled');
// It looks funny if we animate with a scrollbar (at what point is
// the scrollbar added?) so just skip that case
if (animate && needsScrollbar)
@ -1457,7 +1460,7 @@ const PopupMenuSection = new Lang.Class({
// deliberately ignore any attempt to open() or close(), but emit the
// corresponding signal so children can still pick it up
open: function(animate) { this.emit('open-state-changed', true); },
open: function() { this.emit('open-state-changed', true); },
close: function() { this.emit('open-state-changed', false); },
destroy: function() {
@ -1895,7 +1898,7 @@ const RemoteMenu = new Lang.Class({
}));
}
item.actor.reactive = action.enabled;
item.actor.reactive = item.actor.can_focus = action.enabled;
destroyId = item.connect('destroy', Lang.bind(this, function() {
item.disconnect(destroyId);
@ -2027,7 +2030,7 @@ const RemoteMenu = new Lang.Class({
if (action.items.length) {
for (let i = 0; i < action.items.length; i++) {
let item = action.items[i];
item.actor.reactive = action.enabled;
item.actor.reactive = item.actor.can_focus = action.enabled;
}
}
}
@ -2055,6 +2058,9 @@ const PopupMenuManager = new Lang.Class({
},
addMenu: function(menu, position) {
if (this._findMenu(menu) > -1)
return;
let menudata = {
menu: menu,
openStateChangeId: menu.connect('open-state-changed', Lang.bind(this, this._onMenuOpenState)),
@ -2278,9 +2284,6 @@ const PopupMenuManager = new Lang.Class({
this._owner.menuEventFilter(event))
return true;
if (this._activeMenu != null && this._activeMenu.passEvents)
return false;
if (this._didPop) {
this._didPop = false;
return true;

View File

@ -34,16 +34,30 @@ var SearchProviderProxy = Gio.DBusProxy.makeProxyWrapper(SearchProviderIface);
function loadRemoteSearchProviders(addProviderCallback) {
let dataDirs = GLib.get_system_data_dirs();
let loadedProviders = {};
for (let i = 0; i < dataDirs.length; i++) {
let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'search-providers']);
let dir = Gio.file_new_for_path(path);
if (!dir.query_exists(null))
continue;
loadRemoteSearchProvidersFromDir(dir, addProviderCallback);
dir.query_info_async('standard:type', Gio.FileQueryInfoFlags.NONE,
GLib.PRIORITY_DEFAULT, null,
function(object, res) {
let exists = false;
try {
object.query_info_finish(res);
exists = true;
} catch (e) {
}
if (!exists)
return;
loadRemoteSearchProvidersFromDir(dir, loadedProviders, addProviderCallback);
});
}
};
function loadRemoteSearchProvidersFromDir(dir, addProviderCallback) {
function loadRemoteSearchProvidersFromDir(dir, loadedProviders, addProviderCallback) {
let dirPath = dir.get_path();
FileUtils.listDirAsync(dir, Lang.bind(this, function(files) {
for (let i = 0; i < files.length; i++) {
@ -59,35 +73,31 @@ function loadRemoteSearchProvidersFromDir(dir, addProviderCallback) {
if (!keyfile.has_group(KEY_FILE_GROUP))
continue;
let remoteProvider, title;
let remoteProvider;
try {
let group = KEY_FILE_GROUP;
let busName = keyfile.get_string(group, 'BusName');
let objectPath = keyfile.get_string(group, 'ObjectPath');
if (loadedProviders[objectPath])
continue;
let appInfo = null;
try {
let desktopId = keyfile.get_string(group, 'DesktopId');
appInfo = Gio.DesktopAppInfo.new(desktopId);
} catch (e) {
log('Ignoring search provider ' + path + ': missing DesktopId');
continue;
}
let icon;
if (appInfo) {
icon = appInfo.get_icon();
title = appInfo.get_name();
} else {
let iconName = keyfile.get_string(group, 'Icon');
icon = new Gio.ThemedIcon({ name: iconName });
title = keyfile.get_locale_string(group, 'Title', null);
}
remoteProvider = new RemoteSearchProvider(title,
icon,
remoteProvider = new RemoteSearchProvider(appInfo.get_name(),
appInfo.get_icon(),
busName,
objectPath);
loadedProviders[objectPath] = remoteProvider;
} catch(e) {
log('Failed to add search provider "%s": %s'.format(title, e.toString()));
log('Failed to add search provider %s: %s'.format(path, e.toString()));
continue;
}
@ -103,17 +113,20 @@ const RemoteSearchProvider = new Lang.Class({
_init: function(title, icon, dbusName, dbusPath) {
this._proxy = new SearchProviderProxy(Gio.DBus.session,
dbusName, dbusPath);
dbusName, dbusPath, Lang.bind(this, this._onProxyConstructed));
this.parent(title.toUpperCase());
this._cancellable = new Gio.Cancellable();
},
_onProxyConstructed: function(proxy) {
// Do nothing
},
createIcon: function(size, meta) {
if (meta['gicon']) {
return new St.Icon({ gicon: Gio.icon_new_for_string(meta['gicon']),
icon_size: size,
icon_type: St.IconType.FULLCOLOR });
icon_size: size });
} else if (meta['icon-data']) {
let [width, height, rowStride, hasAlpha,
bitsPerSample, nChannels, data] = meta['icon-data'];
@ -124,8 +137,7 @@ const RemoteSearchProvider = new Lang.Class({
// Ugh, but we want to fall back to something ...
return new St.Icon({ icon_name: 'text-x-generic',
icon_size: size,
icon_type: St.IconType.FULLCOLOR });
icon_size: size });
},
_getResultsFinished: function(results, error) {

View File

@ -202,11 +202,12 @@ const RunDialog = new Lang.Class({
let label = new St.Label({ style_class: 'run-dialog-label',
text: _("Please enter a command:") });
text: _("Enter a Command") });
this.contentLayout.add(label, { y_align: St.Align.START });
let entry = new St.Entry({ style_class: 'run-dialog-entry' });
let entry = new St.Entry({ style_class: 'run-dialog-entry',
can_focus: true });
ShellEntry.addContextMenu(entry);
entry.label_actor = label;
@ -219,7 +220,9 @@ const RunDialog = new Lang.Class({
this.contentLayout.add(this._errorBox, { expand: true });
let errorIcon = new St.Icon({ icon_name: 'dialog-error', icon_size: 24, style_class: 'run-dialog-error-icon' });
let errorIcon = new St.Icon({ icon_name: 'dialog-error-symbolic',
icon_size: 24,
style_class: 'run-dialog-error-icon' });
this._errorBox.add(errorIcon, { y_align: St.Align.MIDDLE });
@ -234,6 +237,10 @@ const RunDialog = new Lang.Class({
this._errorBox.hide();
this.setButtons([{ action: Lang.bind(this, this.close),
label: _("Close"),
key: Clutter.Escape }]);
this._pathCompleter = new Gio.FilenameCompleter();
this._commandCompleter = new CommandCompleter();
this._group.connect('notify::visible', Lang.bind(this._commandCompleter, this._commandCompleter.update));
@ -244,20 +251,12 @@ const RunDialog = new Lang.Class({
let symbol = e.get_key_symbol();
if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
this.popModal();
if (e.get_state() & Clutter.ModifierType.CONTROL_MASK)
this._run(o.get_text(), true);
else
this._run(o.get_text(), false);
if (!this._commandError)
this._run(o.get_text(),
e.get_state() & Clutter.ModifierType.CONTROL_MASK);
if (!this._commandError ||
!this.pushModal())
this.close();
else {
if (!this.pushModal())
this.close();
}
return true;
}
if (symbol == Clutter.Escape) {
this.close();
return true;
}
if (symbol == Clutter.slash) {

File diff suppressed because it is too large Load Diff

View File

@ -10,8 +10,6 @@ const Util = imports.misc.util;
const FileUtils = imports.misc.fileUtils;
const Main = imports.ui.main;
const DISABLED_OPEN_SEARCH_PROVIDERS_KEY = 'disabled-open-search-providers';
// Not currently referenced by the search API, but
// this enumeration can be useful for provider
// implementations.
@ -169,99 +167,6 @@ const SearchProvider = new Lang.Class({
});
Signals.addSignalMethods(SearchProvider.prototype);
const OpenSearchSystem = new Lang.Class({
Name: 'OpenSearchSystem',
_init: function() {
this._providers = [];
global.settings.connect('changed::' + DISABLED_OPEN_SEARCH_PROVIDERS_KEY, Lang.bind(this, this._refresh));
this._refresh();
},
getProviders: function() {
let res = [];
for (let i = 0; i < this._providers.length; i++)
res.push({ id: i, name: this._providers[i].name });
return res;
},
setSearchTerms: function(terms) {
this._terms = terms;
},
_checkSupportedProviderLanguage: function(provider) {
if (provider.url.search(/{language}/) == -1)
return true;
let langs = GLib.get_language_names();
langs.push('en');
let lang = null;
for (let i = 0; i < langs.length; i++) {
for (let k = 0; k < provider.langs.length; k++) {
if (langs[i] == provider.langs[k])
lang = langs[i];
}
if (lang)
break;
}
provider.lang = lang;
return lang != null;
},
activateResult: function(id, params) {
let searchTerms = this._terms.join(' ');
let url = this._providers[id].url.replace('{searchTerms}', encodeURIComponent(searchTerms));
if (url.match('{language}'))
url = url.replace('{language}', this._providers[id].lang);
try {
Gio.app_info_launch_default_for_uri(url, global.create_app_launch_context());
} catch (e) {
// TODO: remove this after glib will be removed from moduleset
// In the default jhbuild, gio is in our prefix but gvfs is not
Util.spawn(['gvfs-open', url])
}
Main.overview.hide();
},
_addProvider: function(fileName) {
let path = global.datadir + '/open-search-providers/' + fileName;
let source = Shell.get_file_contents_utf8_sync(path);
let [success, name, url, langs, icon_uri] = Shell.parse_search_provider(source);
let provider ={ name: name,
url: url,
id: this._providers.length,
icon_uri: icon_uri,
langs: langs };
if (this._checkSupportedProviderLanguage(provider)) {
this._providers.push(provider);
this.emit('changed');
}
},
_refresh: function() {
this._providers = [];
let names = global.settings.get_strv(DISABLED_OPEN_SEARCH_PROVIDERS_KEY);
let file = Gio.file_new_for_path(global.datadir + '/open-search-providers');
FileUtils.listDirAsync(file, Lang.bind(this, function(files) {
for (let i = 0; i < files.length; i++) {
let enabled = true;
let name = files[i].get_name();
for (let k = 0; k < names.length; k++)
if (names[k] == name)
enabled = false;
if (enabled)
this._addProvider(name);
}
}));
}
});
Signals.addSignalMethods(OpenSearchSystem.prototype);
const SearchSystem = new Lang.Class({
Name: 'SearchSystem',

View File

@ -173,10 +173,9 @@ const GridSearchResults = new Lang.Class({
const SearchResults = new Lang.Class({
Name: 'SearchResults',
_init: function(searchSystem, openSearchSystem) {
_init: function(searchSystem) {
this._searchSystem = searchSystem;
this._searchSystem.connect('search-updated', Lang.bind(this, this._updateResults));
this._openSearchSystem = openSearchSystem;
this.actor = new St.BoxLayout({ name: 'searchResults',
vertical: true });
@ -191,7 +190,7 @@ const SearchResults = new Lang.Class({
scrollView.add_actor(this._content);
this.actor.add(scrollView, { x_fill: true,
y_fill: false,
y_fill: true,
expand: true,
x_align: St.Align.START,
y_align: St.Align.START });
@ -206,70 +205,26 @@ const SearchResults = new Lang.Class({
}));
this._statusText = new St.Label({ style_class: 'search-statustext' });
this._content.add(this._statusText);
this._statusBin = new St.Bin({ x_align: St.Align.MIDDLE,
y_align: St.Align.MIDDLE });
this._content.add(this._statusBin, { expand: true });
this._statusBin.add_actor(this._statusText);
this._providers = this._searchSystem.getProviders();
this._providerMeta = [];
for (let i = 0; i < this._providers.length; i++) {
this.createProviderMeta(this._providers[i]);
}
this._searchProvidersBox = new St.BoxLayout({ style_class: 'search-providers-box' });
this.actor.add(this._searchProvidersBox);
this._openSearchProviders = [];
this._openSearchSystem.connect('changed', Lang.bind(this, this._updateOpenSearchProviderButtons));
this._updateOpenSearchProviderButtons();
this._highlightDefault = false;
this._defaultResult = null;
},
_updateOpenSearchProviderButtons: function() {
for (let i = 0; i < this._openSearchProviders.length; i++)
this._openSearchProviders[i].actor.destroy();
this._openSearchProviders = this._openSearchSystem.getProviders();
for (let i = 0; i < this._openSearchProviders.length; i++)
this._createOpenSearchProviderButton(this._openSearchProviders[i]);
},
_createOpenSearchProviderButton: function(provider) {
let button = new St.Button({ style_class: 'dash-search-button',
reactive: true,
can_focus: true,
x_fill: true,
y_align: St.Align.MIDDLE });
let bin = new St.Bin({ x_fill: false,
x_align:St.Align.MIDDLE });
button.connect('clicked', Lang.bind(this, function() {
this._openSearchSystem.activateResult(provider.id);
}));
let title = new St.Label({ text: provider.name,
style_class: 'dash-search-button-label' });
button.label_actor = title;
bin.set_child(title);
button.set_child(bin);
provider.actor = button;
button.setSelected = function(selected) {
if (selected)
button.add_style_pseudo_class('selected');
else
button.remove_style_pseudo_class('selected');
};
button.activate = Lang.bind(this, function() {
this._openSearchSystem.activateResult(provider.id);
});
button.actor = button;
this._searchProvidersBox.add(button);
},
createProviderMeta: function(provider) {
let providerBox = new St.BoxLayout({ style_class: 'search-section',
vertical: true });
let title = new St.Label({ style_class: 'search-section-header',
text: provider.title });
providerBox.add(title);
providerBox.add(title, { x_fill: false, x_align: St.Align.START });
let resultDisplayBin = new St.Bin({ style_class: 'search-section-results',
x_fill: true,
@ -311,20 +266,18 @@ const SearchResults = new Lang.Class({
reset: function() {
this._searchSystem.reset();
this._statusText.hide();
this._statusBin.hide();
this._clearDisplay();
},
startingSearch: function() {
this.reset();
this._statusText.set_text(_("Searching..."));
this._statusText.show();
this._statusBin.show();
},
doSearch: function (searchString) {
this._searchSystem.updateSearch(searchString);
let terms = this._searchSystem.getTerms();
this._openSearchSystem.setSearchTerms(terms);
},
_metaForProvider: function(provider) {
@ -347,9 +300,6 @@ const SearchResults = new Lang.Class({
}
}
if (!newDefaultResult)
newDefaultResult = this._searchProvidersBox.get_first_child();
if (newDefaultResult != this._defaultResult) {
if (this._defaultResult)
this._defaultResult.setSelected(false);
@ -370,10 +320,10 @@ const SearchResults = new Lang.Class({
}
if (!haveResults) {
this._statusText.set_text(_("No matching results."));
this._statusText.show();
this._statusText.set_text(_("No results."));
this._statusBin.show();
} else {
this._statusText.hide();
this._statusBin.hide();
}
},

View File

@ -1,135 +1,161 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Lang = imports.lang;
const Signals = imports.signals;
const Config = imports.misc.config;
const Main = imports.ui.main;
const Params = imports.misc.params;
const STANDARD_STATUS_AREA_SHELL_IMPLEMENTATION = {
'a11y': imports.ui.status.accessibility.ATIndicator,
'volume': imports.ui.status.volume.Indicator,
'battery': imports.ui.status.power.Indicator,
'keyboard': imports.ui.status.keyboard.InputSourceIndicator,
'userMenu': imports.ui.userMenu.UserMenuButton
};
if (Config.HAVE_BLUETOOTH)
STANDARD_STATUS_AREA_SHELL_IMPLEMENTATION['bluetooth'] =
imports.ui.status.bluetooth.Indicator;
try {
STANDARD_STATUS_AREA_SHELL_IMPLEMENTATION['network'] =
imports.ui.status.network.NMApplet;
} catch(e) {
log('NMApplet is not supported. It is possible that your NetworkManager version is too old');
}
const DEFAULT_MODE = 'user';
const DEFAULT_MODE = 'restrictive';
const _modes = {
'gdm': { hasOverview: false,
hasAppMenu: false,
showCalendarEvents: false,
allowSettings: false,
allowExtensions: false,
allowKeybindingsWhenModal: true,
hasRunDialog: false,
hasWorkspaces: false,
createSession: Main.createGDMSession,
createUnlockDialog: Main.createGDMLoginDialog,
extraStylesheet: null,
statusArea: {
order: [
'a11y', 'display', 'keyboard',
'volume', 'battery', 'powerMenu'
],
implementation: {
'a11y': imports.ui.status.accessibility.ATIndicator,
'volume': imports.ui.status.volume.Indicator,
'battery': imports.ui.status.power.Indicator,
'keyboard': imports.ui.status.keyboard.InputSourceIndicator,
'powerMenu': imports.gdm.powerMenu.PowerMenuButton
}
}
},
'restrictive': {
hasOverview: false,
showCalendarEvents: false,
allowSettings: false,
allowExtensions: false,
allowKeybindingsWhenModal: false,
hasRunDialog: false,
hasWorkspaces: false,
hasWindows: false,
hasNotifications: false,
isLocked: false,
isGreeter: false,
isPrimary: false,
unlockDialog: null,
components: [],
panel: {
left: [],
center: [],
right: []
},
},
'initial-setup': { hasOverview: false,
hasAppMenu: false,
showCalendarEvents: false,
allowSettings: false,
allowExtensions: false,
allowKeybindingsWhenModal: false,
hasRunDialog: false,
hasWorkspaces: false,
createSession: Main.createInitialSetupSession,
extraStylesheet: null,
statusArea: {
order: [
'a11y', 'keyboard', 'volume'
],
implementation: {
'a11y': imports.ui.status.accessibility.ATIndicator,
'keyboard': imports.ui.status.keyboard.XKBIndicator,
'volume': imports.ui.status.volume.Indicator
}
}
},
'gdm': {
allowKeybindingsWhenModal: true,
hasNotifications: true,
isGreeter: true,
isPrimary: true,
unlockDialog: imports.gdm.loginDialog.LoginDialog,
components: ['polkitAgent', 'mediaKeysManager'],
panel: {
left: ['logo'],
center: ['dateMenu'],
right: ['a11y', 'display', 'keyboard',
'volume', 'battery', 'powerMenu']
}
},
'user': { hasOverview: true,
hasAppMenu: true,
showCalendarEvents: true,
allowSettings: true,
allowExtensions: true,
allowKeybindingsWhenModal: false,
hasRunDialog: true,
hasWorkspaces: true,
createSession: Main.createUserSession,
createUnlockDialog: Main.createSessionUnlockDialog,
extraStylesheet: null,
statusArea: {
order: [
'input-method', 'a11y', 'keyboard', 'volume', 'bluetooth',
'network', 'battery', 'userMenu'
],
implementation: STANDARD_STATUS_AREA_SHELL_IMPLEMENTATION
}
}
'lock-screen': {
isLocked: true,
isGreeter: undefined,
unlockDialog: undefined,
components: ['polkitAgent', 'telepathyClient', 'mediaKeysManager'],
panel: {
left: ['userMenu'],
center: [],
right: ['lockScreen']
},
},
'unlock-dialog': {
isLocked: true,
unlockDialog: undefined,
components: ['polkitAgent', 'telepathyClient', 'mediaKeysManager'],
panel: {
left: ['userMenu'],
center: [],
right: ['a11y', 'keyboard', 'lockScreen']
},
},
'initial-setup': {
isPrimary: true,
components: ['keyring', 'mediaKeysManager'],
panel: {
left: [],
center: ['dateMenu'],
right: ['a11y', 'keyboard', 'volume']
}
},
'user': {
hasOverview: true,
showCalendarEvents: true,
allowSettings: true,
allowExtensions: true,
hasRunDialog: true,
hasWorkspaces: true,
hasWindows: true,
hasNotifications: true,
isLocked: false,
isPrimary: true,
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
components: ['networkAgent', 'polkitAgent', 'telepathyClient', 'keyring',
'recorder', 'autorunManager', 'automountManager',
'mediaKeysManager'],
panel: {
left: ['activities', 'appMenu'],
center: ['dateMenu'],
right: ['a11y', 'keyboard', 'volume', 'bluetooth',
'network', 'battery', 'userMenu']
}
}
};
function listModes() {
let modes = Object.getOwnPropertyNames(_modes);
for (let i = 0; i < modes.length; i++)
print(modes[i]);
if (_modes[modes[i]].isPrimary)
print(modes[i]);
}
const SessionMode = new Lang.Class({
Name: 'SessionMode',
_init: function() {
let params = _modes[global.session_mode];
global.connect('notify::session-mode', Lang.bind(this, this._sync));
let mode = _modes[global.session_mode].isPrimary ? global.session_mode
: 'user';
this._modeStack = [mode];
this._sync();
},
pushMode: function(mode) {
this._modeStack.push(mode);
this._sync();
},
popMode: function(mode) {
if (this.currentMode != mode || this._modeStack.length === 1)
throw new Error("Invalid SessionMode.popMode");
this._modeStack.pop();
this._sync();
},
switchMode: function(to) {
if (this.currentMode == to)
return;
this._modeStack[this._modeStack.length - 1] = to;
this._sync();
},
get currentMode() {
return this._modeStack[this._modeStack.length - 1];
},
_sync: function() {
let params = _modes[this.currentMode];
params = Params.parse(params, _modes[DEFAULT_MODE]);
this._createSession = params.createSession;
delete params.createSession;
this._createUnlockDialog = params.createUnlockDialog;
delete params.createUnlockDialog;
// A simplified version of Lang.copyProperties, handles
// undefined as a special case for "no change / inherit from previous mode"
for (let prop in params) {
if (params[prop] !== undefined)
this[prop] = params[prop];
}
Lang.copyProperties(params, this);
},
createSession: function() {
if (this._createSession)
this._createSession();
},
createUnlockDialog: function() {
if (this._createUnlockDialog)
return this._createUnlockDialog.apply(this, arguments);
else
return null;
},
this.emit('updated');
}
});
Signals.addSignalMethods(SessionMode.prototype);

View File

@ -57,7 +57,10 @@ const ScreenSaverIface = <interface name="org.gnome.ScreenSaver">
<arg name="active" direction="out" type="b" />
</method>
<method name="SetActive">
<arg name="value" direction="in" type="u" />
<arg name="value" direction="in" type="b" />
</method>
<method name="GetActiveTime">
<arg name="value" direction="out" type="u" />
</method>
<signal name="ActiveChanged">
<arg name="new_value" type="b" />
@ -318,8 +321,11 @@ const GnomeShellExtensions = new Lang.Class({
},
ReloadExtension: function(uuid) {
ExtensionSystem.unloadExtension(uuid);
ExtensionSystem.loadExtension(uuid);
let extension = ExtensionUtils.extensions[uuid];
if (!extension)
return;
ExtensionSystem.reloadExtension(extension);
},
CheckForUpdates: function() {
@ -337,29 +343,46 @@ const GnomeShellExtensions = new Lang.Class({
const ScreenSaverDBus = new Lang.Class({
Name: 'ScreenSaverDBus',
_init: function() {
_init: function(screenShield) {
this.parent();
Main.screenShield.connect('lock-status-changed', Lang.bind(this, function(shield, locked) {
this._dbusImpl.emit_signal('ActiveChanged', GLib.Variant.new('(b)', [locked]));
this._screenShield = screenShield;
screenShield.connect('lock-status-changed', Lang.bind(this, function(shield) {
this._dbusImpl.emit_signal('ActiveChanged', GLib.Variant.new('(b)', [shield.locked]));
}));
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(ScreenSaverIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/ScreenSaver');
Gio.DBus.session.own_name('org.gnome.ScreenSaver', Gio.BusNameOwnerFlags.REPLACE, null, null);
},
Lock: function() {
Main.screenShield.lock(true);
LockAsync: function(parameters, invocation) {
let tmpId = this._screenShield.connect('lock-screen-shown', Lang.bind(this, function() {
this._screenShield.disconnect(tmpId);
invocation.return_value(null);
}));
this._screenShield.lock(true);
},
SetActive: function(active) {
if (active)
Main.screenShield.lock(true);
this._screenShield.lock(true);
else
Main.screenShield.unlock();
this._screenShield.unlock();
},
GetActive: function() {
return Main.screenShield.locked;
}
return this._screenShield.locked;
},
GetActiveTime: function() {
let started = this._screenShield.activationTime;
if (started > 0)
return Math.floor((GLib.get_monotonic_time() - started) / 1000000);
else
return 0;
},
});

View File

@ -76,6 +76,12 @@ const EntryMenu = new Lang.Class({
this.actor.grab_key_focus();
this.parent();
this._entry.add_style_pseudo_class('focus');
},
close: function() {
this._entry.grab_key_focus();
this.parent();
},
_updateCopyItem: function() {
@ -126,34 +132,20 @@ function _setMenuAlignment(entry, stageX) {
entry.menu.setSourceAlignment(entryX / entry.width);
};
function _onClicked(action, actor) {
let entry = actor.menu ? actor : actor.get_parent();
function _onButtonPressEvent(actor, event, entry) {
if (entry.menu.isOpen) {
entry.menu.close();
} else if (action.get_button() == 3) {
let [stageX, stageY] = action.get_coords();
_setMenuAlignment(entry, stageX);
entry.menu.open();
}
};
function _onLongPress(action, actor, state) {
let entry = actor.menu ? actor : actor.get_parent();
if (state == Clutter.LongPressState.QUERY)
return action.get_button() == 1 && !entry.menu.isOpen;
if (state == Clutter.LongPressState.ACTIVATE) {
let [stageX, stageY] = action.get_coords();
return true;
} else if (event.get_button() == 3) {
let [stageX, stageY] = event.get_coords();
_setMenuAlignment(entry, stageX);
entry.menu.open();
return true;
}
return false;
};
function _onPopup(actor) {
let entry = actor.menu ? actor : actor.get_parent();
function _onPopup(actor, entry) {
let [success, textX, textY, lineHeight] = entry.clutter_text.position_to_coords(-1);
if (success)
entry.menu.setSourceAlignment(textX / entry.width);
@ -168,20 +160,11 @@ function addContextMenu(entry, params) {
entry._menuManager = new PopupMenu.PopupMenuManager({ actor: entry });
entry._menuManager.addMenu(entry.menu);
let clickAction;
// Add a click action to both the entry and its clutter_text; the former
// Add an event handler to both the entry and its clutter_text; the former
// so padding is included in the clickable area, the latter because the
// event processing of ClutterText prevents event-bubbling.
clickAction = new Clutter.ClickAction();
clickAction.connect('clicked', _onClicked);
clickAction.connect('long-press', _onLongPress);
entry.clutter_text.add_action(clickAction);
entry.clutter_text.connect('button-press-event', Lang.bind(null, _onButtonPressEvent, entry));
entry.connect('button-press-event', Lang.bind(null, _onButtonPressEvent, entry));
clickAction = new Clutter.ClickAction();
clickAction.connect('clicked', _onClicked);
clickAction.connect('long-press', _onLongPress);
entry.add_action(clickAction);
entry.connect('popup-menu', _onPopup);
entry.connect('popup-menu', Lang.bind(null, _onPopup, entry));
}

View File

@ -240,7 +240,7 @@ const ShellUnmountNotifier = new Lang.Class({
Extends: MessageTray.Source,
_init: function() {
this.parent('', 'media-removable', St.IconType.FULLCOLOR);
this.parent('', 'media-removable');
this._notification = null;
Main.messageTray.add(this);
@ -361,12 +361,12 @@ const ShellMountPasswordDialog = new Lang.Class({
if (strings[1])
description.set_text(strings[1]);
this._passwordBox = new St.BoxLayout({ vertical: false });
this._passwordBox = new St.BoxLayout({ vertical: false, style_class: 'prompt-dialog-password-box' });
this._messageBox.add(this._passwordBox);
this._passwordLabel = new St.Label(({ style_class: 'prompt-dialog-password-label',
text: _("Passphrase") }));
this._passwordBox.add(this._passwordLabel);
text: _("Password") }));
this._passwordBox.add(this._passwordLabel, { y_fill: false, y_align: St.Align.MIDDLE });
this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
text: "",
@ -386,7 +386,7 @@ const ShellMountPasswordDialog = new Lang.Class({
if (flags & Gio.AskPasswordFlags.SAVING_SUPPORTED) {
this._rememberChoice = new CheckBox.CheckBox();
this._rememberChoice.getLabelActor().text = _("Remember Passphrase");
this._rememberChoice.getLabelActor().text = _("Remember Password");
this._rememberChoice.actor.checked = true;
this._messageBox.add(this._rememberChoice.actor);
} else {

View File

@ -36,10 +36,10 @@ const ATIndicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent('preferences-desktop-accessibility', _("Accessibility"));
this.parent('preferences-desktop-accessibility-symbolic', _("Accessibility"));
let highContrast = this._buildHCItem();
this.menu.addMenuItem(highContrast);
this._highContrast = this._buildHCItem();
this.menu.addMenuItem(this._highContrast);
let magnifier = this._buildItem(_("Zoom"), APPLICATIONS_SCHEMA,
'screen-magnifier-enabled');
@ -75,10 +75,6 @@ const ATIndicator = new Lang.Class({
this.menu.addSettingsAction(_("Universal Access Settings"), 'gnome-universal-access-panel.desktop');
},
setLockedState: function(locked) {
this.menu.setSettingsVisibility(!locked);
},
_buildItemExtended: function(string, initial_value, writable, on_set) {
let widget = new PopupMenu.PopupSwitchMenuItem(string, initial_value);
if (!writable)
@ -163,5 +159,9 @@ const ATIndicator = new Lang.Class({
widget.setToggleState(active);
});
return widget;
}
},
toggleHighContrast: function() {
this._highContrast.toggle();
},
});

View File

@ -24,7 +24,7 @@ const Indicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent('bluetooth-disabled', _("Bluetooth"));
this.parent('bluetooth-disabled-symbolic', _("Bluetooth"));
this._applet = new GnomeBluetoothApplet.Applet();
@ -88,11 +88,6 @@ const Indicator = new Lang.Class({
this._applet.connect('cancel-request', Lang.bind(this, this._cancelRequest));
},
setLockedState: function(locked) {
this._isLocked = locked;
this._updateKillswitch();
},
_updateKillswitch: function() {
let current_state = this._applet.killswitch_state;
let on = current_state == GnomeBluetooth.KillswitchState.UNBLOCKED;
@ -107,14 +102,14 @@ const Indicator = new Lang.Class({
/* TRANSLATORS: this means that bluetooth was disabled by hardware rfkill */
this._killswitch.setStatus(_("hardware disabled"));
this.actor.visible = !this._isLocked && has_adapter;
this.actor.visible = has_adapter;
if (on) {
this._discoverable.actor.show();
this.setIcon('bluetooth-active');
this.setIcon('bluetooth-active-symbolic');
} else {
this._discoverable.actor.hide();
this.setIcon('bluetooth-disabled');
this.setIcon('bluetooth-disabled-symbolic');
}
},
@ -306,7 +301,7 @@ const Indicator = new Lang.Class({
_ensureSource: function() {
if (!this._source) {
this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active', St.IconType.SYMBOLIC);
this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active');
Main.messageTray.add(this._source);
}
},
@ -461,7 +456,10 @@ const PinNotification = new Lang.Class({
_canActivateOkButton: function() {
// PINs have a fixed length of 6
return this._entry.clutter_text.text.length == 6;
if (this._numeric)
return this._entry.clutter_text.text.length == 6;
else
return true;
},
grabFocus: function(lockTray) {

View File

@ -5,6 +5,7 @@ const GLib = imports.gi.GLib;
const GnomeDesktop = imports.gi.GnomeDesktop;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const Signals = imports.signals;
const St = imports.gi.St;
try {
@ -45,6 +46,7 @@ const IBusManager = new Lang.Class({
this._panelService = null;
this._engines = {};
this._ready = false;
this._registerPropertiesId = 0;
this._nameWatcherId = Gio.DBus.session.watch_name(IBus.SERVICE_IBUS,
Gio.BusNameWatcherFlags.NONE,
@ -63,6 +65,7 @@ const IBusManager = new Lang.Class({
this._candidatePopup.setPanelService(null);
this._engines = {};
this._ready = false;
this._registerPropertiesId = 0;
},
_onNameAppeared: function() {
@ -100,6 +103,11 @@ const IBusManager = new Lang.Class({
this._panelService = new IBus.PanelService({ connection: this._ibus.get_connection(),
object_path: IBus.PATH_PANEL });
this._candidatePopup.setPanelService(this._panelService);
// Need to set this to get 'global-engine-changed' emitions
this._ibus.set_watch_ibus_signal(true);
this._ibus.connect('global-engine-changed', Lang.bind(this, this._resetProperties));
this._panelService.connect('update-property', Lang.bind(this, this._updateProperty));
this._resetProperties();
} else {
this._clear();
return;
@ -116,6 +124,39 @@ const IBusManager = new Lang.Class({
this._readyCallback();
},
_resetProperties: function() {
this.emit('properties-registered', null);
if (this._registerPropertiesId != 0)
return;
this._registerPropertiesId =
this._panelService.connect('register-properties', Lang.bind(this, function(p, props) {
if (!props.get(0))
return;
this._panelService.disconnect(this._registerPropertiesId);
this._registerPropertiesId = 0;
this.emit('properties-registered', props);
}));
},
_updateProperty: function(panel, prop) {
this.emit('property-updated', prop);
},
activateProperty: function(key, state) {
this._panelService.property_activate(key, state);
},
hasProperties: function(id) {
if (id == 'anthy')
return true;
return false;
},
getEngineDesc: function(id) {
if (!IBus || !this._ready)
return null;
@ -123,6 +164,7 @@ const IBusManager = new Lang.Class({
return this._engines[id];
}
});
Signals.addSignalMethods(IBusManager.prototype);
const LayoutMenuItem = new Lang.Class({
Name: 'LayoutMenuItem',
@ -135,6 +177,7 @@ const LayoutMenuItem = new Lang.Class({
this.indicator = new St.Label({ text: shortName });
this.addActor(this.label);
this.addActor(this.indicator);
this.actor.label_actor = this.label;
}
});
@ -142,6 +185,12 @@ const InputSourceIndicator = new Lang.Class({
Name: 'InputSourceIndicator',
Extends: PanelMenu.Button,
_propertiesWhitelist: [
'InputMode',
'TypingMode',
'DictMode'
],
_init: function() {
this.parent(0.0, _("Keyboard"));
@ -162,54 +211,73 @@ const InputSourceIndicator = new Lang.Class({
this._currentSourceIndex = this._settings.get_uint(KEY_CURRENT_INPUT_SOURCE);
this._xkbInfo = new GnomeDesktop.XkbInfo();
this._ibusManager = new IBusManager(Lang.bind(this, this._inputSourcesChanged));
this._propSeparator = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(this._propSeparator);
this._propSection = new PopupMenu.PopupMenuSection();
this.menu.addMenuItem(this._propSection);
this._propSection.actor.hide();
this._properties = null;
this._ibusManager = new IBusManager(Lang.bind(this, this._inputSourcesChanged));
this._ibusManager.connect('properties-registered', Lang.bind(this, this._ibusPropertiesRegistered));
this._ibusManager.connect('property-updated', Lang.bind(this, this._ibusPropertyUpdated));
this._inputSourcesChanged();
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this._showLayoutItem = this.menu.addAction(_("Show Keyboard Layout"), Lang.bind(this, this._showLayout));
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._sessionUpdated();
this.menu.addSettingsAction(_("Region and Language Settings"), 'gnome-region-panel.desktop');
},
_sessionUpdated: function() {
// re-using "allowSettings" for the keyboard layout is a bit shady,
// but at least for now it is used as "allow popping up windows
// from shell menus"; we can always add a separate sessionMode
// option if need arises.
if (Main.sessionMode.allowSettings) {
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this._showLayoutItem = this.menu.addAction(_("Show Keyboard Layout"), Lang.bind(this, this._showLayout));
}
this.menu.addSettingsAction(_("Region and Language Settings"), 'gnome-region-panel.desktop');
},
setLockedState: function(locked) {
this._showLayoutItem.actor.visible = !locked;
this.menu.setSettingsVisibility(!locked);
this._showLayoutItem.actor.visible = Main.sessionMode.allowSettings;
},
_currentInputSourceChanged: function() {
let nVisibleSources = Object.keys(this._layoutItems).length;
if (nVisibleSources < 2)
return;
let nSources = this._settings.get_value(KEY_INPUT_SOURCES).n_children();
let newCurrentSourceIndex = this._settings.get_uint(KEY_CURRENT_INPUT_SOURCE);
if (newCurrentSourceIndex >= nSources)
return;
let newLayoutItem = this._layoutItems[newCurrentSourceIndex];
let hasProperties;
if (!this._layoutItems[newCurrentSourceIndex]) {
// This source index is invalid as we weren't able to
// build a menu item for it, so we hide ourselves since we
// can't fix it here. *shrug*
if (newLayoutItem)
hasProperties = this._ibusManager.hasProperties(newLayoutItem.ibusEngineId);
else
hasProperties = false;
if (!newLayoutItem || (nVisibleSources < 2 && !hasProperties)) {
// This source index might be invalid if we weren't able
// to build a menu item for it, so we hide ourselves since
// we can't fix it here. *shrug*
// We also hide if we have only one visible source unless
// it's an IBus source with properties.
this.menu.close();
this.actor.hide();
return;
} else {
this.actor.show();
}
this.actor.show();
if (this._layoutItems[this._currentSourceIndex]) {
this._layoutItems[this._currentSourceIndex].setShowDot(false);
this._container.set_skip_paint(this._labelActors[this._currentSourceIndex], true);
}
this._layoutItems[newCurrentSourceIndex].setShowDot(true);
this._container.set_skip_paint(this._labelActors[newCurrentSourceIndex], false);
newLayoutItem.setShowDot(true);
let newLabelActor = this._labelActors[newCurrentSourceIndex];
this._container.set_skip_paint(newLabelActor, false);
if (hasProperties)
newLabelActor.set_text(newLayoutItem.indicator.get_text());
this._currentSourceIndex = newCurrentSourceIndex;
},
@ -240,9 +308,12 @@ const InputSourceIndicator = new Lang.Class({
} else if (type == INPUT_SOURCE_TYPE_IBUS) {
let engineDesc = this._ibusManager.getEngineDesc(id);
if (engineDesc) {
let language = IBus.get_language_name(engineDesc.get_language());
info.exists = true;
info.displayName = engineDesc.get_longname();
info.shortName = engineDesc.get_symbol();
info.displayName = language + ' (' + engineDesc.get_longname() + ')';
info.shortName = this._makeEngineShortName(engineDesc);
info.ibusEngineId = id;
}
}
@ -257,13 +328,6 @@ const InputSourceIndicator = new Lang.Class({
infos.push(info);
}
if (infos.length > 1) {
this.actor.show();
} else {
this.menu.close();
this.actor.hide();
}
for (let i = 0; i < infos.length; i++) {
let info = infos[i];
if (infosByShortName[info.shortName].length > 1) {
@ -272,6 +336,7 @@ const InputSourceIndicator = new Lang.Class({
}
let item = new LayoutMenuItem(info.displayName, info.shortName);
item.ibusEngineId = info.ibusEngineId;
this._layoutItems[info.sourceIndex] = item;
this.menu.addMenuItem(item, i);
item.connect('activate', Lang.bind(this, function() {
@ -317,6 +382,146 @@ const InputSourceIndicator = new Lang.Class({
Util.spawn(['gkbd-keyboard-display', '-l', description]);
},
_makeEngineShortName: function(engineDesc) {
let symbol = engineDesc.get_symbol();
if (symbol && symbol[0])
return symbol;
let langCode = engineDesc.get_language().split('_', 1)[0];
if (langCode.length == 2 || langCode.length == 3)
return langCode.toLowerCase();
return String.fromCharCode(0x2328); // keyboard glyph
},
_propertyWhitelisted: function(prop) {
for (let i = 0; i < this._propertiesWhitelist.length; ++i) {
let key = prop.get_key();
if (key.substr(0, this._propertiesWhitelist[i].length) == this._propertiesWhitelist[i])
return true;
}
return false;
},
_ibusPropertiesRegistered: function(im, props) {
this._properties = props;
this._buildPropSection();
},
_ibusPropertyUpdated: function(im, prop) {
if (!this._propertyWhitelisted(prop))
return;
if (this._updateSubProperty(this._properties, prop))
this._buildPropSection();
},
_updateSubProperty: function(props, prop) {
if (!props)
return false;
let p;
for (let i = 0; (p = props.get(i)) != null; ++i) {
if (p.get_key() == prop.get_key() && p.get_prop_type() == prop.get_prop_type()) {
p.update(prop);
return true;
} else if (p.get_prop_type() == IBus.PropType.MENU) {
if (this._updateSubProperty(p.get_sub_props(), prop))
return true;
}
}
return false;
},
_updateIndicatorLabel: function(text) {
let layoutItem = this._layoutItems[this._currentSourceIndex];
let hasProperties;
if (layoutItem)
hasProperties = this._ibusManager.hasProperties(layoutItem.ibusEngineId);
else
hasProperties = false;
if (hasProperties)
this._labelActors[this._currentSourceIndex].set_text(text);
},
_buildPropSection: function() {
this._propSeparator.actor.hide();
this._propSection.actor.hide();
this._propSection.removeAll();
this._buildPropSubMenu(this._propSection, this._properties);
if (!this._propSection.isEmpty()) {
this._propSection.actor.show();
this._propSeparator.actor.show();
}
},
_buildPropSubMenu: function(menu, props) {
if (!props)
return;
let radioGroup = [];
let p;
for (let i = 0; (p = props.get(i)) != null; ++i) {
let prop = p;
if (!this._propertyWhitelisted(prop) ||
!prop.get_visible())
continue;
if (prop.get_key() == 'InputMode') {
let text;
if (prop.get_symbol)
text = prop.get_symbol().get_text();
else
text = prop.get_label().get_text();
if (text && text.length > 0 && text.length < 3)
this._updateIndicatorLabel(text);
}
let item;
let type = prop.get_prop_type();
if (type == IBus.PropType.MENU) {
item = new PopupMenu.PopupSubMenuMenuItem(prop.get_label().get_text());
this._buildPropSubMenu(item.menu, prop.get_sub_props());
} else if (type == IBus.PropType.RADIO) {
item = new PopupMenu.PopupMenuItem(prop.get_label().get_text());
item.prop = prop;
radioGroup.push(item);
item.radioGroup = radioGroup;
item.setShowDot(prop.get_state() == IBus.PropState.CHECKED);
item.connect('activate', Lang.bind(this, function() {
if (item.prop.get_state() == IBus.PropState.CHECKED)
return;
let group = item.radioGroup;
for (let i = 0; i < group.length; ++i) {
if (group[i] == item) {
item.setShowDot(true);
item.prop.set_state(IBus.PropState.CHECKED);
this._ibusManager.activateProperty(item.prop.get_key(),
IBus.PropState.CHECKED);
} else {
group[i].setShowDot(false);
group[i].prop.set_state(IBus.PropState.UNCHECKED);
this._ibusManager.activateProperty(group[i].prop.get_key(),
IBus.PropState.UNCHECKED);
}
}
}));
} else {
continue;
}
item.setSensitive(prop.get_sensitive());
menu.addMenuItem(item);
}
},
_containerGetPreferredWidth: function(container, for_height, alloc) {
// Here, and in _containerGetPreferredHeight, we need to query
// for the height of all children, but we ignore the results

View File

@ -0,0 +1,57 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const GObject = imports.gi.GObject;
const Lang = imports.lang;
const St = imports.gi.St;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const VolumeMenu = imports.ui.status.volume;
const Indicator = new Lang.Class({
Name: 'LockScreenMenuIndicator',
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent(null, _("Volume, network, battery"));
this._volume = Main.panel.statusArea.volume;
if (this._volume) {
this._volumeIcon = this.addIcon(null);
this._volume.mainIcon.bind_property('gicon', this._volumeIcon, 'gicon',
GObject.BindingFlags.SYNC_CREATE);
this._volume.mainIcon.bind_property('visible', this._volumeIcon, 'visible',
GObject.BindingFlags.SYNC_CREATE);
this._volumeControl = VolumeMenu.getMixerControl();
this._volumeMenu = new VolumeMenu.VolumeMenu(this._volumeControl);
this.menu.addMenuItem(this._volumeMenu);
}
this._network = Main.panel.statusArea.network;
if (this._network) {
this._networkIcon = this.addIcon(null);
this._network.mainIcon.bind_property('gicon', this._networkIcon, 'gicon',
GObject.BindingFlags.SYNC_CREATE);
this._network.mainIcon.bind_property('visible', this._networkIcon, 'visible',
GObject.BindingFlags.SYNC_CREATE);
this._networkSecondaryIcon = this.addIcon(null);
this._network.secondaryIcon.bind_property('gicon', this._networkSecondaryIcon, 'gicon',
GObject.BindingFlags.SYNC_CREATE);
this._network.secondaryIcon.bind_property('visible', this._networkSecondaryIcon, 'visible',
GObject.BindingFlags.SYNC_CREATE);
}
this._battery = Main.panel.statusArea.battery;
if (this._battery) {
this._batteryIcon = this.addIcon(null);
this._battery.mainIcon.bind_property('gicon', this._batteryIcon, 'gicon',
GObject.BindingFlags.SYNC_CREATE);
this._battery.mainIcon.bind_property('visible', this._batteryIcon, 'visible',
GObject.BindingFlags.SYNC_CREATE);
}
}
});

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ const Indicator = new Lang.Class({
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent('battery-missing', _("Battery"));
this.parent('battery-missing-symbolic', _("Battery"));
this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
@ -76,12 +76,6 @@ const Indicator = new Lang.Class({
this._devicesChanged();
},
setLockedState: function(locked) {
if (locked)
this.menu.close();
this.actor.reactive = !locked;
},
_readPrimaryDevice: function() {
this._proxy.GetPrimaryDeviceRemote(Lang.bind(this, function(result, error) {
if (error) {
@ -102,7 +96,7 @@ const Indicator = new Lang.Class({
let minutes = time % 60;
let hours = Math.floor(time / 60);
let timestring;
if (time > 60) {
if (time >= 60) {
if (minutes == 0) {
timestring = ngettext("%d hour remaining", "%d hours remaining", hours).format(hours);
} else {
@ -150,16 +144,21 @@ const Indicator = new Lang.Class({
}));
},
_devicesChanged: function() {
_syncIcon: function() {
let icon = this._proxy.Icon;
let hasIcon = false;
if (icon) {
let gicon = Gio.icon_new_for_string(icon);
this.setGIcon(gicon);
this.actor.show();
} else {
this.menu.close();
this.actor.hide();
hasIcon = true;
}
this.mainIcon.visible = hasIcon;
this.actor.visible = hasIcon;
},
_devicesChanged: function() {
this._syncIcon();
this._readPrimaryDevice();
this._readOtherDevices();
}
@ -178,7 +177,6 @@ const DeviceItem = new Lang.Class({
this._label = new St.Label({ text: this._deviceTypeToString(device_type) });
this._icon = new St.Icon({ gicon: Gio.icon_new_for_string(icon),
icon_type: St.IconType.SYMBOLIC,
style_class: 'popup-menu-icon' });
this._box.add_actor(this._icon);
@ -187,6 +185,8 @@ const DeviceItem = new Lang.Class({
let percentLabel = new St.Label({ text: C_("percent of battery remaining", "%d%%").format(Math.round(percentage)) });
this.addActor(percentLabel, { align: St.Align.END });
//FIXME: ideally we would like to expose this._label and percentLabel
this.actor.label_actor = percentLabel;
},
_deviceTypeToString: function(type) {

View File

@ -12,14 +12,27 @@ const VOLUME_ADJUSTMENT_STEP = 0.05; /* Volume adjustment step in % */
const VOLUME_NOTIFY_ID = 1;
const Indicator = new Lang.Class({
Name: 'VolumeIndicator',
Extends: PanelMenu.SystemStatusButton,
// Each Gvc.MixerControl is a connection to PulseAudio,
// so it's better to make it a singleton
let _mixerControl;
function getMixerControl() {
if (_mixerControl)
return _mixerControl;
_init: function() {
this.parent('audio-volume-muted', _("Volume"));
_mixerControl = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' });
_mixerControl.open();
this._control = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' });
return _mixerControl;
}
const VolumeMenu = new Lang.Class({
Name: 'VolumeMenu',
Extends: PopupMenu.PopupMenuSection,
_init: function(control) {
this.parent();
this._control = control;
this._control.connect('state-changed', Lang.bind(this, this._onControlStateChanged));
this._control.connect('default-sink-changed', Lang.bind(this, this._readOutput));
this._control.connect('default-source-changed', Lang.bind(this, this._readInput));
@ -35,10 +48,10 @@ const Indicator = new Lang.Class({
this._outputSlider = new PopupMenu.PopupSliderMenuItem(0);
this._outputSlider.connect('value-changed', Lang.bind(this, this._sliderChanged, '_output'));
this._outputSlider.connect('drag-end', Lang.bind(this, this._notifyVolumeChange));
this.menu.addMenuItem(this._outputTitle);
this.menu.addMenuItem(this._outputSlider);
this.addMenuItem(this._outputTitle);
this.addMenuItem(this._outputSlider);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this._input = null;
this._inputVolumeId = 0;
@ -47,22 +60,27 @@ const Indicator = new Lang.Class({
this._inputSlider = new PopupMenu.PopupSliderMenuItem(0);
this._inputSlider.connect('value-changed', Lang.bind(this, this._sliderChanged, '_input'));
this._inputSlider.connect('drag-end', Lang.bind(this, this._notifyVolumeChange));
this.menu.addMenuItem(this._inputTitle);
this.menu.addMenuItem(this._inputSlider);
this.addMenuItem(this._inputTitle);
this.addMenuItem(this._inputSlider);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addSettingsAction(_("Sound Settings"), 'gnome-sound-panel.desktop');
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
this._control.open();
this._onControlStateChanged();
},
setLockedState: function(locked) {
this.menu.setSettingsVisibility(!locked);
toggleMute: function(quiet) {
let muted = this._output.is_muted;
this._output.change_is_muted(!muted);
if (muted && !quiet)
this._notifyVolumeChange();
if (!muted)
return ['audio-volume-muted-symbolic', 0];
else
return [this._volumeToIcon(this._output.volume),
this._output.volume / this._volumeMax];
},
_onScrollEvent: function(actor, event) {
let direction = event.get_scroll_direction();
scroll: function(direction, quiet) {
let currentVolume = this._output.volume;
if (direction == Clutter.ScrollDirection.DOWN) {
@ -81,16 +99,23 @@ const Indicator = new Lang.Class({
this._output.push_volume();
}
this._notifyVolumeChange();
if (!quiet)
this._notifyVolumeChange();
if (this._output.is_muted)
return ['audio-volume-muted-symbolic', 0];
else
return [this._volumeToIcon(this._output.volume),
this._output.volume / this._volumeMax];
},
_onControlStateChanged: function() {
if (this._control.get_state() == Gvc.MixerControlState.READY) {
this._readOutput();
this._readInput();
this.actor.show();
this._maybeShowInput();
} else {
this.actor.hide();
this.emit('icon-changed', null);
}
},
@ -109,7 +134,7 @@ const Indicator = new Lang.Class({
this._volumeChanged (null, null, '_output');
} else {
this._outputSlider.setValue(0);
this.setIcon('audio-volume-muted-symbolic');
this.emit('icon-changed', 'audio-volume-muted-symbolic');
}
},
@ -155,14 +180,14 @@ const Indicator = new Lang.Class({
_volumeToIcon: function(volume) {
if (volume <= 0) {
return 'audio-volume-muted';
return 'audio-volume-muted-symbolic';
} else {
let n = Math.floor(3 * volume / this._volumeMax) + 1;
if (n < 2)
return 'audio-volume-low';
return 'audio-volume-low-symbolic';
if (n >= 3)
return 'audio-volume-high';
return 'audio-volume-medium';
return 'audio-volume-high-symbolic';
return 'audio-volume-medium-symbolic';
}
},
@ -196,15 +221,48 @@ const Indicator = new Lang.Class({
slider.setValue(muted ? 0 : (this[property].volume / this._volumeMax));
if (property == '_output') {
if (muted)
this.setIcon('audio-volume-muted');
this.emit('icon-changed', 'audio-volume-muted-symbolic');
else
this.setIcon(this._volumeToIcon(this._output.volume));
this.emit('icon-changed', this._volumeToIcon(this._output.volume));
}
},
_volumeChanged: function(object, param_spec, property) {
this[property+'Slider'].setValue(this[property].volume / this._volumeMax);
if (property == '_output' && !this._output.is_muted)
this.setIcon(this._volumeToIcon(this._output.volume));
this.emit('icon-changed', this._volumeToIcon(this._output.volume));
}
});
const Indicator = new Lang.Class({
Name: 'VolumeIndicator',
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent('audio-volume-muted-symbolic', _("Volume"));
this._control = getMixerControl();
this.volumeMenu = new VolumeMenu(this._control);
this.volumeMenu.connect('icon-changed', Lang.bind(this, function(menu, icon) {
this._hasPulseAudio = (icon != null);
this.setIcon(icon);
this._syncVisibility();
}));
this.menu.addMenuItem(this.volumeMenu);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addSettingsAction(_("Sound Settings"), 'gnome-sound-panel.desktop');
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
},
_syncVisibility: function() {
this.actor.visible = this._hasPulseAudio;
this.mainIcon.visible = this._hasPulseAudio;
},
_onScrollEvent: function(actor, event) {
this.volumeMenu.scroll(event.get_scroll_direction(), false);
},
});

View File

@ -2,9 +2,10 @@
const AccountsService = imports.gi.AccountsService;
const Clutter = imports.gi.Clutter;
const Gdm = imports.gi.Gdm;
const Gdm = imports.gi.Gdm;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GnomeDesktop = imports.gi.GnomeDesktop;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Signals = imports.signals;
@ -20,6 +21,38 @@ const UserMenu = imports.ui.userMenu;
const Batch = imports.gdm.batch;
const GdmUtil = imports.gdm.util;
// The timeout before going back automatically to the lock screen (in seconds)
const IDLE_TIMEOUT = 2 * 60;
function versionCompare(required, reference) {
required = required.split('.');
reference = reference.split('.');
for (let i = 0; i < required.length; i++) {
if (required[i] != reference[i])
return required[i] < reference[i];
}
return true;
}
function isSupported() {
try {
let params = GLib.Variant.new('(ss)', ['org.gnome.DisplayManager.Manager', 'Version']);
let result = Gio.DBus.system.call_sync('org.gnome.DisplayManager',
'/org/gnome/DisplayManager/Manager',
'org.freedesktop.DBus.Properties',
'Get', params, null,
Gio.DBusCallFlags.NONE,
-1, null);
let version = result.deep_unpack()[0].deep_unpack();
return versionCompare('3.5.91', version);
} catch(e) {
return false;
}
}
// A widget showing the user avatar and name
const UserWidget = new Lang.Class({
Name: 'UserWidget',
@ -38,6 +71,7 @@ const UserWidget = new Lang.Class({
this.actor.add(this._label,
{ expand: true,
x_fill: true,
y_fill: false,
y_align: St.Align.MIDDLE });
this._userLoadedId = this._user.connect('notify::is-loaded',
@ -86,22 +120,26 @@ const UnlockDialog = new Lang.Class({
this._userName = GLib.get_user_name();
this._user = this._userManager.get_user(this._userName);
this._failCounter = 0;
this._firstQuestion = true;
this._greeterClient = new Gdm.Client();
this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient, { reauthenticationOnly: true });
this._userVerifier.connect('reset', Lang.bind(this, this._reset));
this._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion));
this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
this._userVerifier.connect('show-fingerprint-prompt', Lang.bind(this, this._showFingerprintPrompt));
this._userVerifier.connect('hide-fingerprint-prompt', Lang.bind(this, this._hideFingerprintPrompt));
this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
this._userWidget = new UserWidget(this._user);
this.contentLayout.add_actor(this._userWidget.actor);
this._promptLayout = new St.BoxLayout({ style_class: 'login-dialog-prompt-layout',
vertical: false });
vertical: true });
this._promptLabel = new St.Label({ style_class: 'login-dialog-prompt-label' });
this._promptLayout.add(this._promptLabel,
@ -109,9 +147,13 @@ const UnlockDialog = new Lang.Class({
this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
can_focus: true });
ShellEntry.addContextMenu(this._promptEntry);
this._promptEntry.clutter_text.set_password_char('\u25cf');
ShellEntry.addContextMenu(this._promptEntry, { isPassword: true });
this.setInitialKeyFocus(this._promptEntry);
this._promptEntry.clutter_text.connect('activate', Lang.bind(this, this._doUnlock));
this._promptEntry.clutter_text.connect('text-changed', Lang.bind(this, function() {
this._updateOkButtonSensitivity(this._promptEntry.text.length > 0);
}));
this._promptLayout.add(this._promptEntry,
{ expand: true,
@ -119,14 +161,24 @@ const UnlockDialog = new Lang.Class({
this.contentLayout.add_actor(this._promptLayout);
// Translators: this message is shown below the password entry field
// to indicate the user can swipe their finger instead
this._promptFingerprintMessage = new St.Label({ text: _("(or swipe finger)"),
style_class: 'login-dialog-prompt-fingerprint-message' });
this._promptFingerprintMessage.hide();
this.contentLayout.add_actor(this._promptFingerprintMessage);
this._promptMessage = new St.Label({ visible: false });
this.contentLayout.add(this._promptMessage, { x_fill: true });
let otherUserLabel = new St.Label({ text: _("Login as another user"),
this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint' });
this._promptLoginHint.hide();
this.contentLayout.add_actor(this._promptLoginHint);
let cancelButton = { label: _("Cancel"),
action: Lang.bind(this, this._escape),
key: Clutter.KEY_Escape };
this._okButton = { label: _("Unlock"),
action: Lang.bind(this, this._doUnlock),
default: true };
this.setButtons([cancelButton, this._okButton]);
this._updateSensitivity(true);
let otherUserLabel = new St.Label({ text: _("Log in as another user"),
style_class: 'login-dialog-not-listed-label' });
this._otherUserButton = new St.Button({ style_class: 'login-dialog-not-listed-button',
can_focus: true,
@ -135,60 +187,91 @@ const UnlockDialog = new Lang.Class({
x_align: St.Align.START,
x_fill: true });
this._otherUserButton.connect('clicked', Lang.bind(this, this._otherUserClicked));
this.contentLayout.add(this._otherUserButton,
{ x_align: St.Align.START,
x_fill: false });
this.dialogLayout.add(this._otherUserButton,
{ x_align: St.Align.START,
x_fill: false });
this._okButton = { label: _("Unlock"),
action: Lang.bind(this, this._doUnlock),
default: true };
this.setButtons([this._okButton]);
this.setActionKey(Clutter.KEY_Escape, Lang.bind(this, this._escape));
this._updateOkButton(false);
this._reset();
let batch = new Batch.Hold();
this._userVerifier.begin(this._userName, batch);
GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
this.emit('loaded');
return false;
}));
this._idleMonitor = new GnomeDesktop.IdleMonitor();
this._idleWatchId = this._idleMonitor.add_watch(IDLE_TIMEOUT * 1000, Lang.bind(this, this._escape));
},
_updateOkButton: function(sensitive) {
_updateSensitivity: function(sensitive) {
this._promptEntry.reactive = sensitive;
this._promptEntry.clutter_text.editable = sensitive;
this._updateOkButtonSensitivity(sensitive && this._promptEntry.text.length > 0);
},
_updateOkButtonSensitivity: function(sensitive) {
this._okButton.button.reactive = sensitive;
this._okButton.button.can_focus = sensitive;
},
_reset: function() {
this._userVerifier.begin(this._userName, new Batch.Hold());
_showMessage: function(userVerifier, message, styleClass) {
if (message) {
this._promptMessage.text = message;
this._promptMessage.styleClass = styleClass;
GdmUtil.fadeInActor(this._promptMessage);
} else {
GdmUtil.fadeOutActor(this._promptMessage);
}
},
_onAskQuestion: function(verifier, serviceName, question, passwordChar) {
if (this._firstQuestion && this._firstQuestionAnswer) {
this._userVerifier.answerQuery(serviceName, this._firstQuestionAnswer);
this._firstQuestionAnswer = null;
this._firstQuestion = false;
return;
}
this._promptLabel.text = question;
this._promptEntry.text = '';
if (!this._firstQuestion)
this._promptEntry.text = '';
else
this._firstQuestion = false;
this._promptEntry.clutter_text.set_password_char(passwordChar);
this._promptEntry.menu.isPassword = passwordChar != '';
this._currentQuery = serviceName;
this._updateOkButton(true);
this._updateSensitivity(true);
},
_showFingerprintPrompt: function() {
GdmUtil.fadeInActor(this._promptFingerprintMessage);
_showLoginHint: function(verifier, message) {
this._promptLoginHint.set_text(message)
GdmUtil.fadeInActor(this._promptLoginHint);
},
_hideFingerprintPrompt: function() {
GdmUtil.fadeOutActor(this._promptFingerprintMessage);
_hideLoginHint: function() {
GdmUtil.fadeOutActor(this._promptLoginHint);
},
_doUnlock: function() {
if (this._firstQuestion) {
// we haven't received a query yet, so stash the answer
// and make ourself non-reactive
// the actual reply to GDM will be sent as soon as asked
this._firstQuestionAnswer = this._promptEntry.text;
this._updateSensitivity(false);
return;
}
if (!this._currentQuery)
return;
let query = this._currentQuery;
this._currentQuery = null;
this._updateOkButton(false);
this._updateSensitivity(false);
this._userVerifier.answerQuery(query, this._promptEntry.text);
},
@ -198,17 +281,28 @@ const UnlockDialog = new Lang.Class({
this.emit('unlocked');
},
_onReset: function() {
this.emit('failed');
},
_onVerificationFailed: function() {
this._currentQuery = null;
this._firstQuestion = true;
this._promptEntry.text = '';
this._promptEntry.clutter_text.set_password_char('\u25cf');
this._promptEntry.menu.isPassword = true;
this._updateSensitivity(false);
},
_escape: function() {
this._userVerifier.cancel();
this.emit('failed');
},
_escape: function() {
this._onVerificationFailed();
},
_otherUserClicked: function(button, event) {
this._userManager.goto_login_session();
Gdm.goto_login_session_sync(null);
this._userVerifier.cancel();
this.emit('failed');
@ -216,6 +310,12 @@ const UnlockDialog = new Lang.Class({
destroy: function() {
this._userVerifier.clear();
if (this._idleWatchId) {
this._idleMonitor.remove_watch(this._idleWatchId);
this._idleWatchId = 0;
}
this.parent();
},

View File

@ -9,19 +9,24 @@ const Pango = imports.gi.Pango;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Tp = imports.gi.TelepathyGLib;
const UPowerGlib = imports.gi.UPowerGlib;
const Atk = imports.gi.Atk;
const BoxPointer = imports.ui.boxpointer;
const GnomeSession = imports.misc.gnomeSession;
const LoginManager = imports.misc.loginManager;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Params = imports.misc.params;
const Util = imports.misc.util;
const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
const DISABLE_USER_SWITCH_KEY = 'disable-user-switching';
const DISABLE_LOCK_SCREEN_KEY = 'disable-lock-screen';
const DISABLE_LOG_OUT_KEY = 'disable-log-out';
const LOCK_ENABLED_KEY = 'lock-enabled';
const ALWAYS_SHOW_LOG_OUT_KEY = 'always-show-log-out';
const DIALOG_ICON_SIZE = 64;
@ -43,12 +48,21 @@ const IMStatus = {
const UserAvatarWidget = new Lang.Class({
Name: 'UserAvatarWidget',
_init: function(user) {
_init: function(user, params) {
this._user = user;
params = Params.parse(params, { reactive: false,
iconSize: DIALOG_ICON_SIZE,
styleClass: 'status-chooser-user-icon' });
this._iconSize = params.iconSize;
this.actor = new St.Bin({ style_class: 'status-chooser-user-icon',
track_hover: true,
reactive: true });
this.actor = new St.Bin({ style_class: params.styleClass,
track_hover: params.reactive,
reactive: params.reactive });
},
setSensitive: function(sensitive) {
this.actor.can_focus = sensitive;
this.actor.reactive = sensitive;
},
update: function() {
@ -62,9 +76,8 @@ const UserAvatarWidget = new Lang.Class({
this.actor.style = 'background-image: url("%s");'.format(iconFile);
} else {
this.actor.style = null;
this.actor.child = new St.Icon({ icon_name: 'avatar-default',
icon_type: St.IconType.SYMBOLIC,
icon_size: DIALOG_ICON_SIZE });
this.actor.child = new St.Icon({ icon_name: 'avatar-default-symbolic',
icon_size: this._iconSize });
}
}
});
@ -96,6 +109,7 @@ const IMUserNameItem = new Lang.Class({
_init: function() {
this.parent({ reactive: false,
can_focus: false,
style_class: 'status-chooser-user-name' });
this._wrapper = new Shell.GenericContainer();
@ -133,12 +147,13 @@ const IMStatusChooserItem = new Lang.Class({
_init: function() {
this.parent({ reactive: false,
can_focus: false,
style_class: 'status-chooser' });
this._userManager = AccountsService.UserManager.get_default();
this._user = this._userManager.get_user(GLib.get_user_name());
this._avatar = new UserAvatarWidget(this._user);
this._avatar = new UserAvatarWidget(this._user, { reactive: true });
this._iconBin = new St.Button({ child: this._avatar.actor });
this.addActor(this._iconBin);
@ -158,22 +173,22 @@ const IMStatusChooserItem = new Lang.Class({
let item;
item = new IMStatusItem(_("Available"), 'user-available');
item = new IMStatusItem(_("Available"), 'user-available-symbolic');
this._combo.addMenuItem(item, IMStatus.AVAILABLE);
item = new IMStatusItem(_("Busy"), 'user-busy');
item = new IMStatusItem(_("Busy"), 'user-busy-symbolic');
this._combo.addMenuItem(item, IMStatus.BUSY);
item = new IMStatusItem(_("Invisible"), 'user-invisible');
item = new IMStatusItem(_("Invisible"), 'user-invisible-symbolic');
this._combo.addMenuItem(item, IMStatus.HIDDEN);
item = new IMStatusItem(_("Away"), 'user-away');
item = new IMStatusItem(_("Away"), 'user-away-symbolic');
this._combo.addMenuItem(item, IMStatus.AWAY);
item = new IMStatusItem(_("Idle"), 'user-idle');
item = new IMStatusItem(_("Idle"), 'user-idle-symbolic');
this._combo.addMenuItem(item, IMStatus.IDLE);
item = new IMStatusItem(_("Unavailable"), 'user-offline');
item = new IMStatusItem(_("Offline"), 'user-offline-symbolic');
this._combo.addMenuItem(item, IMStatus.OFFLINE);
this._combo.connect('active-item-changed',
@ -201,20 +216,21 @@ const IMStatusChooserItem = new Lang.Class({
Lang.bind(this, this._IMAccountsChanged));
this._accountMgr.prepare_async(null, Lang.bind(this,
function(mgr) {
let [presence, status, msg] = mgr.get_most_available_presence();
let savedPresence = global.settings.get_int('saved-im-presence');
this._IMAccountsChanged(mgr);
if (savedPresence == presence) {
this._IMStatusChanged(mgr, presence, status, msg);
} else {
this._setComboboxPresence(savedPresence);
status = this._statusForPresence(savedPresence);
msg = msg ? msg : '';
mgr.set_all_requested_presences(savedPresence, status, msg);
}
if (this._networkMonitor.network_available)
this._restorePresence();
else
this._setComboboxPresence(Tp.ConnectionPresenceType.OFFLINE);
}));
this._networkMonitor = Gio.NetworkMonitor.get_default();
this._networkMonitor.connect('network-changed',
Lang.bind(this, function(monitor, available) {
this._IMAccountsChanged(this._accountMgr);
if (available && !this._imPresenceRestored)
this._restorePresence();
}));
this._userLoadedId = this._user.connect('notify::is-loaded',
@ -227,6 +243,25 @@ const IMStatusChooserItem = new Lang.Class({
if (this.actor.mapped)
this._updateUser();
}));
this.connect('sensitive-changed', function(sensitive) {
this._avatar.setSensitive(sensitive);
});
},
_restorePresence: function() {
let [presence, status, msg] = this._accountMgr.get_most_available_presence();
let savedPresence = global.settings.get_int('saved-im-presence');
if (savedPresence == presence) {
this._IMStatusChanged(this._accountMgr, presence, status, msg);
} else {
this._setComboboxPresence(savedPresence);
status = this._statusForPresence(savedPresence);
msg = msg ? msg : '';
this._accountMgr.set_all_requested_presences(savedPresence, status, msg);
}
},
destroy: function() {
@ -285,7 +320,8 @@ const IMStatusChooserItem = new Lang.Class({
let accounts = mgr.get_valid_accounts().filter(function(account) {
return account.enabled;
});
this._combo.setSensitive(accounts.length > 0);
let sensitive = accounts.length > 0 && this._networkMonitor.network_available;
this._combo.setSensitive(sensitive);
},
_IMStatusChanged: function(accountMgr, presence, status, message) {
@ -438,6 +474,7 @@ const UserMenuButton = new Lang.Class({
let box = new St.BoxLayout({ name: 'panelUserMenu' });
this.actor.add_actor(box);
this._screenSaverSettings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA });
this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });
this._userManager = AccountsService.UserManager.get_default();
@ -446,30 +483,33 @@ const UserMenuButton = new Lang.Class({
this._presence = new GnomeSession.Presence();
this._session = new GnomeSession.SessionManager();
this._haveShutdown = true;
this._haveSuspend = true;
this._accountMgr = Tp.AccountManager.dup();
this._upClient = new UPowerGlib.Client();
this._loginManager = LoginManager.getLoginManager();
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
this._iconBox = new St.Bin();
box.add(this._iconBox, { y_align: St.Align.MIDDLE, y_fill: false });
let textureCache = St.TextureCache.get_default();
this._offlineIcon = new St.Icon({ icon_name: 'user-offline',
this._offlineIcon = new St.Icon({ icon_name: 'user-offline-symbolic',
style_class: 'popup-menu-icon' });
this._availableIcon = new St.Icon({ icon_name: 'user-available',
this._availableIcon = new St.Icon({ icon_name: 'user-available-symbolic',
style_class: 'popup-menu-icon' });
this._busyIcon = new St.Icon({ icon_name: 'user-busy',
this._busyIcon = new St.Icon({ icon_name: 'user-busy-symbolic',
style_class: 'popup-menu-icon' });
this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible',
this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible-symbolic',
style_class: 'popup-menu-icon' });
this._awayIcon = new St.Icon({ icon_name: 'user-away',
this._awayIcon = new St.Icon({ icon_name: 'user-away-symbolic',
style_class: 'popup-menu-icon' });
this._idleIcon = new St.Icon({ icon_name: 'user-idle',
this._idleIcon = new St.Icon({ icon_name: 'user-idle-symbolic',
style_class: 'popup-menu-icon' });
this._pendingIcon = new St.Icon({ icon_name: 'user-status-pending',
this._pendingIcon = new St.Icon({ icon_name: 'user-status-pending-symbolic',
style_class: 'popup-menu-icon' });
this._lockedIcon = new St.Icon({ icon_name: 'changes-prevent-symbolic',
style_class: 'popup-menu-icon' });
this._accountMgr.connect('most-available-presence-changed',
Lang.bind(this, this._updatePresenceIcon));
@ -527,19 +567,29 @@ const UserMenuButton = new Lang.Class({
// the lockdown setting changes, which should be close enough.
this.menu.connect('open-state-changed', Lang.bind(this,
function(menu, open) {
if (open)
this._updateHaveShutdown();
if (!open)
return;
this._updateHaveShutdown();
this._updateHaveSuspend();
this._updateHaveHibernate();
}));
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
Lang.bind(this, this._updateHaveShutdown));
this._upClient.connect('notify::can-suspend', Lang.bind(this, this._updateSuspendOrPowerOff));
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._sessionUpdated();
},
setLockedState: function(locked) {
if (locked)
this.menu.close();
this.actor.reactive = !locked;
_sessionUpdated: function() {
this.actor.visible = !Main.sessionMode.isGreeter;
let allowSettings = Main.sessionMode.allowSettings;
this._statusChooser.setSensitive(allowSettings);
this._systemSettings.visible = allowSettings;
this.setSensitive(!Main.sessionMode.isLocked);
this._updatePresenceIcon();
},
_onDestroy: function() {
@ -562,19 +612,19 @@ const UserMenuButton = new Lang.Class({
_updateSwitchUser: function() {
let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY);
let multiUser = this._userManager.can_switch() && this._userManager.has_multiple_users;
let multiSession = Gdm.get_session_ids().length > 1;
this._loginScreenItem.label.set_text(multiUser ? _("Switch User")
: _("Switch Session"));
this._loginScreenItem.actor.visible = allowSwitch && (multiUser || multiSession);
this._loginScreenItem.actor.visible = allowSwitch && multiUser;
},
_updateLogout: function() {
let allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY);
let alwaysShow = global.settings.get_boolean(ALWAYS_SHOW_LOG_OUT_KEY);
let systemAccount = this._user.system_account;
let localAccount = this._user.local_account;
let multiUser = this._userManager.has_multiple_users;
let multiSession = Gdm.get_session_ids().length > 1;
this._logoutItem.actor.visible = allowLogout && (multiUser || multiSession);
this._logoutItem.actor.visible = allowLogout && (alwaysShow || multiUser || multiSession || systemAccount || !localAccount);
},
_updateLockScreen: function() {
@ -598,9 +648,22 @@ const UserMenuButton = new Lang.Class({
}));
},
_updateSuspendOrPowerOff: function() {
this._haveSuspend = this._upClient.get_can_suspend();
_updateHaveSuspend: function() {
this._loginManager.canSuspend(Lang.bind(this,
function(result) {
this._haveSuspend = result;
this._updateSuspendOrPowerOff();
}));
},
_updateHaveHibernate: function() {
this._loginManager.canHibernate(Lang.bind(this,
function(result) {
this._haveHibernate = result;
}));
},
_updateSuspendOrPowerOff: function() {
if (!this._suspendOrPowerOffItem)
return;
@ -623,7 +686,9 @@ const UserMenuButton = new Lang.Class({
},
_updatePresenceIcon: function(accountMgr, presence, status, message) {
if (presence == Tp.ConnectionPresenceType.AVAILABLE)
if (Main.sessionMode.isLocked)
this._iconBox.child = this._lockedIcon;
else if (presence == Tp.ConnectionPresenceType.AVAILABLE)
this._iconBox.child = this._availableIcon;
else if (presence == Tp.ConnectionPresenceType.BUSY)
this._iconBox.child = this._busyIcon;
@ -654,8 +719,10 @@ const UserMenuButton = new Lang.Class({
},
_onAccountRemoved: function(accountMgr, account) {
account.disconnect(account._changingId);
account._changingId = 0;
if (account._changingId) {
account.disconnect(account._changingId);
account._changingId = 0;
}
this._updateChangingPresence();
},
@ -681,8 +748,7 @@ const UserMenuButton = new Lang.Class({
let item;
item = new IMStatusChooserItem();
if (Main.sessionMode.allowSettings)
item.connect('activate', Lang.bind(this, this._onMyAccountActivate));
item.connect('activate', Lang.bind(this, this._onMyAccountActivate));
this.menu.addMenuItem(item);
this._statusChooser = item;
@ -694,11 +760,10 @@ const UserMenuButton = new Lang.Class({
item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item);
if (Main.sessionMode.allowSettings) {
item = new PopupMenu.PopupMenuItem(_("System Settings"));
item.connect('activate', Lang.bind(this, this._onPreferencesActivate));
this.menu.addMenuItem(item);
}
item = new PopupMenu.PopupMenuItem(_("Settings"));
item.connect('activate', Lang.bind(this, this._onPreferencesActivate));
this.menu.addMenuItem(item);
this._systemSettings = item;
item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item);
@ -709,7 +774,7 @@ const UserMenuButton = new Lang.Class({
this._loginScreenItem = item;
item = new PopupMenu.PopupMenuItem(_("Log Out"));
item.connect('activate', Lang.bind(this, this._onQuitSessionActivate));
item.connect('activate', Lang.bind(this, this.logOut));
this.menu.addMenuItem(item);
this._logoutItem = item;
@ -766,17 +831,19 @@ const UserMenuButton = new Lang.Class({
},
_onLockScreenActivate: function() {
this.menu.close(BoxPointer.PopupAnimation.NONE);
Main.overview.hide();
Main.screenShield.lock(true);
},
_onLoginScreenActivate: function() {
this.menu.close(BoxPointer.PopupAnimation.NONE);
Main.overview.hide();
Main.screenShield.lock(false);
this._userManager.goto_login_session();
Gdm.goto_login_session_sync(null);
},
_onQuitSessionActivate: function() {
logOut: function() {
Main.overview.hide();
this._session.LogoutRemote(0);
},
@ -788,20 +855,60 @@ const UserMenuButton = new Lang.Class({
this._session.RebootRemote();
},
shutdown: function() {
this._session.ShutdownRemote();
},
suspend: function() {
if (!this._haveSuspend)
return false;
// Ensure we only suspend after locking the screen
if (this._screenSaverSettings.get_boolean(LOCK_ENABLED_KEY)) {
let tmpId = Main.screenShield.connect('lock-screen-shown', Lang.bind(this, function() {
Main.screenShield.disconnect(tmpId);
this._loginManager.suspend();
}));
this.menu.close(BoxPointer.PopupAnimation.NONE);
Main.screenShield.lock(true);
} else {
this._loginManager.suspend();
}
return true;
},
hibernate: function() {
if (!this._haveHibernate)
return false;
// Ensure we only suspend after locking the screen
if (this._screenSaverSettings.get_boolean(LOCK_ENABLED_KEY)) {
let tmpId = Main.screenShield.connect('lock-screen-shown', Lang.bind(this, function() {
Main.screenShield.disconnect(tmpId);
this._loginManager.hibernate();
}));
this.menu.close(BoxPointer.PopupAnimation.NONE);
Main.screenShield.lock(true);
} else {
this._loginManager.hibernate();
}
return true;
},
_onSuspendOrPowerOffActivate: function() {
Main.overview.hide();
if (this._haveShutdown &&
this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
this._session.ShutdownRemote();
this.shutdown();
} else {
let tmpId = Main.screenShield.connect('lock-screen-shown', Lang.bind(this, function() {
Main.screenShield.disconnect(tmpId);
this._upClient.suspend_sync(null);
}));
Main.screenShield.lock(true);
this.suspend();
}
}
});

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
@ -9,176 +10,267 @@ const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const AppDisplay = imports.ui.appDisplay;
const Main = imports.ui.main;
const RemoteSearch = imports.ui.remoteSearch;
const Search = imports.ui.search;
const SearchDisplay = imports.ui.searchDisplay;
const ShellEntry = imports.ui.shellEntry;
const Tweener = imports.ui.tweener;
const Wanda = imports.ui.wanda;
const WorkspacesView = imports.ui.workspacesView;
const BaseTab = new Lang.Class({
Name: 'BaseTab',
const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
_init: function(titleActor, pageActor, name, a11yIcon) {
this.title = titleActor;
this.page = new St.Bin({ child: pageActor,
x_align: St.Align.START,
y_align: St.Align.START,
x_fill: true,
y_fill: true,
style_class: 'view-tab-page' });
const FocusTrap = new Lang.Class({
Name: 'FocusTrap',
Extends: St.Widget,
if (this.title.can_focus) {
Main.ctrlAltTabManager.addGroup(this.title, name, a11yIcon);
} else {
Main.ctrlAltTabManager.addGroup(this.page, name, a11yIcon,
{ proxy: this.title,
focusCallback: Lang.bind(this, this._a11yFocus) });
}
this.visible = false;
},
show: function(animate) {
this.visible = true;
this.page.show();
if (!animate)
return;
this.page.opacity = 0;
Tweener.addTween(this.page,
{ opacity: 255,
time: 0.1,
transition: 'easeOutQuad' });
},
hide: function() {
this.visible = false;
Tweener.addTween(this.page,
{ opacity: 0,
time: 0.1,
transition: 'easeOutQuad',
onComplete: Lang.bind(this,
function() {
this.page.hide();
})
});
},
_a11yFocus: function() {
this._activate();
this.page.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
},
_activate: function() {
this.emit('activated');
}
});
Signals.addSignalMethods(BaseTab.prototype);
const ViewTab = new Lang.Class({
Name: 'ViewTab',
Extends: BaseTab,
_init: function(id, label, pageActor, a11yIcon) {
this.id = id;
let titleActor = new St.Button({ label: label,
style_class: 'view-tab-title' });
titleActor.connect('clicked', Lang.bind(this, this._activate));
this.parent(titleActor, pageActor, label, a11yIcon);
vfunc_navigate_focus: function(from, direction) {
if (direction == Gtk.DirectionType.TAB_FORWARD ||
direction == Gtk.DirectionType.TAB_BACKWARD)
return this.parent(from, direction);
return false;
}
});
const SearchTab = new Lang.Class({
Name: 'SearchTab',
Extends: BaseTab,
const ViewSelector = new Lang.Class({
Name: 'ViewSelector',
_init : function(searchEntry, showAppsButton) {
this.actor = new St.BoxLayout({ name: 'viewSelector',
vertical: true });
this._showAppsButton = showAppsButton;
this._showAppsButton.connect('notify::checked', Lang.bind(this, this._onShowAppsButtonToggled));
this._pageArea = new Shell.Stack();
this.actor.add(this._pageArea, { x_fill: true,
y_fill: true,
expand: true });
this._activePage = null;
_init: function() {
this.active = false;
this._searchPending = false;
this._searchTimeoutId = 0;
this._searchSystem = new Search.SearchSystem();
this._openSearchSystem = new Search.OpenSearchSystem();
this._entry = new St.Entry({ name: 'searchEntry',
/* Translators: this is the text displayed
in the search entry when no search is
active; it should not exceed ~30
characters. */
hint_text: _("Type to search..."),
track_hover: true,
can_focus: true });
this._entry = searchEntry;
ShellEntry.addContextMenu(this._entry);
this._text = this._entry.clutter_text;
this._text.connect('key-press-event', Lang.bind(this, this._onKeyPress));
this._inactiveIcon = new St.Icon({ style_class: 'search-entry-icon',
icon_name: 'edit-find',
icon_type: St.IconType.SYMBOLIC });
this._activeIcon = new St.Icon({ style_class: 'search-entry-icon',
icon_name: 'edit-clear',
icon_type: St.IconType.SYMBOLIC });
this._entry.set_secondary_icon(this._inactiveIcon);
this._iconClickedId = 0;
this._searchResults = new SearchDisplay.SearchResults(this._searchSystem, this._openSearchSystem);
this.parent(this._entry, this._searchResults.actor, _("Search"), 'edit-find');
this._text.connect('text-changed', Lang.bind(this, this._onTextChanged));
this._text.connect('key-press-event', Lang.bind(this, function (o, e) {
// We can't connect to 'activate' here because search providers
// might want to do something with the modifiers in activateDefault.
let symbol = e.get_key_symbol();
if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
if (this._searchTimeoutId > 0) {
Mainloop.source_remove(this._searchTimeoutId);
this._doSearch();
}
this._searchResults.activateDefault();
return true;
}
return false;
}));
this._entry.connect('notify::mapped', Lang.bind(this, this._onMapped));
global.stage.connect('notify::key-focus', Lang.bind(this, this._onStageKeyFocusChanged));
this._capturedEventId = 0;
this._text.connect('key-press-event', Lang.bind(this, this._onKeyPress));
this._text.connect('key-focus-in', Lang.bind(this, function() {
this._searchResults.highlightDefault(true);
}));
this._text.connect('key-focus-out', Lang.bind(this, function() {
this._searchResults.highlightDefault(false);
}));
this._entry.connect('notify::mapped', Lang.bind(this, this._onMapped));
global.stage.connect('notify::key-focus', Lang.bind(this, this._onStageKeyFocusChanged));
this._inactiveIcon = new St.Icon({ style_class: 'search-entry-icon',
icon_name: 'edit-find-symbolic' });
this._activeIcon = new St.Icon({ style_class: 'search-entry-icon',
icon_name: 'edit-clear-symbolic' });
this._entry.set_secondary_icon(this._inactiveIcon);
this._iconClickedId = 0;
this._capturedEventId = 0;
this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
this._workspacesPage = this._addPage(this._workspacesDisplay.actor, null,
_("Windows"), 'text-x-generic-symbolic');
this._appDisplay = new AppDisplay.AllAppDisplay();
this._appsPage = this._addPage(this._appDisplay.actor, null,
_("Applications"), 'system-run-symbolic');
this._searchResults = new SearchDisplay.SearchResults(this._searchSystem);
this._searchPage = this._addPage(this._searchResults.actor, this._entry,
_("Search"), 'edit-find-symbolic');
// Default search providers
// Wanda comes obviously first
this.addSearchProvider(new Wanda.WandaSearchProvider());
this.addSearchProvider(new AppDisplay.AppSearchProvider());
this.addSearchProvider(new AppDisplay.SettingsSearchProvider());
// Load remote search providers provided by applications
RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, this.addSearchProvider));
// Since the entry isn't inside the results container we install this
// dummy widget as the last results container child so that we can
// include the entry in the keynav tab path...
this._focusTrap = new St.Bin({ can_focus: true });
// include the entry in the keynav tab path
this._focusTrap = new FocusTrap({ can_focus: true });
this._focusTrap.connect('key-focus-in', Lang.bind(this, function() {
this._entry.grab_key_focus();
}));
// ... but make it unfocusable using arrow keys keynav by making its
// bounding box always contain the possible focus source's bounding
// box since StWidget's keynav logic won't ever select it as a target
// in that case.
this._focusTrap.add_constraint(new Clutter.BindConstraint({ source: this._searchResults.actor,
coordinate: Clutter.BindCoordinate.ALL }));
this._searchResults.actor.add_actor(this._focusTrap);
global.focus_manager.add_group(this._searchResults.actor);
Main.overview.connect('item-drag-begin',
Lang.bind(this, this._resetShowAppsButton));
this._stageKeyPressId = 0;
Main.overview.connect('showing', Lang.bind(this,
function () {
this._resetShowAppsButton();
this._stageKeyPressId = global.stage.connect('key-press-event',
Lang.bind(this, this._onStageKeyPress));
}));
Main.overview.connect('hiding', Lang.bind(this,
function () {
this._resetShowAppsButton();
if (this._stageKeyPressId != 0) {
global.stage.disconnect(this._stageKeyPressId);
this._stageKeyPressId = 0;
}
}));
// Public constraints which may be used to tie actors' height or
// vertical position to the current tab's content; as the content's
// height and position depend on the view selector's style properties
// (e.g. font size, padding, spacing, ...) it would be extremely hard
// and ugly to get these from the outside. While it would be possible
// to use position and height properties directly, outside code would
// need to ensure that the content is properly allocated before
// accessing the properties.
this.constrainHeight = new Clutter.BindConstraint({ source: this._pageArea,
coordinate: Clutter.BindCoordinate.HEIGHT });
global.display.add_keybinding('toggle-application-view',
new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE,
Lang.bind(this, this._showWithAppsPage));
},
_showWithAppsPage: function() {
Main.overview.show();
this._showAppsButton.set_checked(true);
},
show: function() {
this._activePage = this._workspacesPage;
this._appsPage.hide();
this._searchPage.hide();
this._workspacesDisplay.show();
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
Main.overview.fadeOutDesktop();
this._showPage(this._workspacesPage);
},
zoomFromOverview: function() {
this._workspacesDisplay.zoomFromOverview();
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
Main.overview.fadeInDesktop();
},
hide: function() {
this.parent();
this._workspacesDisplay.hide();
},
_addPage: function(actor, a11yFocus, name, a11yIcon) {
let page = new St.Bin({ child: actor,
x_align: St.Align.START,
y_align: St.Align.START,
x_fill: true,
y_fill: true });
if (a11yFocus)
Main.ctrlAltTabManager.addGroup(a11yFocus, name, a11yIcon);
else
Main.ctrlAltTabManager.addGroup(actor, name, a11yIcon,
{ proxy: this.actor,
focusCallback: Lang.bind(this,
function() {
this._a11yFocusPage(page);
})
});;
this._pageArea.add_actor(page);
return page;
},
_showPage: function(page) {
if(page == this._activePage)
return;
if(this._activePage) {
Tweener.addTween(this._activePage,
{ opacity: 0,
time: 0.1,
transition: 'easeOutQuad',
onComplete: Lang.bind(this,
function() {
this._activePage.hide();
this._activePage = page;
})
});
}
page.show();
Tweener.addTween(page,
{ opacity: 255,
time: 0.1,
transition: 'easeOutQuad'
});
},
_a11yFocusPage: function(page) {
this._showAppsButton.checked = page == this._appsPage;
page.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
},
_onShowAppsButtonToggled: function() {
if (this.active)
this.reset();
else
this._showPage(this._showAppsButton.checked ? this._appsPage
: this._workspacesPage);
},
_resetShowAppsButton: function() {
this._showAppsButton.checked = false;
},
_onStageKeyPress: function(actor, event) {
let modifiers = event.get_state();
let symbol = event.get_key_symbol();
if (symbol == Clutter.Escape) {
if (this.active)
this.reset();
else if (this._showAppsButton.checked)
this._resetShowAppsButton();
else
Main.overview.hide();
return true;
} else if (Clutter.keysym_to_unicode(symbol) ||
(symbol == Clutter.BackSpace && this.active)) {
this.startSearch(event);
} else if (!this.active) {
if (symbol == Clutter.Tab || symbol == Clutter.Down) {
this._activePage.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
return true;
} else if (symbol == Clutter.ISO_Left_Tab) {
this._activePage.navigate_focus(null, Gtk.DirectionType.TAB_BACKWARD, false);
return true;
}
}
return false;
},
_searchCancelled: function() {
this._showPage(this._showAppsButton.checked ? this._appsPage
: this._workspacesPage);
// Leave the entry focused when it doesn't have any text;
// when replacing a selected search term, Clutter emits
@ -227,19 +319,9 @@ const SearchTab = new Lang.Class({
}
},
addSearchProvider: function(provider) {
this._searchSystem.registerProvider(provider);
this._searchResults.createProviderMeta(provider);
},
removeSearchProvider: function(provider) {
this._searchSystem.unregisterProvider(provider);
this._searchResults.destroyProviderMeta(provider);
},
startSearch: function(event) {
global.stage.set_key_focus(this._text);
this._text.event(event, false);
this._text.event(event, true);
},
// the entry does not show the hint
@ -263,14 +345,13 @@ const SearchTab = new Lang.Class({
this.reset();
}));
}
this._activate();
} else {
if (this._iconClickedId > 0)
this._entry.disconnect(this._iconClickedId);
this._iconClickedId = 0;
this._entry.set_secondary_icon(this._inactiveIcon);
this.emit('search-cancelled');
this._searchCancelled();
}
if (!this.active) {
if (this._searchTimeoutId > 0) {
@ -291,6 +372,15 @@ const SearchTab = new Lang.Class({
this.reset();
return true;
}
} else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
// We can't connect to 'activate' here because search providers
// might want to do something with the modifiers in activateDefault.
if (this._searchTimeoutId > 0) {
Mainloop.source_remove(this._searchTimeoutId);
this._doSearch();
}
this._searchResults.activateDefault();
return true;
} else if (this.active) {
let arrowNext, nextDirection;
if (entry.get_text_direction() == Clutter.TextDirection.RTL) {
@ -340,259 +430,17 @@ const SearchTab = new Lang.Class({
let text = this._text.get_text().replace(/^\s+/g, '').replace(/\s+$/g, '');
this._searchResults.doSearch(text);
return false;
}
});
const ViewSelector = new Lang.Class({
Name: 'ViewSelector',
_init : function() {
this.actor = new St.BoxLayout({ name: 'viewSelector',
vertical: true });
// The tab bar is located at the top of the view selector and
// holds both "normal" tab labels and the search entry. The former
// is left aligned, the latter right aligned - unless the text
// direction is RTL, in which case the order is reversed.
this._tabBar = new Shell.GenericContainer();
this._tabBar.connect('get-preferred-width',
Lang.bind(this, this._getPreferredTabBarWidth));
this._tabBar.connect('get-preferred-height',
Lang.bind(this, this._getPreferredTabBarHeight));
this._tabBar.connect('allocate',
Lang.bind(this, this._allocateTabBar));
this.actor.add(this._tabBar);
// Box to hold "normal" tab labels
this._tabBox = new St.BoxLayout({ name: 'viewSelectorTabBar' });
this._tabBar.add_actor(this._tabBox);
// The searchArea just holds the entry
this._searchArea = new St.Bin({ name: 'searchArea' });
this._tabBar.add_actor(this._searchArea);
// The page area holds the tab pages. Every page is given the
// area's full allocation, so that the pages would appear on top
// of each other if the inactive ones weren't hidden.
this._pageArea = new Shell.Stack();
this.actor.add(this._pageArea, { x_fill: true,
y_fill: true,
expand: true });
this._tabs = [];
this._activeTab = null;
this._searchTab = new SearchTab();
this._searchArea.set_child(this._searchTab.title);
this._addTab(this._searchTab);
this._searchTab.connect('search-cancelled', Lang.bind(this,
function() {
this._switchTab(this._activeTab);
}));
Main.overview.connect('item-drag-begin',
Lang.bind(this, this._switchDefaultTab));
this._stageKeyPressId = 0;
Main.overview.connect('showing', Lang.bind(this,
function () {
this._switchDefaultTab();
this._stageKeyPressId = global.stage.connect('key-press-event',
Lang.bind(this, this._onStageKeyPress));
}));
Main.overview.connect('hiding', Lang.bind(this,
function () {
this._switchDefaultTab();
if (this._stageKeyPressId != 0) {
global.stage.disconnect(this._stageKeyPressId);
this._stageKeyPressId = 0;
}
}));
// Public constraints which may be used to tie actors' height or
// vertical position to the current tab's content; as the content's
// height and position depend on the view selector's style properties
// (e.g. font size, padding, spacing, ...) it would be extremely hard
// and ugly to get these from the outside. While it would be possible
// to use position and height properties directly, outside code would
// need to ensure that the content is properly allocated before
// accessing the properties.
this.constrainY = new Clutter.BindConstraint({ source: this._pageArea,
coordinate: Clutter.BindCoordinate.Y });
this.constrainHeight = new Clutter.BindConstraint({ source: this._pageArea,
coordinate: Clutter.BindCoordinate.HEIGHT });
},
_addTab: function(tab) {
tab.page.hide();
this._pageArea.add_actor(tab.page);
tab.connect('activated', Lang.bind(this, function(tab) {
this._switchTab(tab);
}));
},
addViewTab: function(id, title, pageActor, a11yIcon) {
let viewTab = new ViewTab(id, title, pageActor, a11yIcon);
this._tabs.push(viewTab);
this._tabBox.add(viewTab.title);
this._addTab(viewTab);
},
_switchTab: function(tab) {
let firstSwitch = this._activeTab == null;
if (this._activeTab && this._activeTab.visible) {
if (this._activeTab == tab)
return;
this._activeTab.title.remove_style_pseudo_class('selected');
this._activeTab.hide();
}
if (tab != this._searchTab) {
tab.title.add_style_pseudo_class('selected');
this._activeTab = tab;
if (this._searchTab.visible) {
this._searchTab.hide();
}
}
// Only fade when switching between tabs,
// not when setting the initially selected one.
if (!tab.visible)
tab.show(!firstSwitch);
},
switchTab: function(id) {
for (let i = 0; i < this._tabs.length; i++)
if (this._tabs[i].id == id) {
this._switchTab(this._tabs[i]);
break;
}
},
_switchDefaultTab: function() {
if (this._tabs.length > 0)
this._switchTab(this._tabs[0]);
},
_nextTab: function() {
if (this._tabs.length == 0 ||
this._tabs[this._tabs.length - 1] == this._activeTab)
return;
for (let i = 0; i < this._tabs.length; i++)
if (this._tabs[i] == this._activeTab) {
this._switchTab(this._tabs[i + 1]);
return;
}
},
_prevTab: function() {
if (this._tabs.length == 0 || this._tabs[0] == this._activeTab)
return;
for (let i = 0; i < this._tabs.length; i++)
if (this._tabs[i] == this._activeTab) {
this._switchTab(this._tabs[i - 1]);
return;
}
},
_getPreferredTabBarWidth: function(box, forHeight, alloc) {
let children = box.get_children();
for (let i = 0; i < children.length; i++) {
let [childMin, childNat] = children[i].get_preferred_width(forHeight);
alloc.min_size += childMin;
alloc.natural_size += childNat;
}
},
_getPreferredTabBarHeight: function(box, forWidth, alloc) {
let children = box.get_children();
for (let i = 0; i < children.length; i++) {
let [childMin, childNatural] = children[i].get_preferred_height(forWidth);
if (childMin > alloc.min_size)
alloc.min_size = childMin;
if (childNatural > alloc.natural_size)
alloc.natural_size = childNatural;
}
},
_allocateTabBar: function(container, box, flags) {
let allocWidth = box.x2 - box.x1;
let allocHeight = box.y2 - box.y1;
let [searchMinWidth, searchNatWidth] = this._searchArea.get_preferred_width(-1);
let [barMinWidth, barNatWidth] = this._tabBox.get_preferred_width(-1);
let childBox = new Clutter.ActorBox();
childBox.y1 = 0;
childBox.y2 = allocHeight;
if (this.actor.get_text_direction() == Clutter.TextDirection.RTL) {
childBox.x1 = allocWidth - barNatWidth;
childBox.x2 = allocWidth;
} else {
childBox.x1 = 0;
childBox.x2 = barNatWidth;
}
this._tabBox.allocate(childBox, flags);
if (this.actor.get_text_direction() == Clutter.TextDirection.RTL) {
childBox.x1 = 0;
childBox.x2 = searchNatWidth;
} else {
childBox.x1 = allocWidth - searchNatWidth;
childBox.x2 = allocWidth;
}
this._searchArea.allocate(childBox, flags);
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this,
function() {
this.constrainY.offset = this.actor.y;
}));
},
_onStageKeyPress: function(actor, event) {
let modifiers = event.get_state();
let symbol = event.get_key_symbol();
if (symbol == Clutter.Escape) {
if (this._searchTab.active)
this._searchTab.reset();
else
Main.overview.hide();
return true;
} else if (Clutter.keysym_to_unicode(symbol) ||
(symbol == Clutter.BackSpace && this._searchTab.active)) {
this._searchTab.startSearch(event);
} else if (!this._searchTab.active) {
if (modifiers & Clutter.ModifierType.CONTROL_MASK) {
if (symbol == Clutter.Page_Up) {
this._prevTab();
return true;
} else if (symbol == Clutter.Page_Down) {
this._nextTab();
return true;
}
} else if (symbol == Clutter.Tab) {
this._activeTab.page.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
return true;
} else if (symbol == Clutter.ISO_Left_Tab) {
this._activeTab.page.navigate_focus(null, Gtk.DirectionType.TAB_BACKWARD, false);
return true;
}
}
return false;
this._showPage(this._searchPage);
},
addSearchProvider: function(provider) {
this._searchTab.addSearchProvider(provider);
this._searchSystem.registerProvider(provider);
this._searchResults.createProviderMeta(provider);
},
removeSearchProvider: function(provider) {
this._searchTab.removeSearchProvider(provider);
this._searchSystem.unregisterProvider(provider);
this._searchResults.destroyProviderMeta(provider);
}
});
Signals.addSignalMethods(ViewSelector.prototype);

View File

@ -1,14 +1,13 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const GdkPixbuf = imports.gi.GdkPixbuf;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const Signals = imports.signals;
const St = imports.gi.St;
const IconGrid = imports.ui.iconGrid;
const Layout = imports.ui.layout;
const Main = imports.ui.main;
const Search = imports.ui.search;
@ -49,23 +48,12 @@ const WandaIcon = new Lang.Class({
},
createIcon: function(iconSize) {
if (this._animations)
this._animations.destroy();
if (!this._imageFile) {
return new St.Icon({ icon_name: 'face-smile',
icon_type: St.IconType.FULLCOLOR,
icon_size: iconSize
});
icon_size: iconSize });
}
this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile, this._imgWidth, this._imgHeight);
this._animations.connect('destroy', Lang.bind(this, function() {
if (this._timeoutId)
GLib.source_remove(this._timeoutId);
this._timeoutId = 0;
this._animations = null;
}));
this._animations.connect('notify::mapped', Lang.bind(this, function() {
if (this._animations.mapped && !this._timeoutId) {
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, FISH_SPEED, Lang.bind(this, this._update));
@ -78,11 +66,16 @@ const WandaIcon = new Lang.Class({
}
}));
this._i = 0;
return this._animations;
},
_createIconTexture: function(size) {
if (size == this.iconSize)
return;
this.parent(size);
},
_update: function() {
let n = this._animations.get_n_children();
if (n == 0) {
@ -142,17 +135,18 @@ const FortuneDialog = new Lang.Class({
this._button.connect('clicked', Lang.bind(this, this.destroy));
this._button.child = this._box;
let monitor = Main.layoutManager.primaryMonitor;
this._bin = new St.Bin({ x_align: St.Align.MIDDLE,
y_align: St.Align.MIDDLE });
this._bin.add_constraint(new Layout.MonitorConstraint({ primary: true }));
this._bin.add_actor(this._button);
Main.layoutManager.addChrome(this._button);
this._button.set_position(Math.floor(monitor.width / 2 - this._button.width / 2),
Math.floor(monitor.height / 2 - this._button.height / 2));
Main.layoutManager.addChrome(this._bin);
GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 10, Lang.bind(this, this.destroy));
},
destroy: function() {
this._button.destroy();
this._bin.destroy();
}
});
@ -173,16 +167,8 @@ const WandaSearchProvider = new Lang.Class({
// only one which speaks the truth!
'name': capitalize(fish[0]),
'createIcon': function(iconSize) {
// for DND only (maybe could be improved)
// DON'T use St.Icon here, it crashes the shell
// (dnd.js code assumes it can query the actor size
// without parenting it, while StWidget accesses
// StThemeNode in get_preferred_width/height, which
// triggers an assertion failure)
return St.TextureCache.get_default().load_icon_name(null,
'face-smile',
St.IconType.FULLCOLOR,
iconSize);
return new St.Icon({ gicon: Gio.icon_new_for_string('face-smile'),
icon_size: iconSize });
}
}]);
},

View File

@ -39,6 +39,8 @@ const WindowAttentionHandler = new Lang.Class({
let [title, banner] = this._getTitleAndBanner(app, window);
let notification = new MessageTray.Notification(source, title, banner);
notification.setForFeedback(true);
source.notify(notification);
source.signalIDs.push(window.connect('notify::title', Lang.bind(this, function() {

View File

@ -12,11 +12,11 @@ const AltTab = imports.ui.altTab;
const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup;
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;
const Util = imports.misc.util;
const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
const WINDOW_ANIMATION_TIME = 0.25;
const DIM_DESATURATION = 0.6;
const DIM_BRIGHTNESS = -0.1;
const DIM_BRIGHTNESS = -0.3;
const DIM_TIME = 0.500;
const UNDIM_TIME = 0.250;
@ -25,23 +25,27 @@ const WindowDimmer = new Lang.Class({
Name: 'WindowDimmer',
_init: function(actor) {
this._desaturateEffect = new Clutter.DesaturateEffect();
this._brightnessEffect = new Clutter.BrightnessContrastEffect();
actor.add_effect(this._desaturateEffect);
actor.add_effect(this._brightnessEffect);
this.actor = actor;
this._enabled = true;
this._dimFactor = 0.0;
this._syncEnabled();
},
_syncEnabled: function() {
this._brightnessEffect.enabled = (this._enabled && this._dimFactor > 0);
},
setEnabled: function(enabled) {
this._desaturateEffect.enabled = enabled;
this._brightnessEffect.enabled = enabled;
this._enabled = enabled;
this._syncEnabled();
},
set dimFactor(factor) {
this._dimFactor = factor;
this._desaturateEffect.set_factor(factor * DIM_DESATURATION);
this._brightnessEffect.set_brightness(factor * DIM_BRIGHTNESS);
this._syncEnabled();
},
get dimFactor() {
@ -50,10 +54,17 @@ const WindowDimmer = new Lang.Class({
});
function getWindowDimmer(actor) {
if (!actor._windowDimmer)
actor._windowDimmer = new WindowDimmer(actor);
let enabled = Meta.prefs_get_attach_modal_dialogs();
if (actor._windowDimmer)
actor._windowDimmer.setEnabled(enabled);
return actor._windowDimmer;
if (enabled) {
if (!actor._windowDimmer)
actor._windowDimmer = new WindowDimmer(actor);
return actor._windowDimmer;
} else {
return null;
}
}
const WindowManager = new Lang.Class({
@ -91,32 +102,32 @@ const WindowManager = new Lang.Class({
this._shellwm.connect('destroy', Lang.bind(this, this._destroyWindow));
this._workspaceSwitcherPopup = null;
Meta.keybindings_set_custom_handler('switch-to-workspace-left',
Meta.keybindings_set_custom_handler('internal-keybinding-switch-to-workspace-left',
Util.wrapKeybinding(Lang.bind(this, this._showWorkspaceSwitcher), true));
Meta.keybindings_set_custom_handler('internal-keybinding-switch-to-workspace-right',
Util.wrapKeybinding(Lang.bind(this, this._showWorkspaceSwitcher), true));
Meta.keybindings_set_custom_handler('internal-keybinding-switch-to-workspace-up',
Util.wrapKeybinding(Lang.bind(this, this._showWorkspaceSwitcher), true));
Meta.keybindings_set_custom_handler('internal-keybinding-switch-to-workspace-down',
Util.wrapKeybinding(Lang.bind(this, this._showWorkspaceSwitcher), true));
Meta.keybindings_set_custom_handler('internal-keybinding-move-to-workspace-left',
Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('switch-to-workspace-right',
Meta.keybindings_set_custom_handler('internal-keybinding-move-to-workspace-right',
Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('switch-to-workspace-up',
Meta.keybindings_set_custom_handler('internal-keybinding-move-to-workspace-up',
Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('switch-to-workspace-down',
Meta.keybindings_set_custom_handler('internal-keybinding-move-to-workspace-down',
Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('move-to-workspace-left',
Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('move-to-workspace-right',
Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('move-to-workspace-up',
Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('move-to-workspace-down',
Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('switch-windows',
Meta.keybindings_set_custom_handler('internal-keybinding-switch-windows',
Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-group',
Meta.keybindings_set_custom_handler('internal-keybinding-switch-group',
Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-windows-backward',
Meta.keybindings_set_custom_handler('internal-keybinding-switch-windows-backward',
Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-group-backward',
Meta.keybindings_set_custom_handler('internal-keybinding-switch-group-backward',
Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-panels',
Lang.bind(this, this._startA11ySwitcher));
Meta.keybindings_set_custom_handler('internal-keybinding-switch-panels',
Util.wrapKeybinding(Lang.bind(this, this._startA11ySwitcher), true));
global.display.add_keybinding('open-application-menu',
new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE,
@ -260,9 +271,7 @@ const WindowManager = new Lang.Class({
if (!actor)
return;
let dimmer = getWindowDimmer(actor);
let enabled = Meta.prefs_get_attach_modal_dialogs();
dimmer.setEnabled(enabled);
if (!enabled)
if (!dimmer)
return;
Tweener.addTween(dimmer,
{ dimFactor: 1.0,
@ -276,15 +285,12 @@ const WindowManager = new Lang.Class({
if (!actor)
return;
let dimmer = getWindowDimmer(actor);
let enabled = Meta.prefs_get_attach_modal_dialogs();
dimmer.setEnabled(enabled);
if (!enabled)
if (!dimmer)
return;
Tweener.addTween(dimmer,
{ dimFactor: 0.0,
time: UNDIM_TIME,
transition: 'linear'
});
transition: 'linear' });
},
_mapWindow : function(shellwm, actor) {
@ -304,12 +310,29 @@ const WindowManager = new Lang.Class({
}));
if (actor.meta_window.is_attached_dialog()) {
this._checkDimming(actor.get_meta_window().get_transient_for());
if (this._shouldAnimate()) {
actor.set_scale(1.0, 0.0);
actor.scale_gravity = Clutter.Gravity.CENTER;
actor.show();
this._mapping.push(actor);
if (!this._shouldAnimate()) {
shellwm.completed_map(actor);
Tweener.addTween(actor,
{ scale_y: 1,
time: WINDOW_ANIMATION_TIME,
transition: "easeOutQuad",
onComplete: this._mapWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
onOverwrite: this._mapWindowOverwrite,
onOverwriteScope: this,
onOverwriteParams: [shellwm, actor]
});
return;
}
} else if (!this._shouldAnimateActor(actor)) {
shellwm.completed_map(actor);
return;
}
if (!this._shouldAnimateActor(actor)) {
shellwm.completed_map(actor);
return;
}
@ -365,7 +388,8 @@ const WindowManager = new Lang.Class({
return;
}
actor.opacity = 255;
actor.set_scale(1.0, 1.0);
actor.scale_gravity = Clutter.Gravity.CENTER;
actor.show();
this._destroying.push(actor);
@ -375,7 +399,7 @@ const WindowManager = new Lang.Class({
}));
Tweener.addTween(actor,
{ opacity: 0,
{ scale_y: 0,
time: WINDOW_ANIMATION_TIME,
transition: "easeOutQuad",
onComplete: this._destroyWindowDone,
@ -529,30 +553,32 @@ const WindowManager = new Lang.Class({
let backwards = modifiers & Meta.VirtualModifier.SHIFT_MASK;
if (!tabPopup.show(backwards, binding.get_name(), binding.get_mask()))
tabPopup.destroy();
return true;
},
_startA11ySwitcher : function(display, screen, window, binding) {
let modifiers = binding.get_modifiers();
let backwards = modifiers & Meta.VirtualModifier.SHIFT_MASK;
Main.ctrlAltTabManager.popup(backwards, binding.get_mask());
return true;
},
_openAppMenu : function(display, screen, window, event, binding) {
Main.panel.openAppMenu();
return true;
},
_showWorkspaceSwitcher : function(display, screen, window, binding) {
if (screen.n_workspaces == 1)
return;
return false;
let [action,,,direction] = binding.get_name().split('-');
let [,,action,,,direction] = binding.get_name().split('-');
let direction = Meta.MotionDirection[direction.toUpperCase()];
let newWs;
if (direction != Meta.MotionDirection.UP &&
direction != Meta.MotionDirection.DOWN)
return;
return false;
if (action == 'switch')
newWs = this.actionMoveWorkspace(direction);
@ -568,6 +594,8 @@ const WindowManager = new Lang.Class({
}
this._workspaceSwitcherPopup.display(direction, newWs.index());
}
return true;
},
actionMoveWorkspace: function(direction) {

View File

@ -33,21 +33,13 @@ const DRAGGING_WINDOW_OPACITY = 100;
const BUTTON_LAYOUT_SCHEMA = 'org.gnome.shell.overrides';
const BUTTON_LAYOUT_KEY = 'button-layout';
// Define a layout scheme for small window counts. For larger
// counts we fall back to an algorithm. We need more schemes here
// unless we have a really good algorithm.
// Each triplet is [xCenter, yCenter, scale] where the scale
// is relative to the width of the workspace.
const POSITIONS = {
1: [[0.5, 0.5, 0.95]],
2: [[0.25, 0.5, 0.48], [0.75, 0.5, 0.48]],
3: [[0.25, 0.25, 0.48], [0.75, 0.25, 0.48], [0.5, 0.75, 0.48]],
4: [[0.25, 0.25, 0.47], [0.75, 0.25, 0.47], [0.75, 0.75, 0.47], [0.25, 0.75, 0.47]],
5: [[0.165, 0.25, 0.32], [0.495, 0.25, 0.32], [0.825, 0.25, 0.32], [0.25, 0.75, 0.32], [0.75, 0.75, 0.32]]
};
// Used in _orderWindowsPermutations, 5! = 120 which is probably the highest we can go
const POSITIONING_PERMUTATIONS_MAX = 5;
// When calculating a layout, we calculate the scale of windows and the percent
// of the available area the new layout uses. If the values for the new layout,
// when weighted with the values as below, are worse than the previous layout's,
// we stop looking for a new layout and use the previous layout.
// Otherwise, we keep looking for a new layout.
const LAYOUT_SCALE_WEIGHT = 1;
const LAYOUT_SPACE_WEIGHT = 0.1;
function _interpolate(start, end, step) {
return start + (end - start) * step;
@ -167,6 +159,24 @@ const WindowClone = new Lang.Class({
this._selected = false;
},
get slot() {
let x, y, w, h;
if (this.inDrag) {
x = this.dragOrigX;
y = this.dragOrigY;
w = this.actor.width * this.dragOrigScale;
h = this.actor.height * this.dragOrigScale;
} else {
x = this.actor.x;
y = this.actor.y;
w = this.actor.width * this.actor.scale_x;
h = this.actor.height * this.actor.scale_y;
}
return [x, y, w, h];
},
setStackAbove: function (actor) {
this._stackAbove = actor;
if (this.inDrag || this._zooming)
@ -443,6 +453,11 @@ const WindowOverlay = new Lang.Class({
this._updateCaptionId = metaWindow.connect('notify::title',
Lang.bind(this, function(w) {
this.title.text = w.title;
// we need this for the next call to get_preferred_width
// to return useful results
this.title.set_size(-1, -1);
this._repositionSelf();
}));
let button = new St.Button({ style_class: 'window-close' });
@ -499,18 +514,19 @@ const WindowOverlay = new Lang.Class({
this.title.opacity = 0;
this._parentActor.raise_top();
Tweener.addTween(this.title,
{ opacity: 255,
time: CLOSE_BUTTON_FADE_TIME,
transition: 'easeOutQuad' });
},
chromeWidth: function () {
return this.closeButton.width - this.closeButton._overlap;
{ opacity: 255,
time: CLOSE_BUTTON_FADE_TIME,
transition: 'easeOutQuad' });
},
chromeHeights: function () {
return [this.closeButton.height - this.closeButton._overlap,
this.title.height + this.title._spacing];
this.title.height + this.title._spacing];
},
_repositionSelf: function() {
let [cloneX, cloneY, cloneWidth, cloneHeight] = this._windowClone.slot;
this.updatePositions(cloneX, cloneY, cloneWidth, cloneHeight, false);
},
/**
@ -550,9 +566,8 @@ const WindowOverlay = new Lang.Class({
else
button.set_position(Math.floor(buttonX), Math.floor(buttonY));
if (!title.fullWidth)
title.fullWidth = title.width;
let titleWidth = Math.min(title.fullWidth, cloneWidth);
let [titleMinWidth, titleNatWidth] = title.get_preferred_width(-1);
let titleWidth = Math.max(titleMinWidth, Math.min(titleNatWidth, cloneWidth));
let titleX = cloneX + (cloneWidth - titleWidth) / 2;
let titleY = cloneY + cloneHeight + title._spacing;
@ -668,6 +683,280 @@ const WindowPositionFlags = {
ANIMATE: 1 << 1
};
const LayoutStrategy = new Lang.Class({
Name: 'LayoutStrategy',
Abstract: true,
_init: function(monitor, rowSpacing, columnSpacing, bottomPadding) {
this._monitor = monitor;
this._rowSpacing = rowSpacing;
this._columnSpacing = columnSpacing;
this._bottomPadding = bottomPadding;
},
_newRow: function() {
// Row properties:
//
// * x, y are the position of row, relative to area
//
// * width, height are the scaled versions of fullWidth, fullHeight
//
// * width also has the spacing in between windows. It's not in
// fullWidth, as the spacing is constant, whereas fullWidth is
// meant to be scaled
//
// * neither height/fullHeight have any sort of spacing or padding
//
// * if cellWidth is present, all windows in the row will occupy
// the space of cellWidth, centered.
return { x: 0, y: 0,
width: 0, height: 0,
fullWidth: 0, fullHeight: 0,
cellWidth: 0,
windows: [] };
},
// Compute the size and fancy scale for @window using the
// base scale, @scale.
//
// Returns a list structure: [ scaledWidth, scaledHeight, fancyScale ]
// where scaledWidth and scaledHeight are the window's
// width and height, scaled by fancyScale for convenience.
_computeWindowSizeAndScale: function(window, scale) {
let width = window.actor.width;
let height = window.actor.height;
let ratio;
if (width > height)
ratio = width / this._monitor.width;
else
ratio = height / this._monitor.height;
let fancyScale = (2 / (1 + ratio)) * scale;
return [width * fancyScale, height * fancyScale, fancyScale];
},
// Compute the size of each row, by assigning to the properties
// row.width, row.height, row.fullWidth, row.fullHeight, and
// (optionally) row.cellWidth, for each row in @layout.rows.
// This method is intended to be called by subclasses.
_computeRowSizes: function(layout) {
throw new Error('_computeRowSizes not implemented');
},
// Compute strategy-specific window slots for each window in
// @windows, given the @layout. The strategy may also use @layout
// as strategy-specific storage.
//
// This must calculate:
// * maxColumns - The maximum number of columns used by the layout.
// * gridWidth - The total width used by the grid, unscaled, unspaced.
// * gridHeight - The totial height used by the grid, unscaled, unspaced.
// * rows - A list of rows, which should be instantiated by _newRow.
computeLayout: function(windows, layout) {
throw new Error('computeLayout not implemented');
},
// Given @layout, compute the overall scale and space of the layout.
// The scale is the individual, non-fancy scale of each window, and
// the space is the percentage of the available area eventually
// used by the layout.
// This method does not return anything, but instead installs
// the properties "scale" and "space" on @layout directly.
//
// Make sure to call this methods before calling computeWindowSlots(),
// as it depends on the scale property installed in @layout here.
computeScaleAndSpace: function(layout) {
let area = layout.area;
let hspacing = (layout.maxColumns - 1) * this._columnSpacing;
let vspacing = (layout.numRows - 1) * this._rowSpacing + this._bottomPadding;
let spacedWidth = area.width - hspacing;
let spacedHeight = area.height - vspacing;
let horizontalScale = spacedWidth / layout.gridWidth;
let verticalScale = spacedHeight / layout.gridHeight;
// Thumbnails should be less than 70% of the original size
let scale = Math.min(horizontalScale, verticalScale, WINDOW_CLONE_MAXIMUM_SCALE);
let scaledLayoutWidth = layout.gridWidth * scale + hspacing;
let scaledLayoutHeight = layout.gridHeight * scale + vspacing;
let space = (scaledLayoutWidth * scaledLayoutHeight) / (area.width * area.height);
layout.scale = scale;
layout.space = space;
},
computeWindowSlots: function(layout, area) {
this._computeRowSizes(layout);
let { rows: rows, scale: scale, state: state } = layout;
let slots = [];
let y = 0;
for (let i = 0; i < rows.length; i++) {
let row = rows[i];
row.x = area.x + (area.width - row.width) / 2;
row.y = area.y + y;
y += row.height + this._rowSpacing;
}
let height = y - this._rowSpacing + this._bottomPadding;
let baseY = (area.height - height) / 2;
for (let i = 0; i < rows.length; i++) {
let row = rows[i];
row.y += baseY;
let baseX = row.x;
for (let j = 0; j < row.windows.length; j++) {
let window = row.windows[j];
let [width, height, s] = this._computeWindowSizeAndScale(window, scale);
let y = row.y + row.height - height;
let x = baseX;
if (row.cellWidth) {
x += (row.cellWidth - width) / 2;
width = row.cellWidth;
}
slots.push([x, y, s]);
baseX += width + this._columnSpacing;
}
}
return slots;
}
});
const UnalignedLayoutStrategy = new Lang.Class({
Name: 'UnalignedLayoutStrategy',
Extends: LayoutStrategy,
_computeRowSizes: function(layout) {
let { rows: rows, scale: scale } = layout;
for (let i = 0; i < rows.length; i++) {
let row = rows[i];
row.width = row.fullWidth * scale + (row.windows.length - 1) * this._columnSpacing;
row.height = row.fullHeight * scale;
}
},
_keepSameRow: function(row, window, width, idealRowWidth) {
if (row.fullWidth + width <= idealRowWidth)
return true;
let oldRatio = row.fullWidth / idealRowWidth;
let newRatio = (row.fullWidth + width) / idealRowWidth;
if (Math.abs(1 - newRatio) < Math.abs(1 - oldRatio))
return true;
return false;
},
computeLayout: function(windows, layout) {
let numRows = layout.numRows;
let rows = [];
let totalWidth = 0;
for (let i = 0; i < windows.length; i++) {
totalWidth += windows[i].actor.width;
}
let idealRowWidth = totalWidth / numRows;
let windowIdx = 0;
for (let i = 0; i < numRows; i++) {
let col = 0;
let row = this._newRow();
rows.push(row);
for (; windowIdx < windows.length; windowIdx++) {
let window = windows[windowIdx];
let [width, height] = this._computeWindowSizeAndScale(window, 1);
row.fullHeight = Math.max(row.fullHeight, height);
// either new width is < idealWidth or new width is nearer from idealWidth then oldWidth
if (this._keepSameRow(row, window, width, idealRowWidth) || (i == numRows - 1)) {
row.windows.push(window);
row.fullWidth += width;
} else {
break;
}
}
}
let gridHeight = 0;
let maxRow;
for (let i = 0; i < numRows; i++) {
let row = rows[i];
if (!maxRow || row.fullWidth > maxRow.fullWidth)
maxRow = row;
gridHeight += row.fullHeight;
}
layout.rows = rows;
layout.maxColumns = maxRow.windows.length;
layout.gridWidth = maxRow.fullWidth;
layout.gridHeight = gridHeight;
}
});
const GridLayoutStrategy = new Lang.Class({
Name: 'GridLayoutStrategy',
Extends: LayoutStrategy,
_computeRowSizes: function(layout) {
let { rows: rows, scale: scale } = layout;
let gridWidth = layout.numColumns * layout.maxWindowWidth;
let hspacing = (layout.numColumns - 1) * this._columnSpacing;
for (let i = 0; i < rows.length; i++) {
let row = rows[i];
row.fullWidth = layout.gridWidth;
row.fullHeight = layout.maxWindowHeight;
row.width = row.fullWidth * scale + hspacing;
row.height = row.fullHeight * scale;
row.cellWidth = layout.maxWindowWidth * scale;
}
},
computeLayout: function(windows, layout) {
let { numRows: numRows, numColumns: numColumns } = layout;
let rows = [];
let windowIdx = 0;
let maxWindowWidth = 0;
let maxWindowHeight = 0;
for (let i = 0; i < numRows; i++) {
let row = this._newRow();
rows.push(row);
for (; windowIdx < windows.length; windowIdx++) {
if (row.windows.length >= numColumns)
break;
let window = windows[windowIdx];
row.windows.push(window);
let [width, height] = this._computeWindowSizeAndScale(window, 1);
maxWindowWidth = Math.max(maxWindowWidth, width);
maxWindowHeight = Math.max(maxWindowHeight, height);
}
}
layout.rows = rows;
layout.maxColumns = numColumns;
layout.gridWidth = numColumns * maxWindowWidth;
layout.gridHeight = numRows * maxWindowHeight;
layout.maxWindowWidth = maxWindowWidth;
layout.maxWindowHeight = maxWindowHeight;
}
});
/**
* @metaWorkspace: a #Meta.Workspace, or null
*/
@ -689,7 +978,7 @@ const Workspace = new Lang.Class({
// Without this the drop area will be overlapped.
this._windowOverlaysGroup.set_size(0, 0);
this.actor = new Clutter.Group();
this.actor = new St.Widget({ style_class: 'window-picker' });
this.actor.set_size(0, 0);
this._dropRect = new Clutter.Rectangle({ opacity: 0 });
@ -720,12 +1009,17 @@ const Workspace = new Lang.Class({
Lang.bind(this, this._windowRemoved));
}
this._windowEnteredMonitorId = global.screen.connect('window-entered-monitor',
Lang.bind(this, this._windowEnteredMonitor));
Lang.bind(this, this._windowEnteredMonitor));
this._windowLeftMonitorId = global.screen.connect('window-left-monitor',
Lang.bind(this, this._windowLeftMonitor));
Lang.bind(this, this._windowLeftMonitor));
this._repositionWindowsId = 0;
this.leavingOverview = false;
this._positionWindowsFlags = 0;
this._positionWindowsId = 0;
this._currentLayout = null;
},
setGeometry: function(x, y, width, height) {
@ -734,15 +1028,13 @@ const Workspace = new Lang.Class({
this._width = width;
this._height = height;
// This is sometimes called during allocation, so we do this later
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this,
function () {
this._dropRect.set_position(x, y);
this._dropRect.set_size(width, height);
this.positionWindows(WindowPositionFlags.ANIMATE);
return false;
}));
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
this._dropRect.set_position(x, y);
this._dropRect.set_size(width, height);
return false;
}));
this.positionWindows(WindowPositionFlags.ANIMATE);
},
_lookupIndex: function (metaWindow) {
@ -762,238 +1054,15 @@ const Workspace = new Lang.Class({
return this._windows.length == 0;
},
// Only use this for n <= 20 say
_factorial: function(n) {
let result = 1;
for (let i = 2; i <= n; i++)
result *= i;
return result;
},
/**
* _permutation:
* @permutationIndex: An integer from [0, list.length!)
* @list: (inout): Array of objects to permute; will be modified in place
*
* Given an integer between 0 and length of array, re-order the array in-place
* into a permutation denoted by the index.
*/
_permutation: function(permutationIndex, list) {
for (let j = 2; j <= list.length; j++) {
let firstIndex = (permutationIndex % j);
let secondIndex = j - 1;
// Swap
let tmp = list[firstIndex];
list[firstIndex] = list[secondIndex];
list[secondIndex] = tmp;
permutationIndex = Math.floor(permutationIndex / j);
}
},
/**
* _forEachPermutations:
* @list: Array
* @func: Function which takes a single array argument
*
* Call @func with each permutation of @list as an argument.
*/
_forEachPermutations: function(list, func) {
let nCombinations = this._factorial(list.length);
for (let i = 0; i < nCombinations; i++) {
let listCopy = list.concat();
this._permutation(i, listCopy);
func(listCopy);
}
},
/**
* _computeWindowMotion:
* @actor: A #WindowClone's #ClutterActor
* @slot: An element of #POSITIONS
* @slotGeometry: Layout of @slot
*
* Returns a number corresponding to how much perceived motion
* would be involved in moving the window to the given slot.
* Currently this is the square of the distance between the
* centers.
*/
_computeWindowMotion: function (actor, slot) {
let [xCenter, yCenter, fraction] = slot;
let xDelta, yDelta, distanceSquared;
let actorWidth, actorHeight;
let x = actor.x;
let y = actor.y;
let scale = actor.scale_x;
if (actor._delegate.inDrag) {
x = actor._delegate.dragOrigX;
y = actor._delegate.dragOrigY;
scale = actor._delegate.dragOrigScale;
}
actorWidth = actor.width * scale;
actorHeight = actor.height * scale;
xDelta = x + actorWidth / 2.0 - xCenter * this._width - this._x;
yDelta = y + actorHeight / 2.0 - yCenter * this._height - this._y;
distanceSquared = xDelta * xDelta + yDelta * yDelta;
return distanceSquared;
},
/**
* _orderWindowsPermutations:
*
* Iterate over all permutations of the windows, and determine the
* permutation which has the least total motion.
*/
_orderWindowsPermutations: function (clones, slots) {
let minimumMotionPermutation = null;
let minimumMotion = -1;
let permIndex = 0;
this._forEachPermutations(clones, Lang.bind(this, function (permutation) {
let motion = 0;
for (let i = 0; i < permutation.length; i++) {
let cloneActor = permutation[i].actor;
let slot = slots[i];
let delta = this._computeWindowMotion(cloneActor, slot);
motion += delta;
// Bail out early if we're already larger than the
// previous best
if (minimumMotionPermutation != null &&
motion > minimumMotion)
continue;
}
if (minimumMotionPermutation == null || motion < minimumMotion) {
minimumMotionPermutation = permutation;
minimumMotion = motion;
}
permIndex++;
}));
return minimumMotionPermutation;
},
/**
* _orderWindowsGreedy:
*
* Iterate over available slots in order, placing into each one the window
* we find with the smallest motion to that slot.
*/
_orderWindowsGreedy: function(clones, slots) {
let result = [];
let slotIndex = 0;
// Copy since we mutate below
let clonesCopy = clones.concat();
for (let i = 0; i < slots.length; i++) {
let slot = slots[i];
let minimumMotionIndex = -1;
let minimumMotion = -1;
for (let j = 0; j < clonesCopy.length; j++) {
let cloneActor = clonesCopy[j].actor;
let delta = this._computeWindowMotion(cloneActor, slot);
if (minimumMotionIndex == -1 || delta < minimumMotion) {
minimumMotionIndex = j;
minimumMotion = delta;
}
}
result.push(clonesCopy[minimumMotionIndex]);
clonesCopy.splice(minimumMotionIndex, 1);
}
return result;
},
/**
* _orderWindowsByMotionAndStartup:
* @windows: Array of #MetaWindow
* @slots: Array of slots
*
* Returns a copy of @windows, ordered in such a way that they require least motion
* to move to the final screen coordinates of @slots. Ties are broken in a stable
* fashion by the order in which the windows were created.
*/
_orderWindowsByMotionAndStartup: function(clones, slots) {
clones.sort(function(w1, w2) {
return w2.metaWindow.get_stable_sequence() - w1.metaWindow.get_stable_sequence();
});
if (clones.length <= POSITIONING_PERMUTATIONS_MAX)
return this._orderWindowsPermutations(clones, slots);
else
return this._orderWindowsGreedy(clones, slots);
},
/**
* _getSlotGeometry:
* @slot: A layout slot
*
* Returns: the screen-relative [x, y, width, height]
* of a given window layout slot.
*/
_getSlotGeometry: function(slot) {
let [xCenter, yCenter, fraction] = slot;
let width = this._width * fraction;
let height = this._height * fraction;
let x = this._x + xCenter * this._width - width / 2 ;
let y = this._y + yCenter * this._height - height / 2;
return [x, y, width, height];
},
/**
* _computeWindowLayout:
* @metaWindow: A #MetaWindow
* @slot: A layout slot
*
* Given a window and slot to fit it in, compute its
* screen-relative [x, y, scale] where scale applies
* to both X and Y directions.
*/
_computeWindowLayout: function(metaWindow, slot) {
let [x, y, width, height] = this._getSlotGeometry(slot);
let rect = metaWindow.get_outer_rect();
let buttonOuterHeight, captionHeight;
let buttonOuterWidth = 0;
if (this._windowOverlays[0]) {
[buttonOuterHeight, captionHeight] = this._windowOverlays[0].chromeHeights();
buttonOuterWidth = this._windowOverlays[0].chromeWidth();
} else
[buttonOuterHeight, captionHeight] = [0, 0];
let scale = Math.min((width - buttonOuterWidth) / rect.width,
(height - buttonOuterHeight - captionHeight) / rect.height,
WINDOW_CLONE_MAXIMUM_SCALE);
x = Math.floor(x + (width - scale * rect.width) / 2);
// We want to center the window in case we have just one
if (metaWindow.get_workspace().n_windows == 1)
y = Math.floor(y + (height - scale * rect.height) / 2);
else
y = Math.floor(y + height - rect.height * scale - captionHeight);
return [x, y, scale];
},
setReservedSlot: function(clone) {
if (this._reservedSlot == clone)
return;
if (clone && this.containsMetaWindow(clone.metaWindow)) {
this._reservedSlot = null;
this.positionWindows(WindowPositionFlags.ANIMATE);
return;
}
if (clone)
this._reservedSlot = clone;
else
this._reservedSlot = null;
if (clone && this.containsMetaWindow(clone.metaWindow))
clone = null;
this._reservedSlot = clone;
this._currentLayout = null;
this.positionWindows(WindowPositionFlags.ANIMATE);
},
@ -1003,13 +1072,32 @@ const Workspace = new Lang.Class({
* INITIAL - this is the initial positioning of the windows.
* ANIMATE - Indicates that we need animate changing position.
*/
positionWindows : function(flags) {
positionWindows: function(flags) {
this._positionWindowsFlags |= flags;
if (this._positionWindowsId > 0)
return;
this._positionWindowsId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
this._realPositionWindows(this._positionWindowsFlags);
this._positionWindowsFlags = 0;
this._positionWindowsId = 0;
return false;
}));
},
_realPositionWindows : function(flags) {
if (this._repositionWindowsId > 0) {
Mainloop.source_remove(this._repositionWindowsId);
this._repositionWindowsId = 0;
}
let clones = this._windows.slice();
clones.sort(function(a, b) {
return a.metaWindow.get_stable_sequence() - b.metaWindow.get_stable_sequence();
});
if (this._reservedSlot)
clones.push(this._reservedSlot);
@ -1017,8 +1105,7 @@ const Workspace = new Lang.Class({
let animate = flags & WindowPositionFlags.ANIMATE;
// Start the animations
let slots = this._computeAllWindowSlots(clones.length);
clones = this._orderWindowsByMotionAndStartup(clones, slots);
let slots = this._computeAllWindowSlots(clones);
let currentWorkspace = global.screen.get_active_workspace();
let isOnCurrentWorkspace = this.metaWorkspace == null || this.metaWorkspace == currentWorkspace;
@ -1035,33 +1122,36 @@ const Workspace = new Lang.Class({
if (clone.inDrag)
continue;
let [x, y, scale] = this._computeWindowLayout(metaWindow, slot);
let [x, y, scale] = slot;
if (overlay && initialPositioning)
overlay.hide();
if (animate && isOnCurrentWorkspace) {
if (!metaWindow.showing_on_its_workspace()) {
/* Hidden windows should fade in and grow
* therefore we need to resize them now so they
* can be scaled up later */
if (initialPositioning) {
clone.actor.opacity = 0;
clone.actor.scale_x = 0;
clone.actor.scale_y = 0;
clone.actor.x = x;
clone.actor.y = y;
}
if (initialPositioning) {
clone.actor.opacity = 0;
clone.actor.scale_x = 0;
clone.actor.scale_y = 0;
clone.actor.x = x;
clone.actor.y = y;
}
// Make the window slightly transparent to indicate it's hidden
Tweener.addTween(clone.actor,
{ opacity: 255,
time: Overview.ANIMATION_TIME,
transition: 'easeInQuad'
});
// Make the window slightly transparent to indicate it's hidden
Tweener.addTween(clone.actor,
{ opacity: 255,
time: Overview.ANIMATION_TIME,
transition: 'easeInQuad'
});
}
this._animateClone(clone, overlay, x, y, scale, initialPositioning);
} else {
// cancel any active tweens (otherwise they might override our changes)
Tweener.removeTweens(clone.actor);
clone.actor.set_position(x, y);
clone.actor.set_scale(scale, scale);
this._updateWindowOverlayPositions(clone, overlay, x, y, scale, false);
@ -1088,26 +1178,26 @@ const Workspace = new Lang.Class({
_animateClone: function(clone, overlay, x, y, scale, initialPositioning) {
Tweener.addTween(clone.actor,
{ x: x,
y: y,
scale_x: scale,
scale_y: scale,
time: Overview.ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() {
this._showWindowOverlay(clone, overlay, true);
})
});
{ x: x,
y: y,
scale_x: scale,
scale_y: scale,
time: Overview.ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() {
this._showWindowOverlay(clone, overlay, true);
})
});
this._updateWindowOverlayPositions(clone, overlay, x, y, scale, true);
},
_updateWindowOverlayPositions: function(clone, overlay, x, y, scale, animate) {
if (!overlay)
return;
let [cloneWidth, cloneHeight] = clone.actor.get_size();
cloneWidth = scale * cloneWidth;
cloneHeight = scale * cloneHeight;
if (overlay)
overlay.updatePositions(x, y, cloneWidth, cloneHeight, animate);
overlay.updatePositions(x, y, cloneWidth * scale, cloneHeight * scale, animate);
},
_showWindowOverlay: function(clone, overlay, fade) {
@ -1201,6 +1291,7 @@ const Workspace = new Lang.Class({
this._cursorX = x;
this._cursorY = y;
this._currentLayout = null;
this._repositionWindowsId = Mainloop.timeout_add(750,
Lang.bind(this, this._delayedWindowRepositioning));
},
@ -1253,6 +1344,7 @@ const Workspace = new Lang.Class({
clone.actor.set_position (this._x, this._y);
}
this._currentLayout = null;
this.positionWindows(WindowPositionFlags.ANIMATE);
},
@ -1290,6 +1382,8 @@ const Workspace = new Lang.Class({
// Animate the full-screen to Overview transition.
zoomToOverview : function() {
this._currentLayout = null;
// Position and scale the windows.
if (Main.overview.animationInProgress)
this.positionWindows(WindowPositionFlags.ANIMATE | WindowPositionFlags.INITIAL);
@ -1372,6 +1466,9 @@ const Workspace = new Lang.Class({
if (this._repositionWindowsId > 0)
Mainloop.source_remove(this._repositionWindowsId);
if (this._positionWindowsId > 0)
Meta.later_remove(this._positionWindowsId);
// Usually, the windows will be destroyed automatically with
// their parent (this.actor), but we might have a zoomed window
// which has been reparented to the stage - _windows[0] holds
@ -1451,29 +1548,108 @@ const Workspace = new Lang.Class({
}
},
_computeWindowSlot : function(windowIndex, numberOfWindows) {
if (numberOfWindows in POSITIONS)
return POSITIONS[numberOfWindows][windowIndex];
_isBetterLayout: function(oldLayout, newLayout) {
if (oldLayout.scale === undefined)
return true;
// If we don't have a predefined scheme for this window count,
// arrange the windows in a grid pattern.
let gridWidth = Math.ceil(Math.sqrt(numberOfWindows));
let gridHeight = Math.ceil(numberOfWindows / gridWidth);
let spacePower = (newLayout.space - oldLayout.space) * LAYOUT_SPACE_WEIGHT;
let scalePower = (newLayout.scale - oldLayout.scale) * LAYOUT_SCALE_WEIGHT;
let fraction = 0.95 * (1. / gridWidth);
let xCenter = (.5 / gridWidth) + ((windowIndex) % gridWidth) / gridWidth;
let yCenter = (.5 / gridHeight) + Math.floor((windowIndex / gridWidth)) / gridHeight;
return [xCenter, yCenter, fraction];
if (newLayout.scale > oldLayout.scale && newLayout.space > oldLayout.space) {
// Win win -- better scale and better space
return true;
} else if (newLayout.scale > oldLayout.scale && newLayout.space <= oldLayout.space) {
// Keep new layout only if scale gain outweights aspect space loss
return scalePower > spacePower;
} else if (newLayout.scale <= oldLayout.scale && newLayout.space > oldLayout.space) {
// Keep new layout only if aspect space gain outweights scale loss
return spacePower > scalePower;
} else {
// Lose -- worse scale and space
return false;
}
},
_computeAllWindowSlots: function(totalWindows) {
let slots = [];
for (let i = 0; i < totalWindows; i++) {
slots.push(this._computeWindowSlot(i, totalWindows));
_computeLayout: function(windows, area, rowSpacing, columnSpacing, bottomPadding) {
// We look for the largest scale that allows us to fit the
// largest row/tallest column on the workspace.
let lastLayout = {};
for (let numRows = 1; ; numRows++) {
let numColumns = Math.ceil(windows.length / numRows);
// If adding a new row does not change column count just stop
// (for instance: 9 windows, with 3 rows -> 3 columns, 4 rows ->
// 3 columns as well => just use 3 rows then)
if (numColumns == lastLayout.numColumns)
break;
let strategyClass = numRows > 2 ? GridLayoutStrategy : UnalignedLayoutStrategy;
let strategy = new strategyClass(this._monitor, rowSpacing, columnSpacing, bottomPadding);
let layout = { area: area, strategy: strategy, numRows: numRows, numColumns: numColumns };
strategy.computeLayout(windows, layout);
strategy.computeScaleAndSpace(layout);
if (!this._isBetterLayout(lastLayout, layout))
break;
lastLayout = layout;
}
return slots;
return lastLayout;
},
_rectEqual: function(one, two) {
if (one == two)
return true;
return (one.x == two.x &&
one.y == two.y &&
one.width == two.width &&
one.height == two.height);
},
_computeAllWindowSlots: function(windows) {
let totalWindows = windows.length;
let node = this.actor.get_theme_node();
// Window grid spacing
let columnSpacing = node.get_length('-horizontal-spacing');
let rowSpacing = node.get_length('-vertical-spacing');
if (!totalWindows)
return [];
let closeButtonHeight, captionHeight;
if (this._windowOverlays.length) {
// All of the overlays have the same chrome sizes,
// so just pick the first one.
let overlay = this._windowOverlays[0];
[closeButtonHeight, captionHeight] = overlay.chromeHeights();
} else {
[closeButtonHeight, captionHeight] = [0, 0];
}
rowSpacing += captionHeight;
let area = { x: this._x, y: this._y, width: this._width, height: this._height };
area.y += closeButtonHeight;
area.height -= closeButtonHeight;
if (!this._currentLayout)
this._currentLayout = this._computeLayout(windows, area, rowSpacing, columnSpacing, captionHeight);
let layout = this._currentLayout;
let strategy = layout.strategy;
if (!this._rectEqual(area, layout.area)) {
layout.area = area;
strategy.computeScaleAndSpace(layout);
}
return strategy.computeWindowSlots(layout, area);
},
_onCloneSelected : function (clone, time) {

View File

@ -620,9 +620,7 @@ const ThumbnailsBox = new Lang.Class({
if (!source.realWindow && !source.shellWorkspaceLaunch && source != Main.xdndHandler)
return DND.DragMotionResult.CONTINUE;
if (!Meta.prefs_get_dynamic_workspaces())
return DND.DragMotionResult.CONTINUE;
let canCreateWorkspaces = Meta.prefs_get_dynamic_workspaces();
let spacing = this.actor.get_theme_node().get_length('spacing');
this._dropWorkspace = -1;
@ -647,7 +645,7 @@ const ThumbnailsBox = new Lang.Class({
if (i == this._dropPlaceholderPos)
targetBottom += this._dropPlaceholder.get_height();
if (y > targetTop && y <= targetBottom && source != Main.xdndHandler) {
if (y > targetTop && y <= targetBottom && source != Main.xdndHandler && canCreateWorkspaces) {
placeholderPos = i;
break;
} else if (y > targetBottom && y <= nextTargetTop) {
@ -785,7 +783,7 @@ const ThumbnailsBox = new Lang.Class({
this._indicator.raise_top();
},
removeThumbmails: function(start, count) {
removeThumbnails: function(start, count) {
let currentPos = 0;
for (let k = 0; k < this._thumbnails.length; k++) {
let thumbnail = this._thumbnails[k];
@ -1045,9 +1043,16 @@ const ThumbnailsBox = new Lang.Class({
childBox.y2 = box.y2;
this._background.allocate(childBox, flags);
let indicatorY = this._indicatorY;
let indicatorY1 = this._indicatorY;
let indicatorY2;
// when not animating, the workspace position overrides this._indicatorY
let indicatorWorkspace = !this._animatingIndicator ? global.screen.get_active_workspace() : null;
let indicatorThemeNode = this._indicator.get_theme_node();
let indicatorTopFullBorder = indicatorThemeNode.get_padding(St.Side.TOP) + indicatorThemeNode.get_border_width(St.Side.TOP);
let indicatorBottomFullBorder = indicatorThemeNode.get_padding(St.Side.BOTTOM) + indicatorThemeNode.get_border_width(St.Side.BOTTOM);
let indicatorLeftFullBorder = indicatorThemeNode.get_padding(St.Side.LEFT) + indicatorThemeNode.get_border_width(St.Side.LEFT);
let indicatorRightFullBorder = indicatorThemeNode.get_padding(St.Side.RIGHT) + indicatorThemeNode.get_border_width(St.Side.RIGHT);
let y = contentBox.y1;
@ -1093,8 +1098,10 @@ const ThumbnailsBox = new Lang.Class({
let y2 = Math.round(y + thumbnailHeight);
let roundedVScale = (y2 - y1) / portholeHeight;
if (thumbnail.metaWorkspace == indicatorWorkspace)
indicatorY = y1;
if (thumbnail.metaWorkspace == indicatorWorkspace) {
indicatorY1 = y1;
indicatorY2 = y2;
}
// Allocating a scaled actor is funny - x1/y1 correspond to the origin
// of the actor, but x2/y2 are increased by the *unscaled* size.
@ -1119,8 +1126,10 @@ const ThumbnailsBox = new Lang.Class({
childBox.x1 = contentBox.x2 - thumbnailWidth;
childBox.x2 = contentBox.x2;
}
childBox.y1 = indicatorY;
childBox.y2 = childBox.y1 + thumbnailHeight;
childBox.x1 -= indicatorLeftFullBorder;
childBox.x2 += indicatorRightFullBorder;
childBox.y1 = indicatorY1 - indicatorTopFullBorder;
childBox.y2 = (indicatorY2 ? indicatorY2 : (indicatorY1 + thumbnailHeight)) + indicatorBottomFullBorder;
this._indicator.allocate(childBox, flags);
},
@ -1135,7 +1144,9 @@ const ThumbnailsBox = new Lang.Class({
}
this._animatingIndicator = true;
this.indicatorY = this._indicator.allocation.y1;
let indicatorThemeNode = this._indicator.get_theme_node();
let indicatorTopFullBorder = indicatorThemeNode.get_padding(St.Side.TOP) + indicatorThemeNode.get_border_width(St.Side.TOP);
this.indicatorY = this._indicator.allocation.y1 + indicatorTopFullBorder;
Tweener.addTween(this,
{ indicatorY: thumbnail.actor.allocation.y1,
time: WorkspacesView.WORKSPACE_SWITCH_TIME,

View File

@ -51,7 +51,6 @@ const WorkspacesView = new Lang.Class({
this._clipY = 0;
this._clipWidth = 0;
this._clipHeight = 0;
this._workspaceRatioSpacing = 0;
this._spacing = 0;
this._animating = false; // tweening
this._scrolling = false; // swipe-scrolling
@ -72,6 +71,7 @@ const WorkspacesView = new Lang.Class({
this._workspaces[w].actor.reparent(this.actor);
this._workspaces[activeWorkspaceIndex].actor.raise_top();
this._extraWorkspaces = [];
this._updateExtraWorkspaces();
// Position/scale the desktop windows and their children after the
@ -83,8 +83,6 @@ const WorkspacesView = new Lang.Class({
Lang.bind(this, function() {
for (let w = 0; w < this._workspaces.length; w++)
this._workspaces[w].zoomToOverview();
if (!this._extraWorkspaces)
return;
for (let w = 0; w < this._extraWorkspaces.length; w++)
this._extraWorkspaces[w].zoomToOverview();
}));
@ -124,7 +122,6 @@ const WorkspacesView = new Lang.Class({
if (!this._settings.get_boolean('workspaces-only-on-primary'))
return;
this._extraWorkspaces = [];
let monitors = Main.layoutManager.monitors;
for (let i = 0; i < monitors.length; i++) {
if (i == Main.layoutManager.primaryIndex)
@ -139,23 +136,20 @@ const WorkspacesView = new Lang.Class({
},
_destroyExtraWorkspaces: function() {
if (!this._extraWorkspaces)
return;
for (let m = 0; m < this._extraWorkspaces.length; m++)
this._extraWorkspaces[m].destroy();
this._extraWorkspaces = null;
this._extraWorkspaces = [];
},
setGeometry: function(x, y, width, height, spacing) {
setGeometry: function(x, y, width, height) {
if (this._x == x && this._y == y &&
this._width == width && this._height == height)
return;
this._width = width;
this._height = height;
this._x = x;
this._y = y;
this._workspaceRatioSpacing = spacing;
for (let i = 0; i < this._workspaces.length; i++)
this._workspaces[i].setGeometry(x, y, width, height);
@ -191,8 +185,6 @@ const WorkspacesView = new Lang.Class({
for (let w = 0; w < this._workspaces.length; w++)
this._workspaces[w].zoomFromOverview();
if (!this._extraWorkspaces)
return;
for (let w = 0; w < this._extraWorkspaces.length; w++)
this._extraWorkspaces[w].zoomFromOverview();
},
@ -204,8 +196,6 @@ const WorkspacesView = new Lang.Class({
syncStacking: function(stackIndices) {
for (let i = 0; i < this._workspaces.length; i++)
this._workspaces[i].syncStacking(stackIndices);
if (!this._extraWorkspaces)
return;
for (let i = 0; i < this._extraWorkspaces.length; i++)
this._extraWorkspaces[i].syncStacking(stackIndices);
},
@ -234,7 +224,7 @@ const WorkspacesView = new Lang.Class({
Tweener.removeTweens(workspace.actor);
let y = (w - active) * (this._height + this._spacing + this._workspaceRatioSpacing);
let y = (w - active) * (this._height + this._spacing);
if (showAnimation) {
let params = { y: y,
@ -317,8 +307,6 @@ const WorkspacesView = new Lang.Class({
this._updateWorkspaceActors(false);
}
this._scrollToActive(true);
},
_activeWorkspaceChanged: function(wm, from, to, direction) {
@ -378,9 +366,6 @@ const WorkspacesView = new Lang.Class({
this._firstDragMotion = false;
for (let i = 0; i < this._workspaces.length; i++)
this._workspaces[i].setReservedSlot(dragEvent.dragActor._delegate);
if (!this._extraWorkspaces)
return DND.DragMotionResult.CONTINUE;
for (let i = 0; i < this._extraWorkspaces.length; i++)
this._extraWorkspaces[i].setReservedSlot(dragEvent.dragActor._delegate);
}
@ -394,9 +379,6 @@ const WorkspacesView = new Lang.Class({
for (let i = 0; i < this._workspaces.length; i++)
this._workspaces[i].setReservedSlot(null);
if (!this._extraWorkspaces)
return;
for (let i = 0; i < this._extraWorkspaces.length; i++)
this._extraWorkspaces[i].setReservedSlot(null);
},
@ -543,6 +525,16 @@ const WorkspacesDisplay = new Lang.Class({
this._notifyOpacityId = 0;
this._swipeScrollBeginId = 0;
this._swipeScrollEndId = 0;
this._settings = new Gio.Settings({ schema: OVERRIDE_SCHEMA });
this._settings.connect('changed::dynamic-workspaces',
Lang.bind(this, this._updateSwitcherVisibility));
},
_updateSwitcherVisibility: function() {
this._thumbnailsBox.actor.visible =
this._settings.get_boolean('dynamic-workspaces') ||
global.screen.n_workspaces > 1;
},
show: function() {
@ -565,6 +557,7 @@ const WorkspacesDisplay = new Lang.Class({
this._controls.show();
this._thumbnailsBox.show();
this._updateSwitcherVisibility();
this._updateWorkspacesViews();
@ -866,24 +859,15 @@ const WorkspacesDisplay = new Lang.Class({
let rtl = (Clutter.get_default_text_direction () == Clutter.TextDirection.RTL);
let clipWidth = width - controlsVisible;
let clipHeight = (fullHeight / fullWidth) * clipWidth;
let clipHeight = fullHeight;
let clipX = rtl ? x + controlsVisible : x;
let clipY = y + (fullHeight - clipHeight) / 2;
if (this._zoomOut) {
width -= controlsNatural;
if (rtl)
x += controlsNatural;
} else {
width -= controlsVisible;
if (rtl)
x += controlsVisible;
}
height = (fullHeight / fullWidth) * width;
let difference = fullHeight - height;
y += difference / 2;
let widthAdjust = this._zoomOut ? controlsNatural : controlsVisible;
widthAdjust += Main.overview._spacing;
width -= widthAdjust;
if (rtl)
x += widthAdjust;
let monitors = Main.layoutManager.monitors;
let m = 0;
@ -891,8 +875,7 @@ const WorkspacesDisplay = new Lang.Class({
if (i == this._primaryIndex) {
this._workspacesViews[m].setClipRect(clipX, clipY,
clipWidth, clipHeight);
this._workspacesViews[m].setGeometry(x, y, width, height,
difference);
this._workspacesViews[m].setGeometry(x, y, width, height);
m++;
} else if (!this._workspacesOnlyOnPrimary) {
this._workspacesViews[m].setClipRect(monitors[i].x,
@ -902,7 +885,7 @@ const WorkspacesDisplay = new Lang.Class({
this._workspacesViews[m].setGeometry(monitors[i].x,
monitors[i].y,
monitors[i].width,
monitors[i].height, 0);
monitors[i].height);
m++;
}
}
@ -939,16 +922,17 @@ const WorkspacesDisplay = new Lang.Class({
let monitors = Main.layoutManager.monitors;
let m = 0;
for (let i = 0; i < monitors.length; i++) {
if (this._workspacesOnlyOnPrimaryChanged &&
if (this._workspacesOnlyOnPrimary &&
i != this._primaryIndex)
continue;
// Assume workspaces are only added at the end
for (let w = oldNumWorkspaces; w < newNumWorkspaces; w++) {
let metaWorkspace = global.screen.get_workspace_by_index(w);
this._workspaces[m++][w] =
this._workspaces[m][w] =
new Workspace.Workspace(metaWorkspace, i);
}
m++;
}
this._thumbnailsBox.addThumbnails(oldNumWorkspaces, newNumWorkspaces - oldNumWorkspaces);
@ -975,12 +959,13 @@ const WorkspacesDisplay = new Lang.Class({
}
}
this._thumbnailsBox.removeThumbmails(removedIndex, removedNum);
this._thumbnailsBox.removeThumbnails(removedIndex, removedNum);
}
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].updateWorkspaces(oldNumWorkspaces,
newNumWorkspaces);
this._updateSwitcherVisibility();
},
_updateZoom : function() {

View File

@ -1 +1,19 @@
dist_man_MANS = gnome-shell.1
XSLTPROC_FLAGS = \
--nonet \
--stringparam man.output.quietly 1 \
--stringparam funcsynopsis.style ansi \
--stringparam man.th.extra1.suppress 1 \
--stringparam man.authors.section.enabled 0 \
--stringparam man.copyright.section.enabled 0
.xml.1:
$(AM_V_GEN) $(XSLTPROC) $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
man_MANS = \
gnome-shell.1
xml_files = $(man_MANS:.1=.xml)
EXTRA_DIST = $(xml_files)
DISTCLEANFILES = $(man_MANS)

View File

@ -1,94 +0,0 @@
.\" Copyright (c) 2009, Marcelo Jorge Vieira (metal) <metal@alucinados.com>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
.\" Boston, MA 02111-1301 USA.
.TH GNOME-SHELL 1
.SH NAME
gnome-shell \- Graphical shell for the GNOME desktop
.SH SYNOPSIS
.B gnome-shell [options]
.SH DESCRIPTION
GNOME Shell provides core user interface functions for the GNOME 3
desktop, like switching to windows and launching applications. GNOME
Shell takes advantage of the capabilities of modern graphics hardware
and introduces innovative user interface concepts to provide a
visually attractive and easy to use experience.
.SH OPTIONS
.TP
.B \-\-replace
Replace the running window manager
.br
.TP
.B \-\-sm-disable
Disable connection to the session manager
.br
.TP
.B \-\-sm-client-id=ID
Specify session management ID
.br
.TP
.B \-\-sm-save-file=FILE
Initialize session from savefile
.br
.TP
.B \-\-screen=SCREEN
X screen to use
.br
.TP
.B \-d, \-\-display=DISPLAY
X display to use
.br
.TP
.B \-\-sync
Make X calls synchronous
.br
.TP
.B \-\-version
Print version and exit
.br
.TP
.B \-\-help
Display help and exit
.br
.SH BUGS
The bug tracker can be reached by visiting the website
\fIhttps://bugzilla.gnome.org/buglist.cgi?product=gnome-shell\fR
Before sending a bug report, please verify that you have the latest
version of gnome-shell. Many bugs (major and minor) are fixed at each
release, and if yours is out of date, the problem may already have
been solved.
.SH ADDITIONAL INFORMATION
For further information, visit the website \fIhttp://live.gnome.org/GnomeShell\fR

159
man/gnome-shell.xml Normal file
View File

@ -0,0 +1,159 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry id="gnome-shell">
<refentryinfo>
<title>gnome-shell</title>
<productname>gnome-shell</productname>
<authorgroup>
<author>
<contrib>wrote the original gnome-shell man page</contrib>
<firstname>Marcelo Jorge</firstname>
<surname>Vieira</surname>
<email>metal@alucinados.com</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>gnome-shell</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>gnome-shell</refname>
<refpurpose>Graphical shell for the GNOME desktop</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>gnome-shell <arg choice="opt" rep="repeat">OPTION</arg></command>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>GNOME shell provides core user
interface functions for the GNOME 3 desktop, like switching
to windows and launching applications. GNOME shell takes
advantage of the capabilities of modern graphics hardware
and introduces innovative user interface concepts to provide
a visually attractive and easy to use experience.</para>
<para>gnome-shell is a required component of
the GNOME desktop, i.e. it is listed in the
RequiredComponents field of
<filename>/usr/share/gnome-session/sessions/gnome.session</filename>.
It is started in the window manager phase of the session.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<variablelist>
<varlistentry>
<term><option>-r</option>, <option>--replace</option></term>
<listitem><para>Replace the running window manager</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--sm-disable</option></term>
<listitem><para>Disable connection to the session manager</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--sm-client-id=<replaceable>ID</replaceable></option></term>
<listitem><para>Specify session management <replaceable>ID</replaceable></para></listitem>
</varlistentry>
<varlistentry>
<term><option>--sm-save-file=<replaceable>FILE</replaceable></option></term>
<listitem><para>Initialize session from <replaceable>FILE</replaceable></para></listitem>
</varlistentry>
<varlistentry>
<term><option>--screen=<replaceable>SCREEN</replaceable></option></term>
<listitem><para>X screen to use</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option>, <option>--display=<replaceable>DISPLAY</replaceable></option></term>
<listitem><para>X Display to use</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--sync</option></term>
<listitem><para>Make X calls synchronous</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--version</option></term>
<listitem><para>Print version and exit</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--help</option></term>
<listitem><para>Display help and exit</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--mode=<replaceable>MODE</replaceable></option></term>
<listitem><para>Use a specific mode, e.g. "gdm" for login screen</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--list-modes</option></term>
<listitem><para>List possible modes and exit</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Files</title>
<para>
<filename>/usr/share/gnome-session/sessions/gnome.session</filename>,
<filename>/usr/share/applications/gnome-shell.desktop</filename>.</para>
</refsect1>
<refsect1>
<title>Bugs</title>
<para>The bug tracker can be reached by visiting the
website <ulink url="https://bugzilla.gnome.org/buglist.cgi?product=gnome-shell">https://bugzilla.gnome.org/buglist.cgi?product=gnome-shell</ulink>.
Before sending a bug report, please verify that you have
the latest version of gnome-shell. Many bugs (major and
minor) are fixed at each release, and if yours is out of
date, the problem may already have been solved.</para>
</refsect1>
<refsect1>
<title>Additional Information</title>
<para>For further information, visit the website
<ulink url="http://live.gnome.org/GnomeShell">http://live.gnome.org/GnomeShell</ulink>.</para>
</refsect1>
</refentry>

Some files were not shown because too many files have changed in this diff Show More