Compare commits

..

116 Commits

Author SHA1 Message Date
f0cf611e1b shell: Update to MetaCursorTracker API change
The pointer coordinates in meta_cursor_tracker_get_pointer() are now
returned as a graphene_point_t.
2020-08-13 19:49:11 +00:00
beddbc0583 st/test-theme: Use stage from mutter
Clutter application style stages not supported anymore.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1359
2020-08-13 12:46:22 +00:00
2f840174cb Updated Spanish translation 2020-08-13 10:41:32 +02:00
015559a207 Updated Spanish translation 2020-08-13 10:33:26 +02:00
98d6c4e8dd Update Catalan translation 2020-08-13 09:26:56 +02:00
1675b54738 Updated Galician translations 2020-08-13 01:40:06 +02:00
44cbd1e718 libcroco: Limit recursion in block and any productions (CVE-2020-12825)
If we don't have any limits, we can recurse forever and overflow the
stack.

This is per https://gitlab.gnome.org/Archive/libcroco/-/issues/8

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1404
2020-08-12 15:06:27 -05:00
0dc1e1e99a perf: Add basic run tests
While the performance framework was originally written to collect
performance metrics, driving the shell by an automated script is
also useful to ensure that basic functionality is working.

Add such a basic test, initially checking top bar menus, notifications
and the overview.

Eventually it would be nice to separate the automatic scripting from
gathering performance metrics, but IMHO that can wait until we switch
from gjs' custom imports system to ES modules.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1396
2020-08-12 15:43:39 +00:00
1029e683d3 perf-tool: Expose --x11 option
Running with the X11 backend is no longer as easy as not specifying
wayland, so expose mutter's --x11 option to allow enforcing the X11
backend for testing.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1396
2020-08-12 15:43:38 +00:00
cf1d09b482 environment: Mark transitions as "work"
global.run_at_leisure() is used from automated scripts to schedule
a callback when the shell is idle. However since we moved away from
Tweener, animations are no longer taken into account; fix this by
marking transitions as "work" if the convenience ease() functions
are used.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1396
2020-08-12 15:43:38 +00:00
a436226266 scripting: Switch to standard async/await pattern
The original scripting framework was based on SpiderMonkey's
pre-standard generators, and was simply translated to the
corresponding standard syntax when updating it to work with
recent JS versions.

We can do even better by using the standard async/await pattern
instead of generators/yield.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1396
2020-08-12 15:43:38 +00:00
33ff3dc44f Bump version to 3.37.90
Update NEWS.
2020-08-11 17:41:51 +02:00
2e77ed712c Update Basque translation 2020-08-11 14:01:34 +00:00
9d6ccb6072 dbusServices/screencast: Quote filename in pipeline
Otherwise Gst fails to parse the pipeline string if the filename
contains spaces, as all words following the first are interpreted
as additional Gst elements.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1403
2020-08-11 11:50:44 +00:00
5091eab280 Update Ukrainian translation 2020-08-11 06:24:22 +00:00
6d38bc69ca endSessionDialog: default to not installing updates on low battery
If the user's battery power is low, we should not check the checkbox to
install updates by default. Rationale: if the user's battery is not low,
it's very unlikely to run out during a normal system upgrade. Low
battery is defined as any level below 30%, matching our battery status
indicator.

We'll also change the battery warning to only display when battery is
actually low. However, we will still always warn on battery for full
system upgrades, since these are expected to take a long time.

Future improvement: it would be nice to make the checkbox insensitive
when on low power. However, I don't think we currently have a proper
style for insensitive checkboxes. I was unable to make it look good.

Lastly, note that I did not test this on a laptop. I tested this by
mocking the return values of _isDischargingBattery() and
_isBatteryLow().

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2717
2020-08-10 23:55:14 +00:00
adc8b1ba89 Update Turkish translation 2020-08-10 22:14:14 +00:00
38777b41a5 Update Ukrainian translation 2020-08-10 18:08:16 +00:00
263320696e status/system: Add separate 'Restart' item
A side effect of removing the action buttons in favor of a regular
submenu is that we are a lot less constrained by size. So instead
of lumping "Restart" in with "Power Off", make it a separate menu
item.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
e6153bb578 status/system: Swap power- and user-related items in session menu
Quoting Allan:
"It's been niggling me that log out is closest to hand,
as opposed to suspend"

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
c723a1b72a status/system: Use new indentation style
... before moving stuff around.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
0b56416d30 sytemActions: Add separate 'restart' action
In order to split restart and power-off in the system menu, we need
to separate the underlying actions as well.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
0c5716b018 systemActions: Reindent properties
... so we can add another property using the new coding style
without making surrounding code terribly inconsistent.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
1fa1333e13 endSessionDialog: Remove "Restart" option from shutdown dialog
Restart will be exposed as a separate action instead of being part
of the shutdown dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
6edd3c4b93 endSessionDialog: Support updates in restart dialog
We will split off restart from the existing shutdown dialog, and
instead offer it as a separate menu item in the session submenu.
But before doing that, make sure that the existing restart dialog
exposes the same feature set as power off.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
72a8522a10 endSessionDialog: Reindent dialog configs
We are about to make some changes, so make them conform to the
new indentation style first.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202
2020-08-10 15:36:26 +00:00
b91903555a Update Brazilian Portuguese translation 2020-08-10 11:53:38 +00:00
6b78f58a75 keyboard: Fix missing icons in Keypad
This is more fallout from commit 57669bca1b.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3007
2020-08-09 15:59:34 +02:00
e62c0757c3 Update Ukrainian translation 2020-08-08 14:57:38 +00:00
9168f6055e St Documentation: add and improve documentation for public classes
Much of St is undocumented, aside from input/output arguments. This is
no doubt because a lot of it parallels Gtk closely, but is worth
improving since many new programmers are not familiar with Gtk.

closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2983
2020-08-08 11:26:41 +00:00
8993de76f0 ci: Remove pot file test
A recent Docker image update broke the test, as xgettext now prints
the following warning:

warning: a fallback ITS rule file '/usr/share/gettext-0.21/its/metainfo.its'
is used; it may not be in sync with the upstream

That is completely unrelated to what the test is meant to catch and
could be fixed by adding appstream to the image, but considering that

 - the test didn't actually catch the last template string regression
 - we no longer allow template strings in files that include translatable
   strings (and enforce that with a CI job)
 - as of gettext 0.20.2, the template handling really really is fixed
   (we'll see)

let's remove the test rather than piling up more stuff in the container
image.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1399
2020-08-07 21:52:00 +02:00
01fedeed8f Update Turkish translation 2020-08-07 14:35:48 +00:00
757e4b6731 shell-screenshot: Change to use clutter_stage_paint_to*() API
This eliminates the need to wait for redraws, drawing cursors, and
stiching together cairo images in case the screenshot covers multiple
monitors.

All of that is now handled by mutter itself.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1383
2020-08-06 16:26:59 +00:00
c2b70101f2 endSessionDialog: Support rebooting into the bootloader menu aka ("Boot Options")
This implements the "Alt" behavior for the "Reboot" button as outlined in
the design here: https://wiki.gnome.org/Design/OS/BootOptions

Note I've tried implemeting this with the AltSwitcher class from
js/ui/status/system.js first, but that puts the button in a St.Bin()
which causes the button to think it is the only button on the dialog
and makes it have rounded corners on both of its bottom corners.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/199
2020-08-06 15:14:45 +02:00
9d4a3a614d endSessionDialog: Immediately add buttons to the dialog
Immediately add buttons to the dialog instead of first building an
array of button-info structs.

This is a preparation patch for adding support changing the "Reboot"
button into a "Boot Options" button when Alt is pressed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/199
2020-08-06 15:14:45 +02:00
2af7264cff LoginManager: Add canRebootToBootLoaderMenu and setRebootToBootLoaderMenu methods
Add wrappers for the new logind Manager CanRebootToBootLoaderMenu and
SetRebootToBootLoaderMenu dbus methods.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/199
2020-08-06 15:14:42 +02:00
a96c8d91b5 ci: Explicitly specify job dependencies
We can speed up CI a bit by allowing build jobs to run in parallel
with review jobs, and don't have test jobs wait for the flatpak build.

See https://gitlab.gnome.org/help/ci/yaml/README.md#needs for details.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1391
2020-08-04 14:12:11 +00:00
3541a57570 cleanup: remove controversial naming
Replace "whitelist" and "blacklist" with "allow" and "deny" in variable
naming, which better represents the purpose of those variables.

There is no functional change.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1393
2020-08-04 13:24:50 +02:00
18155fc6ea st/private: Multiply position in fb coordinates with resource scale
The framebuffer we use for rendering shadows is scaled by the resource
scale, that means we also need to offset coordinates when translating
them to the framebuffers coordinate system.

So far we forgot to do that when translating the framebuffer using the
position of the actor, which lead to small rendering bugs of
text-shadows for actors allocated at non-zero origins. To fix that,
simply multiply those positions with the actors resource scale.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1390
2020-08-03 21:57:50 +00:00
b83c93ad62 appDisplay: Return false in acceptDrop when not accepting the drop
Fix what is probably a copy-paste error and return false instead of a
CONTINUE DragMotionResult which is only meant for dragMotion events, not
drop events. This makes sure we don't create a folder when dropping an
app over the drag leeways of another icon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1389
2020-08-03 21:48:44 +00:00
d0dab5a6d1 style: Swap text-align in RTL locales
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3037
2020-08-03 16:26:37 +00:00
c9708b140c status/network: Use D-Bus to launch Settings panels
For more obscure network configurations, we need to launch the
corresponding Settings panel with additional parameters, so we
cannot simply launch the .desktop file.

However we can do better than spawning a command line: Control center
exposes an application action we can use instead, so the process is
launched with the appropriate activation environment and startup
notification support.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1385
2020-08-03 16:17:40 +00:00
dd846f1ba2 rfkill: Always sync state on construction
This fixes an issue where the indicator can be out of sync until the
RfkillManager (used by it) properties change.

The problem is that multiple instances of the indicator will use
the same RfkillManager instance (getRfkillManager() returns a singleton)
that only guarantees to emit the changed signal in two scenarios:
when the D-Bus proxy connects and when the proxy properties change.

If by the time an indicator is instantiated the RfkillManager's D-Bus
proxy is already connected, that indicator would only sync its state
when the RfkillManager properties change.

Let's fix that by always syncing the state on construction - in the worst
case scenario the RfkillManager's D-Bus proxy won't have connected yet
and the indicator state will be temporarily out of sync but once it gets
connected the indicator will sync again with the correct state.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1386
2020-08-02 19:57:11 +00:00
ec3653240a Update POTFILES.skip
It silences false positives on https://l10n.gnome.org/module/gnome-shell/

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1387
2020-08-01 14:33:13 +02:00
b689b35b7d data: Place the shell into session.slice when using systemd
This way we conform more to https://systemd.io/DESKTOP_ENVIRONMENTS

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/895
2020-07-31 13:53:31 +00:00
01a927f388 windowManager: Wait for X11 services using systemd
To do this, we now wait for the start/stop job to complete. We also have
two targets in gnome-session to ensure that everything is working as
expected.

In order to start the services, we simply request the
gnome-session-x11-services-ready.target unit, and wait for it to become
available. To stop, we use the gnome-session-x11-services.target unit
which should stop all services in a way that is entirely race free.

This requires both gnome-session and gnome-settings-daemon changes to
work (which are in the corresponding merge requests).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/895
2020-07-31 13:53:31 +00:00
41d5b1455f data: Create generic org.gnome.Shell.target
Move the GNOME shell service file adapation for x11/wayland into the
target/service files. This means that the session definition can simply
pull in org.gnome.Shell.target, without having to care about whether it
is starting an X11 or wayland session.

Note that this currently requires fork'ing to do the test. This will
however not be needed in the long term when ConditionEnvironment becomes
available (see https://github.com/systemd/systemd/pull/15817).

We technically do not need to use template units. But doing so means
that the unit can be translated to the app id more easily (though it is
not yet completely clear how this should look like in the long term).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/895
2020-07-31 13:53:31 +00:00
b710c6e275 data: Remove unused, commented and obsolete Conflicts lines
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/895
2020-07-31 13:53:31 +00:00
4c9f42eea9 data: Use org.gnome.Shell prefix for systemd units
In general we want to move towards using reverse domain names for
systemd units. Doing this also means we have a consistent name between
desktop file and systemd unit, allowing us to create a generator that
pulls in the unit as defined in the sessions RequiredComponents.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/895
2020-07-31 13:53:31 +00:00
2b0731ab81 Move screencasting into a separate service process
Move the screencasting into a separate D-Bus service process, using
PipeWire instead of Clutter API. The service is implemented in
Javascript using the dbusService.js helper, and implements the same API
as was done by screencast.js and the corresponding C code.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1372
2020-07-31 10:51:12 +02:00
a9b803f075 introspect: Introspect screen size
To be used by the screen cast service.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1372
2020-07-31 10:51:12 +02:00
73436b5276 dbusService: Queue shutdown check on startup
If something started the service, but crashed before managing to make a
method call, we'd end up with the service running indefinitely. Fix this
by queueing a shutdown check immediately on startup.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1372
2020-07-31 10:51:12 +02:00
20dcc8aa87 status/remote-access: Visualize recordings as screen recording
If a remote access is marked as a recording, visualize it the same way
as a built in recording. Also don't stop it if there is an actual screen
sharing going on, so that one can use a plain "recording" while still
disabling what is an actual screen sharing.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1372
2020-07-31 10:51:12 +02:00
fdac0602db background: Mark pattern backgrounds as loaded
Otherwise we don't let GNOME Shell startup to proceed. Noticed
by accidentally running on the memory GSettings backend.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1381
2020-07-30 11:48:13 +02:00
e5272c84d7 Update Turkish translation 2020-07-29 21:57:19 +00:00
1812db7aa8 panelMenu: Destroy menu before chaining up
This avoid some (harmless but annoying) warnings, and is closer to
the original code prior to commit fc342fe8c5 and 557b232c89.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3022
2020-07-29 19:40:54 +00:00
260405a49e popupMenu: Ungrab when removing active menu
While we do have some handling for removing the active menu, it has
been a no-op for years. The bit that we really care about from the
PopupMenuManager's point of view is the existing grab though. Drop
that instead of calling _closeMenu() directly; ungrabbing will still
call the method indirectly, and it will still be a no-op :-)

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3022
2020-07-29 19:40:54 +00:00
71d37bffdf util: Remove shell_util_get_transformed_allocation
This helper function could be replaced with the new
clutter_actor_get_transformed_extents, that does the same.

See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1386

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1380
2020-07-29 18:09:53 +02:00
95436a08b5 Updated Spanish translation 2020-07-29 12:42:11 +02:00
13137aad9d loginDialog: Reset auth prompt on vt switch before fade in
At the moment, if a user switches to the login screen vt,
the login screen fades in whatever was on screen prior, and
then does a reset.

It makes more sense to reset first, so we fade in what the
user is going to interact with instead of what they interacted
with before.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2997
2020-07-27 16:18:44 -04:00
71f55643b2 layout: Only show ripple animation when overview was toggled
On X11, clients can grab keyboard on pointer (for example for popup
menus), and as a result the pushModal() call when opening the overview
fails.

However when the hot corner was used to toggle the overview, we still
show the ripple animation in that case, which is confusing as the action
did not actually happen.

Fix this by only showing the ripples if the overview is animating after
calling toggle(), as that should be a reliable indication of whether
the call was successful.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3005
2020-07-27 13:13:14 +00:00
5c550daecb backgroundManager: Always emit 'loaded' signal
As backgrounds are cached, it is possible that we never emit the
'loaded' signal added in commit f386103bc1. We are relying on the
signal though, so do the same as Background and emit the signal
from an idle if the background was already loaded.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1371
2020-07-22 11:02:24 +00:00
4e0492c517 Update Catalan translation 2020-07-22 08:47:17 +02:00
f386103bc1 Delay login animation until after wallpaper has loaded
Currently, the login animation can occur before the user's wallpaper has
been loaded. When this happens, we wind up displaying a solid blue
background for half a second or so before the proper background is
displayed. This looks jarring and bad. It's great that we can start
GNOME quickly, but starting up before the wallpaper is ready is *too*
quickly.

I've been meaning to fix this since 2014. Better late than never! We can
just have BackgroundManager emit a loaded signal the first time it loads
its first background, and have the startup animation code wait for that
before proceeding.

Some of this code is by Florian, who helped with promisifying. Thanks!

https://bugzilla.gnome.org/show_bug.cgi?id=734996
2020-07-21 20:25:31 -05:00
26e66aa4fd popupMenu: Handle keypress if numlock is enabled
On Wayland, navigating menus with the keyboard would not open drop-down
menus when NumLock is enabled.

That's old issue (gnome-shell#550) that was not completely fixed with
commit 88556226 because the lock mask needs to be filtered out in
_onKeyPress() as well.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/550
2020-07-21 16:38:15 +02:00
4420f52080 Update Romanian translation 2020-07-21 07:08:22 +00:00
b4082063de Update Ukrainian translation 2020-07-21 05:43:54 +00:00
bde974087a appDisplay: Append new icons at the first available page after first
As per design discussion, the first page is a somewhat of a special
page where we really don't want to change anything unless necessary.

Append new icons at the first available slot after the first page.
Make the placeholder icon be appended to the first available page
as well, since it's always used when dragging from folder dialogs.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
d93b51e135 appDisplay: Use a drag monitor to check for out-of-dialog drags
When the app folder dialog handles a drag hover, it starts a timeout
to popdown if dragging outside the "real" dialog area. However, when
dragging inside it, BaseAppView handles all drag hover events which
would disarm the popdown timeout. In cases like this, it's almost
impossible to prevent the timeout from triggering, which always pops
down the dialog.

Add a drag monitor when handling any drag hover (which only happens
when dragging outside the folder's icon grid); and eventually disarm
the popdown timeout from the monitor's motion event. Remove the drag
monitor when dragging over the folder dialog again.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
730a68dffc appDisplay: Increase folder dialog popdown timeout
App folders are now customizable, and the way to move icons to
another page is by throwing the cursor to either the left or
the right of the grid.

However, doing that triggers the popdown timeout, wich is 600ms
as of now, which is considerably short for such interaction.

Increase this timeout to 1.5 seconds.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
f06c257952 appDisplay: Allow reordering folders
Implement the methods to sort and query item positions
using the index in the GSettings key, and store the
updated positions when accepting the drop.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
7afab2c28c appDisplay: Factor out folder loading code
We'll reuse this code to implement custom positioning in
folders.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
16a18f2ae7 appDisplay: Only handle DnD when mapped
Now that the DnD code is shared between AppDisplay and
FolderView, we hit an unexpected problem: FolderView is
handling drag events even when the folder dialog is hidden.
As a side effect, this spams the journal with warnings.

Only handle drag events when mapped. On unmap, disable
the view's drag monitor, and disconnect from all drag
events.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
704e08dc08 appDisplay: Move DnD code to BaseAppView
This code will be shared with FolderView in the next commit, so
avoid duplication already and move the to-be-shared code into the
base class.

Because BaseAppView can handle vertical and horizontal orientations,
adapt the drag overshoot code to also handle horizontal overshoot.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
60311aa4d1 appDisplay: Fully hide icon when dragging
The partially visible icon causes more problems than
it solves, visually speaking. Fade it out completely
while dragging.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
cceb74706a appDisplay: Ensure icons always are at the correct position
When redisplaying, we currently only remove and add icons, but
never adjust the position of already added icons. If the icon
position changed, it wouldn't be reflected on the icon grid.

Make sure to move already added icons.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
578ae29ed2 appDisplay: Add placeholder when moving from folder dialog
When moving an icon from a folder dialog, the app grid doesn't
really have an icon to move around.

Add a placeholder icon and hijack it in the various places.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
701d110493 appDisplay: Restore dragged item's position on drag cancel
Otherwise we end up with the grid in an inconsistent state.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
d1cbf6c7a9 appDisplay: Allow overshooting any icon
Now that the icon being dragged can come from AppDisplay and also
a folder dialog, the check for when to overshoot is broken. Check
if the icon is a BaseAppView icon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
b64ce217e4 appDisplay: Create app folder where the drop happened
Create the app folder where the icon we drop at is located. This
ensures the folder icon doesn't go into the last page, hidden and
solitary.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
783dbe2aa9 appDisplay: Don't resort folders when name changes
With a customizable app grid, we don't want folders to move
after renaming. Their position is fixed.

Remove the sort-after-rename code from AppDisplay.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
f4ce1cf462 appDisplay: Make FolderIcon draggable
By making it a subclass of AppViewItem, it automagically inherits
the DnD code.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
d04d6e069d appDisplay: Check 'app-picker-layout' to make icons draggable
Now we drag not only to the Dash, but also to the icon grid itself,
so make the app icon draggable only when either one or the other is
writable.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
40de201056 appDisplay: Factor out draggable code into AppViewItem
This will be shared by the FolderIcon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
18234ea91a appDisplay: Use custom function to retrieve item page and position
It is important that '_loadApps()' return a sorted list -- adding the
same icons at the same positions but in different orders results in
a wrong icon grid.

Add support for using a custom positioning function, and implement it
in AppDisplay. Because FolderView doesn't implement a custom sorting
function, the items are still sorted alphabetically.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
e3f3297cba appDisplay: Save pages after dropping
Save the icon grid layout after dropping, and only in
that moment.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
e1ea1d2954 appDisplay: Introduce PageManager
The PageManager does the heavy lifting between reading the
'app-picker-layout' GSettings key, and saving the new pages.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
8e23ff8111 gschema: Introduce the 'app-picker-layout' key
This is the key that will be used to store the pages and the icons in
each page. The idea is that we we store an a{sv} variant for each page.
This variant will contain <icon id> → array of properties, where we
can store arbitrary data for each icon. The expected output of this
key is:

[
  {
    'polari.desktop': <{ 'position': 0 }>,
    'epiphany.deskop': <{ 'position': 1 }>,
  },
  {
    'telegram.desktop': <{ 'position': 2 }>,
    'builder.desktop': <{ 'position': 0 }>,
    'gitg.desktop': <{ 'position': 1 }>,
  }
]

The toplevel array is sorted, and pages of the grid always show in the
order they are stored.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:20 +00:00
8a50a8e64c appDisplay: Allow incomplete pages
Allow incomplete pages in the main grid, but not on folders.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
fae207811a appDisplay: Move icons when hovering the grid
Implement a minimal version of the reflow-on-hover behavior,
which gives a better sense of physicality to the grid.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
1d86424942 appDisplay: Factor out item addition and removal methods
It'll be useful later.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
2bc8175219 appDisplay: Accept dropping any kind of icon over it
The grid will be able to handle them. As of now, it doesn't
do anything with folder icons, or icons in folders.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
1e31caf0b8 appDisplay: Introduce moveItem API
This is a simplistic API that basically removes the
icon from it's old location, and adds it to its new
location.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
8e24ac6b26 appDisplay: Ignore dragging over leeways
The leeways are parts of the icon that ignore incoming drag
events. This is how IconGrid and IconGridLayout treat it, and
this is how the icons should treat themselves too.

Make AppIcon ignore dragging over the left and right leeways.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
427b9ac75f iconGrid: Add drop target API
Add a new drop target API. The bulk of it is implemented by
IconGridLayout, since it's the layout manager that knows where
each icon is placed at.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
2020-07-20 16:13:19 +00:00
f50205e9b4 calendar-server: Remove delay before event emission
The timeout seems to have been carried over from the old code that
relied on gnome-shell calling 'GetEvents' after every 'Changed' signal
where it was used to throttle the signal. In the new code where
calendar-server is sending the changes themselves via signals this is no
longer necessary and actually causes a delay when switching between
months.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2992
2020-07-20 13:50:21 +02:00
168cfdd86b keyboard: Fix missing key icons in numeric level
Those were missed in commit 57669bca1b.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2631
2020-07-20 01:24:16 +02:00
d339c94c18 keyboard: Move named icons into subdirectories
While GtkIconTheme does look up icons in the toplevel icons resource
path, it will only use them as ultimate fallback. That is, if the
icon theme (or the hicolor fallback) include a "keyboard" icon, it
will be used over the "keyboard-enter-symbolic" icon in the resource.

Moving the icons to appropriate subdirectories gives them higher
priority than the fallback names, and thus fixes the issue.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2631
2020-07-20 01:08:25 +02:00
97509bf1d2 Update Brazilian Portuguese translation 2020-07-19 12:54:47 +00:00
4a9c2ee805 Update Brazilian Portuguese translation
(cherry picked from commit 222919cfc1)
2020-07-18 13:44:05 +00:00
51e1e6d15c Update Brazilian Portuguese translation
(cherry picked from commit db30fbe3e9)
2020-07-17 21:36:25 +00:00
f0d2509dc3 extensionDownloader: Fix check for updates with several extensions
When having several extensions installed checking for updates fails.
This is because we are using GET and query params and since we are
sending all the metadata of the extension the server returns 502
when the URL is too long. This error code is ignored safely.

It is only needed to send the version of the extension to check if it
has updates.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2962
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1363
2020-07-15 18:26:11 -06:00
95bb194356 layout: Remove redundant background refresh
When using the NVIDIA driver, textures tend to loose their pixels when
suspending. In the past we handled this by figuring out when the NVIDIA
driver was used, and reload the background whenever we noticed we
resumed from suspend.

This shouldn't be needed anymore after
https://gitlab.gnome.org/GNOME/mutter/merge_requests/600, as it should
handle this by listening to video-memory-purged signal. Thus remove our
special handling here.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1358
2020-07-14 23:14:39 +00:00
de8b43a45d Update Greek translation 2020-07-14 20:43:58 +00:00
82be010fd8 workspace: Always set state at the end of overview transition
We don't change to the zoomed out state when fading to the overview,
however we should do that after the transition in case the user
switches to the window picker.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2969
2020-07-13 17:24:43 +00:00
2a0c116757 workspace: Reset window opacity after overview transitions
When using the fade animation when transitioning to the overview instead
of zoom, we fade out all window previews to fully transparent. But after
commit 751189253a removed the old _updateWindowPositions() function,
nothing resets the opacity again, so when switching from the app- to the
window picker, all previews are hidden.

Fix this by always resetting the window preview opacity after showing
or hiding the overview.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2969
2020-07-13 17:24:43 +00:00
6cdaec4001 workspace: Always use floating layout for fade transition
We don't animate size and position when fading, so we want all previews
to already be at their final position. However when the app picker is
opened from within the overview, window previews use the zoomed layout,
so that's the state we are then fading when leaving the overview from
the app picker.

Fix that by setting the correct state at the start of the fade transition.

(In the case of fadeToOverview(), the value should always be correct
already, but set it anyway for symmetry with fadeFromOverview())

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2969
2020-07-13 17:24:43 +00:00
ed4baec40f workspacesView: Really don't animate primary view when fading
In commit 9297d87775 we stopped syncing the primary view's actual
geometry at the start of the transition when doing a fade animation,
however the view animation may still be triggered by an allocation
change.

Prevent those unwanted size changes during fade by keeping track of
the fade state and explicitly skip syncing the geometry while a fade
is ongoing.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2969
2020-07-13 17:24:43 +00:00
9e8883c922 workspacesView: Do not skip entire overview transition
Since commit af543daf1c, we skip the overview transition when the
actual geometry hasn't been set yet. However with the new layout
manager, the only bit that still needs the separate geometry is
the transition of the view, the workspaces can do their transition
just fine.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2969
2020-07-13 17:24:42 +00:00
9bb64da895 Update Friulian translation 2020-07-12 16:08:10 +00:00
049f348e25 Update Chinese (China) translation 2020-07-12 02:35:34 +00:00
be190cc4d9 Update Chinese (China) translation 2020-07-12 02:14:16 +00:00
0893789b34 workspacesView: Update visibily when gesture drag begins
When dragging the workspaces through the swipe gesture, all
workspaces must be visible. WorkspacesView's _updateVisibility()
method special-cases this and ensures that.

However, this method is only called when (1) going to the active
workspace, and (2) when the gesture ends. That means, if there
is any workspace hidden by the time a gesture starts, it is never
shown!

Call _updateVisibility() on startTouchGesture() as well.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2969

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1360
2020-07-10 11:14:12 -03:00
7b5c6b657a Update German translation 2020-07-09 20:29:47 +00:00
9363fd3524 workspaceSwitcherPopup: Set offscreen redirect always
Because for most frames during a workspace switch it's not changing and
we can repaint it faster if it's cached on the GPU as a single texture.

This seems to reduce the render time for workspace switching by more
than 20%.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1356
2020-07-09 11:49:59 +08:00
0ad242a81e shell/window-tracker: Tighten sandbox ID prefix check
Since commit b60836932 we only allow WM_CLASS matches for sandboxed
applications if the found app's ID is prefixed by the sandbox ID.

The existing check still has a hole in it though: "org.example.Foo"
and "org.example.FooDevel" are different applications, yet the former
is a prefix of the latter.

So tighten the check by including a trailing "." in the checked prefix;
this excludes cases like the above, while still working for the regular
case of a single .desktop file because our app IDs include the ".desktop"
suffix.

Spotted by wjt.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1357
2020-07-08 12:23:10 +02:00
123 changed files with 8296 additions and 7128 deletions

View File

@ -9,7 +9,6 @@ stages:
variables:
BUNDLE: "extensions-git.flatpak"
JS_LOG: "js-report.txt"
POT_LOG: "pot-update.txt"
.only_default: &only_default
only:
@ -67,6 +66,7 @@ no_template_check:
build:
image: registry.gitlab.gnome.org/gnome/mutter/master:v4
stage: build
needs: []
before_script:
- .gitlab-ci/checkout-mutter.sh
- meson mutter mutter/build --prefix=/usr -Dtests=false
@ -85,6 +85,7 @@ build:
test:
image: registry.gitlab.gnome.org/gnome/mutter/master:v4
stage: test
needs: ["build"]
variables:
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
NO_AT_BRIDGE: "1"
@ -99,24 +100,9 @@ test:
- build/meson-logs/testlog.txt
when: on_failure
test-pot:
image: registry.gitlab.gnome.org/gnome/mutter/master:v4
stage: test
before_script:
- ninja -C mutter/build install
script:
# Check that pot files are generated correctly:
# https://savannah.gnu.org/bugs/?50920#comment5
- ninja -C build gnome-shell-pot 2>&1 | awk '
BEGIN { start=0; }
start==1 { print $0; }
/gnome-shell-pot/ { start=1; }
' | tee $POT_LOG
- (! grep -q . $POT_LOG)
<<: *only_default
flatpak:
stage: build
needs: []
variables:
SUBPROJECT: "subprojects/extensions-app"
# Your manifest path

32
NEWS
View File

@ -1,3 +1,35 @@
3.37.90
=======
* Fix extension updates when many extensions are installed [Jeremias; !1363]
* Fix missing icons in on-screen keyboard [Emre; #2631, #3007]
* Fix delay when showing calendar events [Sebastian; #2992]
* Allow rearranging items in app picker [Georges; !1284]
* Fix top bar navigation when NumLock is active [Olivier; #550]
* Delay login animation until wallpaper has loaded [Michael; #734996]
* Reset auth prompt on login screen on VT switch before fade in [Ray; #2997]
* Move screencasting into a separate service [Jonas Å.; !1372]
* Replace loaded terms with more descriptive one [Olivier; !1393]
* Add "Boot Options" support to restart dialog [Hans; !199]
* Move "Restart" into a separate menu item/dialog [Florian; #2202]
* Default to not installing updates on low battery [Michael; #2717]
* Misc. bug fixes and cleanups [Florian, Daniel V., Georges, Jonas Å.,
Daniel G., Carlos, Benjamin, Piotr, Andre, Jonas D., Andy; !1357, !1356,
#2969, #2969, !1358, !1371, #3005, !1380, #3022, !1381, !895, !1387, !1386,
!1385, #3037, !1389, !1390, !1391, !1383, !1399, #2983, !1403]
Contributors:
Jonas Ådahl, Benjamin Berg, Michael Catanzaro, Piotr Drąg, Jonas Dreßler,
Olivier Fourdan, Carlos Garnacho, Hans de Goede, Andy Holmes,
Sebastian Keller, Andre Moreira Magalhaes, Daniel García Moreno,
Florian Müllner, Georges Basile Stavracas Neto, Jeremias Ortega, Ray Strode,
Emre Uyguroglu, Daniel van Vugt
Translators:
Tim Sabsch [de], Boyuan Yang [zh_CN], Fabio Tomat [fur],
Efstathios Iosifidis [el], Rafael Fontenelle [pt_BR], Yuri Chornoivan [uk],
Daniel Șerbănescu [ro], Jordi Mas [ca], Daniel Mustieles [es],
Emin Tufan Çetin [tr], Asier Sarasua Garmendia [eu]
3.37.3
======
* Refactor and clean up window picker

View File

@ -20,6 +20,12 @@
<method name="ListSessions">
<arg name="sessions" type="a(susso)" direction="out"/>
</method>
<method name="CanRebootToBootLoaderMenu">
<arg type="s" direction="out"/>
</method>
<method name="SetRebootToBootLoaderMenu">
<arg type="t" direction="in"/>
</method>
<signal name="PrepareForSleep">
<arg type="b" direction="out"/>
</signal>

View File

@ -0,0 +1,191 @@
<!DOCTYPE node PUBLIC
'-//freedesktop//DTD D-BUS Object Introspection 1.0//EN'
'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd'>
<node>
<!--
org.gnome.Mutter.ScreenCast:
@short_description: Screen cast interface
This API is private and not intended to be used outside of the integrated
system that uses libmutter. No compatibility between versions are
promised.
-->
<interface name="org.gnome.Mutter.ScreenCast">
<!--
CreateSession:
@properties: Properties
@session_path: Path to the new session object
* "remote-desktop-session-id" (s): The ID of a remote desktop session.
Remote desktop driven screen casts
are started and stopped by the remote
desktop session.
* "disable-animations" (b): Set to "true" if the screen cast application
would prefer animations to be globally
disabled, while the session is running. Default
is "false". Available since version 3.
-->
<method name="CreateSession">
<arg name="properties" type="a{sv}" direction="in" />
<arg name="session_path" type="o" direction="out" />
</method>
<!--
Version:
@short_description: API version
-->
<property name="Version" type="i" access="read" />
</interface>
<!--
org.gnome.Mutter.ScreenCast.Session:
@short_description: Screen cast session
-->
<interface name="org.gnome.Mutter.ScreenCast.Session">
<!--
Start:
Start the screen cast session
-->
<method name="Start" />
<!--
Stop:
Stop the screen cast session
-->
<method name="Stop" />
<!--
Closed:
The session has closed.
-->
<signal name="Closed" />
<!--
RecordMonitor:
@connector: Connector of the monitor to record
@properties: Properties
@stream_path: Path to the new stream object
Record a single monitor.
Available @properties include:
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see below)
Available since API version 2.
* "is-recording" (b): Whether this is a screen recording. May be
be used for choosing panel icon.
Default: false. Available since API version 4.
Available cursor mode values:
0: hidden - cursor is not included in the stream
1: embedded - cursor is included in the framebuffer
2: metadata - cursor is included as metadata in the PipeWire stream
-->
<method name="RecordMonitor">
<arg name="connector" type="s" direction="in" />
<arg name="properties" type="a{sv}" direction="in" />
<arg name="stream_path" type="o" direction="out" />
</method>
<!--
RecordWindow:
@properties: Properties used determining what window to select
@stream_path: Path to the new stream object
Supported since API version 2.
Record a single window. The cursor will not be included.
Available @properties include:
* "window-id" (t): Id of the window to record.
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see RecordMonitor).
* "is-recording" (b): Whether this is a screen recording. May be
be used for choosing panel icon.
Default: false. Available since API version 4.
-->
<method name="RecordWindow">
<arg name="properties" type="a{sv}" direction="in" />
<arg name="stream_path" type="o" direction="out" />
</method>
<!--
RecordArea:
@x: X position of the recorded area
@y: Y position of the recorded area
@width: width of the recorded area
@height: height of the recorded area
@properties: Properties
@stream_path: Path to the new stream object
Record an area of the stage. The coordinates are in stage coordinates.
The size of the stream does not necessarily match the size of the
recorded area, and will depend on DPI scale of the affected monitors.
Available @properties include:
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see below)
Available since API version 2.
* "is-recording" (b): Whether this is a screen recording. May be
be used for choosing panel icon.
Default: false. Available since API version 4.
Available cursor mode values:
0: hidden - cursor is not included in the stream
1: embedded - cursor is included in the framebuffer
2: metadata - cursor is included as metadata in the PipeWire stream
-->
<method name="RecordArea">
<arg name="x" type="i" direction="in" />
<arg name="y" type="i" direction="in" />
<arg name="width" type="i" direction="in" />
<arg name="height" type="i" direction="in" />
<arg name="properties" type="a{sv}" direction="in" />
<arg name="stream_path" type="o" direction="out" />
</method>
</interface>
<!--
org.gnome.Mutter.ScreenCast.Stream:
@short_description: Screen cast stream
-->
<interface name="org.gnome.Mutter.ScreenCast.Stream">
<!--
PipeWireStreamAdded:
@short_description: Pipewire stream added
A signal emitted when PipeWire stream for the screen cast stream has
been created. The @node_id corresponds to the PipeWire stream node.
-->
<signal name="PipeWireStreamAdded">
<annotation name="org.gtk.GDBus.C.Name" value="pipewire-stream-added"/>
<arg name="node_id" type="u" direction="out" />
</signal>
<!--
Parameters:
@short_description: Optional stream parameters
Available parameters include:
* "position" (ii): Position of the source of the stream in the
compositor coordinate space.
* "size" (ii): Size of the source of the stream in the compositor
coordinate space.
-->
<property name="Parameters" type="a{sv}" access="read" />
</interface>
</node>

View File

@ -70,6 +70,14 @@
-->
<property name="AnimationsEnabled" type="b" access="read"/>
<!--
ScreenSize:
@short_description: The size of the screen
Since: 3
-->
<property name="ScreenSize" type="(ii)" access="read"/>
<property name="version" type="u" access="read"/>
</interface>
</node>

View File

@ -28,6 +28,7 @@
<file preprocess="xml-stripblanks">org.freedesktop.UPower.xml</file>
<file preprocess="xml-stripblanks">org.gnome.Magnifier.xml</file>
<file preprocess="xml-stripblanks">org.gnome.Magnifier.ZoomRegion.xml</file>
<file preprocess="xml-stripblanks">org.gnome.Mutter.ScreenCast.xml</file>
<file preprocess="xml-stripblanks">org.gnome.ScreenSaver.xml</file>
<file preprocess="xml-stripblanks">org.gnome.SessionManager.EndSessionDialog.xml</file>
<file preprocess="xml-stripblanks">org.gnome.SessionManager.Inhibitor.xml</file>

View File

@ -6,25 +6,25 @@
<file>checkbox-off-focused.svg</file>
<file>checkbox-off.svg</file>
<file>checkbox.svg</file>
<file alias="icons/color-pick.svg">color-pick.svg</file>
<file alias="icons/scalable/actions/color-pick.svg">color-pick.svg</file>
<file>dash-placeholder.svg</file>
<file>gnome-shell.css</file>
<file>gnome-shell-high-contrast.css</file>
<file alias="icons/message-indicator-symbolic.svg">message-indicator-symbolic.svg</file>
<file alias="icons/scalable/status/message-indicator-symbolic.svg">message-indicator-symbolic.svg</file>
<file>no-events.svg</file>
<file>no-notifications.svg</file>
<file>pad-osd.css</file>
<file alias="icons/eye-open-negative-filled-symbolic.svg">eye-open-negative-filled-symbolic.svg</file>
<file alias="icons/eye-not-looking-symbolic.svg">eye-not-looking-symbolic.svg</file>
<file alias="icons/pointer-double-click-symbolic.svg">pointer-double-click-symbolic.svg</file>
<file alias="icons/pointer-drag-symbolic.svg">pointer-drag-symbolic.svg</file>
<file alias="icons/pointer-primary-click-symbolic.svg">pointer-primary-click-symbolic.svg</file>
<file alias="icons/pointer-secondary-click-symbolic.svg">pointer-secondary-click-symbolic.svg</file>
<file alias="icons/keyboard-caps-lock-filled-symbolic.svg">keyboard-caps-lock-filled-symbolic.svg</file>
<file alias="icons/keyboard-enter-symbolic.svg">keyboard-enter-symbolic.svg</file>
<file alias="icons/keyboard-hide-symbolic.svg">keyboard-hide-symbolic.svg</file>
<file alias="icons/keyboard-layout-filled-symbolic.svg">keyboard-layout-filled-symbolic.svg</file>
<file alias="icons/keyboard-shift-filled-symbolic.svg">keyboard-shift-filled-symbolic.svg</file>
<file alias="icons/scalable/status/eye-open-negative-filled-symbolic.svg">eye-open-negative-filled-symbolic.svg</file>
<file alias="icons/scalable/status/eye-not-looking-symbolic.svg">eye-not-looking-symbolic.svg</file>
<file alias="icons/scalable/actions/pointer-double-click-symbolic.svg">pointer-double-click-symbolic.svg</file>
<file alias="icons/scalable/actions/pointer-drag-symbolic.svg">pointer-drag-symbolic.svg</file>
<file alias="icons/scalable/actions/pointer-primary-click-symbolic.svg">pointer-primary-click-symbolic.svg</file>
<file alias="icons/scalable/actions/pointer-secondary-click-symbolic.svg">pointer-secondary-click-symbolic.svg</file>
<file alias="icons/scalable/status/keyboard-caps-lock-filled-symbolic.svg">keyboard-caps-lock-filled-symbolic.svg</file>
<file alias="icons/scalable/status/keyboard-enter-symbolic.svg">keyboard-enter-symbolic.svg</file>
<file alias="icons/scalable/status/keyboard-hide-symbolic.svg">keyboard-hide-symbolic.svg</file>
<file alias="icons/scalable/status/keyboard-layout-filled-symbolic.svg">keyboard-layout-filled-symbolic.svg</file>
<file alias="icons/scalable/status/keyboard-shift-filled-symbolic.svg">keyboard-shift-filled-symbolic.svg</file>
<file>process-working.svg</file>
<file>toggle-off.svg</file>
<file>toggle-off-dark.svg</file>

View File

@ -1,10 +0,0 @@
[Unit]
Description=GNOME Shell on X11
DefaultDependencies=no
Requisite=gnome-session-initialized.target
PartOf=gnome-session-initialized.target
Before=gnome-session-initialized.target
Requires=gnome-shell-x11.service
After=gnome-shell-x11.service

View File

@ -101,22 +101,21 @@ if have_systemd
unitconf.set('bindir', bindir)
configure_file(
input: 'gnome-shell-x11.service.in',
output: 'gnome-shell-x11.service',
input: 'org.gnome.Shell@x11.service.in',
output: 'org.gnome.Shell@x11.service',
configuration: unitconf,
install_dir: systemduserunitdir
)
configure_file(
input: 'gnome-shell-wayland.service.in',
output: 'gnome-shell-wayland.service',
input: 'org.gnome.Shell@wayland.service.in',
output: 'org.gnome.Shell@wayland.service',
configuration: unitconf,
install_dir: systemduserunitdir
)
units = files('gnome-shell-x11.target',
'gnome-shell-wayland.target',
'gnome-shell-disable-extensions.service')
units = files('org.gnome.Shell.target',
'org.gnome.Shell-disable-extensions.service')
install_data(units, install_dir: systemduserunitdir)
endif

View File

@ -6,5 +6,5 @@ Requisite=gnome-session-initialized.target
PartOf=gnome-session-initialized.target
Before=gnome-session-initialized.target
Requires=gnome-shell-wayland.service
After=gnome-shell-wayland.service
Wants=org.gnome.Shell@wayland.service
Wants=org.gnome.Shell@x11.service

View File

@ -1,7 +1,7 @@
[Unit]
Description=GNOME Shell on Wayland
# On wayland, force a session shutdown
OnFailure=gnome-shell-disable-extensions.service gnome-session-shutdown.target
OnFailure=org.gnome.Shell-disable-extensions.service gnome-session-shutdown.target
OnFailureJobMode=replace-irreversibly
CollectMode=inactive-or-failed
RefuseManualStart=on
@ -13,18 +13,21 @@ Requisite=gnome-session-initialized.target
PartOf=gnome-session-initialized.target
Before=gnome-session-initialized.target
# The units already conflict because they use the same BusName
#Conflicts=gnome-shell-x11.service
[Service]
Slice=session.slice
Type=notify
# NOTE: This can be replaced with ConditionEnvironment=XDG_SESSION_TYPE=%I
# with systemd >= 245. Also, the current solution is kind of painful
# as systemd had a bug where it retries the condition.
# Only start if the template instance matches the session type.
ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2'
ExecStart=@bindir@/gnome-shell
# Exit code 1 means we are probably *not* dealing with an extension failure
SuccessExitStatus=1
# unset some environment variables that were set by the shell and won't work now that the shell is gone
ExecStopPost=-systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY
# Exit code 1 means we are probably *not* dealing with an extension failure
SuccessExitStatus=1
# On wayland we cannot restart
Restart=no
# Kill any stubborn child processes after this long

View File

@ -1,7 +1,7 @@
[Unit]
Description=GNOME Shell on X11
# On X11, try to show the GNOME Session Failed screen
OnFailure=gnome-shell-disable-extensions.service gnome-session-failed.target
OnFailure=org.gnome.Shell-disable-extensions.service gnome-session-failed.target
OnFailureJobMode=replace
CollectMode=inactive-or-failed
RefuseManualStart=on
@ -13,18 +13,24 @@ Requisite=gnome-session-initialized.target
PartOf=gnome-session-initialized.target
Before=gnome-session-initialized.target
# The units already conflict because they use the same BusName
#Conflicts=gnome-shell-wayland.service
# Limit startup frequency more than the default
StartLimitIntervalSec=15s
StartLimitBurst=3
[Service]
Slice=session.slice
Type=notify
# NOTE: This can be replaced with ConditionEnvironment=XDG_SESSION_TYPE=%I
# with systemd >= 245. Also, the current solution is kind of painful
# as systemd had a bug where it retries the condition.
# Only start if the template instance matches the session type.
ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2'
ExecStart=@bindir@/gnome-shell
# Exit code 1 means we are probably *not* dealing with an extension failure
SuccessExitStatus=1
# On X11 we do not need to unset any variables
# On X11 we want to restart on-success (Alt+F2 + r) and on-failure.
Restart=always
# Do not wait before restarting the shell

View File

@ -109,6 +109,17 @@
the shell.
</description>
</key>
<key name="app-picker-layout" type="aa{sv}">
<default>[]</default>
<summary>Layout of the app picker</summary>
<description>
Layout of the app picker. Each entry in the array is a page. Pages are
stored in the order they appear in GNOME Shell. Each page contains an
“application id” → 'data' pair. Currently, the following values are
stored as 'data':
• “position”: the position of the application icon in the page
</description>
</key>
<child name="keybindings" schema="org.gnome.shell.keybindings"/>
</schema>

View File

@ -232,7 +232,9 @@
color: $fg_color;
font-feature-settings: "tnum";
@include fontsize($base_font_size);
text-align: right;
&:ltr { text-align: right; }
&:rtl { text-align: left; }
}
// timezone offset label

View File

@ -138,11 +138,10 @@
.user-widget.horizontal .user-widget-label {
@include fontsize($base_font_size + 2);
font-weight: bold;
text-align: left;
padding-left: 15px;
&:ltr { padding-left: 14px; }
&:rtl { padding-right: 14px; }
&:ltr { padding-left: 14px; text-align: left; }
&:rtl { padding-right: 14px; text-align: right; }
}
.user-widget.vertical .user-widget-label {

View File

@ -71,9 +71,11 @@
> .event-time {
color: transparentize($fg_color, 0.5);
@include fontsize($base_font_size - 2);
text-align: right;
/* HACK: the label should be baseline-aligned with a 1em label, fake this with some bottom padding */
padding-bottom: 0.13em;
&:ltr { text-align: right };
&:rtl { text-align: left };
}
}

View File

@ -76,8 +76,10 @@ $popover_arrow_height: 12px;
// container for radio and check boxes
.popup-menu-ornament {
text-align: right;
width: 1.2em;
&:ltr { text-align: right };
&:rtl { text-align: left };
}
// separator

View File

@ -3,13 +3,8 @@ private_headers = [
'gactionobservable.h',
'gactionobserver.h',
'shell-network-agent.h',
'shell-recorder-src.h'
]
if not enable_recorder
private_headers += 'shell-recorder.h'
endif
exclude_directories = [
'calendar-server',
'hotplug-sniffer',

View File

@ -25,6 +25,8 @@ var ServiceImplementation = class {
// subclasses may override this to disable automatic shutdown
this._autoShutdown = true;
this._queueShutdownCheck();
}
// subclasses may override this to own additional names

View File

@ -8,6 +8,12 @@ dbus_services = {
'org.gnome.Shell.Notifications': 'notifications',
}
if enable_recorder
dbus_services += {
'org.gnome.Shell.Screencast': 'screencast',
}
endif
config_dir = '@0@/..'.format(meson.current_build_dir())
foreach service, dir : dbus_services

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/Shell/Screencast/js">
<file>main.js</file>
<file>screencastService.js</file>
<file>dbusService.js</file>
<file>misc/config.js</file>
<file>misc/fileUtils.js</file>
</gresource>
</gresources>

View File

@ -0,0 +1,11 @@
/* exported main */
const { DBusService } = imports.dbusService;
const { ScreencastService } = imports.screencastService;
function main() {
const service = new DBusService(
'org.gnome.Shell.Screencast',
new ScreencastService());
service.run();
}

View File

@ -0,0 +1,458 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported ScreencastService */
const { Gio, GLib, Gst } = imports.gi;
const { loadInterfaceXML, loadSubInterfaceXML } = imports.misc.fileUtils;
const { ServiceImplementation } = imports.dbusService;
const ScreencastIface = loadInterfaceXML('org.gnome.Shell.Screencast');
const IntrospectIface = loadInterfaceXML('org.gnome.Shell.Introspect');
const IntrospectProxy = Gio.DBusProxy.makeProxyWrapper(IntrospectIface);
const ScreenCastIface = loadSubInterfaceXML(
'org.gnome.Mutter.ScreenCast', 'org.gnome.Mutter.ScreenCast');
const ScreenCastSessionIface = loadSubInterfaceXML(
'org.gnome.Mutter.ScreenCast.Session', 'org.gnome.Mutter.ScreenCast');
const ScreenCastStreamIface = loadSubInterfaceXML(
'org.gnome.Mutter.ScreenCast.Stream', 'org.gnome.Mutter.ScreenCast');
const ScreenCastProxy = Gio.DBusProxy.makeProxyWrapper(ScreenCastIface);
const ScreenCastSessionProxy = Gio.DBusProxy.makeProxyWrapper(ScreenCastSessionIface);
const ScreenCastStreamProxy = Gio.DBusProxy.makeProxyWrapper(ScreenCastStreamIface);
const DEFAULT_PIPELINE = 'vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! webmmux';
const DEFAULT_FRAMERATE = 30;
const DEFAULT_DRAW_CURSOR = true;
const PipelineState = {
INIT: 0,
PLAYING: 1,
FLUSHING: 2,
STOPPED: 3,
};
const SessionState = {
INIT: 0,
ACTIVE: 1,
STOPPED: 2,
};
var Recorder = class {
constructor(sessionPath, x, y, width, height, filePath, options,
invocation,
onErrorCallback) {
this._startInvocation = invocation;
this._dbusConnection = invocation.get_connection();
this._onErrorCallback = onErrorCallback;
this._stopInvocation = null;
this._pipelineIsPlaying = false;
this._sessionIsActive = false;
this._x = x;
this._y = y;
this._width = width;
this._height = height;
this._filePath = filePath;
this._pipelineString = DEFAULT_PIPELINE;
this._framerate = DEFAULT_FRAMERATE;
this._drawCursor = DEFAULT_DRAW_CURSOR;
this._applyOptions(options);
this._watchSender(invocation.get_sender());
this._initSession(sessionPath);
}
_applyOptions(options) {
for (const option in options)
options[option] = options[option].deep_unpack();
if (options['pipeline'] !== undefined)
this._pipelineString = options['pipeline'];
if (options['framerate'] !== undefined)
this._framerate = options['framerate'];
if ('draw-cursor' in options)
this._drawCursor = options['draw-cursor'];
}
_watchSender(sender) {
this._nameWatchId = this._dbusConnection.watch_name(
sender,
Gio.BusNameWatcherFlags.NONE,
null,
this._senderVanished.bind(this));
}
_unwatchSender() {
if (this._nameWatchId !== 0) {
this._dbusConnection.unwatch_name(this._nameWatchId);
this._nameWatchId = 0;
}
}
_senderVanished() {
this._unwatchSender();
this.stopRecording(null);
}
_notifyStopped() {
this._unwatchSender();
if (this._onStartedCallback)
this._onStartedCallback(this, false);
else if (this._onStoppedCallback)
this._onStoppedCallback(this);
else
this._onErrorCallback(this);
}
_onSessionClosed() {
switch (this._pipelineState) {
case PipelineState.STOPPED:
break;
default:
this._pipeline.set_state(Gst.State.NULL);
log(`Unexpected pipeline state: ${this._pipelineState}`);
break;
}
this._notifyStopped();
}
_initSession(sessionPath) {
this._sessionProxy = new ScreenCastSessionProxy(Gio.DBus.session,
'org.gnome.Mutter.ScreenCast',
sessionPath);
this._sessionProxy.connectSignal('Closed', this._onSessionClosed.bind(this));
}
_startPipeline(nodeId) {
this._ensurePipeline(nodeId);
const bus = this._pipeline.get_bus();
bus.add_watch(bus, this._onBusMessage.bind(this));
this._pipeline.set_state(Gst.State.PLAYING);
this._pipelineState = PipelineState.PLAYING;
this._onStartedCallback(this, true);
this._onStartedCallback = null;
}
startRecording(onStartedCallback) {
this._onStartedCallback = onStartedCallback;
const [streamPath] = this._sessionProxy.RecordAreaSync(
this._x, this._y,
this._width, this._height,
{
'is-recording': GLib.Variant.new('b', true),
'cursor-mode': GLib.Variant.new('u', this._drawCursor ? 1 : 0),
});
this._streamProxy = new ScreenCastStreamProxy(Gio.DBus.session,
'org.gnome.ScreenCast.Stream',
streamPath);
this._streamProxy.connectSignal('PipeWireStreamAdded',
(proxy, sender, params) => {
const [nodeId] = params;
this._startPipeline(nodeId);
});
this._sessionProxy.StartSync();
this._sessionState = SessionState.ACTIVE;
}
stopRecording(onStoppedCallback) {
this._pipelineState = PipelineState.FLUSHING;
this._onStoppedCallback = onStoppedCallback;
this._pipeline.send_event(Gst.Event.new_eos());
}
_stopSession() {
this._sessionProxy.StopSync();
this._sessionState = SessionState.STOPPED;
}
_onBusMessage(bus, message, _) {
switch (message.type) {
case Gst.MessageType.EOS:
this._pipeline.set_state(Gst.State.NULL);
switch (this._pipelineState) {
case PipelineState.FLUSHING:
this._pipelineState = PipelineState.STOPPED;
break;
default:
break;
}
switch (this._sessionState) {
case SessionState.ACTIVE:
this._stopSession();
break;
case SessionState.STOPPED:
this._notifyStopped();
break;
default:
break;
}
break;
default:
break;
}
return true;
}
_substituteThreadCount(pipelineDescr) {
const numProcessors = GLib.get_num_processors();
const numThreads = Math.min(Math.max(1, numProcessors), 64);
return pipelineDescr.replace(/%T/, numThreads);
}
_ensurePipeline(nodeId) {
const framerate = this._framerate;
let fullPipeline = `
pipewiresrc path=${nodeId}
do-timestamp=true
keepalive-time=1000
resend-last=true !
video/x-raw,max-framerate=${framerate}/1 !
videoconvert !
${this._pipelineString} !
filesink location="${this._filePath}"`;
fullPipeline = this._substituteThreadCount(fullPipeline);
this._pipeline = Gst.parse_launch_full(fullPipeline,
null,
Gst.ParseFlags.FATAL_ERRORS);
}
};
var ScreencastService = class extends ServiceImplementation {
constructor() {
super(ScreencastIface, '/org/gnome/Shell/Screencast');
Gst.init(null);
this._recorders = new Map();
this._senders = new Map();
this._lockdownSettings = new Gio.Settings({
schema_id: 'org.gnome.desktop.lockdown',
});
this._proxy = new ScreenCastProxy(Gio.DBus.session,
'org.gnome.Mutter.ScreenCast',
'/org/gnome/Mutter/ScreenCast');
this._introspectProxy = new IntrospectProxy(Gio.DBus.session,
'org.gnome.Shell.Introspect',
'/org/gnome/Shell/Introspect');
}
_removeRecorder(sender) {
this._recorders.delete(sender);
if (this._recorders.size === 0)
this.release();
}
_addRecorder(sender, recorder) {
this._recorders.set(sender, recorder);
if (this._recorders.size === 1)
this.hold();
}
_getAbsolutePath(filename) {
if (GLib.path_is_absolute(filename))
return filename;
let videoDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_VIDEOS);
if (!GLib.file_test(videoDir, GLib.FileTest.EXISTS))
videoDir = GLib.get_home_dir();
return GLib.build_filenamev([videoDir, filename]);
}
_generateFilePath(template) {
let filename = '';
let escape = false;
[...template].forEach(c => {
if (escape) {
switch (c) {
case '%':
filename += '%';
break;
case 'd': {
const datetime = GLib.DateTime.new_now_local();
const datestr = datetime.format('%0x');
const datestrEscaped = datestr.replace(/\//g, '-');
filename += datestrEscaped;
break;
}
case 't': {
const datetime = GLib.DateTime.new_now_local();
const datestr = datetime.format('%0X');
const datestrEscaped = datestr.replace(/\//g, ':');
filename += datestrEscaped;
break;
}
default:
log(`Warning: Unknown escape ${c}`);
}
escape = false;
} else if (c === '%') {
escape = true;
} else {
filename += c;
}
});
if (escape)
filename += '%';
return this._getAbsolutePath(filename);
}
ScreencastAsync(params, invocation) {
let returnValue = [false, ''];
if (this._lockdownSettings.get_boolean('disable-save-to-disk')) {
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
return;
}
const sender = invocation.get_sender();
if (this._recorders.get(sender)) {
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
return;
}
const [sessionPath] = this._proxy.CreateSessionSync({});
const [fileTemplate, options] = params;
const [screenWidth, screenHeight] = this._introspectProxy.ScreenSize;
const filePath = this._generateFilePath(fileTemplate);
let recorder;
try {
recorder = new Recorder(
sessionPath,
0, 0,
screenWidth, screenHeight,
fileTemplate,
options,
invocation,
_recorder => this._removeRecorder(sender));
} catch (error) {
log(`Failed to create recorder: ${error.message}`);
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
return;
}
this._addRecorder(sender, recorder);
try {
recorder.startRecording(
(_, result) => {
if (result) {
returnValue = [true, filePath];
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
} else {
this._removeRecorder(sender);
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
}
});
} catch (error) {
log(`Failed to start recorder: ${error.message}`);
this._removeRecorder(sender);
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
}
}
ScreencastAreaAsync(params, invocation) {
let returnValue = [false, ''];
if (this._lockdownSettings.get_boolean('disable-save-to-disk')) {
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
return;
}
const sender = invocation.get_sender();
if (this._recorders.get(sender)) {
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
return;
}
const [sessionPath] = this._proxy.CreateSessionSync({});
const [x, y, width, height, fileTemplate, options] = params;
const filePath = this._generateFilePath(fileTemplate);
let recorder;
try {
recorder = new Recorder(
sessionPath,
x, y,
width, height,
filePath,
options,
invocation,
_recorder => this._removeRecorder(sender));
} catch (error) {
log(`Failed to create recorder: ${error.message}`);
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
return;
}
this._addRecorder(sender, recorder);
try {
recorder.startRecording(
(_, result) => {
if (result) {
returnValue = [true, filePath];
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
} else {
this._removeRecorder(sender);
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
}
});
} catch (error) {
log(`Failed to start recorder: ${error.message}`);
this._removeRecorder(sender);
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
}
}
StopScreencastAsync(params, invocation) {
const sender = invocation.get_sender();
const recorder = this._recorders.get(sender);
if (!recorder) {
invocation.return_value(GLib.Variant.new('(b)', [false]));
return;
}
recorder.stopRecording(() => {
this._removeRecorder(sender);
invocation.return_value(GLib.Variant.new('(b)', [true]));
});
}
};

View File

@ -953,16 +953,15 @@ var LoginDialog = GObject.registerClass({
if (this.opacity == 255 && this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
return;
if (this._authPrompt.verificationStatus !== AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
this._authPrompt.reset();
this._bindOpacity();
this.ease({
opacity: 255,
duration: _FADE_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
this._authPrompt.reset();
this._unbindOpacity();
},
onComplete: () => this._unbindOpacity(),
});
}

View File

@ -32,6 +32,7 @@
<file>misc/util.js</file>
<file>misc/weather.js</file>
<file>perf/basic.js</file>
<file>perf/core.js</file>
<file>perf/hwtest.js</file>
@ -92,7 +93,6 @@
<file>ui/ripples.js</file>
<file>ui/runDialog.js</file>
<file>ui/screenShield.js</file>
<file>ui/screencast.js</file>
<file>ui/screenshot.js</file>
<file>ui/scripting.js</file>
<file>ui/search.js</file>
@ -137,7 +137,6 @@
<file>ui/status/volume.js</file>
<file>ui/status/bluetooth.js</file>
<file>ui/status/remoteAccess.js</file>
<file>ui/status/screencast.js</file>
<file>ui/status/system.js</file>
<file>ui/status/thunderbolt.js</file>
</gresource>

View File

@ -1,6 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported collectFromDatadirs, recursivelyDeleteDir,
recursivelyMoveDir, loadInterfaceXML */
recursivelyMoveDir, loadInterfaceXML, loadSubInterfaceXML */
const { Gio, GLib } = imports.gi;
const Config = imports.misc.config;
@ -67,14 +67,19 @@ function recursivelyMoveDir(srcDir, destDir) {
}
let _ifaceResource = null;
function ensureIfaceResource() {
if (_ifaceResource)
return;
// don't use global.datadir so the method is usable from tests/tools
let dir = GLib.getenv('GNOME_SHELL_DATADIR') || Config.PKGDATADIR;
let path = `${dir}/gnome-shell-dbus-interfaces.gresource`;
_ifaceResource = Gio.Resource.load(path);
_ifaceResource._register();
}
function loadInterfaceXML(iface) {
if (!_ifaceResource) {
// don't use global.datadir so the method is usable from tests/tools
let dir = GLib.getenv('GNOME_SHELL_DATADIR') || Config.PKGDATADIR;
let path = `${dir}/gnome-shell-dbus-interfaces.gresource`;
_ifaceResource = Gio.Resource.load(path);
_ifaceResource._register();
}
ensureIfaceResource();
let uri = `resource:///org/gnome/shell/dbus-interfaces/${iface}.xml`;
let f = Gio.File.new_for_uri(uri);
@ -88,3 +93,25 @@ function loadInterfaceXML(iface) {
return null;
}
function loadSubInterfaceXML(iface, ifaceFile) {
let xml = loadInterfaceXML(ifaceFile);
if (!xml)
return null;
let ifaceStartTag = `<interface name="${iface}">`;
let ifaceStopTag = '</interface>';
let ifaceStartIndex = xml.indexOf(ifaceStartTag);
let ifaceEndIndex = xml.indexOf(ifaceStopTag, ifaceStartIndex + 1) + ifaceStopTag.length;
let xmlHeader = '<!DOCTYPE node PUBLIC\n' +
'\'-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\'\n' +
'\'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\'>\n' +
'<node>\n';
let xmlFooter = '</node>';
return (
xmlHeader +
xml.substr(ifaceStartIndex, ifaceEndIndex - ifaceStartIndex) +
xmlFooter);
}

View File

@ -3,9 +3,9 @@ const { Gio, GLib, Meta, Shell, St } = imports.gi;
const INTROSPECT_SCHEMA = 'org.gnome.shell';
const INTROSPECT_KEY = 'introspect';
const APP_WHITELIST = ['org.freedesktop.impl.portal.desktop.gtk'];
const APP_ALLOWLIST = ['org.freedesktop.impl.portal.desktop.gtk'];
const INTROSPECT_DBUS_API_VERSION = 2;
const INTROSPECT_DBUS_API_VERSION = 3;
const { loadInterfaceXML } = imports.misc.fileUtils;
@ -46,19 +46,24 @@ var IntrospectService = class {
this._syncRunningApplications();
this._whitelistMap = new Map();
APP_WHITELIST.forEach(appName => {
this._allowlistMap = new Map();
APP_ALLOWLIST.forEach(appName => {
Gio.DBus.watch_name(Gio.BusType.SESSION,
appName,
Gio.BusNameWatcherFlags.NONE,
(conn, name, owner) => this._whitelistMap.set(name, owner),
(conn, name) => this._whitelistMap.delete(name));
(conn, name, owner) => this._allowlistMap.set(name, owner),
(conn, name) => this._allowlistMap.delete(name));
});
this._settings = St.Settings.get();
this._settings.connect('notify::enable-animations',
this._syncAnimationsEnabled.bind(this));
this._syncAnimationsEnabled();
const monitorManager = Meta.MonitorManager.get();
monitorManager.connect('monitors-changed',
this._syncScreenSize.bind(this));
this._syncScreenSize();
}
_isStandaloneApp(app) {
@ -69,8 +74,8 @@ var IntrospectService = class {
return this._introspectSettings.get_boolean(INTROSPECT_KEY);
}
_isSenderWhitelisted(sender) {
return [...this._whitelistMap.values()].includes(sender);
_isSenderAllowed(sender) {
return [...this._allowlistMap.values()].includes(sender);
}
_getSandboxedAppId(app) {
@ -133,7 +138,7 @@ var IntrospectService = class {
if (this._isIntrospectEnabled())
return true;
if (this._isSenderWhitelisted(invocation.get_sender()))
if (this._isSenderAllowed(invocation.get_sender()))
return true;
return false;
@ -209,10 +214,28 @@ var IntrospectService = class {
}
}
_syncScreenSize() {
const oldScreenWidth = this._screenWidth;
const oldScreenHeight = this._screenHeight;
this._screenWidth = global.screen_width;
this._screenHeight = global.screen_height;
if (oldScreenWidth !== this._screenWidth ||
oldScreenHeight !== this._screenHeight) {
const variant = new GLib.Variant('(ii)',
[this._screenWidth, this._screenHeight]);
this._dbusImpl.emit_property_changed('ScreenSize', variant);
}
}
get AnimationsEnabled() {
return this._animationsEnabled;
}
get ScreenSize() {
return [this._screenWidth, this._screenHeight];
}
get version() {
return INTROSPECT_DBUS_API_VERSION;
}

View File

@ -158,6 +158,23 @@ var LoginManagerSystemd = class {
});
}
canRebootToBootLoaderMenu(asyncCallback) {
this._proxy.CanRebootToBootLoaderMenuRemote((result, error) => {
if (error) {
asyncCallback(false, false);
} else {
const needsAuth = result[0] === 'challenge';
const canRebootToBootLoaderMenu = needsAuth || result[0] === 'yes';
asyncCallback(canRebootToBootLoaderMenu, needsAuth);
}
});
}
setRebootToBootLoaderMenu() {
/* Parameter is timeout in usec, show to menu for 60 seconds */
this._proxy.SetRebootToBootLoaderMenuRemote(60000000);
}
listSessions(asyncCallback) {
this._proxy.ListSessionsRemote((result, error) => {
if (error)
@ -203,6 +220,13 @@ var LoginManagerDummy = class {
asyncCallback(false, false);
}
canRebootToBootLoaderMenu(asyncCallback) {
asyncCallback(false, false);
}
setRebootToBootLoaderMenu() {
}
listSessions(asyncCallback) {
asyncCallback([]);
}

View File

@ -121,10 +121,10 @@ var ParentalControlsManager = GObject.registerClass({
// Calculate whether the given app (a Gio.DesktopAppInfo) should be shown
// on the desktop, in search results, etc. The app should be shown if:
// - The .desktop file doesnt say it should be hidden.
// - The executable from the .desktop files Exec line isnt blacklisted in
// - The executable from the .desktop files Exec line isnt denied in
// the users parental controls.
// - None of the flatpak app IDs from the X-Flatpak and the
// X-Flatpak-RenamedFrom lines are blacklisted in the users parental
// X-Flatpak-RenamedFrom lines are denied in the users parental
// controls.
shouldShowApp(appInfo) {
// Quick decision?

View File

@ -21,6 +21,7 @@ const SENSOR_OBJECT_PATH = '/net/hadess/SensorProxy';
const SensorProxyInterface = loadInterfaceXML('net.hadess.SensorProxy');
const POWER_OFF_ACTION_ID = 'power-off';
const RESTART_ACTION_ID = 'restart';
const LOCK_SCREEN_ACTION_ID = 'lock-screen';
const LOGOUT_ACTION_ID = 'logout';
const SUSPEND_ACTION_ID = 'suspend';
@ -40,41 +41,38 @@ function getDefault() {
const SystemActions = GObject.registerClass({
Properties: {
'can-power-off': GObject.ParamSpec.boolean('can-power-off',
'can-power-off',
'can-power-off',
GObject.ParamFlags.READABLE,
false),
'can-suspend': GObject.ParamSpec.boolean('can-suspend',
'can-suspend',
'can-suspend',
GObject.ParamFlags.READABLE,
false),
'can-lock-screen': GObject.ParamSpec.boolean('can-lock-screen',
'can-lock-screen',
'can-lock-screen',
GObject.ParamFlags.READABLE,
false),
'can-switch-user': GObject.ParamSpec.boolean('can-switch-user',
'can-switch-user',
'can-switch-user',
GObject.ParamFlags.READABLE,
false),
'can-logout': GObject.ParamSpec.boolean('can-logout',
'can-logout',
'can-logout',
GObject.ParamFlags.READABLE,
false),
'can-lock-orientation': GObject.ParamSpec.boolean('can-lock-orientation',
'can-lock-orientation',
'can-lock-orientation',
GObject.ParamFlags.READABLE,
false),
'orientation-lock-icon': GObject.ParamSpec.string('orientation-lock-icon',
'orientation-lock-icon',
'orientation-lock-icon',
GObject.ParamFlags.READWRITE,
null),
'can-power-off': GObject.ParamSpec.boolean(
'can-power-off', 'can-power-off', 'can-power-off',
GObject.ParamFlags.READABLE,
false),
'can-restart': GObject.ParamSpec.boolean(
'can-restart', 'can-restart', 'can-restart',
GObject.ParamFlags.READABLE,
false),
'can-suspend': GObject.ParamSpec.boolean(
'can-suspend', 'can-suspend', 'can-suspend',
GObject.ParamFlags.READABLE,
false),
'can-lock-screen': GObject.ParamSpec.boolean(
'can-lock-screen', 'can-lock-screen', 'can-lock-screen',
GObject.ParamFlags.READABLE,
false),
'can-switch-user': GObject.ParamSpec.boolean(
'can-switch-user', 'can-switch-user', 'can-switch-user',
GObject.ParamFlags.READABLE,
false),
'can-logout': GObject.ParamSpec.boolean(
'can-logout', 'can-logout', 'can-logout',
GObject.ParamFlags.READABLE,
false),
'can-lock-orientation': GObject.ParamSpec.boolean(
'can-lock-orientation', 'can-lock-orientation', 'can-lock-orientation',
GObject.ParamFlags.READABLE,
false),
'orientation-lock-icon': GObject.ParamSpec.string(
'orientation-lock-icon', 'orientation-lock-icon', 'orientation-lock-icon',
GObject.ParamFlags.READWRITE,
null),
},
}, class SystemActions extends GObject.Object {
_init() {
@ -93,7 +91,15 @@ const SystemActions = GObject.registerClass({
name: C_("search-result", "Power Off"),
iconName: 'system-shutdown-symbolic',
// Translators: A list of keywords that match the power-off action, separated by semicolons
keywords: tokenizeKeywords(_('power off;shutdown;reboot;restart;halt;stop')),
keywords: tokenizeKeywords(_('power off;shutdown;halt;stop')),
available: false,
});
this._actions.set(RESTART_ACTION_ID, {
// Translators: The name of the restart action in search
name: C_('search-result', 'Restart'),
iconName: 'system-reboot-symbolic',
// Translators: A list of keywords that match the restart action, separated by semicolons
keywords: tokenizeKeywords(_('reboot;restart;')),
available: false,
});
this._actions.set(LOCK_SCREEN_ACTION_ID, {
@ -203,6 +209,11 @@ const SystemActions = GObject.registerClass({
return this._actions.get(POWER_OFF_ACTION_ID).available;
}
// eslint-disable-next-line camelcase
get can_restart() {
return this._actions.get(RESTART_ACTION_ID).available;
}
// eslint-disable-next-line camelcase
get can_suspend() {
return this._actions.get(SUSPEND_ACTION_ID).available;
@ -306,6 +317,9 @@ const SystemActions = GObject.registerClass({
case POWER_OFF_ACTION_ID:
this.activatePowerOff();
break;
case RESTART_ACTION_ID:
this.activateRestart();
break;
case LOCK_SCREEN_ACTION_ID:
this.activateLockScreen();
break;
@ -347,6 +361,9 @@ const SystemActions = GObject.registerClass({
this._loginScreenSettings.get_boolean(DISABLE_RESTART_KEY));
this._actions.get(POWER_OFF_ACTION_ID).available = this._canHavePowerOff && !disabled;
this.notify('can-power-off');
this._actions.get(RESTART_ACTION_ID).available = this._canHavePowerOff && !disabled;
this.notify('can-restart');
}
_updateHaveSuspend() {
@ -445,6 +462,13 @@ const SystemActions = GObject.registerClass({
this._session.ShutdownRemote(0);
}
activateRestart() {
if (!this._actions.get(RESTART_ACTION_ID).available)
throw new Error('The restart action is not available!');
this._session.RebootRemote();
}
activateSuspend() {
if (!this._actions.get(SUSPEND_ACTION_ID).available)
throw new Error('The suspend action is not available!');

146
js/perf/basic.js Normal file
View File

@ -0,0 +1,146 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported run, finish, script_topBarNavDone, script_notificationShowDone,
script_notificationCloseDone, script_overviewShowDone,
script_applicationsShowStart, script_applicationsShowDone, METRICS,
*/
/* eslint camelcase: ["error", { properties: "never", allow: ["^script_"] }] */
const { St } = imports.gi;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const Scripting = imports.ui.scripting;
// This script tests the most important (basic) functionality of the shell.
var METRICS = {};
async function run() {
/* eslint-disable no-await-in-loop */
Scripting.defineScriptEvent('topBarNavStart', 'Starting to navigate the top bar');
Scripting.defineScriptEvent('topBarNavDone', 'Done navigating the top bar');
Scripting.defineScriptEvent('notificationShowStart', 'Showing a notification');
Scripting.defineScriptEvent('notificationShowDone', 'Done showing a notification');
Scripting.defineScriptEvent('notificationCloseStart', 'Closing a notification');
Scripting.defineScriptEvent('notificationCloseDone', 'Done closing a notification');
Scripting.defineScriptEvent('overviewShowStart', 'Starting to show the overview');
Scripting.defineScriptEvent('overviewShowDone', 'Overview finished showing');
Scripting.defineScriptEvent('applicationsShowStart', 'Starting to switch to applications view');
Scripting.defineScriptEvent('applicationsShowDone', 'Done switching to applications view');
Main.overview.connect('shown',
() => Scripting.scriptEvent('overviewShowDone'));
await Scripting.sleep(1000);
// navigate through top bar
Scripting.scriptEvent('topBarNavStart');
Main.panel.statusArea.aggregateMenu.menu.open();
await Scripting.sleep(400);
const { menuManager } = Main.panel;
while (menuManager.activeMenu &&
Main.panel.navigate_focus(menuManager.activeMenu.sourceActor,
St.DirectionType.TAB_BACKWARD, false))
await Scripting.sleep(400);
Scripting.scriptEvent('topBarNavDone');
await Scripting.sleep(1000);
// notification
const source = new MessageTray.SystemNotificationSource();
Main.messageTray.add(source);
Scripting.scriptEvent('notificationShowStart');
source.connect('notification-show',
() => Scripting.scriptEvent('notificationShowDone'));
const notification = new MessageTray.Notification(source,
'A test notification');
source.showNotification(notification);
await Scripting.sleep(400);
Main.panel.statusArea.dateMenu.menu.open();
await Scripting.sleep(400);
Scripting.scriptEvent('notificationCloseStart');
notification.connect('destroy',
() => Scripting.scriptEvent('notificationCloseDone'));
notification.destroy();
await Scripting.sleep(400);
Main.panel.statusArea.dateMenu.menu.close();
await Scripting.waitLeisure();
await Scripting.sleep(1000);
// overview (window picker)
Scripting.scriptEvent('overviewShowStart');
Main.overview.show();
await Scripting.waitLeisure();
Main.overview.hide();
await Scripting.waitLeisure();
await Scripting.sleep(1000);
// overview (app picker)
Main.overview.show();
await Scripting.waitLeisure();
Scripting.scriptEvent('applicationsShowStart');
// eslint-disable-next-line require-atomic-updates
Main.overview.dash.showAppsButton.checked = true;
await Scripting.waitLeisure();
Scripting.scriptEvent('applicationsShowDone');
// eslint-disable-next-line require-atomic-updates
Main.overview.dash.showAppsButton.checked = false;
await Scripting.waitLeisure();
Main.overview.hide();
await Scripting.waitLeisure();
/* eslint-enable no-await-in-loop */
}
let topBarNav = false;
let notificationShown = false;
let notificationClosed = false;
let windowPickerShown = false;
let appPickerShown = false;
function script_topBarNavDone() {
topBarNav = true;
}
function script_notificationShowDone() {
notificationShown = true;
}
function script_notificationCloseDone() {
notificationClosed = true;
}
function script_overviewShowDone() {
windowPickerShown = true;
}
function script_applicationsShowDone() {
appPickerShown = true;
}
function finish() {
if (!topBarNav)
throw new Error('Failed to navigate top bar');
if (!notificationShown)
throw new Error('Failed to show notification');
if (!notificationClosed)
throw new Error('Failed to close notification');
if (!windowPickerShown)
throw new Error('Failed to show window picker');
if (!appPickerShown)
throw new Error('Failed to show app picker');
}

View File

@ -70,7 +70,8 @@ let WINDOW_CONFIGS = [
{ width: 640, height: 480, alpha: true, maximized: false, count: 10, metric: 'overviewFps10Alpha' },
];
function *run() {
async function run() {
/* eslint-disable no-await-in-loop */
Scripting.defineScriptEvent("overviewShowStart", "Starting to show the overview");
Scripting.defineScriptEvent("overviewShowDone", "Overview finished showing");
Scripting.defineScriptEvent("afterShowHide", "After a show/hide cycle for the overview");
@ -84,7 +85,7 @@ function *run() {
Scripting.scriptEvent('overviewShowDone');
});
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
for (let i = 0; i < 2 * WINDOW_CONFIGS.length; i++) {
// We go to the overview twice for each configuration; the first time
@ -92,49 +93,50 @@ function *run() {
// a clean set of numbers.
if ((i % 2) == 0) {
let config = WINDOW_CONFIGS[i / 2];
yield Scripting.destroyTestWindows();
await Scripting.destroyTestWindows();
for (let k = 0; k < config.count; k++) {
yield Scripting.createTestWindow({ width: config.width,
await Scripting.createTestWindow({ width: config.width,
height: config.height,
alpha: config.alpha,
maximized: config.maximized });
}
yield Scripting.waitTestWindows();
yield Scripting.sleep(1000);
yield Scripting.waitLeisure();
await Scripting.waitTestWindows();
await Scripting.sleep(1000);
await Scripting.waitLeisure();
}
Scripting.scriptEvent('overviewShowStart');
Main.overview.show();
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
Main.overview.hide();
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
System.gc();
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
Scripting.collectStatistics();
Scripting.scriptEvent('afterShowHide');
}
yield Scripting.destroyTestWindows();
yield Scripting.sleep(1000);
await Scripting.destroyTestWindows();
await Scripting.sleep(1000);
Main.overview.show();
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
for (let i = 0; i < 2; i++) {
Scripting.scriptEvent('applicationsShowStart');
// eslint-disable-next-line require-atomic-updates
Main.overview.dash.showAppsButton.checked = true;
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
Scripting.scriptEvent('applicationsShowDone');
// eslint-disable-next-line require-atomic-updates
Main.overview.dash.showAppsButton.checked = false;
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
}
/* eslint-enable no-await-in-loop */
}
let showingOverview = false;

View File

@ -94,7 +94,8 @@ function extractBootTimestamp() {
return result;
}
function *run() {
async function run() {
/* eslint-disable no-await-in-loop */
Scripting.defineScriptEvent("desktopShown", "Finished initial animation");
Scripting.defineScriptEvent("overviewShowStart", "Starting to show the overview");
Scripting.defineScriptEvent("overviewShowDone", "Overview finished showing");
@ -110,7 +111,7 @@ function *run() {
Scripting.defineScriptEvent("geditLaunch", "gedit application launch");
Scripting.defineScriptEvent("geditFirstFrame", "first frame of gedit window drawn");
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
Scripting.scriptEvent('desktopShown');
let interfaceSettings = new Gio.Settings({
@ -120,22 +121,22 @@ function *run() {
Scripting.scriptEvent('overviewShowStart');
Main.overview.show();
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
Scripting.scriptEvent('overviewShowDone');
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
Scripting.scriptEvent('applicationsShowStart');
// eslint-disable-next-line require-atomic-updates
Main.overview.dash.showAppsButton.checked = true;
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
Scripting.scriptEvent('applicationsShowDone');
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
Main.overview.hide();
yield Scripting.waitLeisure();
await Scripting.waitLeisure();
// --------------------- //
// Tests of redraw speed //
@ -145,46 +146,46 @@ function *run() {
global.frame_finish_timestamp = true;
for (let k = 0; k < 5; k++)
yield Scripting.createTestWindow({ maximized: true });
yield Scripting.waitTestWindows();
await Scripting.createTestWindow({ maximized: true });
await Scripting.waitTestWindows();
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
Scripting.scriptEvent('mainViewDrawStart');
yield waitAndDraw(1000);
await waitAndDraw(1000);
Scripting.scriptEvent('mainViewDrawDone');
Main.overview.show();
Scripting.waitLeisure();
yield Scripting.sleep(1500);
await Scripting.sleep(1500);
Scripting.scriptEvent('overviewDrawStart');
yield waitAndDraw(1000);
await waitAndDraw(1000);
Scripting.scriptEvent('overviewDrawDone');
yield Scripting.destroyTestWindows();
await Scripting.destroyTestWindows();
Main.overview.hide();
yield Scripting.createTestWindow({ maximized: true,
await Scripting.createTestWindow({ maximized: true,
redraws: true });
yield Scripting.waitTestWindows();
await Scripting.waitTestWindows();
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
Scripting.scriptEvent('redrawTestStart');
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
Scripting.scriptEvent('redrawTestDone');
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
Scripting.scriptEvent('collectTimings');
yield Scripting.destroyTestWindows();
await Scripting.destroyTestWindows();
global.frame_timestamps = false;
global.frame_finish_timestamp = false;
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
let appSys = Shell.AppSystem.get_default();
let app = appSys.lookup_app('org.gnome.gedit.desktop');
@ -197,21 +198,22 @@ function *run() {
throw new Error('gedit was already running');
while (windows.length == 0) {
yield waitSignal(global.display, 'window-created');
await waitSignal(global.display, 'window-created');
windows = app.get_windows();
}
let actor = windows[0].get_compositor_private();
yield waitSignal(actor, 'first-frame');
await waitSignal(actor, 'first-frame');
Scripting.scriptEvent('geditFirstFrame');
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
windows[0].delete(global.get_current_time());
yield Scripting.sleep(1000);
await Scripting.sleep(1000);
interfaceSettings.set_boolean('enable-animations', true);
/* eslint-enable no-await-in-loop */
}
let overviewShowStart;

File diff suppressed because it is too large Load Diff

View File

@ -347,6 +347,8 @@ var Background = GObject.registerClass({
this.set_color(color);
else
this.set_gradient(shadingType, color, secondColor);
this._setLoaded();
}
_watchFile(file) {
@ -765,10 +767,27 @@ var BackgroundManager = class BackgroundManager {
this._updateBackgroundActor();
});
let loadedSignalId;
if (background.isLoaded) {
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
this.emit('loaded');
return GLib.SOURCE_REMOVE;
});
} else {
loadedSignalId = background.connect('loaded', () => {
background.disconnect(loadedSignalId);
loadedSignalId = null;
this.emit('loaded');
});
}
backgroundActor.connect('destroy', () => {
if (changeSignalId)
background.disconnect(changeSignalId);
if (loadedSignalId)
background.disconnect(loadedSignalId);
if (backgroundActor.loadedSignalId)
background.disconnect(backgroundActor.loadedSignalId);
});

View File

@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported BoxPointer */
const { Clutter, GObject, Shell, St } = imports.gi;
const { Clutter, GObject, St } = imports.gi;
const Main = imports.ui.main;
@ -453,15 +453,16 @@ var BoxPointer = GObject.registerClass({
let alignment = this._arrowAlignment;
let monitorIndex = Main.layoutManager.findIndexForActor(sourceActor);
this._sourceAllocation = Shell.util_get_transformed_allocation(sourceActor);
this._sourceExtents = sourceActor.get_transformed_extents();
this._workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
// Position correctly relative to the sourceActor
let sourceNode = sourceActor.get_theme_node();
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
let sourceAllocation = this._sourceAllocation;
let sourceCenterX = sourceAllocation.x1 + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
let sourceCenterY = sourceAllocation.y1 + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
let sourceTopLeft = this._sourceExtents.get_top_left();
let sourceBottomRight = this._sourceExtents.get_bottom_right();
let sourceCenterX = sourceTopLeft.x + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
let sourceCenterY = sourceTopLeft.y + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
let [, , natWidth, natHeight] = this.get_preferred_size();
// We also want to keep it onscreen, and separated from the
@ -481,16 +482,16 @@ var BoxPointer = GObject.registerClass({
switch (this._arrowSide) {
case St.Side.TOP:
resY = sourceAllocation.y2 + gap;
resY = sourceBottomRight.y + gap;
break;
case St.Side.BOTTOM:
resY = sourceAllocation.y1 - natHeight - gap;
resY = sourceTopLeft.y - natHeight - gap;
break;
case St.Side.LEFT:
resX = sourceAllocation.x2 + gap;
resX = sourceBottomRight.x + gap;
break;
case St.Side.RIGHT:
resX = sourceAllocation.x1 - natWidth - gap;
resX = sourceTopLeft.x - natWidth - gap;
break;
}
@ -586,29 +587,30 @@ var BoxPointer = GObject.registerClass({
}
_calculateArrowSide(arrowSide) {
let sourceAllocation = this._sourceAllocation;
let sourceTopLeft = this._sourceExtents.get_top_left();
let sourceBottomRight = this._sourceExtents.get_bottom_right();
let [, , boxWidth, boxHeight] = this.get_preferred_size();
let workarea = this._workArea;
switch (arrowSide) {
case St.Side.TOP:
if (sourceAllocation.y2 + boxHeight > workarea.y + workarea.height &&
boxHeight < sourceAllocation.y1 - workarea.y)
if (sourceBottomRight.y + boxHeight > workarea.y + workarea.height &&
boxHeight < sourceTopLeft.y - workarea.y)
return St.Side.BOTTOM;
break;
case St.Side.BOTTOM:
if (sourceAllocation.y1 - boxHeight < workarea.y &&
boxHeight < workarea.y + workarea.height - sourceAllocation.y2)
if (sourceTopLeft.y - boxHeight < workarea.y &&
boxHeight < workarea.y + workarea.height - sourceBottomRight.y)
return St.Side.TOP;
break;
case St.Side.LEFT:
if (sourceAllocation.x2 + boxWidth > workarea.x + workarea.width &&
boxWidth < sourceAllocation.x1 - workarea.x)
if (sourceBottomRight.x + boxWidth > workarea.x + workarea.width &&
boxWidth < sourceTopLeft.x - workarea.x)
return St.Side.RIGHT;
break;
case St.Side.RIGHT:
if (sourceAllocation.x1 - boxWidth < workarea.x &&
boxWidth < workarea.x + workarea.width - sourceAllocation.x2)
if (sourceTopLeft.x - boxWidth < workarea.x &&
boxWidth < workarea.x + workarea.width - sourceBottomRight.x)
return St.Side.LEFT;
break;
}

View File

@ -388,17 +388,16 @@ var _Draggable = class _Draggable {
const [, newAllocatedWidth] = this._dragActor.get_preferred_width(-1);
const [, newAllocatedHeight] = this._dragActor.get_preferred_height(-1);
const transformedAllocation =
Shell.util_get_transformed_allocation(this._dragActor);
const transformedExtents = this._dragActor.get_transformed_extents();
// Set the actor's scale such that it will keep the same
// transformed size when it's reparented to the uiGroup
this._dragActor.set_scale(
transformedAllocation.get_width() / newAllocatedWidth,
transformedAllocation.get_height() / newAllocatedHeight);
transformedExtents.get_width() / newAllocatedWidth,
transformedExtents.get_height() / newAllocatedHeight);
this._dragOffsetX = transformedAllocation.x1 - this._dragStartX;
this._dragOffsetY = transformedAllocation.y1 - this._dragStartY;
this._dragOffsetX = transformedExtents.origin.x - this._dragStartX;
this._dragOffsetY = transformedExtents.origin.y - this._dragStartY;
this._dragOrigParent.remove_actor(this._dragActor);
Main.uiGroup.add_child(this._dragActor);

View File

@ -18,7 +18,7 @@
*/
const { AccountsService, Clutter, Gio,
GLib, GObject, Pango, Polkit, Shell, St } = imports.gi;
GLib, GObject, Pango, Polkit, Shell, St, UPowerGlib: UPower } = imports.gi;
const CheckBox = imports.ui.checkBox;
const Dialog = imports.ui.dialog;
@ -31,24 +31,30 @@ const { loadInterfaceXML } = imports.misc.fileUtils;
const _ITEM_ICON_SIZE = 64;
const LOW_BATTERY_THRESHOLD = 30;
const EndSessionDialogIface = loadInterfaceXML('org.gnome.SessionManager.EndSessionDialog');
const logoutDialogContent = {
subjectWithUser: C_("title", "Log Out %s"),
subject: C_("title", "Log Out"),
descriptionWithUser(user, seconds) {
return ngettext("%s will be logged out automatically in %d second.",
"%s will be logged out automatically in %d seconds.",
seconds).format(user, seconds);
return ngettext(
'%s will be logged out automatically in %d second.',
'%s will be logged out automatically in %d seconds.',
seconds).format(user, seconds);
},
description(seconds) {
return ngettext("You will be logged out automatically in %d second.",
"You will be logged out automatically in %d seconds.",
seconds).format(seconds);
return ngettext(
'You will be logged out automatically in %d second.',
'You will be logged out automatically in %d seconds.',
seconds).format(seconds);
},
showBatteryWarning: false,
confirmButtons: [{ signal: 'ConfirmedLogout',
label: C_("button", "Log Out") }],
confirmButtons: [{
signal: 'ConfirmedLogout',
label: C_('button', 'Log Out'),
}],
showOtherSessions: false,
};
@ -56,30 +62,36 @@ const shutdownDialogContent = {
subject: C_("title", "Power Off"),
subjectWithUpdates: C_("title", "Install Updates & Power Off"),
description(seconds) {
return ngettext("The system will power off automatically in %d second.",
"The system will power off automatically in %d seconds.",
seconds).format(seconds);
return ngettext(
'The system will power off automatically in %d second.',
'The system will power off automatically in %d seconds.',
seconds).format(seconds);
},
checkBoxText: C_("checkbox", "Install pending software updates"),
showBatteryWarning: true,
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart") },
{ signal: 'ConfirmedShutdown',
label: C_("button", "Power Off") }],
confirmButtons: [{
signal: 'ConfirmedShutdown',
label: C_('button', 'Power Off'),
}],
iconName: 'system-shutdown-symbolic',
showOtherSessions: true,
};
const restartDialogContent = {
subject: C_("title", "Restart"),
subjectWithUpdates: C_('title', 'Install Updates & Restart'),
description(seconds) {
return ngettext("The system will restart automatically in %d second.",
"The system will restart automatically in %d seconds.",
seconds).format(seconds);
return ngettext(
'The system will restart automatically in %d second.',
'The system will restart automatically in %d seconds.',
seconds).format(seconds);
},
showBatteryWarning: false,
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart") }],
checkBoxText: C_('checkbox', 'Install pending software updates'),
showBatteryWarning: true,
confirmButtons: [{
signal: 'ConfirmedReboot',
label: C_('button', 'Restart'),
}],
iconName: 'view-refresh-symbolic',
showOtherSessions: true,
};
@ -88,13 +100,16 @@ const restartUpdateDialogContent = {
subject: C_("title", "Restart & Install Updates"),
description(seconds) {
return ngettext("The system will automatically restart and install updates in %d second.",
"The system will automatically restart and install updates in %d seconds.",
seconds).format(seconds);
return ngettext(
'The system will automatically restart and install updates in %d second.',
'The system will automatically restart and install updates in %d seconds.',
seconds).format(seconds);
},
showBatteryWarning: true,
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart &amp; Install") }],
confirmButtons: [{
signal: 'ConfirmedReboot',
label: C_('button', 'Restart &amp; Install'),
}],
unusedFutureButtonForTranslation: C_("button", "Install &amp; Power Off"),
unusedFutureCheckBoxForTranslation: C_("checkbox", "Power off after updates are installed"),
iconName: 'view-refresh-symbolic',
@ -112,8 +127,10 @@ const restartUpgradeDialogContent = {
},
disableTimer: true,
showBatteryWarning: false,
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart &amp; Install") }],
confirmButtons: [{
signal: 'ConfirmedReboot',
label: C_('button', 'Restart &amp; Install'),
}],
iconName: 'view-refresh-symbolic',
showOtherSessions: true,
};
@ -142,7 +159,7 @@ const LogindSession = Gio.DBusProxy.makeProxyWrapper(LogindSessionIface);
const PkOfflineIface = loadInterfaceXML('org.freedesktop.PackageKit.Offline');
const PkOfflineProxy = Gio.DBusProxy.makeProxyWrapper(PkOfflineIface);
const UPowerIface = loadInterfaceXML('org.freedesktop.UPower');
const UPowerIface = loadInterfaceXML('org.freedesktop.UPower.Device');
const UPowerProxy = Gio.DBusProxy.makeProxyWrapper(UPowerIface);
function findAppFromInhibitor(inhibitor) {
@ -213,6 +230,11 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
destroyOnClose: false });
this._loginManager = LoginManager.getLoginManager();
this._loginManager.canRebootToBootLoaderMenu(
(canRebootToBootLoaderMenu, unusedNeedsAuth) => {
this._canRebootToBootLoaderMenu = canRebootToBootLoaderMenu;
});
this._userManager = AccountsService.UserManager.get_default();
this._user = this._userManager.get_user(GLib.get_user_name());
this._updatesPermission = null;
@ -224,7 +246,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._powerProxy = new UPowerProxy(Gio.DBus.system,
'org.freedesktop.UPower',
'/org/freedesktop/UPower',
'/org/freedesktop/UPower/devices/DisplayDevice',
(proxy, error) => {
if (error) {
log(error.message);
@ -239,6 +261,9 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._totalSecondsToStayOpen = 0;
this._applications = [];
this._sessions = [];
this._capturedEventId = 0;
this._rebootButton = null;
this._rebootButtonAlt = null;
this.connect('destroy',
this._onDestroy.bind(this));
@ -256,7 +281,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._batteryWarning = new St.Label({
style_class: 'end-session-dialog-battery-warning',
text: _('Running on battery power: Please plug in before installing updates.'),
text: _('Low battery power: please plug in before installing updates.'),
});
this._batteryWarning.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._batteryWarning.clutter_text.line_wrap = true;
@ -306,6 +331,32 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._user.disconnect(this._userChangedId);
}
_isDischargingBattery() {
return this._powerProxy.IsPresent &&
this._powerProxy.State !== UPower.DeviceState.CHARGING &&
this._powerProxy.State !== UPower.DeviceState.FULLY_CHARGED;
}
_isBatteryLow() {
return this._isDischargingBattery() && this._powerProxy.Percentage < LOW_BATTERY_THRESHOLD;
}
_shouldShowLowBatteryWarning(dialogContent) {
if (!dialogContent.showBatteryWarning)
return false;
if (!this._isBatteryLow())
return false;
if (this._checkBox.checked)
return true;
// Show the warning if updates have already been triggered, but
// the user doesn't have enough permissions to cancel them.
let updatesAllowed = this._updatesPermission && this._updatesPermission.allowed;
return this._updateInfo.UpdatePrepared && this._updateInfo.UpdateTriggered && !updatesAllowed;
}
_sync() {
let open = this.state == ModalDialog.State.OPENING || this.state == ModalDialog.State.OPENED;
if (!open)
@ -319,10 +370,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
if (dialogContent.subjectWithUpdates && this._checkBox.checked)
subject = dialogContent.subjectWithUpdates;
if (dialogContent.showBatteryWarning) {
this._batteryWarning.visible =
this._powerProxy.OnBattery && this._checkBox.checked;
}
this._batteryWarning.visible = this._shouldShowLowBatteryWarning(dialogContent);
let description;
let displayTime = _roundSecondsToInterval(this._totalSecondsToStayOpen,
@ -363,16 +411,38 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._sessionSection.visible = hasSessions;
}
_updateButtons() {
let dialogContent = DialogContent[this._type];
let buttons = [{ action: this.cancel.bind(this),
label: _("Cancel"),
key: Clutter.KEY_Escape }];
_onCapturedEvent(actor, event) {
let altEnabled = false;
let type = event.type();
if (type !== Clutter.EventType.KEY_PRESS && type !== Clutter.EventType.KEY_RELEASE)
return Clutter.EVENT_PROPAGATE;
let key = event.get_key_symbol();
if (key !== Clutter.KEY_Alt_L && key !== Clutter.KEY_Alt_R)
return Clutter.EVENT_PROPAGATE;
if (type === Clutter.EventType.KEY_PRESS)
altEnabled = true;
this._rebootButton.visible = !altEnabled;
this._rebootButtonAlt.visible = altEnabled;
return Clutter.EVENT_PROPAGATE;
}
_updateButtons() {
this.clearButtons();
this.addButton({ action: this.cancel.bind(this),
label: _("Cancel"),
key: Clutter.KEY_Escape });
let dialogContent = DialogContent[this._type];
for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
let signal = dialogContent.confirmButtons[i].signal;
let label = dialogContent.confirmButtons[i].label;
buttons.push({
let button = this.addButton({
action: () => {
this.close(true);
let signalId = this.connect('closed', () => {
@ -382,9 +452,34 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
},
label,
});
}
this.setButtons(buttons);
// Add Alt "Boot Options" option to the Reboot button
if (this._canRebootToBootLoaderMenu && signal === 'ConfirmedReboot') {
this._rebootButton = button;
this._rebootButtonAlt = this.addButton({
action: () => {
this.close(true);
let signalId = this.connect('closed', () => {
this.disconnect(signalId);
this._confirmRebootToBootLoaderMenu();
});
},
label: C_('button', 'Boot Options'),
});
this._rebootButtonAlt.visible = false;
this._capturedEventId = global.stage.connect('captured-event',
this._onCapturedEvent.bind(this));
}
}
}
_stopAltCapture() {
if (this._capturedEventId > 0) {
global.stage.disconnect(this._capturedEventId);
this._capturedEventId = 0;
}
this._rebootButton = null;
this._rebootButtonAlt = null;
}
close(skipSignal) {
@ -396,14 +491,21 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
cancel() {
this._stopTimer();
this._stopAltCapture();
this._dbusImpl.emit_signal('Canceled', null);
this.close();
}
_confirmRebootToBootLoaderMenu() {
this._loginManager.setRebootToBootLoaderMenu();
this._confirm('ConfirmedReboot');
}
_confirm(signal) {
let callback = () => {
this._fadeOutDialog();
this._stopTimer();
this._stopAltCapture();
this._dbusImpl.emit_signal(signal, null);
};
@ -671,19 +773,17 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
if (dialogContent.showOtherSessions)
this._loadSessions();
let updateTriggered = this._updateInfo.UpdateTriggered;
let updatePrepared = this._updateInfo.UpdatePrepared;
let updatesAllowed = this._updatesPermission && this._updatesPermission.allowed;
_setCheckBoxLabel(this._checkBox, dialogContent.checkBoxText || '');
this._checkBox.visible = dialogContent.checkBoxText && updatePrepared && updatesAllowed;
this._checkBox.checked = this._checkBox.visible;
this._checkBox.visible = dialogContent.checkBoxText && this._updateInfo.UpdatePrepared && updatesAllowed;
// We show the warning either together with the checkbox, or when
// updates have already been triggered, but the user doesn't have
// enough permissions to cancel them.
this._batteryWarning.visible = dialogContent.showBatteryWarning &&
(this._checkBox.visible || updatePrepared && updateTriggered && !updatesAllowed);
if (this._type === DialogType.UPGRADE_RESTART)
this._checkBox.checked = this._checkBox.visible && this._updateInfo.UpdateTriggered && !this._isDischargingBattery();
else
this._checkBox.checked = this._checkBox.visible && !this._isBatteryLow();
this._batteryWarning.visible = this._shouldShowLowBatteryWarning(dialogContent);
this._updateButtons();

View File

@ -134,7 +134,14 @@ function _easeActor(actor, params) {
actor.set_easing_mode(params.mode);
delete params.mode;
let cleanup = () => Meta.enable_unredirect_for_display(global.display);
const prepare = () => {
Meta.disable_unredirect_for_display(global.display);
global.begin_work();
};
const cleanup = () => {
Meta.enable_unredirect_for_display(global.display);
global.end_work();
};
let callback = _makeEaseCallback(params, cleanup);
// cancel overwritten transitions
@ -149,9 +156,9 @@ function _easeActor(actor, params) {
.find(t => t !== null);
if (transition && transition.delay)
transition.connect('started', () => Meta.disable_unredirect_for_display(global.display));
transition.connect('started', () => prepare());
else
Meta.disable_unredirect_for_display(global.display);
prepare();
if (transition) {
transition.set({ repeatCount, autoReverse });
@ -191,7 +198,14 @@ function _easeActorProperty(actor, propName, target, params) {
if (actor instanceof Clutter.Actor && !actor.mapped)
duration = 0;
let cleanup = () => Meta.enable_unredirect_for_display(global.display);
const prepare = () => {
Meta.disable_unredirect_for_display(global.display);
global.begin_work();
};
const cleanup = () => {
Meta.enable_unredirect_for_display(global.display);
global.end_work();
};
let callback = _makeEaseCallback(params, cleanup);
// cancel overwritten transition
@ -203,7 +217,7 @@ function _easeActorProperty(actor, propName, target, params) {
if (!isReversed)
obj[prop] = target;
Meta.disable_unredirect_for_display(global.display);
prepare();
callback(true);
return;
@ -222,9 +236,9 @@ function _easeActorProperty(actor, propName, target, params) {
transition.set_to(target);
if (transition.delay)
transition.connect('started', () => Meta.disable_unredirect_for_display(global.display));
transition.connect('started', () => prepare());
else
Meta.disable_unredirect_for_display(global.display);
prepare();
transition.connect('stopped', (t, finished) => callback(finished));
}

View File

@ -139,7 +139,9 @@ function checkForUpdates() {
return;
if (extension.hasUpdate)
return;
metadatas[uuid] = extension.metadata;
metadatas[uuid] = {
version: extension.metadata.version,
};
});
if (Object.keys(metadatas).length === 0)

View File

@ -52,6 +52,17 @@ const defaultGridModes = [
},
];
var LEFT_DIVIDER_LEEWAY = 20;
var RIGHT_DIVIDER_LEEWAY = 20;
var DragLocation = {
INVALID: 0,
START_EDGE: 1,
ON_ICON: 2,
END_EDGE: 3,
EMPTY_SPACE: 4,
};
var BaseIcon = GObject.registerClass(
class BaseIcon extends St.Bin {
_init(label, params) {
@ -946,6 +957,99 @@ var IconGridLayout = GObject.registerClass({
}
}
/**
* getDropTarget:
* @param {int} x: position of the horizontal axis
* @param {int} y: position of the vertical axis
*
* Retrieves the item located at (@x, @y), as well as the drag location.
* Both @x and @y are relative to the grid.
*
* @returns {[Clutter.Actor, DragLocation]} the item and drag location
* under (@x, @y)
*/
getDropTarget(x, y) {
const childSize = this._getChildrenMaxSize();
const [leftEmptySpace, topEmptySpace, hSpacing, vSpacing] =
this._calculateSpacing(childSize);
const isRtl =
Clutter.get_default_text_direction() === Clutter.TextDirection.RTL;
let page = this._orientation === Clutter.Orientation.VERTICAL
? Math.floor(y / this._pageHeight)
: Math.floor(x / this._pageWidth);
// Out of bounds
if (page >= this._pages.length)
return [null, DragLocation.INVALID];
if (isRtl && this._orientation === Clutter.Orientation.HORIZONTAL)
page = swap(page, this._pages.length);
// Page-relative coordinates from now on
x %= this._pageWidth;
y %= this._pageHeight;
if (x < leftEmptySpace || y < topEmptySpace)
return [null, DragLocation.INVALID];
const gridWidth =
childSize * this._columnsPerPage +
hSpacing * (this._columnsPerPage - 1);
const gridHeight =
childSize * this._rowsPerPage +
vSpacing * (this._rowsPerPage - 1);
if (x > leftEmptySpace + gridWidth || y > topEmptySpace + gridHeight)
return [null, DragLocation.INVALID];
const halfHSpacing = hSpacing / 2;
const halfVSpacing = vSpacing / 2;
const visibleItems = this._getVisibleChildrenForPage(page);
for (const item of visibleItems) {
const childBox = item.allocation.copy();
// Page offset
switch (this._orientation) {
case Clutter.Orientation.HORIZONTAL:
childBox.set_origin(childBox.x1 % this._pageWidth, childBox.y1);
break;
case Clutter.Orientation.VERTICAL:
childBox.set_origin(childBox.x1, childBox.y1 % this._pageHeight);
break;
}
// Outside the icon boundaries
if (x < childBox.x1 - halfHSpacing ||
x > childBox.x2 + halfHSpacing ||
y < childBox.y1 - halfVSpacing ||
y > childBox.y2 + halfVSpacing)
continue;
let dragLocation;
if (x < childBox.x1 + LEFT_DIVIDER_LEEWAY)
dragLocation = DragLocation.START_EDGE;
else if (x > childBox.x2 - RIGHT_DIVIDER_LEEWAY)
dragLocation = DragLocation.END_EDGE;
else
dragLocation = DragLocation.ON_ICON;
if (isRtl) {
if (dragLocation === DragLocation.START_EDGE)
dragLocation = DragLocation.END_EDGE;
else if (dragLocation === DragLocation.END_EDGE)
dragLocation = DragLocation.START_EDGE;
}
return [item, dragLocation];
}
return [null, DragLocation.EMPTY_SPACE];
}
// eslint-disable-next-line camelcase
get allow_incomplete_pages() {
return this._allowIncompletePages;
@ -1559,6 +1663,11 @@ var IconGrid = GObject.registerClass({
this.queue_relayout();
}
getDropTarget(x, y) {
const layoutManager = this.layout_manager;
return layoutManager.getDropTarget(x, y, this._currentPage);
}
get itemsPerPage() {
const layoutManager = this.layout_manager;
return layoutManager.rows_per_page * layoutManager.columns_per_page;

View File

@ -7,7 +7,7 @@ const PermissionStore = imports.misc.permissionStore;
const WAYLAND_KEYBINDINGS_SCHEMA = 'org.gnome.mutter.wayland.keybindings';
const APP_WHITELIST = ['gnome-control-center.desktop'];
const APP_ALLOWLIST = ['gnome-control-center.desktop'];
const APP_PERMISSIONS_TABLE = 'gnome';
const APP_PERMISSIONS_ID = 'shortcuts-inhibitor';
const GRANTED = 'GRANTED';
@ -118,7 +118,7 @@ var InhibitShortcutsDialog = GObject.registerClass({
}
vfunc_show() {
if (this._app && APP_WHITELIST.includes(this._app.get_id())) {
if (this._app && APP_ALLOWLIST.includes(this._app.get_id())) {
this._emitResponse(DialogResponse.ALLOW);
return;
}

View File

@ -42,7 +42,7 @@ const defaultKeysPost = [
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic' }],
[{ label: '=/<', width: 3, level: 3, right: true }],
[{ action: 'emoji', icon: 'face-smile-symbolic' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
[{ action: 'emoji', icon: 'face-smile-symbolic' }, { action: 'languageMenu', extraClassName: 'layout-key', icon: 'keyboard-layout-filled-symbolic' }, { action: 'hide', extraClassName: 'hide-key', icon: 'go-down-symbolic' }]],
[[{ width: 1.5, keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic' }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic' }],
[{ label: '?123', width: 3, level: 2, right: true }],
@ -1091,8 +1091,8 @@ var Keypad = GObject.registerClass({
{ label: '8', keyval: Clutter.KEY_8, left: 1, top: 2 },
{ label: '9', keyval: Clutter.KEY_9, left: 2, top: 2 },
{ label: '0', keyval: Clutter.KEY_0, left: 1, top: 3 },
{ label: '⌫', keyval: Clutter.KEY_BackSpace, left: 3, top: 0 },
{ keyval: Clutter.KEY_Return, extraClassName: 'enter-key', left: 3, top: 1, height: 2 },
{ keyval: Clutter.KEY_BackSpace, icon: 'edit-clear-symbolic', left: 3, top: 0 },
{ keyval: Clutter.KEY_Return, extraClassName: 'enter-key', icon: 'keyboard-enter-symbolic', left: 3, top: 1, height: 2 },
];
super._init({
@ -1109,7 +1109,7 @@ var Keypad = GObject.registerClass({
for (let i = 0; i < keys.length; i++) {
let cur = keys[i];
let key = new Key(cur.label || "", []);
let key = new Key(cur.label || "", [], cur.icon);
if (keys[i].extraClassName)
key.keyButton.add_style_class_name(cur.extraClassName);

View File

@ -6,7 +6,6 @@ const Signals = imports.signals;
const Background = imports.ui.background;
const BackgroundMenu = imports.ui.backgroundMenu;
const LoginManager = imports.misc.loginManager;
const DND = imports.ui.dnd;
const Main = imports.ui.main;
@ -295,18 +294,6 @@ var LayoutManager = GObject.registerClass({
monitorManager.connect('monitors-changed',
this._monitorsChanged.bind(this));
this._monitorsChanged();
// NVIDIA drivers don't preserve FBO contents across
// suspend/resume, see
// https://bugzilla.gnome.org/show_bug.cgi?id=739178
if (Shell.util_need_background_refresh()) {
LoginManager.getLoginManager().connect('prepare-for-sleep',
(lm, suspending) => {
if (suspending)
return;
Meta.Background.refresh_all();
});
}
}
// This is called by Main after everything else is constructed
@ -470,6 +457,15 @@ var LayoutManager = GObject.registerClass({
}
}
_waitLoaded(bgManager) {
return new Promise(resolve => {
const id = bgManager.connect('loaded', () => {
bgManager.disconnect(id);
resolve();
});
});
}
_updateBackgrounds() {
for (let i = 0; i < this._bgManagers.length; i++)
this._bgManagers[i].destroy();
@ -477,7 +473,7 @@ var LayoutManager = GObject.registerClass({
this._bgManagers = [];
if (Main.sessionMode.isGreeter)
return;
return Promise.resolve();
for (let i = 0; i < this.monitors.length; i++) {
let bgManager = this._createBackgroundManager(i);
@ -486,6 +482,8 @@ var LayoutManager = GObject.registerClass({
if (i != this.primaryIndex && this._startingUp)
bgManager.backgroundActor.hide();
}
return Promise.all(this._bgManagers.map(this._waitLoaded));
}
_updateKeyboardBox() {
@ -644,7 +642,7 @@ var LayoutManager = GObject.registerClass({
// When starting a normal user session, we want to grow it out of the middle
// of the screen.
_prepareStartupAnimation() {
async _prepareStartupAnimation() {
// During the initial transition, add a simple actor to block all events,
// so they don't get delivered to X11 windows that have been transformed.
this._coverPane = new Clutter.Actor({ opacity: 0,
@ -661,8 +659,6 @@ var LayoutManager = GObject.registerClass({
} else if (Main.sessionMode.isGreeter) {
this.panelBox.translation_y = -this.panelBox.height;
} else {
this._updateBackgrounds();
// We need to force an update of the regions now before we scale
// the UI group to get the correct allocation for the struts.
this._updateRegions();
@ -678,6 +674,8 @@ var LayoutManager = GObject.registerClass({
this.uiGroup.scale_x = this.uiGroup.scale_y = 0.75;
this.uiGroup.opacity = 0;
global.window_group.set_clip(monitor.x, monitor.y, monitor.width, monitor.height);
await this._updateBackgrounds();
}
this.emit('startup-prepared');
@ -1230,8 +1228,9 @@ class HotCorner extends Clutter.Actor {
return;
if (Main.overview.shouldToggleByCornerOrButton()) {
this._ripples.playAnimation(this._x, this._y);
Main.overview.toggle();
if (Main.overview.animationInProgress)
this._ripples.playAnimation(this._x, this._y);
}
}

View File

@ -3,10 +3,10 @@
ctrlAltTabManager, padOsdService, osdWindowManager,
osdMonitorLabeler, shellMountOpDBusService, shellDBusService,
shellAccessDialogDBusService, shellAudioSelectionDBusService,
screenSaverDBus, screencastService, uiGroup, magnifier,
xdndHandler, keyboard, kbdA11yDialog, introspectService,
start, pushModal, popModal, activateWindow, createLookingGlass,
initializeDeferredWork, getThemeStylesheet, setThemeStylesheet */
screenSaverDBus, uiGroup, magnifier, xdndHandler, keyboard,
kbdA11yDialog, introspectService, start, pushModal, popModal,
activateWindow, createLookingGlass, initializeDeferredWork,
getThemeStylesheet, setThemeStylesheet */
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
@ -34,7 +34,6 @@ const LoginManager = imports.misc.loginManager;
const LookingGlass = imports.ui.lookingGlass;
const NotificationDaemon = imports.ui.notificationDaemon;
const WindowAttentionHandler = imports.ui.windowAttentionHandler;
const Screencast = imports.ui.screencast;
const ScreenShield = imports.ui.screenShield;
const Scripting = imports.ui.scripting;
const SessionMode = imports.ui.sessionMode;
@ -74,7 +73,6 @@ var shellAudioSelectionDBusService = null;
var shellDBusService = null;
var shellMountOpDBusService = null;
var screenSaverDBus = null;
var screencastService = null;
var modalCount = 0;
var actionMode = Shell.ActionMode.NONE;
var modalActorFocusStack = [];
@ -200,7 +198,6 @@ function _initializeUI() {
uiGroup = layoutManager.uiGroup;
padOsdService = new PadOsd.PadOsdService();
screencastService = new Screencast.ScreencastService();
xdndHandler = new XdndHandler.XdndHandler();
ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager();
osdWindowManager = new OsdWindow.OsdWindowManager();

View File

@ -736,13 +736,11 @@ class AggregateMenu extends PanelMenu.Button {
this._volume = new imports.ui.status.volume.Indicator();
this._brightness = new imports.ui.status.brightness.Indicator();
this._system = new imports.ui.status.system.Indicator();
this._screencast = new imports.ui.status.screencast.Indicator();
this._location = new imports.ui.status.location.Indicator();
this._nightLight = new imports.ui.status.nightLight.Indicator();
this._thunderbolt = new imports.ui.status.thunderbolt.Indicator();
this._indicators.add_child(this._thunderbolt);
this._indicators.add_child(this._screencast);
this._indicators.add_child(this._location);
this._indicators.add_child(this._nightLight);
if (this._network)

View File

@ -183,10 +183,9 @@ var Button = GObject.registerClass({
}
_onDestroy() {
super._onDestroy();
if (this.menu)
this.menu.destroy();
super._onDestroy();
}
});

View File

@ -881,9 +881,10 @@ var PopupMenu = class extends PopupMenuBase {
let state = event.get_state();
// if user has a modifier down (except capslock)
// if user has a modifier down (except capslock and numlock)
// then don't handle the key press here
state &= ~Clutter.ModifierType.LOCK_MASK;
state &= ~Clutter.ModifierType.MOD2_MASK;
state &= Clutter.ModifierType.MODIFIER_MASK;
if (state)
@ -1324,7 +1325,7 @@ var PopupMenuManager = class {
removeMenu(menu) {
if (menu == this.activeMenu)
this._closeMenu(false, menu);
this._grabHelper.ungrab({ actor: menu.actor });
let position = this._findMenu(menu);
if (position == -1) // not a menu we manage

View File

@ -1,146 +0,0 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const { Gio, GLib, Shell } = imports.gi;
const Signals = imports.signals;
const Main = imports.ui.main;
const { loadInterfaceXML } = imports.misc.fileUtils;
const ScreencastIface = loadInterfaceXML('org.gnome.Shell.Screencast');
var ScreencastService = class {
constructor() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(ScreencastIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell/Screencast');
Gio.DBus.session.own_name('org.gnome.Shell.Screencast', Gio.BusNameOwnerFlags.REPLACE, null, null);
this._recorders = new Map();
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
}
get isRecording() {
return this._recorders.size > 0;
}
_ensureRecorderForSender(sender) {
let recorder = this._recorders.get(sender);
if (!recorder) {
recorder = new Shell.Recorder({ stage: global.stage,
display: global.display });
recorder._watchNameId =
Gio.bus_watch_name(Gio.BusType.SESSION, sender, 0, null,
this._onNameVanished.bind(this));
this._recorders.set(sender, recorder);
this.emit('updated');
}
return recorder;
}
_sessionUpdated() {
if (Main.sessionMode.allowScreencast)
return;
for (let sender of this._recorders.keys())
this._stopRecordingForSender(sender);
}
_onNameVanished(connection, name) {
this._stopRecordingForSender(name);
}
_stopRecordingForSender(sender) {
let recorder = this._recorders.get(sender);
if (!recorder)
return false;
Gio.bus_unwatch_name(recorder._watchNameId);
recorder.close();
this._recorders.delete(sender);
this.emit('updated');
return true;
}
_applyOptionalParameters(recorder, options) {
for (let option in options)
options[option] = options[option].deep_unpack();
if (options['pipeline'])
recorder.set_pipeline(options['pipeline']);
if (options['framerate'])
recorder.set_framerate(options['framerate']);
if ('draw-cursor' in options)
recorder.set_draw_cursor(options['draw-cursor']);
}
ScreencastAsync(params, invocation) {
let returnValue = [false, ''];
if (!Main.sessionMode.allowScreencast ||
this._lockdownSettings.get_boolean('disable-save-to-disk')) {
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
return;
}
let sender = invocation.get_sender();
let recorder = this._ensureRecorderForSender(sender);
if (!recorder.is_recording()) {
let [fileTemplate, options] = params;
recorder.set_file_template(fileTemplate);
this._applyOptionalParameters(recorder, options);
let [success, fileName] = recorder.record();
returnValue = [success, fileName ? fileName : ''];
if (!success)
this._stopRecordingForSender(sender);
}
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
}
ScreencastAreaAsync(params, invocation) {
let returnValue = [false, ''];
if (!Main.sessionMode.allowScreencast ||
this._lockdownSettings.get_boolean('disable-save-to-disk')) {
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
return;
}
let sender = invocation.get_sender();
let recorder = this._ensureRecorderForSender(sender);
if (!recorder.is_recording()) {
let [x, y, width, height, fileTemplate, options] = params;
if (x < 0 || y < 0 ||
width <= 0 || height <= 0 ||
x + width > global.screen_width ||
y + height > global.screen_height) {
invocation.return_error_literal(Gio.IOErrorEnum,
Gio.IOErrorEnum.CANCELLED,
"Invalid params");
return;
}
recorder.set_file_template(fileTemplate);
recorder.set_area(x, y, width, height);
this._applyOptionalParameters(recorder, options);
let [success, fileName] = recorder.record();
returnValue = [success, fileName ? fileName : ''];
if (!success)
this._stopRecordingForSender(sender);
}
invocation.return_value(GLib.Variant.new('(bs)', returnValue));
}
StopScreencastAsync(params, invocation) {
let success = this._stopRecordingForSender(invocation.get_sender());
invocation.return_value(GLib.Variant.new('(b)', [success]));
}
};
Signals.addSignalMethods(ScreencastService.prototype);

View File

@ -21,16 +21,13 @@ const { loadInterfaceXML } = imports.misc.fileUtils;
// When scripting an automated test we want to make a series of calls
// in a linear fashion, but we also want to be able to let the main
// loop run so actions can finish. For this reason we write the script
// as a generator function that yields when it want to let the main
// as an async function that uses await when it wants to let the main
// loop run.
//
// yield Scripting.sleep(1000);
// await Scripting.sleep(1000);
// main.overview.show();
// yield Scripting.waitLeisure();
// await Scripting.waitLeisure();
//
// While it isn't important to the person writing the script, the actual
// yielded result is a function that the caller uses to provide the
// callback for resuming the script.
/**
* sleep:
@ -285,13 +282,11 @@ function _collect(scriptModule, outputFile) {
}
async function _runPerfScript(scriptModule, outputFile) {
for (let step of scriptModule.run()) {
try {
await step; // eslint-disable-line no-await-in-loop
} catch (err) {
log(`Script failed: ${err}\n${err.stack}`);
Meta.exit(Meta.ExitCode.ERROR);
}
try {
await scriptModule.run();
} catch (err) {
log(`Script failed: ${err}\n${err.stack}`);
Meta.exit(Meta.ExitCode.ERROR);
}
try {

View File

@ -113,10 +113,10 @@ function _loadMode(file, info) {
}
_modes[modeName] = {};
let propBlacklist = ['unlockDialog'];
const excludedProps = ['unlockDialog'];
for (let prop in _modes[DEFAULT_MODE]) {
if (newMode[prop] !== undefined &&
!propBlacklist.includes(prop))
!excludedProps.includes(prop))
_modes[modeName][prop] = newMode[prop];
}
_modes[modeName]['isPrimary'] = true;

View File

@ -15,6 +15,7 @@ const Util = imports.misc.util;
const { loadInterfaceXML } = imports.misc.fileUtils;
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
Gio._promisify(NM.Client, 'new_async', 'new_finish');
Gio._promisify(NM.Client.prototype,
'check_connectivity_async', 'check_connectivity_finish');
@ -82,6 +83,30 @@ function ensureActiveConnectionProps(active) {
}
}
function launchSettingsPanel(panel, ...args) {
const param = new GLib.Variant('(sav)',
[panel, args.map(s => new GLib.Variant('s', s))]);
const platformData = {
'desktop-startup-id': new GLib.Variant('s',
'_TIME%s'.format(global.get_current_time())),
};
try {
Gio.DBus.session.call(
'org.gnome.ControlCenter',
'/org/gnome/ControlCenter',
'org.freedesktop.Application',
'ActivateAction',
new GLib.Variant('(sava{sv})',
['launch-panel', [param], platformData]),
null,
Gio.DBusCallFlags.NONE,
-1,
null);
} catch (e) {
log('Failed to launch Settings panel: %s'.format(e.message));
}
}
var NMConnectionItem = class {
constructor(section, connection) {
this._section = section;
@ -539,8 +564,7 @@ var NMDeviceModem = class extends NMConnectionDevice {
}
_autoConnect() {
Util.spawn(['gnome-control-center', 'network',
'connect-3g', this._device.get_path()]);
launchSettingsPanel('network', 'connect-3g', this._device.get_path());
}
destroy() {
@ -931,8 +955,8 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
(accessPoints[0]._secType == NMAccessPointSecurity.WPA_ENT)) {
// 802.1x-enabled APs require further configuration, so they're
// handled in gnome-control-center
Util.spawn(['gnome-control-center', 'wifi', 'connect-8021x-wifi',
this._device.get_path(), accessPoints[0].get_path()]);
launchSettingsPanel('wifi', 'connect-8021x-wifi',
this._device.get_path(), accessPoints[0].get_path());
} else {
let connection = new NM.SimpleConnection();
this._client.add_and_activate_connection_async(connection, this._device, accessPoints[0].get_path(), null, null);

View File

@ -24,7 +24,8 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator {
return;
this._handles = new Set();
this._indicator = null;
this._sharedIndicator = null;
this._recordingIndicator = null;
this._menuSection = null;
controller.connect('new-handle', (o, handle) => {
@ -33,32 +34,49 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator {
}
_ensureControls() {
if (this._indicator)
if (this._sharedIndicator && this._recordingIndicator)
return;
this._indicator = this._addIndicator();
this._indicator.icon_name = 'screen-shared-symbolic';
this._indicator.add_style_class_name('remote-access-indicator');
this._item =
this._sharedIndicator = this._addIndicator();
this._sharedIndicator.icon_name = 'screen-shared-symbolic';
this._sharedIndicator.add_style_class_name('remote-access-indicator');
this._sharedItem =
new PopupMenu.PopupSubMenuMenuItem(_("Screen is Being Shared"),
true);
this._item.menu.addAction(_("Turn off"),
() => {
for (let handle of this._handles)
handle.stop();
});
this._item.icon.icon_name = 'screen-shared-symbolic';
this.menu.addMenuItem(this._item);
this._sharedItem.menu.addAction(_("Turn off"),
() => {
for (let handle of this._handles) {
if (!handle.is_recording)
handle.stop();
}
});
this._sharedItem.icon.icon_name = 'screen-shared-symbolic';
this.menu.addMenuItem(this._sharedItem);
this._recordingIndicator = this._addIndicator();
this._recordingIndicator.icon_name = 'media-record-symbolic';
this._recordingIndicator.add_style_class_name('screencast-indicator');
}
_isScreenShared() {
return [...this._handles].some(handle => !handle.is_recording);
}
_isRecording() {
return [...this._handles].some(handle => handle.is_recording);
}
_sync() {
if (this._handles.size == 0) {
this._indicator.visible = false;
this._item.visible = false;
if (this._isScreenShared()) {
this._sharedIndicator.visible = true;
this._sharedItem.visible = true;
} else {
this._indicator.visible = true;
this._item.visible = true;
this._sharedIndicator.visible = false;
this._sharedItem.visible = false;
}
this._recordingIndicator.visible = this._isRecording();
}
_onStopped(handle) {
@ -70,9 +88,7 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator {
this._handles.add(handle);
handle.connect('stopped', this._onStopped.bind(this));
if (this._handles.size == 1) {
this._ensureControls();
this._sync();
}
this._ensureControls();
this._sync();
}
});

View File

@ -86,6 +86,8 @@ class Indicator extends PanelMenu.SystemIndicator {
Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
this._sync();
}
_sessionUpdated() {

View File

@ -1,25 +0,0 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported Indicator */
const GObject = imports.gi.GObject;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
var Indicator = GObject.registerClass(
class Indicator extends PanelMenu.SystemIndicator {
_init() {
super._init();
this._indicator = this._addIndicator();
this._indicator.icon_name = 'media-record-symbolic';
this._indicator.add_style_class_name('screencast-indicator');
this._sync();
Main.screencastService.connect('updated', this._sync.bind(this));
}
_sync() {
this._indicator.visible = Main.screencastService.isRecording;
}
});

View File

@ -27,6 +27,8 @@ class Indicator extends PanelMenu.SystemIndicator {
() => this._updateSessionSubMenu());
this._powerOffItem.connect('notify::visible',
() => this._updateSessionSubMenu());
this._restartItem.connect('notify::visible',
() => this._updateSessionSubMenu());
// Whether shutdown is available or not depends on both lockdown
// settings (disable-log-out) and Polkit policy - the latter doesn't
// notify, so we update the menu item each time the menu opens or
@ -52,6 +54,7 @@ class Indicator extends PanelMenu.SystemIndicator {
this._loginScreenItem.visible ||
this._logoutItem.visible ||
this._suspendItem.visible ||
this._restartItem.visible ||
this._powerOffItem.visible;
}
@ -70,9 +73,8 @@ class Indicator extends PanelMenu.SystemIndicator {
this.menu.addMenuItem(item);
this._orientationLockItem = item;
this._systemActions.bind_property('can-lock-orientation',
this._orientationLockItem,
'visible',
bindFlags);
this._orientationLockItem, 'visible',
bindFlags);
this._systemActions.connect('notify::orientation-lock-icon', () => {
let iconName = this._systemActions.orientation_lock_icon;
let labelText = this._systemActions.getName("lock-orientation");
@ -84,8 +86,8 @@ class Indicator extends PanelMenu.SystemIndicator {
let app = this._settingsApp = Shell.AppSystem.get_default().lookup_app(
'gnome-control-center.desktop');
if (app) {
let [icon, name] = [app.app_info.get_icon().names[0],
app.get_name()];
const [icon] = app.app_info.get_icon().names;
const name = app.app_info.get_name();
item = new PopupMenu.PopupImageMenuItem(name, icon);
item.connect('activate', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
@ -107,41 +109,14 @@ class Indicator extends PanelMenu.SystemIndicator {
this.menu.addMenuItem(item);
this._lockScreenItem = item;
this._systemActions.bind_property('can-lock-screen',
this._lockScreenItem,
'visible',
bindFlags);
this._lockScreenItem, 'visible',
bindFlags);
this._sessionSubMenu = new PopupMenu.PopupSubMenuMenuItem(
_('Power Off / Log Out'), true);
this._sessionSubMenu.icon.icon_name = 'system-shutdown-symbolic';
item = new PopupMenu.PopupMenuItem(_("Log Out"));
item.connect('activate', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateLogout();
});
this._sessionSubMenu.menu.addMenuItem(item);
this._logoutItem = item;
this._systemActions.bind_property('can-logout',
this._logoutItem,
'visible',
bindFlags);
item = new PopupMenu.PopupMenuItem(_("Switch User…"));
item.connect('activate', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateSwitchUser();
});
this._sessionSubMenu.menu.addMenuItem(item);
this._loginScreenItem = item;
this._systemActions.bind_property('can-switch-user',
this._loginScreenItem,
'visible',
bindFlags);
this._sessionSubMenu.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
item = new PopupMenu.PopupMenuItem(_("Suspend"));
item = new PopupMenu.PopupMenuItem(_('Suspend'));
item.connect('activate', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateSuspend();
@ -149,11 +124,21 @@ class Indicator extends PanelMenu.SystemIndicator {
this._sessionSubMenu.menu.addMenuItem(item);
this._suspendItem = item;
this._systemActions.bind_property('can-suspend',
this._suspendItem,
'visible',
bindFlags);
this._suspendItem, 'visible',
bindFlags);
item = new PopupMenu.PopupMenuItem(_("Power Off…"));
item = new PopupMenu.PopupMenuItem(_('Restart…'));
item.connect('activate', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateRestart();
});
this._sessionSubMenu.menu.addMenuItem(item);
this._restartItem = item;
this._systemActions.bind_property('can-restart',
this._restartItem, 'visible',
bindFlags);
item = new PopupMenu.PopupMenuItem(_('Power Off…'));
item.connect('activate', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activatePowerOff();
@ -161,9 +146,32 @@ class Indicator extends PanelMenu.SystemIndicator {
this._sessionSubMenu.menu.addMenuItem(item);
this._powerOffItem = item;
this._systemActions.bind_property('can-power-off',
this._powerOffItem,
'visible',
bindFlags);
this._powerOffItem, 'visible',
bindFlags);
this._sessionSubMenu.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
item = new PopupMenu.PopupMenuItem(_('Log Out'));
item.connect('activate', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateLogout();
});
this._sessionSubMenu.menu.addMenuItem(item);
this._logoutItem = item;
this._systemActions.bind_property('can-logout',
this._logoutItem, 'visible',
bindFlags);
item = new PopupMenu.PopupMenuItem(_('Switch User…'));
item.connect('activate', () => {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._systemActions.activateSwitchUser();
});
this._sessionSubMenu.menu.addMenuItem(item);
this._loginScreenItem = item;
this._systemActions.bind_property('can-switch-user',
this._loginScreenItem, 'visible',
bindFlags);
this.menu.addMenuItem(this._sessionSubMenu);
}

View File

@ -42,6 +42,11 @@ const GsdWacomProxy = Gio.DBusProxy.makeProxyWrapper(GsdWacomIface);
const WINDOW_DIMMER_EFFECT_NAME = "gnome-shell-window-dimmer";
Gio._promisify(Shell,
'util_start_systemd_unit', 'util_start_systemd_unit_finish');
Gio._promisify(Shell,
'util_stop_systemd_unit', 'util_stop_systemd_unit_finish');
var DisplayChangeDialog = GObject.registerClass(
class DisplayChangeDialog extends ModalDialog.ModalDialog {
_init(wm) {
@ -901,46 +906,23 @@ var WindowManager = class {
global.display.connect('init-xserver', (display, task) => {
IBusManager.getIBusManager().restartDaemon(['--xim']);
try {
if (!Shell.util_start_systemd_unit('gsd-xsettings.target', 'fail'))
log('Not starting gsd-xsettings; waiting for gnome-session to do so');
/* Timeout waiting for start job completion after 5 seconds */
let cancellable = new Gio.Cancellable();
GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, () => {
cancellable.cancel();
return GLib.SOURCE_REMOVE;
});
/* Leave this watchdog timeout so don't block indefinitely here */
let timeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, () => {
Gio.DBus.session.unwatch_name(watchId);
log('Warning: Failed to start gsd-xsettings');
task.return_boolean(true);
timeoutId = 0;
return GLib.SOURCE_REMOVE;
});
/* When gsd-xsettings daemon is started, we are good to resume */
let watchId = Gio.DBus.session.watch_name(
'org.gnome.SettingsDaemon.XSettings',
Gio.BusNameWatcherFlags.NONE,
() => {
Gio.DBus.session.unwatch_name(watchId);
if (timeoutId > 0) {
task.return_boolean(true);
GLib.source_remove(timeoutId);
}
},
null);
} catch (e) {
log('Error starting gsd-xsettings: %s'.format(e.message));
task.return_boolean(true);
}
this._startX11Services(task, cancellable);
return true;
});
global.display.connect('x11-display-closing', () => {
if (!Meta.is_wayland_compositor())
return;
try {
Shell.util_stop_systemd_unit('gsd-xsettings.target', 'fail');
} catch (e) {
log('Error stopping gsd-xsettings: %s'.format(e.message));
}
this._stopX11Services(null);
IBusManager.getIBusManager().restartDaemon();
});
@ -1008,6 +990,36 @@ var WindowManager = class {
global.stage.add_action(topDragAction);
}
async _startX11Services(task, cancellable) {
try {
await Shell.util_start_systemd_unit(
'gnome-session-x11-services-ready.target', 'fail', cancellable);
} catch (e) {
// Ignore NOT_SUPPORTED error, which indicates we are not systemd
// managed and gnome-session will have taken care of everything
// already.
// Note that we do log cancellation from here.
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_SUPPORTED))
log('Error starting X11 services: %s'.format(e.message));
} finally {
task.return_boolean(true);
}
}
async _stopX11Services(cancellable) {
try {
await Shell.util_stop_systemd_unit(
'gnome-session-x11-services.target', 'fail', cancellable);
} catch (e) {
// Ignore NOT_SUPPORTED error, which indicates we are not systemd
// managed and gnome-session will have taken care of everything
// already.
// Note that we do log cancellation from here.
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_SUPPORTED))
log('Error stopping X11 services: %s'.format(e.message));
}
}
_showPadOsd(display, device, settings, imagePath, editionMode, monitorIndex) {
this._currentPadOsd = new PadOsd.PadOsd(device, settings, imagePath, editionMode, monitorIndex);
this._currentPadOsd.connect('closed', () => (this._currentPadOsd = null));

View File

@ -1027,6 +1027,8 @@ class Workspace extends St.Widget {
if (this.metaWorkspace !== null && !this.metaWorkspace.active)
return;
this.layout_manager.stateAdjustment.value = 0;
// Special case maximized windows, since it doesn't make sense
// to animate windows below in the stack
let topMaximizedWindow;
@ -1079,6 +1081,8 @@ class Workspace extends St.Widget {
if (this.metaWorkspace !== null && !this.metaWorkspace.active)
return;
this.layout_manager.stateAdjustment.value = 0;
// Special case maximized windows, since it doesn't make sense
// to animate windows below in the stack
let topMaximizedWindow;
@ -1190,10 +1194,14 @@ class Workspace extends St.Widget {
_doneLeavingOverview() {
this.layout_manager.layout_frozen = false;
this.layout_manager.stateAdjustment.value = 0;
this._windows.forEach(w => (w.opacity = 255));
}
_doneShowingOverview() {
this.layout_manager.layout_frozen = false;
this.layout_manager.stateAdjustment.value = 1;
this._windows.forEach(w => (w.opacity = 255));
}
_isMyWindow(window) {

View File

@ -11,7 +11,10 @@ var DISPLAY_TIMEOUT = 600;
var WorkspaceSwitcherPopupList = GObject.registerClass(
class WorkspaceSwitcherPopupList extends St.Widget {
_init() {
super._init({ style_class: 'workspace-switcher' });
super._init({
style_class: 'workspace-switcher',
offscreen_redirect: Clutter.OffscreenRedirect.ALWAYS,
});
this._itemSpacing = 0;
this._childHeight = 0;

View File

@ -241,6 +241,8 @@ class WorkspacesView extends WorkspacesViewBase {
startTouchGesture() {
this._gestureActive = true;
this._updateVisibility();
}
endTouchGesture() {
@ -381,8 +383,10 @@ class WorkspacesDisplay extends St.Widget {
this._windowDragEndId =
Main.overview.connect('window-drag-begin',
this._windowDragEnd.bind(this));
this._overviewShownId = Main.overview.connect('shown',
this._syncWorkspacesActualGeometry.bind(this));
this._overviewShownId = Main.overview.connect('shown', () => {
this._inWindowFade = false;
this._syncWorkspacesActualGeometry();
});
this._primaryIndex = Main.layoutManager.primaryIndex;
this._workspacesViews = [];
@ -401,6 +405,7 @@ class WorkspacesDisplay extends St.Widget {
this._actualGeometry = null;
this._inWindowDrag = false;
this._inWindowFade = false;
this._gestureActive = false; // touch(pad) gestures
this._canScroll = true; // limiting scrolling speed
@ -549,20 +554,20 @@ class WorkspacesDisplay extends St.Widget {
this.show();
this._updateWorkspacesViews();
if (this._actualGeometry) {
for (let i = 0; i < this._workspacesViews.length; i++) {
let animationType;
if (fadeOnPrimary && i == this._primaryIndex)
animationType = AnimationType.FADE;
else
animationType = AnimationType.ZOOM;
this._workspacesViews[i].animateToOverview(animationType);
}
if (!fadeOnPrimary)
this._syncWorkspacesActualGeometry();
for (let i = 0; i < this._workspacesViews.length; i++) {
let animationType;
if (fadeOnPrimary && i == this._primaryIndex)
animationType = AnimationType.FADE;
else
animationType = AnimationType.ZOOM;
this._workspacesViews[i].animateToOverview(animationType);
}
this._inWindowFade = fadeOnPrimary;
if (this._actualGeometry && !fadeOnPrimary)
this._syncWorkspacesActualGeometry();
this._restackedNotifyId =
Main.overview.connect('windows-restacked',
this._onRestacked.bind(this));
@ -583,6 +588,8 @@ class WorkspacesDisplay extends St.Widget {
this._workspacesViews[i].animateFromOverview(animationType);
}
this._inWindowFade = fadeOnPrimary;
const { primaryIndex } = Main.layoutManager;
const { x, y, width, height } =
Main.layoutManager.getWorkAreaForMonitor(primaryIndex);
@ -707,7 +714,7 @@ class WorkspacesDisplay extends St.Widget {
_syncWorkspacesActualGeometry() {
const primaryView = this._getPrimaryView();
if (!primaryView)
if (!primaryView || this._inWindowFade)
return;
primaryView.ease({

View File

@ -1,5 +1,5 @@
project('gnome-shell', 'c',
version: '3.37.3',
version: '3.37.90',
meson_version: '>= 0.53.0',
license: 'GPLv2+'
)
@ -25,7 +25,7 @@ gio_req = '>= 2.56.0'
gi_req = '>= 1.49.1'
gjs_req = '>= 1.65.1'
gtk_req = '>= 3.15.0'
mutter_req = '>= 3.37.3'
mutter_req = '>= 3.37.90'
polkit_req = '>= 0.100'
schemas_req = '>= 3.33.1'
startup_req = '>= 0.11'
@ -96,9 +96,10 @@ gnome_desktop_dep = dependency('gnome-desktop-3.0', version: gnome_desktop_req)
bt_dep = dependency('gnome-bluetooth-1.0', version: bt_req, required: false)
gst_dep = dependency('gstreamer-1.0', version: gst_req, required: false)
gst_base_dep = dependency('gstreamer-base-1.0', required: false)
pipewire_dep = dependency('libpipewire-0.3', required: false)
recorder_deps = []
enable_recorder = gst_dep.found() and gst_base_dep.found()
enable_recorder = gst_dep.found() and gst_base_dep.found() and pipewire_dep.found()
if enable_recorder
recorder_deps += [gst_dep, gst_base_dep, gtk_dep, x11_dep]
endif

View File

@ -1 +1,3 @@
data/org.gnome.Shell@wayland.service.in
data/org.gnome.Shell@x11.service.in
subprojects/extensions-tool/src/templates/indicator/extension.js

589
po/ca.po

File diff suppressed because it is too large Load Diff

742
po/de.po

File diff suppressed because it is too large Load Diff

1118
po/el.po

File diff suppressed because it is too large Load Diff

436
po/es.po

File diff suppressed because it is too large Load Diff

745
po/eu.po

File diff suppressed because it is too large Load Diff

483
po/fur.po

File diff suppressed because it is too large Load Diff

1270
po/gl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

159
po/ro.po
View File

@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell/issues\n"
"POT-Creation-Date: 2020-06-09 19:41+0000\n"
"PO-Revision-Date: 2020-06-17 18:47+0300\n"
"POT-Creation-Date: 2020-07-21 05:44+0000\n"
"PO-Revision-Date: 2020-07-21 09:07+0200\n"
"Last-Translator: Florentina Mușat <florentina [dot] musat [dot] 28 [at] "
"gmail [dot] com>\n"
"Language-Team: Gnome Romanian Translation Team <gnomero-list@lists."
@ -224,95 +224,112 @@ msgid ""
msgstr ""
"Activează un API D-Bus care permite introspecția stării aplicației shell."
#: data/org.gnome.shell.gschema.xml.in:119
#: data/org.gnome.shell.gschema.xml.in:114
msgid "Layout of the app picker"
msgstr "Aspectul selectorului de aplicații"
#: data/org.gnome.shell.gschema.xml.in:115
msgid ""
"Layout of the app picker. Each entry in the array is a page. Pages are "
"stored in the order they appear in GNOME Shell. Each page contains an "
"“application id” → 'data' pair. Currently, the following values are stored "
"as 'data': • “position”: the position of the application icon in the page"
msgstr ""
"Aspectul selectorului de aplicații. Fiecare intrare din matrice este o "
"pagină. Paginile sunt stocate în ordinea în care apar în GNOME Shell. "
"Fiecare pagină conține o pereche de „id aplicație” → „date”. Momentan, "
"următoarele valori sunt stocate ca „data”: • „poziție”: poziția iconiței "
"aplicației în pagină."
#: data/org.gnome.shell.gschema.xml.in:130
msgid "Keybinding to open the application menu"
msgstr "Combinație de taste pentru deschiderea meniului aplicației"
#: data/org.gnome.shell.gschema.xml.in:120
#: data/org.gnome.shell.gschema.xml.in:131
msgid "Keybinding to open the application menu."
msgstr "Combinație de taste pentru deschiderea meniului aplicației."
#: data/org.gnome.shell.gschema.xml.in:126
#: data/org.gnome.shell.gschema.xml.in:137
msgid "Keybinding to open the “Show Applications” view"
msgstr ""
"Combinație de taste pentru deschiderea modului de afișare „Arată aplicațiile”"
#: data/org.gnome.shell.gschema.xml.in:127
#: data/org.gnome.shell.gschema.xml.in:138
msgid ""
"Keybinding to open the “Show Applications” view of the Activities Overview."
msgstr ""
"Combinație de taste pentru deschiderea modului de afișare „Arată "
"aplicațiile” a prezentării generale a activităților."
#: data/org.gnome.shell.gschema.xml.in:134
#: data/org.gnome.shell.gschema.xml.in:145
msgid "Keybinding to open the overview"
msgstr "Combinație de taste pentru deschiderea prezentării generale"
#: data/org.gnome.shell.gschema.xml.in:135
#: data/org.gnome.shell.gschema.xml.in:146
msgid "Keybinding to open the Activities Overview."
msgstr ""
"Combinație de taste pentru deschiderea prezentării generale a activităților."
#: data/org.gnome.shell.gschema.xml.in:141
#: data/org.gnome.shell.gschema.xml.in:152
msgid "Keybinding to toggle the visibility of the notification list"
msgstr ""
"Combinație de taste pentru comutarea vizibilității listei de notificare"
#: data/org.gnome.shell.gschema.xml.in:142
#: data/org.gnome.shell.gschema.xml.in:153
msgid "Keybinding to toggle the visibility of the notification list."
msgstr ""
"Combinație de taste pentru comutarea vizibilității listei de notificare."
#: data/org.gnome.shell.gschema.xml.in:148
#: data/org.gnome.shell.gschema.xml.in:159
msgid "Keybinding to focus the active notification"
msgstr "Combinație de taste pentru focalizarea notificării active"
#: data/org.gnome.shell.gschema.xml.in:149
#: data/org.gnome.shell.gschema.xml.in:160
msgid "Keybinding to focus the active notification."
msgstr "Combinație de taste pentru focalizarea notificării active."
#: data/org.gnome.shell.gschema.xml.in:155
#: data/org.gnome.shell.gschema.xml.in:166
msgid "Switch to application 1"
msgstr "Comută la aplicația 1"
#: data/org.gnome.shell.gschema.xml.in:159
#: data/org.gnome.shell.gschema.xml.in:170
msgid "Switch to application 2"
msgstr "Comută la aplicația 2"
#: data/org.gnome.shell.gschema.xml.in:163
#: data/org.gnome.shell.gschema.xml.in:174
msgid "Switch to application 3"
msgstr "Comută la aplicația 3"
#: data/org.gnome.shell.gschema.xml.in:167
#: data/org.gnome.shell.gschema.xml.in:178
msgid "Switch to application 4"
msgstr "Comută la aplicația 4"
#: data/org.gnome.shell.gschema.xml.in:171
#: data/org.gnome.shell.gschema.xml.in:182
msgid "Switch to application 5"
msgstr "Comută la aplicația 5"
#: data/org.gnome.shell.gschema.xml.in:175
#: data/org.gnome.shell.gschema.xml.in:186
msgid "Switch to application 6"
msgstr "Comută la aplicația 6"
#: data/org.gnome.shell.gschema.xml.in:179
#: data/org.gnome.shell.gschema.xml.in:190
msgid "Switch to application 7"
msgstr "Comută la aplicația 7"
#: data/org.gnome.shell.gschema.xml.in:183
#: data/org.gnome.shell.gschema.xml.in:194
msgid "Switch to application 8"
msgstr "Comută la aplicația 8"
#: data/org.gnome.shell.gschema.xml.in:187
#: data/org.gnome.shell.gschema.xml.in:198
msgid "Switch to application 9"
msgstr "Comută la aplicația 9"
#: data/org.gnome.shell.gschema.xml.in:196
#: data/org.gnome.shell.gschema.xml.in:223
#: data/org.gnome.shell.gschema.xml.in:207
#: data/org.gnome.shell.gschema.xml.in:234
msgid "Limit switcher to current workspace."
msgstr "Limitează comutatorul la spațiul de lucru curent."
#: data/org.gnome.shell.gschema.xml.in:197
#: data/org.gnome.shell.gschema.xml.in:208
msgid ""
"If true, only applications that have windows on the current workspace are "
"shown in the switcher. Otherwise, all applications are included."
@ -320,11 +337,11 @@ msgstr ""
"Dacă este activat, doar aplicațiile care au ferestre în spațiul de lucru "
"curent sunt arătate în comutator. Altfel, toate aplicațiile sunt incluse."
#: data/org.gnome.shell.gschema.xml.in:214
#: data/org.gnome.shell.gschema.xml.in:225
msgid "The application icon mode."
msgstr "Miniatură și pictograma aplicației."
#: data/org.gnome.shell.gschema.xml.in:215
#: data/org.gnome.shell.gschema.xml.in:226
msgid ""
"Configures how the windows are shown in the switcher. Valid possibilities "
"are “thumbnail-only” (shows a thumbnail of the window), “app-icon-"
@ -334,7 +351,7 @@ msgstr ""
"Posibilități valide sunt „mod miniatură” (arată o miniatură a ferestrei) "
"„mod iconiță” (arată doar iconița aplicației) sau „ambele”."
#: data/org.gnome.shell.gschema.xml.in:224
#: data/org.gnome.shell.gschema.xml.in:235
msgid ""
"If true, only windows from the current workspace are shown in the switcher. "
"Otherwise, all windows are included."
@ -342,59 +359,59 @@ msgstr ""
"Dacă este activat, doar ferestrele din spațiul de lucru curent sunt arătate "
"în comutator. Altfel, toate ferestrele sunt incluse."
#: data/org.gnome.shell.gschema.xml.in:234
#: data/org.gnome.shell.gschema.xml.in:245
msgid "Locations"
msgstr "Locații"
#: data/org.gnome.shell.gschema.xml.in:235
#: data/org.gnome.shell.gschema.xml.in:246
msgid "The locations to show in world clocks"
msgstr "Locațiile de arătat în ceasuri globale"
#: data/org.gnome.shell.gschema.xml.in:245
#: data/org.gnome.shell.gschema.xml.in:256
msgid "Automatic location"
msgstr "Locație automată"
#: data/org.gnome.shell.gschema.xml.in:246
#: data/org.gnome.shell.gschema.xml.in:257
msgid "Whether to fetch the current location or not"
msgstr "Dacă să se obțină locația curentă"
#: data/org.gnome.shell.gschema.xml.in:253
#: data/org.gnome.shell.gschema.xml.in:264
msgid "Location"
msgstr "Locație"
#: data/org.gnome.shell.gschema.xml.in:254
#: data/org.gnome.shell.gschema.xml.in:265
msgid "The location for which to show a forecast"
msgstr "Locația pentru care să se arate o prognoză"
#: data/org.gnome.shell.gschema.xml.in:266
#: data/org.gnome.shell.gschema.xml.in:277
msgid "Attach modal dialog to the parent window"
msgstr "Atașează dialogul modal la fereastra părinte"
#: data/org.gnome.shell.gschema.xml.in:267
#: data/org.gnome.shell.gschema.xml.in:276
#: data/org.gnome.shell.gschema.xml.in:284
#: data/org.gnome.shell.gschema.xml.in:292
#: data/org.gnome.shell.gschema.xml.in:300
#: data/org.gnome.shell.gschema.xml.in:278
#: data/org.gnome.shell.gschema.xml.in:287
#: data/org.gnome.shell.gschema.xml.in:295
#: data/org.gnome.shell.gschema.xml.in:303
#: data/org.gnome.shell.gschema.xml.in:311
msgid ""
"This key overrides the key in org.gnome.mutter when running GNOME Shell."
msgstr ""
"Această cheie suprascrie cheia corespondentă din org.gnome.mutter când "
"Vizualizatorul activităților GNOME rulează."
#: data/org.gnome.shell.gschema.xml.in:275
#: data/org.gnome.shell.gschema.xml.in:286
msgid "Enable edge tiling when dropping windows on screen edges"
msgstr ""
"Activează mozaic lateral la plasarea ferestrelor pe marginile ecranului"
#: data/org.gnome.shell.gschema.xml.in:283
#: data/org.gnome.shell.gschema.xml.in:294
msgid "Workspaces are managed dynamically"
msgstr "Spațiile de lucru sunt gestionate în mod dinamic"
#: data/org.gnome.shell.gschema.xml.in:291
#: data/org.gnome.shell.gschema.xml.in:302
msgid "Workspaces only on primary monitor"
msgstr "Spații de lucru doar pe monitorul principal"
#: data/org.gnome.shell.gschema.xml.in:299
#: data/org.gnome.shell.gschema.xml.in:310
msgid "Delay focus changes in mouse mode until the pointer stops moving"
msgstr ""
"Întârzie schimbările de focalizare în maus până când cursorul încetează să "
@ -433,7 +450,7 @@ msgstr "Vizitează pagina principală a extensiei"
#: js/gdm/authPrompt.js:135 js/ui/audioDeviceSelection.js:57
#: js/ui/components/networkAgent.js:110 js/ui/components/polkitAgent.js:139
#: js/ui/endSessionDialog.js:369 js/ui/extensionDownloader.js:181
#: js/ui/endSessionDialog.js:369 js/ui/extensionDownloader.js:183
#: js/ui/shellMountOperation.js:376 js/ui/shellMountOperation.js:386
#: js/ui/status/network.js:916 subprojects/extensions-app/js/main.js:149
msgid "Cancel"
@ -475,7 +492,7 @@ msgstr "Nume de utilizator"
msgid "Login Window"
msgstr "Fereastră de autentificare"
#: js/gdm/util.js:345
#: js/gdm/util.js:355
msgid "Authentication error"
msgstr "Eroare de autentificare"
@ -484,7 +501,7 @@ msgstr "Eroare de autentificare"
#. as a cue to display our own message.
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: js/gdm/util.js:471
#: js/gdm/util.js:481
msgid "(or swipe finger)"
msgstr "(sau treceți degetul peste)"
@ -727,36 +744,36 @@ msgstr "Refuză accesul"
msgid "Grant Access"
msgstr "Permite accesul"
#: js/ui/appDisplay.js:902
#: js/ui/appDisplay.js:1297
msgid "Unnamed Folder"
msgstr "Dosar nedenumit"
#. Translators: This is the heading of a list of open windows
#: js/ui/appDisplay.js:2241 js/ui/panel.js:75
#: js/ui/appDisplay.js:2767 js/ui/panel.js:75
msgid "Open Windows"
msgstr "Ferestre deschise"
#: js/ui/appDisplay.js:2260 js/ui/panel.js:82
#: js/ui/appDisplay.js:2786 js/ui/panel.js:82
msgid "New Window"
msgstr "Fereastră nouă"
#: js/ui/appDisplay.js:2276
#: js/ui/appDisplay.js:2802
msgid "Launch using Integrated Graphics Card"
msgstr "Lansează folosind placa grafică integrată"
#: js/ui/appDisplay.js:2277
#: js/ui/appDisplay.js:2803
msgid "Launch using Discrete Graphics Card"
msgstr "Lansează folosind placa grafică discretă"
#: js/ui/appDisplay.js:2305 js/ui/dash.js:239
#: js/ui/appDisplay.js:2831 js/ui/dash.js:239
msgid "Remove from Favorites"
msgstr "Elimină din favorite"
#: js/ui/appDisplay.js:2311
#: js/ui/appDisplay.js:2837
msgid "Add to Favorites"
msgstr "Adaugă la Favorite"
#: js/ui/appDisplay.js:2321 js/ui/panel.js:93
#: js/ui/appDisplay.js:2847 js/ui/panel.js:93
msgid "Show Details"
msgstr "Arată detaliile"
@ -786,7 +803,7 @@ msgstr "Căști auriculare"
msgid "Headset"
msgstr "Căști cu microfon"
#: js/ui/audioDeviceSelection.js:68 js/ui/status/volume.js:273
#: js/ui/audioDeviceSelection.js:68 js/ui/status/volume.js:272
msgid "Microphone"
msgstr "Microfon"
@ -1300,15 +1317,15 @@ msgstr "%s (la distanță)"
msgid "%s (console)"
msgstr "%s (consolă)"
#: js/ui/extensionDownloader.js:185
#: js/ui/extensionDownloader.js:187
msgid "Install"
msgstr "Instalează"
#: js/ui/extensionDownloader.js:191
#: js/ui/extensionDownloader.js:193
msgid "Install Extension"
msgstr "Instalează extensia"
#: js/ui/extensionDownloader.js:192
#: js/ui/extensionDownloader.js:194
#, javascript-format
msgid "Download and install “%s” from extensions.gnome.org?"
msgstr "Descărcați și instalați „%s” de la extensions.gnome.org?"
@ -1341,11 +1358,11 @@ msgstr "O aplicație vrea să inhibe scurtăturile"
msgid "You can restore shortcuts by pressing %s."
msgstr "Puteți restaura scurtăturile apăsând %s."
#: js/ui/inhibitShortcutsDialog.js:98
#: js/ui/inhibitShortcutsDialog.js:100
msgid "Deny"
msgstr "Refuză"
#: js/ui/inhibitShortcutsDialog.js:105
#: js/ui/inhibitShortcutsDialog.js:107
msgid "Allow"
msgstr "Permite"
@ -1414,7 +1431,7 @@ msgstr "Oprește"
msgid "Leave Off"
msgstr "Lasă oprit"
#: js/ui/keyboard.js:207
#: js/ui/keyboard.js:225
msgid "Region & Language Settings"
msgstr "Configurări de regiune și limbă"
@ -1488,7 +1505,7 @@ msgstr "Blocarea ecranului este dezactivată"
msgid "Screen Locking requires the GNOME display manager."
msgstr "Blocarea ecranului necesită administratorul de afișaj GNOME."
#: js/ui/messageTray.js:1547
#: js/ui/messageTray.js:1476
msgid "System Information"
msgstr "Informații despre sistem"
@ -1500,13 +1517,13 @@ msgstr "Artist necunoscut"
msgid "Unknown title"
msgstr "Titlu necunoscut"
#: js/ui/overview.js:73
#: js/ui/overview.js:74
msgid "Undo"
msgstr "Anulează"
#. Translators: This is the main view to select
#. activities. See also note for "Activities" string.
#: js/ui/overview.js:86
#: js/ui/overview.js:87
msgid "Overview"
msgstr "Prezentare generală"
@ -1514,7 +1531,7 @@ msgstr "Prezentare generală"
#. in the search entry when no search is
#. active; it should not exceed ~30
#. characters.
#: js/ui/overview.js:107
#: js/ui/overview.js:108
msgid "Type to search"
msgstr "Tastați pentru a căuta"
@ -2172,11 +2189,11 @@ msgstr "Eroare de autorizare Thunderbolt"
msgid "Could not authorize the Thunderbolt device: %s"
msgstr "Nu s-a putut autoriza dispozitivul Thunderbolt: %s"
#: js/ui/status/volume.js:154
#: js/ui/status/volume.js:155
msgid "Volume changed"
msgstr "Volumul a fost schimbat"
#: js/ui/status/volume.js:225
#: js/ui/status/volume.js:217
msgid "Volume"
msgstr "Volum"
@ -2222,11 +2239,11 @@ msgstr "Glisați în sus pentru a debloca"
msgid "Click or press a key to unlock"
msgstr "Apăsați clic sau o tastă pentru a debloca"
#: js/ui/unlockDialog.js:550
#: js/ui/unlockDialog.js:555
msgid "Unlock Window"
msgstr "Deblochează fereastră"
#: js/ui/unlockDialog.js:559
#: js/ui/unlockDialog.js:564
msgid "Log in as another user"
msgstr "Intră în sesiune ca utilizator diferit"
@ -2362,12 +2379,12 @@ msgstr "Utilizează un mod specific, de exemplu „gdm” pentru ecranul de loga
msgid "List possible modes"
msgstr "Enumeră câmpurile care pot fi afișate"
#: src/shell-app.c:286
#: src/shell-app.c:268
msgctxt "program"
msgid "Unknown"
msgstr "Necunoscut"
#: src/shell-app.c:537
#: src/shell-app.c:519
#, c-format
msgid "Failed to launch “%s”"
msgstr "Nu s-a putut lansa „%s”"

421
po/tr.po

File diff suppressed because it is too large Load Diff

464
po/uk.po

File diff suppressed because it is too large Load Diff

View File

@ -23,8 +23,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell/issues\n"
"POT-Creation-Date: 2020-05-28 11:29+0000\n"
"PO-Revision-Date: 2020-05-29 09:03-0400\n"
"POT-Creation-Date: 2020-07-12 02:14+0000\n"
"PO-Revision-Date: 2020-07-11 22:32-0400\n"
"Last-Translator: Boyuan Yang <073plan@gmail.com>\n"
"Language-Team: Chinese (China) <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
@ -444,7 +444,7 @@ msgstr "用户名"
msgid "Login Window"
msgstr "登录窗口"
#: js/gdm/util.js:345
#: js/gdm/util.js:355
msgid "Authentication error"
msgstr "认证出错"
@ -453,7 +453,7 @@ msgstr "认证出错"
#. as a cue to display our own message.
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: js/gdm/util.js:471
#: js/gdm/util.js:481
msgid "(or swipe finger)"
msgstr "(或滑动手指)"
@ -559,7 +559,7 @@ msgid "%d hour ago"
msgid_plural "%d hours ago"
msgstr[0] "%d 小时前"
#: js/misc/util.js:191
#: js/misc/util.js:191 js/ui/dateMenu.js:162
msgid "Yesterday"
msgstr "昨天"
@ -672,44 +672,44 @@ msgstr "您到热点登录的连接不安全。您在此页面输入的密码或
#. No support for non-modal system dialogs, so ignore the option
#. let modal = options['modal'] || true;
#: js/ui/accessDialog.js:39 js/ui/status/location.js:374
#: js/ui/accessDialog.js:39 js/ui/status/location.js:369
msgid "Deny Access"
msgstr "拒绝访问"
#: js/ui/accessDialog.js:40 js/ui/status/location.js:377
#: js/ui/accessDialog.js:40 js/ui/status/location.js:372
msgid "Grant Access"
msgstr "允许访问"
#: js/ui/appDisplay.js:960
#: js/ui/appDisplay.js:903
msgid "Unnamed Folder"
msgstr "未命名文件夹"
#. Translators: This is the heading of a list of open windows
#: js/ui/appDisplay.js:2219 js/ui/panel.js:75
#: js/ui/appDisplay.js:2225 js/ui/panel.js:75
msgid "Open Windows"
msgstr "打开窗口"
#: js/ui/appDisplay.js:2238 js/ui/panel.js:82
#: js/ui/appDisplay.js:2244 js/ui/panel.js:82
msgid "New Window"
msgstr "新窗口"
#: js/ui/appDisplay.js:2254
#: js/ui/appDisplay.js:2260
msgid "Launch using Integrated Graphics Card"
msgstr "使用集成显卡启动"
#: js/ui/appDisplay.js:2255
#: js/ui/appDisplay.js:2261
msgid "Launch using Discrete Graphics Card"
msgstr "使用独立显卡启动"
#: js/ui/appDisplay.js:2283 js/ui/dash.js:239
#: js/ui/appDisplay.js:2289 js/ui/dash.js:239
msgid "Remove from Favorites"
msgstr "从收藏夹中移除"
#: js/ui/appDisplay.js:2289
#: js/ui/appDisplay.js:2295
msgid "Add to Favorites"
msgstr "添加到收藏夹"
#: js/ui/appDisplay.js:2299 js/ui/panel.js:93
#: js/ui/appDisplay.js:2305 js/ui/panel.js:93
msgid "Show Details"
msgstr "显示细节"
@ -739,7 +739,7 @@ msgstr "耳机"
msgid "Headset"
msgstr "耳麦"
#: js/ui/audioDeviceSelection.js:68 js/ui/status/volume.js:273
#: js/ui/audioDeviceSelection.js:68 js/ui/status/volume.js:272
msgid "Microphone"
msgstr "麦克风"
@ -756,7 +756,7 @@ msgid "Settings"
msgstr "设置"
#. Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday).
#: js/ui/calendar.js:41
#: js/ui/calendar.js:36
msgctxt "calendar-no-work"
msgid "06"
msgstr "06"
@ -766,43 +766,43 @@ msgstr "06"
#. * NOTE: These grid abbreviations are always shown together
#. * and in order, e.g. "S M T W T F S".
#.
#: js/ui/calendar.js:70
#: js/ui/calendar.js:65
msgctxt "grid sunday"
msgid "S"
msgstr "日"
#. Translators: Calendar grid abbreviation for Monday
#: js/ui/calendar.js:72
#: js/ui/calendar.js:67
msgctxt "grid monday"
msgid "M"
msgstr "一"
#. Translators: Calendar grid abbreviation for Tuesday
#: js/ui/calendar.js:74
#: js/ui/calendar.js:69
msgctxt "grid tuesday"
msgid "T"
msgstr "二"
#. Translators: Calendar grid abbreviation for Wednesday
#: js/ui/calendar.js:76
#: js/ui/calendar.js:71
msgctxt "grid wednesday"
msgid "W"
msgstr "三"
#. Translators: Calendar grid abbreviation for Thursday
#: js/ui/calendar.js:78
#: js/ui/calendar.js:73
msgctxt "grid thursday"
msgid "T"
msgstr "四"
#. Translators: Calendar grid abbreviation for Friday
#: js/ui/calendar.js:80
#: js/ui/calendar.js:75
msgctxt "grid friday"
msgid "F"
msgstr "五"
#. Translators: Calendar grid abbreviation for Saturday
#: js/ui/calendar.js:82
#: js/ui/calendar.js:77
msgctxt "grid saturday"
msgid "S"
msgstr "六"
@ -813,7 +813,7 @@ msgstr "六"
#. * "%OB" is the new format specifier introduced in glibc 2.27,
#. * in most cases you should not change it.
#.
#: js/ui/calendar.js:397
#: js/ui/calendar.js:392
msgid "%OB"
msgstr "%OB"
@ -826,61 +826,37 @@ msgstr "%OB"
#. * in most cases you should not use the old "%B" here unless you
#. * absolutely know what you are doing.
#.
#: js/ui/calendar.js:407
#: js/ui/calendar.js:402
msgid "%OB %Y"
msgstr "%Y %OB"
#: js/ui/calendar.js:466
#: js/ui/calendar.js:461
msgid "Previous month"
msgstr "上个月"
#: js/ui/calendar.js:481
#: js/ui/calendar.js:476
msgid "Next month"
msgstr "下个月"
#: js/ui/calendar.js:631
#: js/ui/calendar.js:626
#, no-javascript-format
msgctxt "date day number format"
msgid "%d"
msgstr "%d"
#: js/ui/calendar.js:687
#: js/ui/calendar.js:682
msgid "Week %V"
msgstr "第 %V 个星期"
#. Translators: Shown in calendar event list for all day events
#. * Keep it short, best if you can use less then 10 characters
#.
#: js/ui/calendar.js:762
msgctxt "event list time"
msgid "All Day"
msgstr "全天"
#. Translators: Shown on calendar heading when selected day occurs on current year
#: js/ui/calendar.js:900
msgctxt "calendar heading"
msgid "%A, %B %-d"
msgstr "%-m月%-d日 %A"
#. Translators: Shown on calendar heading when selected day occurs on different year
#: js/ui/calendar.js:903
msgctxt "calendar heading"
msgid "%A, %B %-d, %Y"
msgstr "%Y年%-m月%-d日 %A"
#: js/ui/calendar.js:1133
#: js/ui/calendar.js:895
msgid "No Notifications"
msgstr "无通知"
#: js/ui/calendar.js:1136
msgid "No Events"
msgstr "无事件"
#: js/ui/calendar.js:1190
#: js/ui/calendar.js:949
msgid "Do Not Disturb"
msgstr "请勿打扰"
#: js/ui/calendar.js:1209
#: js/ui/calendar.js:968
msgid "Clear"
msgstr "清除"
@ -1030,7 +1006,7 @@ msgstr "抱歉,认证失败。请重试。"
msgid "%s is now known as %s"
msgstr "%s 现在叫做 %s"
#: js/ui/ctrlAltTab.js:21 js/ui/viewSelector.js:177
#: js/ui/ctrlAltTab.js:21 js/ui/viewSelector.js:178
msgid "Windows"
msgstr "窗口"
@ -1049,7 +1025,7 @@ msgstr "Dash"
#. * "Tue 9:29 AM"). The string itself should become a full date, e.g.,
#. * "February 17 2015".
#.
#: js/ui/dateMenu.js:75
#: js/ui/dateMenu.js:79
msgid "%B %-d %Y"
msgstr "%Y年%-m月%-d日"
@ -1057,35 +1033,67 @@ msgstr "%Y年%-m月%-d日"
#. * below the time in the shell; it should combine the weekday and the
#. * date, e.g. "Tuesday February 17 2015".
#.
#: js/ui/dateMenu.js:82
#: js/ui/dateMenu.js:86
msgid "%A %B %e %Y"
msgstr "%Y年%-m月%-d日 %A"
#: js/ui/dateMenu.js:162
#. Translators: Shown on calendar heading when selected day occurs on current year
#: js/ui/dateMenu.js:151
msgctxt "calendar heading"
msgid "%B %-d"
msgstr "%-m月%-d日"
#. Translators: Shown on calendar heading when selected day occurs on different year
#: js/ui/dateMenu.js:154
msgctxt "calendar heading"
msgid "%B %-d %Y"
msgstr "%Y年%-m月%-d日"
#: js/ui/dateMenu.js:160
msgid "Today"
msgstr "今天"
#: js/ui/dateMenu.js:164
msgid "Tomorrow"
msgstr "明天"
#. Translators: Shown in calendar event list for all day events
#. * Keep it short, best if you can use less then 10 characters
#.
#: js/ui/dateMenu.js:180
msgctxt "event list time"
msgid "All Day"
msgstr "全天"
#: js/ui/dateMenu.js:231
msgid "No Events"
msgstr "无事件"
#: js/ui/dateMenu.js:348
msgid "Add world clocks…"
msgstr "添加世界时钟…"
#: js/ui/dateMenu.js:163
#: js/ui/dateMenu.js:349
msgid "World Clocks"
msgstr "世界时钟"
#: js/ui/dateMenu.js:443
#: js/ui/dateMenu.js:629
msgid "Loading…"
msgstr "正在载入……"
#: js/ui/dateMenu.js:453
#: js/ui/dateMenu.js:639
msgid "Go online for weather information"
msgstr "通过互联网查看天气信息"
#: js/ui/dateMenu.js:455
#: js/ui/dateMenu.js:641
msgid "Weather information is currently unavailable"
msgstr "天气信息目前不可用"
#: js/ui/dateMenu.js:465
#: js/ui/dateMenu.js:651
msgid "Weather"
msgstr "天气"
#: js/ui/dateMenu.js:467
#: js/ui/dateMenu.js:653
msgid "Select weather location…"
msgstr "选择天气地点…"
@ -1268,11 +1276,11 @@ msgstr "某应用程序希望禁用快捷键"
msgid "You can restore shortcuts by pressing %s."
msgstr "按 %s 以恢复快捷键。"
#: js/ui/inhibitShortcutsDialog.js:98
#: js/ui/inhibitShortcutsDialog.js:100
msgid "Deny"
msgstr "拒绝"
#: js/ui/inhibitShortcutsDialog.js:105
#: js/ui/inhibitShortcutsDialog.js:107
msgid "Allow"
msgstr "允许"
@ -1337,7 +1345,7 @@ msgstr "关闭"
msgid "Leave Off"
msgstr "保持关闭"
#: js/ui/keyboard.js:207
#: js/ui/keyboard.js:225
msgid "Region & Language Settings"
msgstr "区域与语言设置"
@ -1410,25 +1418,25 @@ msgstr "屏幕锁定已禁用"
msgid "Screen Locking requires the GNOME display manager."
msgstr "屏幕锁定需要 GNOME 显示管理器。"
#: js/ui/messageTray.js:1547
#: js/ui/messageTray.js:1476
msgid "System Information"
msgstr "系统信息"
#: js/ui/mpris.js:204
#: js/ui/mpris.js:203
msgid "Unknown artist"
msgstr "未知艺人"
#: js/ui/mpris.js:214
#: js/ui/mpris.js:213
msgid "Unknown title"
msgstr "未知标题"
#: js/ui/overview.js:73
#: js/ui/overview.js:74
msgid "Undo"
msgstr "撤消"
#. Translators: This is the main view to select
#. activities. See also note for "Activities" string.
#: js/ui/overview.js:86
#: js/ui/overview.js:87
msgid "Overview"
msgstr "概览"
@ -1436,7 +1444,7 @@ msgstr "概览"
#. in the search entry when no search is
#. active; it should not exceed ~30
#. characters.
#: js/ui/overview.js:107
#: js/ui/overview.js:108
msgid "Type to search"
msgstr "输入以搜索"
@ -1464,23 +1472,23 @@ msgstr "分配按键"
msgid "Done"
msgstr "完成"
#: js/ui/padOsd.js:745
#: js/ui/padOsd.js:732
msgid "Edit…"
msgstr "编辑…"
#: js/ui/padOsd.js:787 js/ui/padOsd.js:910
#: js/ui/padOsd.js:774 js/ui/padOsd.js:891
msgid "None"
msgstr "无"
#: js/ui/padOsd.js:863
#: js/ui/padOsd.js:845
msgid "Press a button to configure"
msgstr "按下按键以配置"
#: js/ui/padOsd.js:864
#: js/ui/padOsd.js:846
msgid "Press Esc to exit"
msgstr "按 Esc 以退出"
#: js/ui/padOsd.js:867
#: js/ui/padOsd.js:849
msgid "Press any key to exit"
msgstr "按任意键退出"
@ -1570,7 +1578,7 @@ msgstr "隐藏文本"
#: js/ui/shellEntry.js:162
msgid "Caps lock is on."
msgstr "大写锁定已开启。"
msgstr "大写锁定已开启。"
#: js/ui/shellMountOperation.js:285
msgid "Hidden Volume"
@ -1742,17 +1750,17 @@ msgstr "定位服务已禁用"
msgid "Enable"
msgstr "启用"
#: js/ui/status/location.js:355
#: js/ui/status/location.js:350
msgid "Allow location access"
msgstr "允许获取位置信息"
#. Translators: %s is an application name
#: js/ui/status/location.js:357
#: js/ui/status/location.js:352
#, javascript-format
msgid "The app %s wants to access your location"
msgstr "应用 %s 想要获取您的位置信息"
#: js/ui/status/location.js:367
#: js/ui/status/location.js:362
msgid "Location access can be changed at any time from the privacy settings."
msgstr "位置访问权限可以随时在隐私设置里更改。"
@ -2081,11 +2089,11 @@ msgstr "Thunderbolt 授权错误"
msgid "Could not authorize the Thunderbolt device: %s"
msgstr "无法授权 Thunderbolt 设备:%s"
#: js/ui/status/volume.js:154
#: js/ui/status/volume.js:155
msgid "Volume changed"
msgstr "音量已变更"
#: js/ui/status/volume.js:225
#: js/ui/status/volume.js:217
msgid "Volume"
msgstr "音量"
@ -2131,19 +2139,19 @@ msgstr "向上滑动解锁"
msgid "Click or press a key to unlock"
msgstr "单击或按键解锁"
#: js/ui/unlockDialog.js:550
#: js/ui/unlockDialog.js:555
msgid "Unlock Window"
msgstr "解锁窗口"
#: js/ui/unlockDialog.js:559
#: js/ui/unlockDialog.js:564
msgid "Log in as another user"
msgstr "以另一个用户身份登录"
#: js/ui/viewSelector.js:181
#: js/ui/viewSelector.js:182
msgid "Applications"
msgstr "应用程序"
#: js/ui/viewSelector.js:185
#: js/ui/viewSelector.js:186
msgid "Search"
msgstr "搜索"
@ -2269,12 +2277,12 @@ msgstr "使用指定模式如“gdm”用于登录屏幕"
msgid "List possible modes"
msgstr "列出可用的模式"
#: src/shell-app.c:286
#: src/shell-app.c:268
msgctxt "program"
msgid "Unknown"
msgstr "未知"
#: src/shell-app.c:537
#: src/shell-app.c:519
#, c-format
msgid "Failed to launch “%s”"
msgstr "启动“%s”失败"
@ -2504,7 +2512,7 @@ msgstr "描述"
#: subprojects/extensions-tool/src/command-create.c:443
msgid "A short description of what the extension does"
msgstr "简短描述下扩展所做的事情"
msgstr "扩展功能的简短描述"
#: subprojects/extensions-tool/src/command-create.c:446
msgid "TEMPLATE"
@ -2847,6 +2855,14 @@ msgstr[0] "%u 个输入"
msgid "System Sounds"
msgstr "系统声音"
#~ msgctxt "calendar heading"
#~ msgid "%A, %B %-d"
#~ msgstr "%-m月%-d日 %A"
#~ msgctxt "calendar heading"
#~ msgid "%A, %B %-d, %Y"
#~ msgstr "%Y年%-m月%-d日 %A"
#~ msgid "Frequently used applications will appear here"
#~ msgstr "常用的应用程序会出现在这里"

View File

@ -346,8 +346,6 @@ struct _App
GSList *notify_appointments; /* CalendarAppointment *, for EventsAdded */
GSList *notify_ids; /* gchar *, for EventsRemoved */
guint events_added_timeout_id;
guint events_removed_timeout_id;
GSList *live_views;
};
@ -370,24 +368,19 @@ app_update_timezone (App *app)
}
}
static gboolean
on_app_schedule_events_added_cb (gpointer user_data)
static void
app_notify_events_added (App *app)
{
App *app = user_data;
GVariantBuilder builder, extras_builder;
GSList *events, *link;
if (g_source_is_destroyed (g_main_current_source ()))
return FALSE;
events = g_slist_reverse (app->notify_appointments);
app->notify_appointments = NULL;
app->events_added_timeout_id = 0;
print_debug ("Emitting EventsAddedOrUpdated with %d events", g_slist_length (events));
if (!events)
return FALSE;
return;
/* The a{sv} is used as an escape hatch in case we want to provide more
* information in the future without breaking ABI
@ -428,41 +421,21 @@ on_app_schedule_events_added_cb (gpointer user_data)
g_variant_builder_clear (&builder);
g_slist_free_full (events, calendar_appointment_free);
return FALSE;
}
static void
app_schedule_events_added (App *app)
app_notify_events_removed (App *app)
{
print_debug ("Scheduling EventsAddedOrUpdated");
if (app->events_added_timeout_id == 0)
{
app->events_added_timeout_id = g_timeout_add_seconds (2,
on_app_schedule_events_added_cb,
app);
g_source_set_name_by_id (app->events_added_timeout_id, "[gnome-shell] on_app_schedule_events_added_cb");
}
}
static gboolean
on_app_schedule_events_removed_cb (gpointer user_data)
{
App *app = user_data;
GVariantBuilder builder;
GSList *ids, *link;
if (g_source_is_destroyed (g_main_current_source ()))
return FALSE;
ids = app->notify_ids;
app->notify_ids = NULL;
app->events_removed_timeout_id = 0;
print_debug ("Emitting EventsRemoved with %d ids", g_slist_length (ids));
if (!ids)
return FALSE;
return;
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
for (link = ids; link; link = g_slist_next (link))
@ -483,20 +456,7 @@ on_app_schedule_events_removed_cb (gpointer user_data)
g_slist_free_full (ids, g_free);
return FALSE;
}
static void
app_schedule_events_removed (App *app)
{
print_debug ("Scheduling EventsRemoved");
if (app->events_removed_timeout_id == 0)
{
app->events_removed_timeout_id = g_timeout_add_seconds (2,
on_app_schedule_events_removed_cb,
app);
g_source_set_name_by_id (app->events_removed_timeout_id, "[gnome-shell] on_app_schedule_events_removed_cb");
}
return;
}
static void
@ -546,7 +506,7 @@ app_process_added_modified_objects (App *app,
g_clear_object (&cal_client);
if (app->notify_appointments)
app_schedule_events_added (app);
app_notify_events_added (app);
}
static void
@ -610,7 +570,7 @@ on_objects_removed (ECalClientView *view,
g_clear_object (&client);
if (app->notify_ids)
app_schedule_events_removed (app);
app_notify_events_removed (app);
}
static gboolean
@ -874,9 +834,6 @@ app_free (App *app)
{
GSList *ll;
g_clear_handle_id (&app->events_added_timeout_id, g_source_remove);
g_clear_handle_id (&app->events_removed_timeout_id, g_source_remove);
for (ll = app->live_views; ll != NULL; ll = g_slist_next (ll))
{
ECalClientView *view = E_CAL_CLIENT_VIEW (ll->data);

View File

@ -51,6 +51,8 @@ def start_shell(perf_output=None):
args.append('--nested')
else:
args.append('--display-server')
elif options.x11:
args.append('--x11')
return subprocess.Popen(args, env=env)
@ -295,6 +297,8 @@ parser.add_option("-w", "--wayland", action="store_true",
help="Run as a Wayland compositor")
parser.add_option("-n", "--nested", action="store_true",
help="Run as a Wayland nested compositor")
parser.add_option("-x", "--x11", action="store_true",
help="Run as an X11 compositor")
options, args = parser.parse_args()

View File

@ -163,15 +163,6 @@ libshell_private_sources = [
'shell-app-cache.c',
]
if enable_recorder
libshell_sources += ['shell-recorder.c']
libshell_public_headers += ['shell-recorder.h']
libshell_private_sources += ['shell-recorder-src.c']
libshell_private_headers += ['shell-recorder-src.h']
endif
libshell_enums = gnome.mkenums_simple('shell-enum-types',
sources: libshell_public_headers
)

View File

@ -1361,9 +1361,15 @@ shell_global_get_pointer (ShellGlobal *global,
{
ClutterModifierType raw_mods;
MetaCursorTracker *tracker;
graphene_point_t point;
tracker = meta_cursor_tracker_get_for_display (global->meta_display);
meta_cursor_tracker_get_pointer (tracker, x, y, &raw_mods);
meta_cursor_tracker_get_pointer (tracker, &point, &raw_mods);
if (x)
*x = point.x;
if (y)
*y = point.y;
*mods = raw_mods & CLUTTER_MODIFIER_MASK;
}

View File

@ -1,425 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#include "config.h"
#define GST_USE_UNSTABLE_API
#include <gst/base/gstpushsrc.h>
#include "shell-recorder-src.h"
struct _ShellRecorderSrc
{
GstPushSrc parent;
GMutex mutex;
GstCaps *caps;
GMutex queue_lock;
GCond queue_cond;
GQueue *queue;
gboolean eos;
gboolean flushing;
guint memory_used;
guint memory_used_update_idle;
};
struct _ShellRecorderSrcClass
{
GstPushSrcClass parent_class;
};
enum {
PROP_0,
PROP_CAPS,
PROP_MEMORY_USED
};
#define shell_recorder_src_parent_class parent_class
G_DEFINE_TYPE(ShellRecorderSrc, shell_recorder_src, GST_TYPE_PUSH_SRC);
static void
shell_recorder_src_init (ShellRecorderSrc *src)
{
gst_base_src_set_format (GST_BASE_SRC (src), GST_FORMAT_TIME);
gst_base_src_set_live (GST_BASE_SRC (src), TRUE);
src->queue = g_queue_new ();
g_mutex_init (&src->mutex);
g_mutex_init (&src->queue_lock);
g_cond_init (&src->queue_cond);
}
static gboolean
shell_recorder_src_memory_used_update_idle (gpointer data)
{
ShellRecorderSrc *src = data;
g_mutex_lock (&src->mutex);
src->memory_used_update_idle = 0;
g_mutex_unlock (&src->mutex);
g_object_notify (G_OBJECT (src), "memory-used");
return FALSE;
}
/* The memory_used property is used to monitor buffer usage,
* so we marshal notification back to the main loop thread.
*/
static void
shell_recorder_src_update_memory_used (ShellRecorderSrc *src,
int delta)
{
g_mutex_lock (&src->mutex);
src->memory_used += delta;
if (src->memory_used_update_idle == 0)
{
src->memory_used_update_idle = g_idle_add (shell_recorder_src_memory_used_update_idle, src);
g_source_set_name_by_id (src->memory_used_update_idle, "[gnome-shell] shell_recorder_src_memory_used_update_idle");
}
g_mutex_unlock (&src->mutex);
}
/* _negotiate() is called when we have to decide on a format. We
* use the configured format */
static gboolean
shell_recorder_src_negotiate (GstBaseSrc * base_src)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (base_src);
gboolean result;
result = gst_base_src_set_caps (base_src, src->caps);
return result;
}
static gboolean
shell_recorder_src_unlock (GstBaseSrc * base_src)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (base_src);
g_mutex_lock (&src->queue_lock);
src->flushing = TRUE;
g_cond_signal (&src->queue_cond);
g_mutex_unlock (&src->queue_lock);
return TRUE;
}
static gboolean
shell_recorder_src_unlock_stop (GstBaseSrc * base_src)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (base_src);
g_mutex_lock (&src->queue_lock);
src->flushing = FALSE;
g_cond_signal (&src->queue_cond);
g_mutex_unlock (&src->queue_lock);
return TRUE;
}
static gboolean
shell_recorder_src_start (GstBaseSrc * base_src)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (base_src);
g_mutex_lock (&src->queue_lock);
src->flushing = FALSE;
src->eos = FALSE;
g_cond_signal (&src->queue_cond);
g_mutex_unlock (&src->queue_lock);
return TRUE;
}
static gboolean
shell_recorder_src_stop (GstBaseSrc * base_src)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (base_src);
g_mutex_lock (&src->queue_lock);
src->flushing = TRUE;
src->eos = FALSE;
g_queue_foreach (src->queue, (GFunc) gst_buffer_unref, NULL);
g_queue_clear (src->queue);
g_cond_signal (&src->queue_cond);
g_mutex_unlock (&src->queue_lock);
return TRUE;
}
static gboolean
shell_recorder_src_send_event (GstElement * element, GstEvent * event)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (element);
gboolean res;
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)
{
shell_recorder_src_close (src);
gst_event_unref (event);
res = TRUE;
}
else
{
res = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, send_event, (element,
event), FALSE);
}
return res;
}
/* The create() virtual function is responsible for returning the next buffer.
* We just pop buffers off of the queue and block if necessary.
*/
static GstFlowReturn
shell_recorder_src_create (GstPushSrc *push_src,
GstBuffer **buffer_out)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (push_src);
GstBuffer *buffer;
g_mutex_lock (&src->queue_lock);
while (TRUE) {
/* int the flushing state we just return FLUSHING */
if (src->flushing) {
g_mutex_unlock (&src->queue_lock);
return GST_FLOW_FLUSHING;
}
buffer = g_queue_pop_head (src->queue);
/* we have a buffer, exit the loop to handle it */
if (buffer != NULL)
break;
/* no buffer, check EOS */
if (src->eos) {
g_mutex_unlock (&src->queue_lock);
return GST_FLOW_EOS;
}
/* wait for something to happen and try again */
g_cond_wait (&src->queue_cond, &src->queue_lock);
}
g_mutex_unlock (&src->queue_lock);
shell_recorder_src_update_memory_used (src,
- (int)(gst_buffer_get_size(buffer) / 1024));
*buffer_out = buffer;
return GST_FLOW_OK;
}
static void
shell_recorder_src_set_caps (ShellRecorderSrc *src,
const GstCaps *caps)
{
if (caps == src->caps)
return;
if (src->caps != NULL)
{
gst_caps_unref (src->caps);
src->caps = NULL;
}
if (caps)
{
/* The capabilities will be negotated with the downstream element
* and set on the pad when the first buffer is pushed.
*/
src->caps = gst_caps_copy (caps);
}
else
src->caps = NULL;
}
static void
shell_recorder_src_finalize (GObject *object)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (object);
g_clear_handle_id (&src->memory_used_update_idle, g_source_remove);
shell_recorder_src_set_caps (src, NULL);
g_queue_free_full (src->queue, (GDestroyNotify) gst_buffer_unref);
g_mutex_clear (&src->mutex);
g_mutex_clear (&src->queue_lock);
g_cond_clear (&src->queue_cond);
G_OBJECT_CLASS (shell_recorder_src_parent_class)->finalize (object);
}
static void
shell_recorder_src_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (object);
switch (prop_id)
{
case PROP_CAPS:
shell_recorder_src_set_caps (src, gst_value_get_caps (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
shell_recorder_src_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ShellRecorderSrc *src = SHELL_RECORDER_SRC (object);
switch (prop_id)
{
case PROP_CAPS:
gst_value_set_caps (value, src->caps);
break;
case PROP_MEMORY_USED:
g_mutex_lock (&src->mutex);
g_value_set_uint (value, src->memory_used);
g_mutex_unlock (&src->mutex);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
shell_recorder_src_class_init (ShellRecorderSrcClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstBaseSrcClass *base_src_class = GST_BASE_SRC_CLASS (klass);
GstPushSrcClass *push_src_class = GST_PUSH_SRC_CLASS (klass);
static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
object_class->finalize = shell_recorder_src_finalize;
object_class->set_property = shell_recorder_src_set_property;
object_class->get_property = shell_recorder_src_get_property;
g_object_class_install_property (object_class,
PROP_CAPS,
g_param_spec_boxed ("caps",
"Caps",
"Fixed GstCaps for the source",
GST_TYPE_CAPS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_MEMORY_USED,
g_param_spec_uint ("memory-used",
"Memory Used",
"Memory currently used by the queue (in kB)",
0, G_MAXUINT, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_template));
gst_element_class_set_details_simple (element_class,
"ShellRecorderSrc",
"Generic/Src",
"Feed screen capture data to a pipeline",
"Owen Taylor <otaylor@redhat.com>");
element_class->send_event = shell_recorder_src_send_event;
base_src_class->negotiate = shell_recorder_src_negotiate;
base_src_class->unlock = shell_recorder_src_unlock;
base_src_class->unlock_stop = shell_recorder_src_unlock_stop;
base_src_class->start = shell_recorder_src_start;
base_src_class->stop = shell_recorder_src_stop;
push_src_class->create = shell_recorder_src_create;
}
/**
* shell_recorder_src_add_buffer:
*
* Adds a buffer to the internal queue to be pushed out at the next opportunity.
* There is no flow control, so arbitrary amounts of memory may be used by
* the buffers on the queue. The buffer contents must match the #GstCaps
* set in the :caps property.
*/
void
shell_recorder_src_add_buffer (ShellRecorderSrc *src,
GstBuffer *buffer)
{
g_return_if_fail (SHELL_IS_RECORDER_SRC (src));
g_return_if_fail (src->caps != NULL);
shell_recorder_src_update_memory_used (src,
(int)(gst_buffer_get_size(buffer) / 1024));
g_mutex_lock (&src->queue_lock);
g_queue_push_tail (src->queue, gst_buffer_ref (buffer));
g_cond_signal (&src->queue_cond);
g_mutex_unlock (&src->queue_lock);
}
/**
* shell_recorder_src_close:
*
* Indicates the end of the input stream. Once all previously added buffers have
* been pushed out an end-of-stream message will be sent.
*/
void
shell_recorder_src_close (ShellRecorderSrc *src)
{
/* We can't send a message to the source immediately or buffers that haven't
* been pushed yet will be discarded. Instead mark ourselves EOS, which will
* make us send an event once everything has been pushed.
*/
g_mutex_lock (&src->queue_lock);
src->eos = TRUE;
g_cond_signal (&src->queue_cond);
g_mutex_unlock (&src->queue_lock);
}
static gboolean
plugin_init (GstPlugin *plugin)
{
gst_element_register(plugin, "shellrecordersrc", GST_RANK_NONE,
SHELL_TYPE_RECORDER_SRC);
return TRUE;
}
/**
* shell_recorder_src_register:
*
* Registers a plugin holding our single element to use privately in
* this application. Can safely be called multiple times.
*/
void
shell_recorder_src_register (void)
{
static gboolean registered = FALSE;
if (registered)
return;
gst_plugin_register_static (GST_VERSION_MAJOR, GST_VERSION_MINOR,
"shellrecorder",
"Plugin for ShellRecorder",
plugin_init,
"0.1",
"LGPL",
"gnome-shell", "gnome-shell", "http://live.gnome.org/GnomeShell");
registered = TRUE;
}

View File

@ -1,40 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef __SHELL_RECORDER_SRC_H__
#define __SHELL_RECORDER_SRC_H__
#include <gst/gst.h>
G_BEGIN_DECLS
/**
* ShellRecorderSrc:
*
* shellrecordersrc a custom source element is pretty much like a very
* simple version of the stander GStreamer 'appsrc' element, without
* any of the provisions for seeking, generating data on demand,
* etc. In both cases, the application supplies the buffers and the
* element pushes them into the pipeline. The main reason for not using
* appsrc is that it wasn't a supported element until gstreamer 0.10.22,
* and as of 2009-03, many systems still have 0.10.21.
*/
typedef struct _ShellRecorderSrc ShellRecorderSrc;
typedef struct _ShellRecorderSrcClass ShellRecorderSrcClass;
#define SHELL_TYPE_RECORDER_SRC (shell_recorder_src_get_type ())
#define SHELL_RECORDER_SRC(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_RECORDER_SRC, ShellRecorderSrc))
#define SHELL_RECORDER_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_RECORDER_SRC, ShellRecorderSrcClass))
#define SHELL_IS_RECORDER_SRC(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_RECORDER_SRC))
#define SHELL_IS_RECORDER_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_RECORDER_SRC))
#define SHELL_RECORDER_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_RECORDER_SRC, ShellRecorderSrcClass))
GType shell_recorder_src_get_type (void) G_GNUC_CONST;
void shell_recorder_src_register (void);
void shell_recorder_src_add_buffer (ShellRecorderSrc *src,
GstBuffer *buffer);
void shell_recorder_src_close (ShellRecorderSrc *src);
G_END_DECLS
#endif /* __SHELL_RECORDER_SRC_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef __SHELL_RECORDER_H__
#define __SHELL_RECORDER_H__
#include <clutter/clutter.h>
G_BEGIN_DECLS
/**
* SECTION:shell-recorder
* @short_description: Record from a #ClutterStage
*
* The #ShellRecorder object is used to make recordings ("screencasts")
* of a #ClutterStage. Recording is done via #GStreamer. The default is
* to encode as a Theora movie and write it to a file in the current
* directory named after the date, but the encoding and output can
* be configured.
*/
#define SHELL_TYPE_RECORDER (shell_recorder_get_type ())
G_DECLARE_FINAL_TYPE (ShellRecorder, shell_recorder, SHELL, RECORDER, GObject)
ShellRecorder *shell_recorder_new (ClutterStage *stage);
void shell_recorder_set_framerate (ShellRecorder *recorder,
int framerate);
void shell_recorder_set_file_template (ShellRecorder *recorder,
const char *file_template);
void shell_recorder_set_pipeline (ShellRecorder *recorder,
const char *pipeline);
void shell_recorder_set_draw_cursor (ShellRecorder *recorder,
gboolean draw_cursor);
void shell_recorder_set_area (ShellRecorder *recorder,
int x,
int y,
int width,
int height);
gboolean shell_recorder_record (ShellRecorder *recorder,
char **filename_used);
void shell_recorder_close (ShellRecorder *recorder);
void shell_recorder_pause (ShellRecorder *recorder);
gboolean shell_recorder_is_recording (ShellRecorder *recorder);
G_END_DECLS
#endif /* __SHELL_RECORDER_H__ */

View File

@ -12,6 +12,12 @@
#include "shell-screenshot.h"
#include "shell-util.h"
typedef enum _ShellScreenshotFlag
{
SHELL_SCREENSHOT_FLAG_NONE,
SHELL_SCREENSHOT_FLAG_INCLUDE_CURSOR,
} ShellScreenshotFlag;
typedef struct _ShellScreenshotPrivate ShellScreenshotPrivate;
struct _ShellScreenshot
@ -32,7 +38,6 @@ struct _ShellScreenshotPrivate
cairo_surface_t *image;
cairo_rectangle_int_t screenshot_area;
gboolean include_cursor;
gboolean include_frame;
};
@ -45,10 +50,6 @@ typedef enum
G_DEFINE_TYPE_WITH_PRIVATE (ShellScreenshot, shell_screenshot, G_TYPE_OBJECT);
static void
grab_screenshot (ClutterActor *stage,
GTask *result);
static void
shell_screenshot_class_init (ShellScreenshotClass *screenshot_class)
{
@ -77,8 +78,6 @@ on_screenshot_written (GObject *source,
g_clear_pointer (&priv->image, cairo_surface_destroy);
g_clear_object (&priv->stream);
g_clear_pointer (&priv->datetime, g_date_time_unref);
meta_enable_unredirect_for_display (shell_global_get_display (priv->global));
}
static void
@ -121,63 +120,49 @@ write_screenshot_thread (GTask *result,
}
static void
do_grab_screenshot (ShellScreenshot *screenshot,
ClutterStage *stage,
int x,
int y,
int width,
int height)
do_grab_screenshot (ShellScreenshot *screenshot,
int x,
int y,
int width,
int height,
ShellScreenshotFlag flags)
{
ShellScreenshotPrivate *priv = screenshot->priv;
ClutterStage *stage = shell_global_get_stage (priv->global);
cairo_rectangle_int_t screenshot_rect = { x, y, width, height };
ClutterCapture *captures;
int n_captures;
int i;
int image_width;
int image_height;
float scale;
cairo_surface_t *image;
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_NONE;
g_autoptr (GError) error = NULL;
if (!clutter_stage_capture (stage, FALSE,
&screenshot_rect,
&captures,
&n_captures))
return;
clutter_stage_get_capture_final_size (stage, &screenshot_rect,
&image_width,
&image_height,
&scale);
image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
image_width, image_height);
if (n_captures == 1)
priv->image = cairo_surface_reference (captures[0].image);
if (flags & SHELL_SCREENSHOT_FLAG_INCLUDE_CURSOR)
paint_flags |= CLUTTER_PAINT_FLAG_FORCE_CURSORS;
else
paint_flags |= CLUTTER_PAINT_FLAG_NO_CURSORS;
if (!clutter_stage_paint_to_buffer (stage, &screenshot_rect, scale,
cairo_image_surface_get_data (image),
cairo_image_surface_get_stride (image),
CLUTTER_CAIRO_FORMAT_ARGB32,
paint_flags,
&error))
{
float target_scale;
clutter_stage_get_capture_final_size (stage, &screenshot_rect,
&width, &height, &target_scale);
priv->image = shell_util_composite_capture_images (captures,
n_captures,
x, y,
width, height,
target_scale);
cairo_surface_destroy (image);
g_warning ("Failed to take screenshot: %s", error->message);
return;
}
priv->image = image;
priv->datetime = g_date_time_new_now_local ();
for (i = 0; i < n_captures; i++)
cairo_surface_destroy (captures[i].image);
g_free (captures);
}
static gboolean
should_draw_cursor_image (ShellScreenshotMode mode)
{
if (mode == SHELL_SCREENSHOT_WINDOW || !meta_is_wayland_compositor ())
{
StSettings *settings = st_settings_get ();
gboolean magnifier_active = FALSE;
g_object_get (settings, "magnifier-active", &magnifier_active, NULL);
if (!magnifier_active)
return TRUE;
}
return FALSE;
}
static void
@ -196,6 +181,7 @@ draw_cursor_image (cairo_surface_t *surface,
int x, y;
int xhot, yhot;
double xscale, yscale;
graphene_point_t point;
display = shell_global_get_display (shell_global_get ());
tracker = meta_cursor_tracker_get_for_display (display);
@ -205,9 +191,11 @@ draw_cursor_image (cairo_surface_t *surface,
return;
screenshot_region = cairo_region_create_rectangle (&area);
meta_cursor_tracker_get_pointer (tracker, &x, &y, NULL);
meta_cursor_tracker_get_pointer (tracker, &point, NULL);
x = point.x;
y = point.y;
if (!cairo_region_contains_point (screenshot_region, x, y))
if (!cairo_region_contains_point (screenshot_region, point.x, point.y))
{
cairo_region_destroy (screenshot_region);
return;
@ -256,116 +244,37 @@ draw_cursor_image (cairo_surface_t *surface,
}
static void
on_paint (ClutterActor *actor,
ClutterPaintContext *paint_context,
GTask *result)
{
grab_screenshot (actor, result);
}
static void
on_actors_painted (ClutterActor *actor,
GTask *result)
{
grab_screenshot (actor, result);
}
static void
grab_screenshot (ClutterActor *stage,
GTask *result)
grab_screenshot (ShellScreenshot *screenshot,
ShellScreenshotFlag flags,
GTask *result)
{
ShellScreenshotPrivate *priv = screenshot->priv;
MetaDisplay *display;
int width, height;
ShellScreenshot *screenshot = g_task_get_source_object (result);
ShellScreenshotPrivate *priv = screenshot->priv;
GTask *task;
display = shell_global_get_display (priv->global);
meta_display_get_size (display, &width, &height);
do_grab_screenshot (screenshot, CLUTTER_STAGE (stage), 0, 0, width, height);
if (meta_display_get_n_monitors (display) > 1)
{
cairo_region_t *screen_region = cairo_region_create ();
cairo_region_t *stage_region;
MetaRectangle monitor_rect;
cairo_rectangle_int_t stage_rect;
int i;
cairo_t *cr;
for (i = meta_display_get_n_monitors (display) - 1; i >= 0; i--)
{
meta_display_get_monitor_geometry (display, i, &monitor_rect);
cairo_region_union_rectangle (screen_region,
(const cairo_rectangle_int_t *) &monitor_rect);
}
stage_rect.x = 0;
stage_rect.y = 0;
stage_rect.width = width;
stage_rect.height = height;
stage_region = cairo_region_create_rectangle ((const cairo_rectangle_int_t *) &stage_rect);
cairo_region_xor (stage_region, screen_region);
cairo_region_destroy (screen_region);
cr = cairo_create (priv->image);
for (i = 0; i < cairo_region_num_rectangles (stage_region); i++)
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (stage_region, i, &rect);
cairo_rectangle (cr, (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height);
cairo_fill (cr);
}
cairo_destroy (cr);
cairo_region_destroy (stage_region);
}
do_grab_screenshot (screenshot,
0, 0, width, height,
flags);
priv->screenshot_area.x = 0;
priv->screenshot_area.y = 0;
priv->screenshot_area.width = width;
priv->screenshot_area.height = height;
if (priv->include_cursor)
draw_cursor_image (priv->image, priv->screenshot_area);
g_signal_handlers_disconnect_by_func (stage, on_paint, result);
g_signal_handlers_disconnect_by_func (stage, on_actors_painted, result);
task = g_task_new (screenshot, NULL, on_screenshot_written, result);
g_task_run_in_thread (task, write_screenshot_thread);
g_object_unref (task);
}
static void
grab_area_screenshot (ClutterActor *stage,
GTask *result)
grab_window_screenshot (ShellScreenshot *screenshot,
ShellScreenshotFlag flags,
GTask *result)
{
ShellScreenshot *screenshot = g_task_get_source_object (result);
ShellScreenshotPrivate *priv = screenshot->priv;
GTask *task;
do_grab_screenshot (screenshot,
CLUTTER_STAGE (stage),
priv->screenshot_area.x,
priv->screenshot_area.y,
priv->screenshot_area.width,
priv->screenshot_area.height);
g_signal_handlers_disconnect_by_func (stage, grab_area_screenshot, result);
task = g_task_new (screenshot, NULL, on_screenshot_written, result);
g_task_run_in_thread (task, write_screenshot_thread);
g_object_unref (task);
}
static void
grab_window_screenshot (ClutterActor *stage,
GTask *result)
{
ShellScreenshot *screenshot = g_task_get_source_object (result);
ShellScreenshotPrivate *priv = screenshot->priv;
GTask *task;
MetaDisplay *display = shell_global_get_display (priv->global);
@ -388,7 +297,7 @@ grab_window_screenshot (ClutterActor *stage,
NULL);
priv->datetime = g_date_time_new_now_local ();
if (priv->include_cursor)
if (flags & SHELL_SCREENSHOT_FLAG_INCLUDE_CURSOR)
{
if (meta_window_get_client_type (window) == META_WINDOW_CLIENT_TYPE_WAYLAND)
{
@ -401,33 +310,11 @@ grab_window_screenshot (ClutterActor *stage,
draw_cursor_image (priv->image, priv->screenshot_area);
}
g_signal_handlers_disconnect_by_func (stage, grab_window_screenshot, result);
task = g_task_new (screenshot, NULL, on_screenshot_written, result);
g_task_run_in_thread (task, write_screenshot_thread);
g_object_unref (task);
}
static void
grab_pixel (ClutterActor *stage,
GTask *result)
{
ShellScreenshot *screenshot = g_task_get_source_object (result);
ShellScreenshotPrivate *priv = screenshot->priv;
do_grab_screenshot (screenshot,
CLUTTER_STAGE (stage),
priv->screenshot_area.x,
priv->screenshot_area.y,
1,
1);
meta_enable_unredirect_for_display (shell_global_get_display (priv->global));
g_signal_handlers_disconnect_by_func (stage, grab_pixel, result);
g_task_return_boolean (result, TRUE);
g_object_unref (result);
}
static gboolean
finish_screenshot (ShellScreenshot *screenshot,
GAsyncResult *result,
@ -465,10 +352,9 @@ shell_screenshot_screenshot (ShellScreenshot *screenshot,
GAsyncReadyCallback callback,
gpointer user_data)
{
ClutterActor *stage;
ShellScreenshotPrivate *priv;
gboolean use_paint_signal = FALSE;
GTask *result;
ShellScreenshotFlag flags;
g_return_if_fail (SHELL_IS_SCREENSHOT (screenshot));
g_return_if_fail (G_IS_OUTPUT_STREAM (stream));
@ -492,34 +378,12 @@ shell_screenshot_screenshot (ShellScreenshot *screenshot,
g_task_set_source_tag (result, shell_screenshot_screenshot);
priv->stream = g_object_ref (stream);
priv->include_cursor = FALSE;
stage = CLUTTER_ACTOR (shell_global_get_stage (priv->global));
meta_disable_unredirect_for_display (shell_global_get_display (priv->global));
flags = SHELL_SCREENSHOT_FLAG_NONE;
if (include_cursor)
{
if (should_draw_cursor_image (SHELL_SCREENSHOT_SCREEN))
priv->include_cursor = TRUE;
else
use_paint_signal = TRUE;
}
flags |= SHELL_SCREENSHOT_FLAG_INCLUDE_CURSOR;
if (use_paint_signal)
{
g_signal_connect_after (stage, "paint",
G_CALLBACK (on_paint),
result);
}
else
{
g_signal_connect_after (stage, "actors-painted",
G_CALLBACK (on_actors_painted),
result);
}
clutter_actor_queue_redraw (stage);
grab_screenshot (screenshot, flags, result);
}
/**
@ -575,9 +439,9 @@ shell_screenshot_screenshot_area (ShellScreenshot *screenshot,
GAsyncReadyCallback callback,
gpointer user_data)
{
ClutterActor *stage;
ShellScreenshotPrivate *priv;
GTask *result;
g_autoptr (GTask) task = NULL;
g_return_if_fail (SHELL_IS_SCREENSHOT (screenshot));
g_return_if_fail (G_IS_OUTPUT_STREAM (stream));
@ -606,13 +470,15 @@ shell_screenshot_screenshot_area (ShellScreenshot *screenshot,
priv->screenshot_area.width = width;
priv->screenshot_area.height = height;
stage = CLUTTER_ACTOR (shell_global_get_stage (priv->global));
do_grab_screenshot (screenshot,
priv->screenshot_area.x,
priv->screenshot_area.y,
priv->screenshot_area.width,
priv->screenshot_area.height,
SHELL_SCREENSHOT_FLAG_NONE);
meta_disable_unredirect_for_display (shell_global_get_display (shell_global_get ()));
g_signal_connect_after (stage, "actors-painted", G_CALLBACK (grab_area_screenshot), result);
clutter_actor_queue_redraw (stage);
task = g_task_new (screenshot, NULL, on_screenshot_written, result);
g_task_run_in_thread (task, write_screenshot_thread);
}
/**
@ -666,7 +532,6 @@ shell_screenshot_screenshot_window (ShellScreenshot *screenshot,
{
ShellScreenshotPrivate *priv;
MetaDisplay *display;
ClutterActor *stage;
MetaWindow *window;
GTask *result;
@ -695,16 +560,8 @@ shell_screenshot_screenshot_window (ShellScreenshot *screenshot,
priv->stream = g_object_ref (stream);
priv->include_frame = include_frame;
priv->include_cursor = include_cursor &&
should_draw_cursor_image (SHELL_SCREENSHOT_WINDOW);
stage = CLUTTER_ACTOR (shell_global_get_stage (priv->global));
meta_disable_unredirect_for_display (shell_global_get_display (shell_global_get ()));
g_signal_connect_after (stage, "actors-painted", G_CALLBACK (grab_window_screenshot), result);
clutter_actor_queue_redraw (stage);
grab_window_screenshot (screenshot, include_cursor, result);
}
/**
@ -753,9 +610,7 @@ shell_screenshot_pick_color (ShellScreenshot *screenshot,
gpointer user_data)
{
ShellScreenshotPrivate *priv;
MetaDisplay *display;
ClutterActor *stage;
GTask *result;
g_autoptr (GTask) result = NULL;
g_return_if_fail (SHELL_IS_SCREENSHOT (screenshot));
@ -769,14 +624,14 @@ shell_screenshot_pick_color (ShellScreenshot *screenshot,
priv->screenshot_area.width = 1;
priv->screenshot_area.height = 1;
display = shell_global_get_display (priv->global);
stage = CLUTTER_ACTOR (shell_global_get_stage (priv->global));
do_grab_screenshot (screenshot,
priv->screenshot_area.x,
priv->screenshot_area.y,
1,
1,
SHELL_SCREENSHOT_FLAG_NONE);
meta_disable_unredirect_for_display (display);
g_signal_connect_after (stage, "actors-painted", G_CALLBACK (grab_pixel), result);
clutter_actor_queue_redraw (stage);
g_task_return_boolean (result, TRUE);
}
#if G_BYTE_ORDER == G_LITTLE_ENDIAN

View File

@ -77,61 +77,6 @@ shell_util_set_hidden_from_pick (ClutterActor *actor,
}
}
/**
* shell_util_get_transformed_allocation:
* @actor: a #ClutterActor
* @box: (out): location to store returned box in stage coordinates
*
* This function is similar to a combination of clutter_actor_get_transformed_position(),
* and clutter_actor_get_transformed_size(), but unlike
* clutter_actor_get_transformed_size(), it always returns a transform
* of the current allocation, while clutter_actor_get_transformed_size() returns
* bad values (the transform of the requested size) if a relayout has been
* queued.
*
* This function is more convenient to use than
* clutter_actor_get_abs_allocation_vertices() if no transformation is in effect
* and also works around limitations in the GJS binding of arrays.
*/
void
shell_util_get_transformed_allocation (ClutterActor *actor,
ClutterActorBox *box)
{
/* Code adapted from clutter-actor.c:
* Copyright 2006, 2007, 2008 OpenedHand Ltd
*/
graphene_point3d_t v[4];
gfloat x_min, x_max, y_min, y_max;
guint i;
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
clutter_actor_get_abs_allocation_vertices (actor, v);
x_min = x_max = v[0].x;
y_min = y_max = v[0].y;
for (i = 1; i < G_N_ELEMENTS (v); ++i)
{
if (v[i].x < x_min)
x_min = v[i].x;
if (v[i].x > x_max)
x_max = v[i].x;
if (v[i].y < y_min)
y_min = v[i].y;
if (v[i].y > y_max)
y_max = v[i].y;
}
box->x1 = x_min;
box->y1 = y_min;
box->x2 = x_max;
box->y2 = y_max;
}
/**
* shell_util_get_week_start:
*
@ -409,34 +354,6 @@ shell_util_create_pixbuf_from_data (const guchar *data,
typedef const gchar *(*ShellGLGetString) (GLenum);
static const gchar *
get_gl_vendor (void)
{
static const gchar *vendor = NULL;
if (!vendor)
{
ShellGLGetString gl_get_string;
gl_get_string = (ShellGLGetString) cogl_get_proc_address ("glGetString");
if (gl_get_string)
vendor = gl_get_string (GL_VENDOR);
}
return vendor;
}
gboolean
shell_util_need_background_refresh (void)
{
if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
return FALSE;
if (g_strcmp0 (get_gl_vendor (), "NVIDIA Corporation") == 0)
return TRUE;
return FALSE;
}
static gboolean
canvas_draw_cb (ClutterContent *content,
cairo_t *cr,
@ -653,6 +570,57 @@ shell_util_get_uid (void)
return getuid ();
}
typedef struct {
GDBusConnection *connection;
gchar *command;
GCancellable *cancellable;
gulong cancel_id;
guint job_watch;
gchar *job;
} SystemdCall;
static void
shell_util_systemd_call_data_free (SystemdCall *data)
{
if (data->job_watch)
{
g_dbus_connection_signal_unsubscribe (data->connection, data->job_watch);
data->job_watch = 0;
}
if (data->cancellable)
{
g_cancellable_disconnect (data->cancellable, data->cancel_id);
g_clear_object (&data->cancellable);
data->cancel_id = 0;
}
g_clear_object (&data->connection);
g_clear_pointer (&data->job, g_free);
g_clear_pointer (&data->command, g_free);
g_free (data);
}
static void
shell_util_systemd_call_cancelled_cb (GCancellable *cancellable,
GTask *task)
{
SystemdCall *data = g_task_get_task_data (task);
/* Task has returned, but data is not yet free'ed, ignore signal. */
if (g_task_get_completed (task))
return;
/* We are still in the DBus call; it will return the error. */
if (data->job == NULL)
return;
g_task_return_error_if_cancelled (task);
g_object_unref (task);
}
static void
on_systemd_call_cb (GObject *source,
GAsyncResult *res,
@ -660,46 +628,143 @@ on_systemd_call_cb (GObject *source,
{
g_autoptr (GVariant) reply = NULL;
g_autoptr (GError) error = NULL;
const gchar *command = user_data;
GTask *task = G_TASK (user_data);
SystemdCall *data;
reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source),
res, &error);
if (error)
g_warning ("Could not issue '%s' systemd call", command);
data = g_task_get_task_data (task);
if (error) {
g_warning ("Could not issue '%s' systemd call", data->command);
g_task_return_error (task, g_steal_pointer (&error));
g_object_unref (task);
return;
}
g_assert (data->job == NULL);
g_variant_get (reply, "(o)", &data->job);
/* And we wait for the JobRemoved notification. */
}
static gboolean
shell_util_systemd_call (const char *command,
const char *unit,
const char *mode,
GError **error)
static void
on_systemd_job_removed_cb (GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
GTask *task = G_TASK (user_data);
SystemdCall *data;
guint32 id;
const char *path, *unit, *result;
/* Task has returned, but data is not yet free'ed, ignore signal. */
if (g_task_get_completed (task))
return;
data = g_task_get_task_data (task);
/* No job information yet, ignore. */
if (data->job == NULL)
return;
g_variant_get (parameters, "(u&o&s&s)", &id, &path, &unit, &result);
/* Is it the job we are waiting for? */
if (g_strcmp0 (path, data->job) != 0)
return;
/* Task has completed; return the result of the job */
if (g_strcmp0 (result, "done") == 0)
g_task_return_boolean (task, TRUE);
else
g_task_return_new_error (task,
G_IO_ERROR,
G_IO_ERROR_FAILED,
"Systemd job completed with status \"%s\"",
result);
g_object_unref (task);
}
static void
shell_util_systemd_call (const char *command,
const char *unit,
const char *mode,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_autoptr (GTask) task = g_task_new (NULL, cancellable, callback, user_data);
#ifdef HAVE_SYSTEMD
g_autoptr (GDBusConnection) connection = NULL;
GError *error = NULL;
SystemdCall *data;
g_autofree char *self_unit = NULL;
int res;
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
if (connection == NULL) {
g_task_return_error (task, error);
return;
}
/* We look up the systemd unit that our own process is running in here.
* This way we determine whether the session is managed using systemd.
*/
res = sd_pid_get_user_unit (getpid (), &self_unit);
if (res == -ENODATA)
{
g_debug ("Not systemd-managed, not doing '%s' on '%s'", mode, unit);
return FALSE;
g_task_return_new_error (task,
G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"Not systemd managed");
return;
}
else if (res < 0)
{
g_set_error (error,
G_IO_ERROR,
g_io_error_from_errno (-res),
"Error trying to start systemd unit '%s': %s",
unit, g_strerror (-res));
return FALSE;
g_task_return_new_error (task,
G_IO_ERROR,
g_io_error_from_errno (-res),
"Error fetching own systemd unit: %s",
g_strerror (-res));
return;
}
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error);
data = g_new0 (SystemdCall, 1);
data->command = g_strdup (command);
data->connection = g_object_ref (connection);
data->job_watch = g_dbus_connection_signal_subscribe (connection,
"org.freedesktop.systemd1",
"org.freedesktop.systemd1.Manager",
"JobRemoved",
"/org/freedesktop/systemd1",
NULL,
G_DBUS_SIGNAL_FLAGS_NONE,
on_systemd_job_removed_cb,
task,
NULL);
g_task_set_task_data (task,
data,
(GDestroyNotify) shell_util_systemd_call_data_free);
if (connection == NULL)
return FALSE;
if (cancellable)
{
data->cancellable = g_object_ref (cancellable);
data->cancel_id = g_cancellable_connect (cancellable,
G_CALLBACK (shell_util_systemd_call_cancelled_cb),
task,
NULL);
}
g_dbus_connection_call (connection,
"org.freedesktop.systemd1",
@ -708,31 +773,53 @@ shell_util_systemd_call (const char *command,
command,
g_variant_new ("(ss)",
unit, mode),
NULL,
G_VARIANT_TYPE ("(o)"),
G_DBUS_CALL_FLAGS_NONE,
-1, NULL,
-1, cancellable,
on_systemd_call_cb,
(gpointer) command);
return TRUE;
#endif /* HAVE_SYSTEMD */
g_steal_pointer (&task));
#else /* HAVE_SYSTEMD */
g_task_return_new_error (task,
G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"systemd not supported by gnome-shell");
#endif /* !HAVE_SYSTEMD */
}
return FALSE;
void
shell_util_start_systemd_unit (const char *unit,
const char *mode,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
shell_util_systemd_call ("StartUnit", unit, mode,
cancellable, callback, user_data);
}
gboolean
shell_util_start_systemd_unit (const char *unit,
const char *mode,
GError **error)
shell_util_start_systemd_unit_finish (GAsyncResult *res,
GError **error)
{
return shell_util_systemd_call ("StartUnit", unit, mode, error);
return g_task_propagate_boolean (G_TASK (res), error);
}
void
shell_util_stop_systemd_unit (const char *unit,
const char *mode,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
shell_util_systemd_call ("StopUnit", unit, mode,
cancellable, callback, user_data);
}
gboolean
shell_util_stop_systemd_unit (const char *unit,
const char *mode,
GError **error)
shell_util_stop_systemd_unit_finish (GAsyncResult *res,
GError **error)
{
return shell_util_systemd_call ("StopUnit", unit, mode, error);
return g_task_propagate_boolean (G_TASK (res), error);
}
void

View File

@ -14,9 +14,6 @@ G_BEGIN_DECLS
void shell_util_set_hidden_from_pick (ClutterActor *actor,
gboolean hidden);
void shell_util_get_transformed_allocation (ClutterActor *actor,
ClutterActorBox *box);
int shell_util_get_week_start (void);
const char *shell_util_translate_time_string (const char *str);
@ -49,8 +46,6 @@ GdkPixbuf *shell_util_create_pixbuf_from_data (const guchar *data,
int height,
int rowstride);
gboolean shell_util_need_background_refresh (void);
ClutterContent * shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
MetaRectangle *window_rect);
@ -64,12 +59,21 @@ cairo_surface_t * shell_util_composite_capture_images (ClutterCapture *captures
void shell_util_check_cloexec_fds (void);
gboolean shell_util_start_systemd_unit (const char *unit,
const char *mode,
GError **error);
gboolean shell_util_stop_systemd_unit (const char *unit,
const char *mode,
GError **error);
void shell_util_start_systemd_unit (const char *unit,
const char *mode,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean shell_util_start_systemd_unit_finish (GAsyncResult *res,
GError **error);
void shell_util_stop_systemd_unit (const char *unit,
const char *mode,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean shell_util_stop_systemd_unit_finish (GAsyncResult *res,
GError **error);
void shell_util_sd_notify (void);

View File

@ -146,9 +146,13 @@ get_app_from_window_wmclass (MetaWindow *window)
const char *wm_class;
const char *wm_instance;
const char *sandbox_id;
g_autofree char *app_prefix = NULL;
appsys = shell_app_system_get_default ();
sandbox_id = meta_window_get_sandboxed_app_id (window);
if (sandbox_id)
app_prefix = g_strdup_printf ("%s.", sandbox_id);
/* Notes on the heuristics used here:
much of the complexity here comes from the desire to support
@ -188,23 +192,23 @@ get_app_from_window_wmclass (MetaWindow *window)
/* first try a match from WM_CLASS (instance part) to StartupWMClass */
wm_instance = meta_window_get_wm_class_instance (window);
app = shell_app_system_lookup_startup_wmclass (appsys, wm_instance);
if (app != NULL && check_app_id_prefix (app, sandbox_id))
if (app != NULL && check_app_id_prefix (app, app_prefix))
return g_object_ref (app);
/* then try a match from WM_CLASS to StartupWMClass */
wm_class = meta_window_get_wm_class (window);
app = shell_app_system_lookup_startup_wmclass (appsys, wm_class);
if (app != NULL && check_app_id_prefix (app, sandbox_id))
if (app != NULL && check_app_id_prefix (app, app_prefix))
return g_object_ref (app);
/* then try a match from WM_CLASS (instance part) to .desktop */
app = shell_app_system_lookup_desktop_wmclass (appsys, wm_instance);
if (app != NULL && check_app_id_prefix (app, sandbox_id))
if (app != NULL && check_app_id_prefix (app, app_prefix))
return g_object_ref (app);
/* finally, try a match from WM_CLASS to .desktop */
app = shell_app_system_lookup_desktop_wmclass (appsys, wm_class);
if (app != NULL && check_app_id_prefix (app, sandbox_id))
if (app != NULL && check_app_id_prefix (app, app_prefix))
return g_object_ref (app);
return NULL;

View File

@ -136,6 +136,8 @@ struct _CRParserPriv {
#define CHARS_TAB_SIZE 12
#define RECURSIVE_CALLERS_LIMIT 100
/**
* IS_NUM:
*@a_char: the char to test.
@ -343,9 +345,11 @@ static enum CRStatus cr_parser_parse_selector_core (CRParser * a_this);
static enum CRStatus cr_parser_parse_declaration_core (CRParser * a_this);
static enum CRStatus cr_parser_parse_any_core (CRParser * a_this);
static enum CRStatus cr_parser_parse_any_core (CRParser * a_this,
guint n_calls);
static enum CRStatus cr_parser_parse_block_core (CRParser * a_this);
static enum CRStatus cr_parser_parse_block_core (CRParser * a_this,
guint n_calls);
static enum CRStatus cr_parser_parse_value_core (CRParser * a_this);
@ -783,7 +787,7 @@ cr_parser_parse_atrule_core (CRParser * a_this)
cr_parser_try_to_skip_spaces_and_comments (a_this);
do {
status = cr_parser_parse_any_core (a_this);
status = cr_parser_parse_any_core (a_this, 0);
} while (status == CR_OK);
status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr,
@ -794,7 +798,7 @@ cr_parser_parse_atrule_core (CRParser * a_this)
cr_tknzr_unget_token (PRIVATE (a_this)->tknzr,
token);
token = NULL;
status = cr_parser_parse_block_core (a_this);
status = cr_parser_parse_block_core (a_this, 0);
CHECK_PARSING_STATUS (status,
FALSE);
goto done;
@ -929,11 +933,11 @@ cr_parser_parse_selector_core (CRParser * a_this)
RECORD_INITIAL_POS (a_this, &init_pos);
status = cr_parser_parse_any_core (a_this);
status = cr_parser_parse_any_core (a_this, 0);
CHECK_PARSING_STATUS (status, FALSE);
do {
status = cr_parser_parse_any_core (a_this);
status = cr_parser_parse_any_core (a_this, 0);
} while (status == CR_OK);
@ -955,10 +959,12 @@ cr_parser_parse_selector_core (CRParser * a_this)
*in chapter 4.1 of the css2 spec.
*block ::= '{' S* [ any | block | ATKEYWORD S* | ';' ]* '}' S*;
*@param a_this the current instance of #CRParser.
*@param n_calls used to limit recursion depth
*FIXME: code this function.
*/
static enum CRStatus
cr_parser_parse_block_core (CRParser * a_this)
cr_parser_parse_block_core (CRParser * a_this,
guint n_calls)
{
CRToken *token = NULL;
CRInputPos init_pos;
@ -966,6 +972,9 @@ cr_parser_parse_block_core (CRParser * a_this)
g_return_val_if_fail (a_this && PRIVATE (a_this), CR_BAD_PARAM_ERROR);
if (n_calls > RECURSIVE_CALLERS_LIMIT)
return CR_ERROR;
RECORD_INITIAL_POS (a_this, &init_pos);
status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr, &token);
@ -995,13 +1004,13 @@ cr_parser_parse_block_core (CRParser * a_this)
} else if (token->type == CBO_TK) {
cr_tknzr_unget_token (PRIVATE (a_this)->tknzr, token);
token = NULL;
status = cr_parser_parse_block_core (a_this);
status = cr_parser_parse_block_core (a_this, n_calls + 1);
CHECK_PARSING_STATUS (status, FALSE);
goto parse_block_content;
} else {
cr_tknzr_unget_token (PRIVATE (a_this)->tknzr, token);
token = NULL;
status = cr_parser_parse_any_core (a_this);
status = cr_parser_parse_any_core (a_this, n_calls + 1);
CHECK_PARSING_STATUS (status, FALSE);
goto parse_block_content;
}
@ -1108,7 +1117,7 @@ cr_parser_parse_value_core (CRParser * a_this)
status = cr_tknzr_unget_token (PRIVATE (a_this)->tknzr,
token);
token = NULL;
status = cr_parser_parse_block_core (a_this);
status = cr_parser_parse_block_core (a_this, 0);
CHECK_PARSING_STATUS (status, FALSE);
ref++;
goto continue_parsing;
@ -1122,7 +1131,7 @@ cr_parser_parse_value_core (CRParser * a_this)
status = cr_tknzr_unget_token (PRIVATE (a_this)->tknzr,
token);
token = NULL;
status = cr_parser_parse_any_core (a_this);
status = cr_parser_parse_any_core (a_this, 0);
if (status == CR_OK) {
ref++;
goto continue_parsing;
@ -1161,10 +1170,12 @@ cr_parser_parse_value_core (CRParser * a_this)
* | FUNCTION | DASHMATCH | '(' any* ')' | '[' any* ']' ] S*;
*
*@param a_this the current instance of #CRParser.
*@param n_calls used to limit recursion depth
*@return CR_OK upon successfull completion, an error code otherwise.
*/
static enum CRStatus
cr_parser_parse_any_core (CRParser * a_this)
cr_parser_parse_any_core (CRParser * a_this,
guint n_calls)
{
CRToken *token1 = NULL,
*token2 = NULL;
@ -1173,6 +1184,9 @@ cr_parser_parse_any_core (CRParser * a_this)
g_return_val_if_fail (a_this, CR_BAD_PARAM_ERROR);
if (n_calls > RECURSIVE_CALLERS_LIMIT)
return CR_ERROR;
RECORD_INITIAL_POS (a_this, &init_pos);
status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr, &token1);
@ -1211,7 +1225,7 @@ cr_parser_parse_any_core (CRParser * a_this)
*We consider parameter as being an "any*" production.
*/
do {
status = cr_parser_parse_any_core (a_this);
status = cr_parser_parse_any_core (a_this, n_calls + 1);
} while (status == CR_OK);
ENSURE_PARSING_COND (status == CR_PARSING_ERROR);
@ -1236,7 +1250,7 @@ cr_parser_parse_any_core (CRParser * a_this)
}
do {
status = cr_parser_parse_any_core (a_this);
status = cr_parser_parse_any_core (a_this, n_calls + 1);
} while (status == CR_OK);
ENSURE_PARSING_COND (status == CR_PARSING_ERROR);
@ -1264,7 +1278,7 @@ cr_parser_parse_any_core (CRParser * a_this)
}
do {
status = cr_parser_parse_any_core (a_this);
status = cr_parser_parse_any_core (a_this, n_calls + 1);
} while (status == CR_OK);
ENSURE_PARSING_COND (status == CR_PARSING_ERROR);

View File

@ -279,11 +279,23 @@ st_adjustment_class_init (StAdjustmentClass *klass)
object_class->set_property = st_adjustment_set_property;
object_class->dispose = st_adjustment_dispose;
/**
* StAdjustment:actor:
*
* If the adjustment is used as #ClutterAnimatable for a
* #ClutterPropertyTransition, this property is used to determine which
* monitor should drive the animation.
*/
props[PROP_ACTOR] =
g_param_spec_object ("actor", "Actor", "Actor",
CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE);
/**
* StAdjustment:lower:
*
* The minimum value of the adjustment.
*/
props[PROP_LOWER] =
g_param_spec_double ("lower", "Lower", "Lower bound",
-G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
@ -291,6 +303,14 @@ st_adjustment_class_init (StAdjustmentClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_EXPLICIT_NOTIFY);
/**
* StAdjustment:upper:
*
* The maximum value of the adjustment.
*
* Note that values will be restricted by `upper - page-size` if
* #StAdjustment:page-size is non-zero.
*/
props[PROP_UPPER] =
g_param_spec_double ("upper", "Upper", "Upper bound",
-G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
@ -298,6 +318,11 @@ st_adjustment_class_init (StAdjustmentClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_EXPLICIT_NOTIFY);
/**
* StAdjustment:value:
*
* The value of the adjustment.
*/
props[PROP_VALUE] =
g_param_spec_double ("value", "Value", "Current value",
-G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
@ -305,6 +330,11 @@ st_adjustment_class_init (StAdjustmentClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_EXPLICIT_NOTIFY);
/**
* StAdjustment:step-increment:
*
* The step increment of the adjustment.
*/
props[PROP_STEP_INC] =
g_param_spec_double ("step-increment", "Step Increment", "Step increment",
0.0, G_MAXDOUBLE, 0.0,
@ -312,6 +342,11 @@ st_adjustment_class_init (StAdjustmentClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_EXPLICIT_NOTIFY);
/**
* StAdjustment:page-increment:
*
* The page increment of the adjustment.
*/
props[PROP_PAGE_INC] =
g_param_spec_double ("page-increment", "Page Increment", "Page increment",
0.0, G_MAXDOUBLE, 0.0,
@ -319,6 +354,14 @@ st_adjustment_class_init (StAdjustmentClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_EXPLICIT_NOTIFY);
/**
* StAdjustment:page-size:
*
* The page size of the adjustment.
*
* Note that the page-size is irrelevant and should be set to zero if the
* adjustment is used for a simple scalar value.
*/
props[PROP_PAGE_SIZE] =
g_param_spec_double ("page-size", "Page Size", "Page size",
0.0, G_MAXDOUBLE, 0.0,
@ -350,6 +393,20 @@ st_adjustment_init (StAdjustment *self)
priv->is_constructing = TRUE;
}
/**
* st_adjustment_new:
* @actor: (nullable): a #ClutterActor
* @value: the initial value
* @lower: the minimum value
* @upper: the maximum value
* @step_increment: the step increment
* @page_increment: the page increment
* @page_size: the page size
*
* Creates a new #StAdjustment
*
* Returns: a new #StAdjustment
*/
StAdjustment *
st_adjustment_new (ClutterActor *actor,
gdouble value,
@ -370,6 +427,14 @@ st_adjustment_new (ClutterActor *actor,
NULL);
}
/**
* st_adjustment_get_value:
* @adjustment: a #StAdjustment
*
* Gets the current value of the adjustment. See st_adjustment_set_value().
*
* Returns: The current value of the adjustment
*/
gdouble
st_adjustment_get_value (StAdjustment *adjustment)
{
@ -378,6 +443,14 @@ st_adjustment_get_value (StAdjustment *adjustment)
return ((StAdjustmentPrivate *)st_adjustment_get_instance_private (adjustment))->value;
}
/**
* st_adjustment_set_value:
* @adjustment: a #StAdjustment
* @value: the new value
*
* Sets the #StAdjustment value. The value is clamped to lie between
* #StAdjustment:lower and #StAdjustment:upper - #StAdjustment:page-size.
*/
void
st_adjustment_set_value (StAdjustment *adjustment,
gdouble value)
@ -404,6 +477,15 @@ st_adjustment_set_value (StAdjustment *adjustment,
}
}
/**
* st_adjustment_clamp_page:
* @adjustment: a #StAdjustment
* @lower: the lower value
* @upper: the upper value
*
* Set #StAdjustment:value to a value clamped between @lower and @upper. The
* clamping described by st_adjustment_set_value() still applies.
*/
void
st_adjustment_clamp_page (StAdjustment *adjustment,
gdouble lower,
@ -437,6 +519,23 @@ st_adjustment_clamp_page (StAdjustment *adjustment,
g_object_notify_by_pspec (G_OBJECT (adjustment), props[PROP_VALUE]);
}
/**
* st_adjustment_set_lower:
* @adjustment: a #StAdjustment
* @lower: the new minimum value
*
* Sets the minimum value of the adjustment.
*
* When setting multiple adjustment properties via their individual
* setters, multiple #GObject::notify and #StAdjustment::changed
* signals will be emitted. However, its possible to compress the
* #GObject::notify signals into one by calling
* g_object_freeze_notify() and g_object_thaw_notify() around the
* calls to the individual setters.
*
* Alternatively, using st_adjustment_set_values() will compress both
* #GObject::notify and #StAdjustment::changed emissions.
*/
static gboolean
st_adjustment_set_lower (StAdjustment *adjustment,
gdouble lower)
@ -461,6 +560,21 @@ st_adjustment_set_lower (StAdjustment *adjustment,
return FALSE;
}
/**
* st_adjustment_set_upper:
* @adjustment: a #StAdjustment
* @upper: the new maximum value
*
* Sets the maximum value of the adjustment.
*
* Note that values will be restricted by `upper - page-size`
* if the page-size property is nonzero.
*
* See st_adjustment_set_lower() about how to compress multiple
* signal emissions when setting multiple adjustment properties.
*
* Returns: %TRUE if the value was changed
*/
static gboolean
st_adjustment_set_upper (StAdjustment *adjustment,
gdouble upper)
@ -485,6 +599,18 @@ st_adjustment_set_upper (StAdjustment *adjustment,
return FALSE;
}
/**
* st_adjustment_set_step_increment:
* @adjustment: a #StAdjustment
* @step: the new step increment
*
* Sets the step increment of the adjustment.
*
* See st_adjustment_set_lower() about how to compress multiple
* signal emissions when setting multiple adjustment properties.
*
* Returns: %TRUE if the value was changed
*/
static gboolean
st_adjustment_set_step_increment (StAdjustment *adjustment,
gdouble step)
@ -505,6 +631,18 @@ st_adjustment_set_step_increment (StAdjustment *adjustment,
return FALSE;
}
/**
* st_adjustment_set_page_increment:
* @adjustment: a #StAdjustment
* @page: the new page increment
*
* Sets the page increment of the adjustment.
*
* See st_adjustment_set_lower() about how to compress multiple
* signal emissions when setting multiple adjustment properties.
*
* Returns: %TRUE if the value was changed
*/
static gboolean
st_adjustment_set_page_increment (StAdjustment *adjustment,
gdouble page)
@ -525,6 +663,18 @@ st_adjustment_set_page_increment (StAdjustment *adjustment,
return FALSE;
}
/**
* st_adjustment_set_page_size:
* @adjustment: a #StAdjustment
* @size: the new page size
*
* Sets the page size of the adjustment.
*
* See st_adjustment_set_lower() about how to compress multiple
* signal emissions when setting multiple adjustment properties.
*
* Returns: %TRUE if the value was changed
*/
static gboolean
st_adjustment_set_page_size (StAdjustment *adjustment,
gdouble size)
@ -549,6 +699,23 @@ st_adjustment_set_page_size (StAdjustment *adjustment,
return FALSE;
}
/**
* st_adjustment_set_values:
* @adjustment: a #StAdjustment
* @value: the new value
* @lower: the new minimum value
* @upper: the new maximum value
* @step_increment: the new step increment
* @page_increment: the new page increment
* @page_size: the new page size
*
* Sets all properties of the adjustment at once.
*
* Use this function to avoid multiple emissions of the #GObject::notify and
* #StAdjustment::changed signals. See st_adjustment_set_lower() for an
* alternative way of compressing multiple emissions of #GObject::notify into
* one.
*/
void
st_adjustment_set_values (StAdjustment *adjustment,
gdouble value,
@ -593,12 +760,12 @@ st_adjustment_set_values (StAdjustment *adjustment,
/**
* st_adjustment_get_values:
* @adjustment: an #StAdjustment
* @value: (out): the current value
* @lower: (out): the lower bound
* @upper: (out): the upper bound
* @step_increment: (out): the step increment
* @page_increment: (out): the page increment
* @page_size: (out): the page size
* @value: (out) (optional): the current value
* @lower: (out) (optional): the lower bound
* @upper: (out) (optional): the upper bound
* @step_increment: (out) (optional): the step increment
* @page_increment: (out) (optional): the page increment
* @page_size: (out) (optional): the page size
*
* Gets all of @adjustment's values at once.
*/
@ -722,7 +889,13 @@ on_transition_stopped (ClutterTransition *transition,
/**
* st_adjustment_get_transition:
* Returns: (transfer none) (nullable):
* @adjustment: a #StAdjustment
* @name: a transition name
*
* Get the #ClutterTransition for @name previously added with
* st_adjustment_add_transition() or %NULL if not found.
*
* Returns: (transfer none) (nullable): a #ClutterTransition
*/
ClutterTransition *
st_adjustment_get_transition (StAdjustment *adjustment,
@ -745,6 +918,15 @@ st_adjustment_get_transition (StAdjustment *adjustment,
return clos->transition;
}
/**
* st_adjustment_add_transition:
* @adjustment: a #StAdjustment
* @name: a unique name for the transition
* @transtion: a #ClutterTransition
*
* Add a #ClutterTransition for the adjustment. If the transiton stops, it will
* be automatically removed if #ClutterTransition:remove-on-complete is %TRUE.
*/
void
st_adjustment_add_transition (StAdjustment *adjustment,
const char *name,
@ -785,6 +967,14 @@ st_adjustment_add_transition (StAdjustment *adjustment,
clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
/**
* st_adjusmtent_remove_transition:
* @adjusment: a #StAdjustment
* @name: the name of the transition to remove
*
* Remove a #ClutterTransition previously added by st_adjustment_add_transtion()
* with @name.
*/
void
st_adjustment_remove_transition (StAdjustment *adjustment,
const char *name)

View File

@ -327,7 +327,7 @@ st_bin_init (StBin *bin)
*
* Creates a new #StBin, a simple container for one child.
*
* Return value: the newly created #StBin actor
* Returns: the newly created #StBin actor
*/
StWidget *
st_bin_new (void)
@ -378,9 +378,9 @@ st_bin_set_child (StBin *bin,
* st_bin_get_child:
* @bin: a #StBin
*
* Retrieves a pointer to the child of @bin.
* Gets the #ClutterActor child for @bin.
*
* Return value: (transfer none): a #ClutterActor, or %NULL
* Returns: (transfer none) (nullable): a #ClutterActor, or %NULL
*/
ClutterActor *
st_bin_get_child (StBin *bin)

View File

@ -66,6 +66,19 @@ st_border_image_init (StBorderImage *image)
{
}
/**
* st_border_image_new:
* @file: a #GFile
* @border_top: the top border
* @border_right: the right border
* @border_bottom: the bottom border
* @border_left: the left border
* @scale_factor: the scale factor
*
* Creates a new #StBorderImage.
*
* Returns: a new #StBorderImage.
*/
StBorderImage *
st_border_image_new (GFile *file,
int border_top,
@ -90,9 +103,11 @@ st_border_image_new (GFile *file,
/**
* st_border_image_get_file:
* @image: a #StBorder_Image
* @image: a #StBorderImage
*
* Returns: (transfer none): the #GFile for the #StBorder_Image
* Get the #GFile for @image.
*
* Returns: (transfer none): a #GFile
*/
GFile *
st_border_image_get_file (StBorderImage *image)
@ -102,6 +117,17 @@ st_border_image_get_file (StBorderImage *image)
return image->file;
}
/**
* st_border_image_get_border:
* @image: a #StBorderImage
* @border_top: (out) (optional): the top border
* @border_right: (out) (optional): the right border
* @border_bottom: (out) (optional): the bottom border
* @border_left: (out) (optional): the left border
*
* Get the border widths for @image, taking into account the scale factor
* provided at construction.
*/
void
st_border_image_get_borders (StBorderImage *image,
int *border_top,
@ -123,12 +149,12 @@ st_border_image_get_borders (StBorderImage *image,
/**
* st_border_image_equal:
* @image: a #StBorder_Image
* @other: a different #StBorder_Image
* @image: a #StBorderImage
* @other: a different #StBorderImage
*
* Check if two border_image objects are identical.
* Check if two #StBorderImage objects are identical.
*
* Return value: %TRUE if the two border image objects are identical
* Returns: %TRUE if the two border image objects are identical
*/
gboolean
st_border_image_equal (StBorderImage *image,

View File

@ -181,8 +181,8 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
/**
* StBoxLayout:vertical:
*
* A convenience property for getting the #ClutterBoxLayout:vertical
* property of the layout for #StBoxLayout.
* A convenience property for the #ClutterBoxLayout:vertical property of the
* internal layout for #StBoxLayout.
*/
pspec = g_param_spec_boolean ("vertical",
"Vertical",
@ -195,8 +195,8 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
/**
* StBoxLayout:pack-start:
*
* A convenience property for getting the #ClutterBoxLayout:pack-start
* property of the layout for #StBoxLayout.
* A convenience property for the #ClutterBoxLayout:pack-start property of the
* internal layout for #StBoxLayout.
*/
pspec = g_param_spec_boolean ("pack-start",
"Pack Start",

View File

@ -484,6 +484,11 @@ st_button_class_init (StButtonClass *klass)
widget_class->style_changed = st_button_style_changed;
widget_class->get_accessible_type = st_button_accessible_get_type;
/**
* StButton:label:
*
* The label of the #StButton.
*/
props[PROP_LABEL] =
g_param_spec_string ("label",
"Label",
@ -491,6 +496,11 @@ st_button_class_init (StButtonClass *klass)
NULL,
ST_PARAM_READWRITE);
/**
* StButton:button-mask:
*
* Which buttons will trigger the #StButton::clicked signal.
*/
props[PROP_BUTTON_MASK] =
g_param_spec_flags ("button-mask",
"Button mask",
@ -498,6 +508,11 @@ st_button_class_init (StButtonClass *klass)
ST_TYPE_BUTTON_MASK, ST_BUTTON_ONE,
ST_PARAM_READWRITE);
/**
* StButton:toggle-mode:
*
* Whether the #StButton is operating in toggle mode (on/off).
*/
props[PROP_TOGGLE_MODE] =
g_param_spec_boolean ("toggle-mode",
"Toggle Mode",
@ -505,6 +520,15 @@ st_button_class_init (StButtonClass *klass)
FALSE,
ST_PARAM_READWRITE);
/**
* StButton:checked:
*
* If #StButton:toggle-mode is %TRUE, indicates if the #StButton is toggled
* "on" or "off".
*
* When the value is %TRUE, the #StButton will have the `checked` CSS
* pseudo-class set.
*/
props[PROP_CHECKED] =
g_param_spec_boolean ("checked",
"Checked",
@ -512,6 +536,12 @@ st_button_class_init (StButtonClass *klass)
FALSE,
ST_PARAM_READWRITE);
/**
* StButton:pressed:
*
* In contrast to #StButton:checked, this property indicates whether the
* #StButton is being actively pressed, rather than just in the "on" state.
*/
props[PROP_PRESSED] =
g_param_spec_boolean ("pressed",
"Pressed",
@ -583,9 +613,10 @@ st_button_new_with_label (const gchar *text)
* st_button_get_label:
* @button: a #StButton
*
* Get the text displayed on the button
* Get the text displayed on the button. If the label is empty, an empty string
* will be returned instead of %NULL.
*
* Returns: the text for the button. This must not be freed by the application
* Returns: (transfer none): the text for the button
*/
const gchar *
st_button_get_label (StButton *button)
@ -598,9 +629,9 @@ st_button_get_label (StButton *button)
/**
* st_button_set_label:
* @button: a #Stbutton
* @text: text to set the label to
* @text: (nullable): text to set the label to
*
* Sets the text displayed on the button
* Sets the text displayed on the button.
*/
void
st_button_set_label (StButton *button,
@ -726,7 +757,7 @@ st_button_set_toggle_mode (StButton *button,
* st_button_get_checked:
* @button: a #StButton
*
* Get the state of the button that is in toggle mode.
* Get the #StButton:checked property of a #StButton that is in toggle mode.
*
* Returns: %TRUE if the button is checked, or %FALSE if not
*/
@ -743,8 +774,8 @@ st_button_get_checked (StButton *button)
* @button: a #Stbutton
* @checked: %TRUE or %FALSE
*
* Sets the pressed state of the button. This is only really useful if the
* button has #toggle-mode mode set to %TRUE.
* Set the #StButton:checked property of the button. This is only really useful
* if the button has #StButton:toggle-mode property set to %TRUE.
*/
void
st_button_set_checked (StButton *button,
@ -773,9 +804,9 @@ st_button_set_checked (StButton *button,
* @button: an #StButton
*
* If this widget is holding a pointer grab, this function will
* will ungrab it, and reset the pressed state. The effect is
* will ungrab it, and reset the #StButton:pressed state. The effect is
* similar to if the user had released the mouse button, but without
* emitting the clicked signal.
* emitting the #StButton::clicked signal.
*
* This function is useful if for example you want to do something
* after the user is holding the mouse button for a given period of

View File

@ -63,7 +63,7 @@ void st_button_fake_release (StButton *button);
* @ST_BUTTON_TWO: button 2 (middle)
* @ST_BUTTON_THREE: button 3 (right)
*
* A mask representing which mouse buttons an StButton responds to.
* A mask representing which mouse buttons an #StButton responds to.
*/
typedef enum {
ST_BUTTON_ONE = (1 << 0),

View File

@ -195,7 +195,6 @@ st_clipboard_get_mimetypes (StClipboard *clipboard,
*
* Request the data from the clipboard in text form. @callback is executed
* when the data is retreived.
*
*/
void
st_clipboard_get_text (StClipboard *clipboard,
@ -244,7 +243,6 @@ st_clipboard_get_text (StClipboard *clipboard,
*
* Request the data from the clipboard in #GBytes form. @callback is executed
* when the data is retrieved.
*
*/
void
st_clipboard_get_content (StClipboard *clipboard,
@ -287,7 +285,9 @@ st_clipboard_get_content (StClipboard *clipboard,
* @mimetype: content mimetype
* @bytes: content data
*
* Sets the clipboard content.
* Sets the clipboard content to @bytes.
*
* @mimetype is a semi-colon separated list of mime-type strings.
**/
void
st_clipboard_set_content (StClipboard *clipboard,
@ -334,6 +334,13 @@ st_clipboard_set_text (StClipboard *clipboard,
g_bytes_unref (bytes);
}
/**
* st_clipboard_set_selection: (skip)
*
* Sets the #MetaSelection of the default #StClipboard.
*
* This function is called during the initialization of GNOME Shell.
*/
void
st_clipboard_set_selection (MetaSelection *selection)
{

View File

@ -150,8 +150,8 @@ st_drawing_area_init (StDrawingArea *area)
* st_drawing_area_queue_repaint:
* @area: the #StDrawingArea
*
* Will cause the actor to emit a ::repaint signal before it is next
* drawn to the scene. Useful if some parameters for the area being
* Will cause the actor to emit a #StDrawingArea::repaint signal before it is
* next drawn to the scene. Useful if some parameters for the area being
* drawn other than the size or style have changed. Note that
* clutter_actor_queue_redraw() will simply result in the same
* contents being drawn to the scene again.
@ -169,9 +169,26 @@ st_drawing_area_queue_repaint (StDrawingArea *area)
* @area: the #StDrawingArea
*
* Gets the Cairo context to paint to. This function must only be called
* from a signal hander for the ::repaint signal.
* from a signal hander or virtual function for the #StDrawingArea::repaint
* signal.
*
* Return Value: (transfer none): the Cairo context for the paint operation
* JavaScript code must call the special dispose function before returning from
* the signal handler or virtual function to avoid leaking memory:
*
* |[<!-- language="JavaScript" -->
* function onRepaint(area) {
* let cr = area.get_context();
*
* // Draw to the context
*
* cr.$dispose();
* }
*
* let area = new St.DrawingArea();
* area.connect('repaint', onRepaint);
* ]|
*
* Returns: (transfer none): the Cairo context for the paint operation
*/
cairo_t *
st_drawing_area_get_context (StDrawingArea *area)
@ -189,12 +206,12 @@ st_drawing_area_get_context (StDrawingArea *area)
/**
* st_drawing_area_get_surface_size:
* @area: the #StDrawingArea
* @width: (out): location to store the width of the painted area
* @height: (out): location to store the height of the painted area
* @width: (out) (optional): location to store the width of the painted area
* @height: (out) (optional): location to store the height of the painted area
*
* Gets the size of the cairo surface being painted to, which is equal
* to the size of the content area of the widget. This function must
* only be called from a signal hander for the ::repaint signal.
* only be called from a signal hander for the #StDrawingArea::repaint signal.
*/
void
st_drawing_area_get_surface_size (StDrawingArea *area,

View File

@ -29,14 +29,9 @@
* applications to set further properties.
*
* #StEntry supports the following pseudo style states:
* <itemizedlist>
* <listitem>
* <para>focus: the widget has focus</para>
* </listitem>
* <listitem>
* <para>indeterminate: the widget is showing the hint text or actor</para>
* </listitem>
* </itemizedlist>
*
* - `focus`: the widget has focus
* - `indeterminate`: the widget is showing the hint text or actor
*/
#ifdef HAVE_CONFIG_H
@ -897,6 +892,11 @@ st_entry_class_init (StEntryClass *klass)
widget_class->navigate_focus = st_entry_navigate_focus;
widget_class->get_accessible_type = st_entry_accessible_get_type;
/**
* StEntry:clutter-text:
*
* The internal #ClutterText actor supporting the #StEntry.
*/
props[PROP_CLUTTER_TEXT] =
g_param_spec_object ("clutter-text",
"Clutter Text",
@ -904,6 +904,11 @@ st_entry_class_init (StEntryClass *klass)
CLUTTER_TYPE_TEXT,
ST_PARAM_READABLE);
/**
* StEntry:primary-icon:
*
* The #ClutterActor acting as the primary icon at the start of the #StEntry.
*/
props[PROP_PRIMARY_ICON] =
g_param_spec_object ("primary-icon",
"Primary Icon",
@ -911,6 +916,11 @@ st_entry_class_init (StEntryClass *klass)
CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE);
/**
* StEntry:secondary-icon:
*
* The #ClutterActor acting as the secondary icon at the end of the #StEntry.
*/
props[PROP_SECONDARY_ICON] =
g_param_spec_object ("secondary-icon",
"Secondary Icon",
@ -918,6 +928,12 @@ st_entry_class_init (StEntryClass *klass)
CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE);
/**
* StEntry:hint-text:
*
* The text to display when the entry is empty and unfocused. Setting this
* will replace the actor of #StEntry::hint-actor.
*/
props[PROP_HINT_TEXT] =
g_param_spec_string ("hint-text",
"Hint Text",
@ -926,6 +942,12 @@ st_entry_class_init (StEntryClass *klass)
NULL,
ST_PARAM_READWRITE);
/**
* StEntry:hint-actor:
*
* A #ClutterActor to display when the entry is empty and unfocused. Setting
* this will replace the actor displaying #StEntry:hint-text.
*/
props[PROP_HINT_ACTOR] =
g_param_spec_object ("hint-actor",
"Hint Actor",
@ -934,6 +956,11 @@ st_entry_class_init (StEntryClass *klass)
CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE);
/**
* StEntry:text:
*
* The current text value of the #StEntry.
*/
props[PROP_TEXT] =
g_param_spec_string ("text",
"Text",
@ -941,6 +968,12 @@ st_entry_class_init (StEntryClass *klass)
NULL,
ST_PARAM_READWRITE);
/**
* StEntry:input-purpose:
*
* The #ClutterInputContentPurpose that helps on-screen keyboards and similar
* input methods to decide which keys should be presented to the user.
*/
props[PROP_INPUT_PURPOSE] =
g_param_spec_enum ("input-purpose",
"Purpose",
@ -949,6 +982,13 @@ st_entry_class_init (StEntryClass *klass)
CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL,
ST_PARAM_READWRITE);
/**
* StEntry:input-hints:
*
* The #ClutterInputContentHintFlags providing additional hints (beyond
* #StEntry:input-purpose) that allow input methods to fine-tune their
* behaviour.
*/
props[PROP_INPUT_HINTS] =
g_param_spec_flags ("input-hints",
"hints",
@ -964,8 +1004,7 @@ st_entry_class_init (StEntryClass *klass)
* StEntry::primary-icon-clicked:
* @self: the #StEntry
*
*
* Emitted when the primary icon is clicked
* Emitted when the primary icon is clicked.
*/
entry_signals[PRIMARY_ICON_CLICKED] =
g_signal_new ("primary-icon-clicked",
@ -974,11 +1013,12 @@ st_entry_class_init (StEntryClass *klass)
G_STRUCT_OFFSET (StEntryClass, primary_icon_clicked),
NULL, NULL, NULL,
G_TYPE_NONE, 0);
/**
* StEntry::secondary-icon-clicked:
* @self: the #StEntry
*
* Emitted when the secondary icon is clicked
* Emitted when the secondary icon is clicked.
*/
entry_signals[SECONDARY_ICON_CLICKED] =
g_signal_new ("secondary-icon-clicked",
@ -1040,9 +1080,9 @@ st_entry_init (StEntry *entry)
/**
* st_entry_new:
* @text: text to set the entry to
* @text: (nullable): text to set the entry to
*
* Create a new #StEntry with the specified entry
* Create a new #StEntry with the specified text.
*
* Returns: a new #StEntry
*/
@ -1063,9 +1103,10 @@ st_entry_new (const gchar *text)
* st_entry_get_text:
* @entry: a #StEntry
*
* Get the text displayed on the entry
* Get the text displayed on the entry. If @entry is empty, an empty string will
* be returned instead of %NULL.
*
* Returns: the text for the entry. This must not be freed by the application
* Returns: (transfer none): the text for the entry
*/
const gchar *
st_entry_get_text (StEntry *entry)
@ -1084,7 +1125,8 @@ st_entry_get_text (StEntry *entry)
* @entry: a #StEntry
* @text: (nullable): text to set the entry to
*
* Sets the text displayed on the entry
* Sets the text displayed on the entry. If @text is %NULL, the #ClutterText
* will instead be set to an empty string.
*/
void
st_entry_set_text (StEntry *entry,
@ -1106,10 +1148,9 @@ st_entry_set_text (StEntry *entry,
* st_entry_get_clutter_text:
* @entry: a #StEntry
*
* Retrieve the internal #ClutterText so that extra parameters can be set
* Retrieve the internal #ClutterText so that extra parameters can be set.
*
* Returns: (transfer none): the #ClutterText used by #StEntry. The entry is
* owned by the #StEntry and should not be unref'ed by the application.
* Returns: (transfer none): the #ClutterText used by @entry
*/
ClutterActor*
st_entry_get_clutter_text (StEntry *entry)
@ -1125,8 +1166,8 @@ st_entry_get_clutter_text (StEntry *entry)
* @text: (nullable): text to set as the entry hint
*
* Sets the text to display when the entry is empty and unfocused. When the
* entry is displaying the hint, it has a pseudo class of "indeterminate".
* A value of NULL unsets the hint.
* entry is displaying the hint, it has a pseudo class of `indeterminate`.
* A value of %NULL unsets the hint.
*/
void
st_entry_set_hint_text (StEntry *entry,
@ -1146,10 +1187,13 @@ st_entry_set_hint_text (StEntry *entry,
* st_entry_get_hint_text:
* @entry: a #StEntry
*
* Gets the text that is displayed when the entry is empty and unfocused
* Gets the text that is displayed when the entry is empty and unfocused or
* %NULL if the #StEntry:hint-actor was set to an actor that is not a #StLabel.
*
* Returns: the current value of the hint property. This string is owned by the
* #StEntry and should not be freed or modified.
* Unlike st_entry_get_text() this function may return %NULL if
* #StEntry:hint-actor is not a #StLabel.
*
* Returns: (nullable) (transfer none): the current value of the hint property
*/
const gchar *
st_entry_get_hint_text (StEntry *entry)
@ -1200,6 +1244,8 @@ st_entry_set_input_purpose (StEntry *entry,
* @entry: a #StEntry
*
* Gets the value of the #StEntry:input-purpose property.
*
* Returns: the input purpose of the entry
*/
ClutterInputContentPurpose
st_entry_get_input_purpose (StEntry *entry)
@ -1245,6 +1291,8 @@ st_entry_set_input_hints (StEntry *entry,
* @entry: a #StEntry
*
* Gets the value of the #StEntry:input-hints property.
*
* Returns: the input hints for the entry
*/
ClutterInputContentHintFlags
st_entry_get_input_hints (StEntry *entry)
@ -1305,7 +1353,7 @@ _st_entry_set_icon (StEntry *entry,
* @entry: a #StEntry
* @icon: (nullable): a #ClutterActor
*
* Set the primary icon of the entry to @icon
* Set the primary icon of the entry to @icon.
*/
void
st_entry_set_primary_icon (StEntry *entry,
@ -1324,7 +1372,9 @@ st_entry_set_primary_icon (StEntry *entry,
* st_entry_get_primary_icon:
* @entry: a #StEntry
*
* Returns: (transfer none): a #ClutterActor
* Get the value of the #StEntry:primary-icon property.
*
* Returns: (nullable) (transfer none): a #ClutterActor
*/
ClutterActor *
st_entry_get_primary_icon (StEntry *entry)
@ -1342,7 +1392,7 @@ st_entry_get_primary_icon (StEntry *entry)
* @entry: a #StEntry
* @icon: (nullable): an #ClutterActor
*
* Set the secondary icon of the entry to @icon
* Set the secondary icon of the entry to @icon.
*/
void
st_entry_set_secondary_icon (StEntry *entry,
@ -1361,7 +1411,9 @@ st_entry_set_secondary_icon (StEntry *entry,
* st_entry_get_secondary_icon:
* @entry: a #StEntry
*
* Returns: (transfer none): a #ClutterActor
* Get the value of the #StEntry:secondary-icon property.
*
* Returns: (nullable) (transfer none): a #ClutterActor
*/
ClutterActor *
st_entry_get_secondary_icon (StEntry *entry)
@ -1377,9 +1429,9 @@ st_entry_get_secondary_icon (StEntry *entry)
/**
* st_entry_set_hint_actor:
* @entry: a #StEntry
* @hint_actor: (allow-none): a #ClutterActor
* @hint_actor: (nullable): a #ClutterActor
*
* Set the hint actor of the entry to @hint_actor
* Set the hint actor of the entry to @hint_actor.
*/
void
st_entry_set_hint_actor (StEntry *entry,
@ -1412,7 +1464,9 @@ st_entry_set_hint_actor (StEntry *entry,
* st_entry_get_hint_actor:
* @entry: a #StEntry
*
* Returns: (transfer none): a #ClutterActor
* Get the value of the #StEntry:hint-actor property.
*
* Returns: (nullable) (transfer none): a #ClutterActor
*/
ClutterActor *
st_entry_get_hint_actor (StEntry *entry)

View File

@ -133,7 +133,7 @@ st_focus_manager_stage_event (ClutterActor *stage,
*
* Gets the #StFocusManager for @stage, creating it if necessary.
*
* Return value: (transfer none): the focus manager for @stage
* Returns: (transfer none): the focus manager for @stage
*/
StFocusManager *
st_focus_manager_get_for_stage (ClutterStage *stage)
@ -215,7 +215,7 @@ st_focus_manager_remove_group (StFocusManager *manager,
* Checks if @widget is inside a focus group, and if so, returns
* the root of that group.
*
* Return value: (transfer none): the focus group root, or %NULL if
* Returns: (transfer none): the focus group root, or %NULL if
* @widget is not in a focus group
*/
StWidget *

View File

@ -72,7 +72,7 @@ st_generic_accessible_class_init (StGenericAccessibleClass *klass)
* @self. Right now we only care about doubles, so the value is
* directly returned by the signal.
*
* Return value: value of the current element.
* Returns: value of the current element.
*/
st_generic_accessible_signals[GET_CURRENT_VALUE] =
g_signal_new ("get-current-value",
@ -90,7 +90,7 @@ st_generic_accessible_class_init (StGenericAccessibleClass *klass)
* @self. Right now we only care about doubles, so the value is
* directly returned by the signal.
*
* Return value: maximum value of the accessible.
* Returns: maximum value of the accessible.
*/
st_generic_accessible_signals[GET_MAXIMUM_VALUE] =
g_signal_new ("get-maximum-value",
@ -108,7 +108,7 @@ st_generic_accessible_class_init (StGenericAccessibleClass *klass)
* @self. Right now we only care about doubles, so the value is
* directly returned by the signal.
*
* Return value: minimum value of the accessible.
* Returns: minimum value of the accessible.
*/
st_generic_accessible_signals[GET_MINIMUM_VALUE] =
g_signal_new ("get-minimum-value",
@ -126,7 +126,7 @@ st_generic_accessible_class_init (StGenericAccessibleClass *klass)
* @self. Right now we only care about doubles, so the value is
* directly returned by the signal.
*
* Return value: value of the current element.
* Returns: value of the current element.
*/
st_generic_accessible_signals[GET_MINIMUM_INCREMENT] =
g_signal_new ("get-minimum-increment",
@ -221,6 +221,16 @@ atk_value_iface_init (AtkValueIface *iface)
iface->set_current_value = st_generic_accessible_set_current_value;
}
/**
* st_generic_accessible_new_for_actor:
* @actor: a #Clutter Actor
*
* Create a new #StGenericAccessible for @actor.
*
* This is useful only for custom widgets that need a proxy for #AtkObject.
*
* Returns: (transfer full): a new #AtkObject
*/
AtkObject*
st_generic_accessible_new_for_actor (ClutterActor *actor)
{

View File

@ -26,7 +26,7 @@
*
* Creates a new #StIconColors. All colors are initialized to transparent black.
*
* Return value: a newly created #StIconColors. Free with st_icon_colors_unref()
* Returns: a newly created #StIconColors. Free with st_icon_colors_unref()
*/
StIconColors *
st_icon_colors_new (void)
@ -107,6 +107,8 @@ st_icon_colors_copy (StIconColors *colors)
* @colors: a #StIconColors
* @other: another #StIconColors
*
* Check if two #StIconColors objects are identical.
*
* Returns: %TRUE if the #StIconColors are equal
*/
gboolean

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