Compare commits

..

33 Commits

Author SHA1 Message Date
a6783692c5 animation: Set size through CSS
Pretty much the same case of the previous commit: we want this size
to be scale-dependant, and using the width and height properties of
ClutterActor doesn't automatically update.

Use CSS to set the width and height.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1176
2020-04-06 14:37:35 -03:00
1c27b68bcc appDisplay: Set the folder icon geometry through CSS
The CSS engine is scale-aware, whereas simply setting the
width and height properties directly isn't.

Use CSS to set the folder icon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1176
2020-04-06 14:37:35 -03:00
717c05a288 st/theme-node: Use the node's scale factor
Each node stores the scale factor in place when it was created.
Creating nodes with the same style, but with different scale
factors, yields different nodes.

Use the node's scale factor instead of retrieving the context's
one.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1176
2020-04-06 14:37:35 -03:00
e68604b1aa st/theme-node: Consider scale factor when comparing
The CSS engine of St is scale-aware, which means every length
and size it produces is multiplied by the current scale factor.

However, the individual nodes aren't aware of the scale factor
when they compare to each other.

Store and compare the scale factors in the nodes themselves.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1635

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1176
2020-04-06 14:37:35 -03:00
0368ad29e9 st/theme-context: Add a getter for the scale-factor property
Will be used by the next commit to avoid going through the GObject
machinery when retrieving the scale factor.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1176
2020-04-06 14:37:35 -03:00
b982ce394e shell-app: Use container widget for fallback X11 app icons
Just like StIcon does, we should use a container widget for the fallback
app icon that we get using the cairo surface property. It's needed
because the widget returned by shell_app_create_icon_texture() can be
resized freely, while we want the aspect ratio of the actual texture to
remain the same.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2578


(cherry picked from commit 85846d88f0)
2020-04-06 15:00:05 +00:00
025647f585 st/theme-context: Also invalidate root node on stylesheet changes
Since commit 6a42d77261 we invalidate the
cached properties for each theme node on stylesheet changes by iterating
over the hashtable of the theme context instead of listening to the
signal in each individual theme node.

That commit forgot one particular node though that's not stored in the
hashtable, but using the `priv->root_node` property instead: The theme
node that belongs to the stage.

So make sure we also invalidate the cached properties of the stage theme
node on stylesheet changes. This fixes various crashes that happened
with extensions providing custom stylesheets (emitting the
"custom-stylesheets-changed" signal on every extension enable/disable),
trying to access an already freed CSS property of the stage.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2584


(cherry picked from commit bc973b80d7)
2020-04-06 14:59:45 +00:00
7125b726ad data: Add extension-portal desktop file
Now that the extension preference dialog is opened by a separate
D-Bus service rather than the Extensions app, it can be opened
without a parent window that provides name and icon.

Fix this by adding back a hidden .desktop file.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2562


(cherry picked from commit 6b7c85b079)
2020-04-05 13:48:39 +00:00
aebfab7207 extensions-app: Add category in .desktop file
Predefined categories aren't a great way for organizing installed
applications, but they have their use in "stores" like Software
or flathub.

Not listing any category means we fall through the cracks, so
pick the (hopefully) least inappropriate one ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1160


(cherry picked from commit 360f5b1642)
2020-04-05 12:46:11 +00:00
698bd5b3a9 st/icon: Use a static GIcon for the missing-image icon
Don't create a new GIcon for the "missing-image" texture but simply
create it once statically instead and always use that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1179


(cherry picked from commit 1ca39e8586)
2020-04-04 19:40:10 +00:00
51e9f19f2f st/icon: Always show empty texture if both gicons are NULL
Commit 7ff7fb5d3b forgot to clear the
`priv->icon_texture` actor when returning from st_icon_update(), which
means we don't always switch to an empty icon if both gicon properties
are set to NULL.

Fix this and destroy the actor before returning early from
st_icon_update().

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1178


(cherry picked from commit 07deda593a)
2020-04-04 19:30:49 +00:00
6d38a4a7b3 Update Latvian translation 2020-04-04 16:14:40 +00:00
dfcc5ffb1e screenShield: Wake up on deactivate()
Usually the screen is woken up before the shield is deactivated, but
it is also possible to unlock the session programmatically via the
org.gnome.ScreenSaver D-Bus API.

The intention is very likely not to unlock a turned off screen in
that case. Nor does it seem like a good idea to change the lock
state without any indication.

Waking up the screen is more likely to meet expectations and is
more reasonable too, so do that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1158


(cherry picked from commit fbe2e30f38)
2020-04-03 15:09:24 +00:00
8b80a4cf4d screenShield: Switch lightboxes off before unlock transition
There is no point in animating a transition with fullscreen black
rectangles stacked on top, so switch them off before rather than
after the transition.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1158


(cherry picked from commit fb6ead2881)
2020-04-03 15:08:58 +00:00
01e894c028 st/icon: Only load default fallback icon if an icon was set and failed to load
Commit c89d6a633 introduced a default fallback icon that would be displayed in
case the main gicon or the fallback gicon wasn't set or failed to load.

This broke the use case where a StIcon is created but no main icon or
fallback icon are set on purpose, for example the appindicator extension
which always creates a StIcon to represent icons in menu items but the
actual icons are only set if the application provides one, leaving the
menu showing the default fallback ("image-missing") icon for all menu
entries that don't actually have an icon provided by the application.

Fix that by only using the default fallback icon if the provided one
failed to load.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1173

(cherry picked from commit 7ff7fb5d3b)
2020-04-03 17:00:30 +02:00
856adfd1f1 extensionUtils: Add openPrefs() convenience method
Opening their own preferences is a reasonable desire for extensions,
so make up for breaking it by adding a convenience method for that
action.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1163

(cherry picked from commit 8030d9ad32)
2020-04-03 17:00:07 +02:00
efee3aa749 extensionSystem: Add method for opening extension prefs
Extension that want to expose their own preferences (for example as menu
items) do that by passing their UUID to gnome-shell-extension-prefs.

But since 3.36.1 the app is optional and no longer accepts arguments on
the command line. To adjust, extensions now need to make a D-Bus call
the extensions portal, just like the app and gnome-shell.

We will add a convenience method for that purpose, so it makes
sense to share the existing code. As it's extension-related, the
extension manager looks like the right place ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1163

(cherry picked from commit 45bc850715)
2020-04-03 16:58:15 +02:00
15e72da648 workspace: Fix chaining up
Gah, accidentally dropped the 'vfunc' prefix :-(

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1172
2020-04-03 15:47:01 +02:00
3f8bd1db25 extensions-app: Do not expand headerbar switch
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2563
2020-04-03 15:47:01 +02:00
3a863ee341 js: Account for promisified call() method
A promisified method expects the callback parameter to be either
a function (in which case the original method is called normally)
or omitted altogether (in which case a Promise is returned).

The call to open application details in Software does neither and
passes null instead, which will result in a warning (because no
function argument means a promise will be used, but not omitting
the parameter means we end up with too many arguments).

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2551
2020-04-03 02:03:18 +00:00
654a7af929 environment: Move g_dbus_connection_call() promisification
Commit 83c6b2ab promisified the method in endSessionDialog, which means
that after the module is imported, every caller will get the promisifed
version. That can be a bit surprising in completely unrelated modules,
so commit 764527c8 (on master) moved the promisification of more common
methods into environment, as that's initialized early and expected to be
shared between anything else.

Do the same for the call() method on the stable branch.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2551
2020-04-03 02:03:18 +00:00
8dd9cbac7f app-cache: Fix cache for folder translations
The app-cache code currently stores the folder translations in a hash
that can be accessed via shell_util_get_translated_folder_name().
This hash uses the filename (inc. extension) for the "desktop-directory"
as key which causes an issue when trying to find the translation
on AppDisplay._findBestFolderName() which gets categories (folder names)
from the app info which doesn't contain the ".directory" extension.

Fix that by storing the filename without extension as the hash key for
the cached folder translations.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1168


(cherry picked from commit 343b3351f1)
2020-04-03 00:40:34 +00:00
331db650dd appDisplay: Don't clear signal handler id before emitting
Otherwise we won't clear the 'view-loaded' handler after it was emitted.

Also move field initialization to the correct place, i.e. the init
function of the base class.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1169


(cherry picked from commit a9df4e7516)
2020-04-02 21:10:30 +00:00
428d38179d Update Serbian translation 2020-04-02 19:43:03 +00:00
fe9708ebd8 Update Basque translation 2020-04-02 16:15:32 +00:00
8398769321 Update Finnish translation 2020-04-02 09:44:36 +00:00
768c08ba9d main: Don't override DesktopAppInfo desktop if already GNOME
During the shell initialization we call the (deprecated) function to
override the Desktop environment in Gio DesktopAppInfo to make sure that
applications are correctly shown (as per commit b2fbf5a2), however this
might break the cases in which $XDG_CURRENT_DESKTOP is already set and
contains GNOME (given that is now a list).

In Ubuntu this is in fact set to: ubuntu:GNOME.
Now, if an application contains NotShowIn=ubuntu, the key will be ignored by
the shell, and the application is still listed everywhere.

So, override the DesktopAppInfo desktop environment only in the case that
the current desktop is not already GNOME.

At the current date I think we could just safely get rid of this override at
all, but there could be still cases where it still might be useful, like when
running as nested in some other environment, so keeping it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1156


(cherry picked from commit a0def23940)
2020-04-01 03:58:56 +00:00
69426cbfda Update Persian translation 2020-04-01 01:42:46 +00:00
9f968e7378 appDisplay: Clear animateLater callbacks when unmapping
In some situations we could end up not with lingering 'view-loaded'
handler. This could result in delayed spring animate-in being initiated,
e.g. after a minute after the activities overview was already closed.

Fix this by removing any lingering signal or later handlers when
unmapping.

Fixes: 5c33fe4a0a

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1155


(cherry picked from commit f49b58cf97)
2020-03-31 17:12:35 +00:00
1ab5e6973a Update Chinese (Taiwan) translation 2020-03-31 16:07:19 +00:00
1dea3341ec Update Friulian translation 2020-03-31 11:14:15 +00:00
8fda054dc5 Bump version to 3.36.1
Update NEWS.
2020-03-31 00:27:47 +02:00
e989684602 extensions-app/metainfo: Point screenshots to stable branch 2020-03-30 21:32:17 +02:00
45 changed files with 1611 additions and 1341 deletions

58
NEWS
View File

@ -1,3 +1,61 @@
3.36.1
======
* Improve app folders [Jonas D.; !1011]
* Fix launching ibus daemon [Alynx; !1080]
* Do not shutdown ibus/xsettings on X11 compositor restart [Carlos; #2329]
* Hide hint text in entries when preedit is used [Carlos; !1084]
* Do not load app infos on main thread [Christian; #2282]
* Don't expose FDO Notifications interface on main bus name [Florian; !547]
* Fix icon of mobile broadband connections [Cosimo, Reik; !1097, !1105]
* Fix high-contrast/symbolic icon mix-up [Florian; #2414]
* Don't ellipsize times in world clock [Florian; !1090]
* Only check for extension updates if there are any extensions [Florian; !1100]
* Fix crash when trying to update removed extensions [Florian; #2343]
* Make Extensions app available as flatpak [Florian; !1081, !1106, !1087, !1133]
* Display fractional timezones as hours:minutes [Jonas D.; #2438]
* Fix assigning pad keybindings [Carlos; #2451]
* Handle embedded newlines in lock screen notifications [Florian; #2463]
* Fix OSK layout fallback for unsupported variants [Florian; #2471]
* Do not apply text color to color glyphs (emojis) [Carlos; #850]
* Check "Install pending software updates" by default [Michael; #2427]
* Do not warn about missing GDM on each login [Florian; #2432]
* Fix telepathy chat notifications [Marco; !1112]
* Fix offline updates support in end session dialog [Michael; #2276]
* Fix activating notifications by keyboard [Florian; #2319]
* Remove handling of 'blacklisted' extensions [Florian; !1132]
* Only update extensions if Extensions app is installed [Florian; #2346]
* Improve Norwegian on-screen-keyboard layout [Bjørn; !1073]
* Fix IM support for deleting surrounding text [Takao; !477]
* Fix blur effect with fractional scaling [Jonas D.; !1000]
* Use better location name in weather section [Florian; #2468]
* Fix glitch in sound feedback on volume changes [Florian; !1147]
* Fix on-screen keyboard regressions [Jonas D.; !1142]
* Improve screen-reader support [Luke; #2508, #2517]
* Fix password entry resize on login/lock screen [Florian; #2423]
* Fix crash when opening app picker [Jonas Å.; !1154]
* Misc. bug fixes and cleanups [Florian, Sebastian, Jan, Daniel, Philip, Mario,
Ray, Marco, Jonas D., Carlos, Georges; #2298, #2305, !1078, !1077, #2334,
#2381, !1093, !1098, #2386, !1108, !1109, !1114, !1076, !1072, !1115, !1088,
!1101, #2467, !1121, !1122, #2476, !1123, !1117, !1129, !1113, !1102, !1127,
#2238, !1131, !1135, !1136, !849, #2504, #2371, !1146, !1141, #2510, !1150]
Contributors:
Marco Trevisan (Treviño), Michael Catanzaro, Cosimo Cecchi, Jonas Dreßler,
Takao Fujiwara, Carlos Garnacho, Christian Hergert, Sebastian Keller,
Reik Keutterling, Bjørn Lie, Florian Müllner, Jwtiyar Nariman,
Georges Basile Stavracas Neto, Mario Sanchez Prada, Ray Strode, Jan Tojnar,
Daniel van Vugt, Philip Withnall, Luke Yelavich, Alynx Zhou, Jonas Ådahl
Translators:
Марко Костић [sr], Jordi Mas [ca], sicklylife [ja], Marek Černocký [cs],
Daniel Rusek [cs], Kjartan Maraas [nb], Tim Sabsch [de], Stas Solovey [ru],
Peter Mráz [sk], Rafael Fontenelle [pt_BR], Piotr Drąg [pl],
Milo Casagrande [it], Anders Jonsson [sv], Yuri Chornoivan [uk],
Kukuh Syafaat [id], Guillaume Bernard [fr], Daniel Mustieles [es],
Danial Behzadi [fa], Goran Vidović [hr], Yosef Or Boczko [he],
Emin Tufan Çetin [tr], Wolfgang Stöggl [de], Ibai Oihanguren Sala [eu],
Jwtiyar Nariman [ckb], Aurimas Černius [lt]
3.36.0 3.36.0
====== ======
* Fix off-by-1900 error in date conversions [Florian; !1061] * Fix off-by-1900 error in date conversions [Florian; !1061]

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M6.5 1.031c-.371 0-.742-.035-1.11.016-.367.05-.73.203-.972.476-.125.141-.215.309-.266.485-.047.18-.054.367-.02.55.032.184.102.356.192.516.09.164.203.309.317.457L5 4H2a1.8 1.8 0 00-.41.035.791.791 0 00-.36.195.791.791 0 00-.195.36C1 4.723 1 4.863 1 5v2.75l.77-.344c.265-.117.542-.23.832-.242.289-.016.586.074.812.254.227.18.383.441.465.723.082.277.101.57.121.859.02.316.04.637-.016.95-.058.312-.199.616-.43.831a1.264 1.264 0 01-.874.32c-.317-.007-.618-.128-.91-.257L1 10.5V14c0 .137.004.277.035.41a.791.791 0 00.195.36c.098.097.227.16.36.195.133.035.273.035.41.035h3l-.328-.68c-.14-.293-.274-.597-.29-.922-.015-.32.095-.652.31-.894.214-.242.523-.39.84-.453.316-.067.644-.059.968-.059.324 0 .652-.008.969.059.316.062.625.21.84.453.214.242.324.574.308.894-.015.325-.148.63-.289.922L8 15h3a1.8 1.8 0 00.41-.035.791.791 0 00.36-.195.791.791 0 00.195-.36C12 14.277 12 14.137 12 14v-3.563l.703.297c.29.125.59.239.902.246.313.004.63-.101.864-.308.238-.203.386-.496.46-.8C15 9.565 15 9.25 15 8.937c0-.313 0-.63-.07-.934-.075-.305-.223-.598-.461-.8a1.288 1.288 0 00-.864-.31c-.312.008-.613.122-.902.247L12 7.437V5a1.8 1.8 0 00-.035-.41.791.791 0 00-.195-.36.791.791 0 00-.36-.195C11.277 4 11.137 4 11 4H8l.36-.469c.113-.148.226-.293.316-.457.09-.16.16-.332.191-.515a1.248 1.248 0 00-.02-.551 1.256 1.256 0 00-.265-.485c-.242-.273-.605-.425-.973-.476-.367-.05-.738-.016-1.109-.016zm0 0" fill="#474747"/></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

1
data/icons/meson.build Normal file
View File

@ -0,0 +1 @@
install_subdir('hicolor', install_dir: icondir)

View File

@ -1,5 +1,6 @@
desktop_files = [ desktop_files = [
'org.gnome.Shell.desktop', 'org.gnome.Shell.desktop',
'org.gnome.Shell.Extensions.desktop',
] ]
service_files = [] service_files = []
@ -42,6 +43,7 @@ endforeach
subdir('dbus-interfaces') subdir('dbus-interfaces')
subdir('icons')
subdir('theme') subdir('theme')
data_resources = [ data_resources = [

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
# Keep in sync with subprojects/extensions-app
Name=Extensions
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.Shell.Extensions
# Never launch this, just provide name+icon to portal dialog
Exec=false
OnlyShowIn=GNOME;
NoDisplay=true

View File

@ -2,7 +2,7 @@
/* exported BANNER_MESSAGE_KEY, BANNER_MESSAGE_TEXT_KEY, LOGO_KEY, /* exported BANNER_MESSAGE_KEY, BANNER_MESSAGE_TEXT_KEY, LOGO_KEY,
DISABLE_USER_LIST_KEY, fadeInActor, fadeOutActor, cloneAndFadeOutActor */ DISABLE_USER_LIST_KEY, fadeInActor, fadeOutActor, cloneAndFadeOutActor */
const { Clutter, Gdm, Gio, GLib } = imports.gi; const { Clutter, Gio, GLib } = imports.gi;
const Signals = imports.signals; const Signals = imports.signals;
const Batch = imports.gdm.batch; const Batch = imports.gdm.batch;
@ -12,15 +12,6 @@ const Main = imports.ui.main;
const Params = imports.misc.params; const Params = imports.misc.params;
const SmartcardManager = imports.misc.smartcardManager; const SmartcardManager = imports.misc.smartcardManager;
Gio._promisify(Gdm.Client.prototype,
'open_reauthentication_channel', 'open_reauthentication_channel_finish');
Gio._promisify(Gdm.Client.prototype,
'get_user_verifier', 'get_user_verifier_finish');
Gio._promisify(Gdm.UserVerifierProxy.prototype,
'call_begin_verification_for_user', 'call_begin_verification_for_user_finish');
Gio._promisify(Gdm.UserVerifierProxy.prototype,
'call_begin_verification', 'call_begin_verification_finish');
var PASSWORD_SERVICE_NAME = 'gdm-password'; var PASSWORD_SERVICE_NAME = 'gdm-password';
var FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint'; var FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint';
var SMARTCARD_SERVICE_NAME = 'gdm-smartcard'; var SMARTCARD_SERVICE_NAME = 'gdm-smartcard';
@ -177,12 +168,14 @@ var ShellUserVerifier = class {
this._checkForFingerprintReader(); this._checkForFingerprintReader();
// If possible, reauthenticate an already running session, if (userName) {
// so any session specific credentials get updated appropriately // If possible, reauthenticate an already running session,
if (userName) // so any session specific credentials get updated appropriately
this._openReauthenticationChannel(userName); this._client.open_reauthentication_channel(userName, this._cancellable,
else this._reauthenticationChannelOpened.bind(this));
this._getUserVerifier(); } else {
this._client.get_user_verifier(this._cancellable, this._userVerifierGot.bind(this));
}
} }
cancel() { cancel() {
@ -346,11 +339,10 @@ var ShellUserVerifier = class {
this._verificationFailed(false); this._verificationFailed(false);
} }
async _openReauthenticationChannel(userName) { _reauthenticationChannelOpened(client, result) {
try { try {
this._clearUserVerifier(); this._clearUserVerifier();
this._userVerifier = await this._client.open_reauthentication_channel( this._userVerifier = client.open_reauthentication_channel_finish(result);
userName, this._cancellable);
} catch (e) { } catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
return; return;
@ -359,7 +351,8 @@ var ShellUserVerifier = class {
// Gdm emits org.freedesktop.DBus.Error.AccessDenied when there // Gdm emits org.freedesktop.DBus.Error.AccessDenied when there
// is no session to reauthenticate. Fall back to performing // is no session to reauthenticate. Fall back to performing
// verification from this login session // verification from this login session
this._getUserVerifier(); client.get_user_verifier(this._cancellable,
this._userVerifierGot.bind(this));
return; return;
} }
@ -373,11 +366,10 @@ var ShellUserVerifier = class {
this._hold.release(); this._hold.release();
} }
async _getUserVerifier() { _userVerifierGot(client, result) {
try { try {
this._clearUserVerifier(); this._clearUserVerifier();
this._userVerifier = this._userVerifier = client.get_user_verifier_finish(result);
await this._client.get_user_verifier(this._cancellable);
} catch (e) { } catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
return; return;
@ -429,25 +421,35 @@ var ShellUserVerifier = class {
} }
} }
async _startService(serviceName) { _startService(serviceName) {
this._hold.acquire(); this._hold.acquire();
try { if (this._userName) {
if (this._userName) { this._userVerifier.call_begin_verification_for_user(serviceName, this._userName, this._cancellable, (obj, result) => {
await this._userVerifier.call_begin_verification_for_user( try {
serviceName, this._userName, this._cancellable); obj.call_begin_verification_for_user_finish(result);
} else { } catch (e) {
await this._userVerifier.call_begin_verification( if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
serviceName, this._cancellable); return;
} this._reportInitError('Failed to start verification for user', e);
} catch (e) { return;
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) }
return;
this._reportInitError(this._userName this._hold.release();
? 'Failed to start verification for user' });
: 'Failed to start verification', e); } else {
return; this._userVerifier.call_begin_verification(serviceName, this._cancellable, (obj, result) => {
try {
obj.call_begin_verification_finish(result);
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
return;
this._reportInitError('Failed to start verification', e);
return;
}
this._hold.release();
});
} }
this._hold.release();
} }
_beginVerification() { _beginVerification() {

View File

@ -6,15 +6,6 @@ const Signals = imports.signals;
const IBusCandidatePopup = imports.ui.ibusCandidatePopup; const IBusCandidatePopup = imports.ui.ibusCandidatePopup;
Gio._promisify(IBus.Bus.prototype,
'list_engines_async', 'list_engines_async_finish');
Gio._promisify(IBus.Bus.prototype,
'request_name_async', 'request_name_async_finish');
Gio._promisify(IBus.Bus.prototype,
'get_global_engine_async', 'get_global_engine_async_finish');
Gio._promisify(IBus.Bus.prototype,
'set_global_engine_async', 'set_global_engine_async_finish');
// Ensure runtime version matches // Ensure runtime version matches
_checkIBusVersion(1, 5, 2); _checkIBusVersion(1, 5, 2);
@ -111,14 +102,16 @@ var IBusManager = class {
_onConnected() { _onConnected() {
this._cancellable = new Gio.Cancellable(); this._cancellable = new Gio.Cancellable();
this._initEngines(); this._ibus.list_engines_async(-1, this._cancellable,
this._initPanelService(); this._initEngines.bind(this));
this._ibus.request_name_async(IBus.SERVICE_PANEL,
IBus.BusNameFlag.REPLACE_EXISTING, -1, this._cancellable,
this._initPanelService.bind(this));
} }
async _initEngines() { _initEngines(ibus, result) {
try { try {
const enginesList = let enginesList = this._ibus.list_engines_async_finish(result);
await this._ibus.list_engines_async(-1, this._cancellable);
for (let i = 0; i < enginesList.length; ++i) { for (let i = 0; i < enginesList.length; ++i) {
let name = enginesList[i].get_name(); let name = enginesList[i].get_name();
this._engines.set(name, enginesList[i]); this._engines.set(name, enginesList[i]);
@ -133,10 +126,9 @@ var IBusManager = class {
} }
} }
async _initPanelService() { _initPanelService(ibus, result) {
try { try {
await this._ibus.request_name_async(IBus.SERVICE_PANEL, this._ibus.request_name_async_finish(result);
IBus.BusNameFlag.REPLACE_EXISTING, -1, this._cancellable);
} catch (e) { } catch (e) {
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) { if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
logError(e); logError(e);
@ -171,15 +163,19 @@ var IBusManager = class {
this._panelService.connect('set-content-type', this._setContentType.bind(this)); this._panelService.connect('set-content-type', this._setContentType.bind(this));
} catch (e) { } catch (e) {
} }
// If an engine is already active we need to get its properties
try { this._ibus.get_global_engine_async(-1, this._cancellable, (_bus, res) => {
// If an engine is already active we need to get its properties let engine;
const engine = try {
await this._ibus.get_global_engine_async(-1, this._cancellable); engine = this._ibus.get_global_engine_async_finish(res);
if (!engine)
return;
} catch (e) {
return;
}
this._engineChanged(this._ibus, engine.get_name()); this._engineChanged(this._ibus, engine.get_name());
this._updateReadiness(); });
} catch (e) { this._updateReadiness();
}
} }
_updateReadiness() { _updateReadiness() {
@ -227,7 +223,7 @@ var IBusManager = class {
return this._engines.get(id); return this._engines.get(id);
} }
async setEngine(id, callback) { setEngine(id, callback) {
// Send id even if id == this._currentEngineName // Send id even if id == this._currentEngineName
// because 'properties-registered' signal can be emitted // because 'properties-registered' signal can be emitted
// while this._ibusSources == null on a lock screen. // while this._ibusSources == null on a lock screen.
@ -237,16 +233,18 @@ var IBusManager = class {
return; return;
} }
try { this._ibus.set_global_engine_async(id,
await this._ibus.set_global_engine_async(id, this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
this._MAX_INPUT_SOURCE_ACTIVATION_TIME, this._cancellable, (_bus, res) => {
this._cancellable); try {
} catch (e) { this._ibus.set_global_engine_async_finish(res);
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) } catch (e) {
logError(e); if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
} logError(e);
if (callback) }
callback(); if (callback)
callback();
});
} }
preloadEngines(ids) { preloadEngines(ids) {

View File

@ -4,9 +4,6 @@ const { Clutter, GLib, Gio, GObject, IBus } = imports.gi;
const Keyboard = imports.ui.status.keyboard; const Keyboard = imports.ui.status.keyboard;
Gio._promisify(IBus.Bus.prototype,
'create_input_context_async', 'create_input_context_async_finish');
var HIDE_PANEL_TIME = 50; var HIDE_PANEL_TIME = 50;
var InputMethod = GObject.registerClass( var InputMethod = GObject.registerClass(
@ -49,11 +46,15 @@ class InputMethod extends Clutter.InputMethod {
this._currentSource = this._inputSourceManager.currentSource; this._currentSource = this._inputSourceManager.currentSource;
} }
async _onConnected() { _onConnected() {
this._cancellable = new Gio.Cancellable(); this._cancellable = new Gio.Cancellable();
this._ibus.create_input_context_async('gnome-shell', -1,
this._cancellable, this._setContext.bind(this));
}
_setContext(bus, res) {
try { try {
this._context = await this._ibus.create_input_context_async( this._context = this._ibus.create_input_context_async_finish(res);
'gnome-shell', -1, this._cancellable);
} catch (e) { } catch (e) {
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) { if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
logError(e); logError(e);

View File

@ -50,22 +50,25 @@ function canLock() {
} }
async function registerSessionWithGDM() { function registerSessionWithGDM() {
log("Registering session with GDM"); log("Registering session with GDM");
try { Gio.DBus.system.call('org.gnome.DisplayManager',
await Gio.DBus.system.call( '/org/gnome/DisplayManager/Manager',
'org.gnome.DisplayManager', 'org.gnome.DisplayManager.Manager',
'/org/gnome/DisplayManager/Manager', 'RegisterSession',
'org.gnome.DisplayManager.Manager', GLib.Variant.new('(a{sv})', [{}]), null,
'RegisterSession', Gio.DBusCallFlags.NONE, -1, null,
GLib.Variant.new('(a{sv})', [{}]), null, (source, result) => {
Gio.DBusCallFlags.NONE, -1, null); try {
} catch (e) { source.call_finish(result);
if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD)) } catch (e) {
log(`Error registering session with GDM: ${e.message}`); if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
else log(`Error registering session with GDM: ${e.message}`);
log('Not calling RegisterSession(): method not exported, GDM too old?'); else
} log("Not calling RegisterSession(): method not exported, GDM too old?");
}
}
);
} }
let _loginManager = null; let _loginManager = null;
@ -171,19 +174,24 @@ var LoginManagerSystemd = class {
this._proxy.SuspendRemote(true); this._proxy.SuspendRemote(true);
} }
async inhibit(reason, callback) { inhibit(reason, callback) {
try { let inVariant = GLib.Variant.new('(ssss)',
const inVariant = new GLib.Variant('(ssss)', ['sleep',
['sleep', 'GNOME Shell', reason, 'delay']); 'GNOME Shell',
const [outVariant_, fdList] = reason,
await this._proxy.call_with_unix_fd_list('Inhibit', 'delay']);
inVariant, 0, -1, null, null); this._proxy.call_with_unix_fd_list('Inhibit', inVariant, 0, -1, null, null,
const [fd] = fdList.steal_fds(); (proxy, result) => {
callback(new Gio.UnixInputStream({ fd })); let fd = -1;
} catch (e) { try {
logError(e, 'Error getting systemd inhibitor'); let [outVariant_, fdList] = proxy.call_with_unix_fd_list_finish(result);
callback(null); fd = fdList.steal_fds()[0];
} callback(new Gio.UnixInputStream({ fd }));
} catch (e) {
logError(e, "Error getting systemd inhibitor");
callback(null);
}
});
} }
_prepareForSleep(proxy, sender, [aboutToSuspend]) { _prepareForSleep(proxy, sender, [aboutToSuspend]) {

View File

@ -57,7 +57,9 @@ var ObjectManager = class {
// Start out inhibiting load until at least the proxy // Start out inhibiting load until at least the proxy
// manager is loaded and the remote objects are fetched // manager is loaded and the remote objects are fetched
this._numLoadInhibitors = 1; this._numLoadInhibitors = 1;
this._initManagerProxy(); this._managerProxy.init_async(GLib.PRIORITY_DEFAULT,
this._cancellable,
this._onManagerProxyLoaded.bind(this));
} }
_tryToCompleteLoad() { _tryToCompleteLoad() {
@ -71,7 +73,7 @@ var ObjectManager = class {
} }
} }
async _addInterface(objectPath, interfaceName, onFinished) { _addInterface(objectPath, interfaceName, onFinished) {
let info = this._interfaceInfos[interfaceName]; let info = this._interfaceInfos[interfaceName];
if (!info) { if (!info) {
@ -87,38 +89,40 @@ var ObjectManager = class {
g_interface_info: info, g_interface_info: info,
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START }); g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
try { proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable, (initable, result) => {
await proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable); try {
} catch (e) { initable.init_finish(result);
logError(e, `could not initialize proxy for interface ${interfaceName}`); } catch (e) {
logError(e, `could not initialize proxy for interface ${interfaceName}`);
if (onFinished)
onFinished();
return;
}
let isNewObject;
if (!this._objects[objectPath]) {
this._objects[objectPath] = {};
isNewObject = true;
} else {
isNewObject = false;
}
this._objects[objectPath][interfaceName] = proxy;
if (!this._interfaces[interfaceName])
this._interfaces[interfaceName] = [];
this._interfaces[interfaceName].push(proxy);
if (isNewObject)
this.emit('object-added', objectPath);
this.emit('interface-added', interfaceName, proxy);
if (onFinished) if (onFinished)
onFinished(); onFinished();
return; });
}
let isNewObject;
if (!this._objects[objectPath]) {
this._objects[objectPath] = {};
isNewObject = true;
} else {
isNewObject = false;
}
this._objects[objectPath][interfaceName] = proxy;
if (!this._interfaces[interfaceName])
this._interfaces[interfaceName] = [];
this._interfaces[interfaceName].push(proxy);
if (isNewObject)
this.emit('object-added', objectPath);
this.emit('interface-added', interfaceName, proxy);
if (onFinished)
onFinished();
} }
_removeInterface(objectPath, interfaceName) { _removeInterface(objectPath, interfaceName) {
@ -147,10 +151,9 @@ var ObjectManager = class {
} }
} }
async _initManagerProxy() { _onManagerProxyLoaded(initable, result) {
try { try {
await this._managerProxy.init_async( initable.init_finish(result);
GLib.PRIORITY_DEFAULT, this._cancellable);
} catch (e) { } catch (e) {
logError(e, `could not initialize object manager for object ${this._serviceName}`); logError(e, `could not initialize object manager for object ${this._serviceName}`);

View File

@ -7,8 +7,6 @@ const PermissionStore = imports.misc.permissionStore;
const { loadInterfaceXML } = imports.misc.fileUtils; const { loadInterfaceXML } = imports.misc.fileUtils;
Gio._promisify(Geoclue.Simple, 'new', 'new_finish');
const WeatherIntegrationIface = loadInterfaceXML('org.gnome.Shell.WeatherIntegration'); const WeatherIntegrationIface = loadInterfaceXML('org.gnome.Shell.WeatherIntegration');
const WEATHER_BUS_NAME = 'org.gnome.Weather'; const WEATHER_BUS_NAME = 'org.gnome.Weather';
@ -81,7 +79,16 @@ var WeatherClient = class {
this._weatherApp = null; this._weatherApp = null;
this._weatherProxy = null; this._weatherProxy = null;
this._createWeatherProxy(); let nodeInfo = Gio.DBusNodeInfo.new_for_xml(WeatherIntegrationIface);
Gio.DBusProxy.new(
Gio.DBus.session,
Gio.DBusProxyFlags.DO_NOT_AUTO_START | Gio.DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
nodeInfo.lookup_interface(WEATHER_INTEGRATION_IFACE),
WEATHER_BUS_NAME,
WEATHER_OBJECT_PATH,
WEATHER_INTEGRATION_IFACE,
null,
this._onWeatherProxyReady.bind(this));
this._settings = new Gio.Settings({ this._settings = new Gio.Settings({
schema_id: 'org.gnome.shell.weather', schema_id: 'org.gnome.shell.weather',
@ -139,17 +146,9 @@ var WeatherClient = class {
(!this._needsAuth || this._weatherAuthorized); (!this._needsAuth || this._weatherAuthorized);
} }
async _createWeatherProxy() { _onWeatherProxyReady(o, res) {
const nodeInfo = Gio.DBusNodeInfo.new_for_xml(WeatherIntegrationIface);
try { try {
this._weatherProxy = await Gio.DBusProxy.new( this._weatherProxy = Gio.DBusProxy.new_finish(res);
Gio.DBus.session,
Gio.DBusProxyFlags.DO_NOT_AUTO_START | Gio.DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
nodeInfo.lookup_interface(WEATHER_INTEGRATION_IFACE),
WEATHER_BUS_NAME,
WEATHER_OBJECT_PATH,
WEATHER_INTEGRATION_IFACE,
null);
} catch (e) { } catch (e) {
log(`Failed to create GNOME Weather proxy: ${e}`); log(`Failed to create GNOME Weather proxy: ${e}`);
return; return;
@ -240,23 +239,25 @@ var WeatherClient = class {
} }
} }
async _startGClueService() { _startGClueService() {
if (this._gclueStarting) if (this._gclueStarting)
return; return;
this._gclueStarting = true; this._gclueStarting = true;
try { Geoclue.Simple.new('org.gnome.Shell', Geoclue.AccuracyLevel.CITY, null,
this._gclueService = await Geoclue.Simple.new( (o, res) => {
'org.gnome.Shell', Geoclue.AccuracyLevel.CITY, null); try {
} catch (e) { this._gclueService = Geoclue.Simple.new_finish(res);
log(`Failed to connect to Geoclue2 service: ${e.message}`); } catch (e) {
this._setLocation(this._mostRecentLocation); log(`Failed to connect to Geoclue2 service: ${e.message}`);
return; this._setLocation(this._mostRecentLocation);
} return;
this._gclueStarted = true; }
this._gclueService.get_client().distance_threshold = 100; this._gclueStarted = true;
this._updateLocationMonitoring(); this._gclueService.get_client().distance_threshold = 100;
this._updateLocationMonitoring();
});
} }
_onGClueLocationChanged() { _onGClueLocationChanged() {

View File

@ -15,8 +15,7 @@ class Animation extends St.Bin {
const themeContext = St.ThemeContext.get_for_stage(global.stage); const themeContext = St.ThemeContext.get_for_stage(global.stage);
super._init({ super._init({
width: width * themeContext.scale_factor, style: `width: ${width}px; height: ${height}px;`,
height: height * themeContext.scale_factor,
}); });
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));

View File

@ -2551,18 +2551,19 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
if (Shell.AppSystem.get_default().lookup_app('org.gnome.Software.desktop')) { if (Shell.AppSystem.get_default().lookup_app('org.gnome.Software.desktop')) {
this._appendSeparator(); this._appendSeparator();
let item = this._appendMenuItem(_("Show Details")); let item = this._appendMenuItem(_("Show Details"));
item.connect('activate', async () => { item.connect('activate', () => {
let id = this._source.app.get_id(); let id = this._source.app.get_id();
let args = GLib.Variant.new('(ss)', [id, '']); let args = GLib.Variant.new('(ss)', [id, '']);
const bus = await Gio.DBus.get(Gio.BusType.SESSION, null); Gio.DBus.get(Gio.BusType.SESSION, null, (o, res) => {
bus.call( let bus = Gio.DBus.get_finish(res);
'org.gnome.Software', bus.call('org.gnome.Software',
'/org/gnome/Software', '/org/gnome/Software',
'org.gtk.Actions', 'Activate', 'org.gtk.Actions', 'Activate',
new GLib.Variant.new( GLib.Variant.new('(sava{sv})',
'(sava{sv})', ['details', [args], null]), ['details', [args], null]),
null, 0, -1, null); null, 0, -1, null);
Main.overview.hide(); Main.overview.hide();
});
}); });
} }
} }

View File

@ -199,47 +199,46 @@ class DBusEventSource extends EventSourceBase {
this._initialized = false; this._initialized = false;
this._dbusProxy = new CalendarServer(); this._dbusProxy = new CalendarServer();
this._initProxy(); this._dbusProxy.init_async(GLib.PRIORITY_DEFAULT, null, (object, result) => {
} let loaded = false;
async _initProxy() { try {
let loaded = false; this._dbusProxy.init_finish(result);
loaded = true;
try { } catch (e) {
await this._dbusProxy.init_async(GLib.PRIORITY_DEFAULT, null); if (e.matches(Gio.DBusError, Gio.DBusError.TIMED_OUT)) {
loaded = true; // Ignore timeouts and install signals as normal, because with high
} catch (e) { // probability the service will appear later on, and we will get a
// Ignore timeouts and install signals as normal, because with high // NameOwnerChanged which will finish loading
// probability the service will appear later on, and we will get a //
// NameOwnerChanged which will finish loading // (But still _initialized to false, because the proxy does not know
// // about the HasCalendars property and would cause an exception trying
// (But still _initialized to false, because the proxy does not know // to read it)
// about the HasCalendars property and would cause an exception trying } else {
// to read it) log('Error loading calendars: %s'.format(e.message));
if (!e.matches(Gio.DBusError, Gio.DBusError.TIMED_OUT)) { return;
log('Error loading calendars: %s'.format(e.message)); }
return;
} }
}
this._dbusProxy.connectSignal('Changed', this._onChanged.bind(this)); this._dbusProxy.connectSignal('Changed', this._onChanged.bind(this));
this._dbusProxy.connect('notify::g-name-owner', () => { this._dbusProxy.connect('notify::g-name-owner', () => {
if (this._dbusProxy.g_name_owner) if (this._dbusProxy.g_name_owner)
this._onNameAppeared();
else
this._onNameVanished();
});
this._dbusProxy.connect('g-properties-changed', () => {
this.notify('has-calendars');
});
this._initialized = loaded;
if (loaded) {
this.notify('has-calendars');
this._onNameAppeared(); this._onNameAppeared();
else }
this._onNameVanished();
}); });
this._dbusProxy.connect('g-properties-changed', () => {
this.notify('has-calendars');
});
this._initialized = loaded;
if (loaded) {
this.notify('has-calendars');
this._onNameAppeared();
}
} }
destroy() { destroy() {

View File

@ -10,7 +10,6 @@ const MessageTray = imports.ui.messageTray;
const ModalDialog = imports.ui.modalDialog; const ModalDialog = imports.ui.modalDialog;
const ShellEntry = imports.ui.shellEntry; const ShellEntry = imports.ui.shellEntry;
Gio._promisify(Shell.NetworkAgent.prototype, 'init_async', 'init_finish');
Gio._promisify(Shell.NetworkAgent.prototype, Gio._promisify(Shell.NetworkAgent.prototype,
'search_vpn_plugin', 'search_vpn_plugin_finish'); 'search_vpn_plugin', 'search_vpn_plugin_finish');
@ -483,37 +482,39 @@ var VPNRequestHandler = class {
} }
} }
async _readStdoutOldStyle() { _readStdoutOldStyle() {
const [line, len_] = this._dataStdout.read_line_async(GLib.PRIORITY_DEFAULT, null, (stream, result) => {
await this._dataStdout.read_line_async(GLib.PRIORITY_DEFAULT, null); let [line, len_] = this._dataStdout.read_line_finish_utf8(result);
if (line === null) { if (line == null) {
// end of file // end of file
this._stdout.close(null); this._stdout.close(null);
return; return;
} }
this._vpnChildProcessLineOldStyle(line); this._vpnChildProcessLineOldStyle(line);
// try to read more! // try to read more!
this._readStdoutOldStyle(); this._readStdoutOldStyle();
});
} }
async _readStdoutNewStyle() { _readStdoutNewStyle() {
const cnt = this._dataStdout.fill_async(-1, GLib.PRIORITY_DEFAULT, null, (stream, result) => {
await this._dataStdout.fill_async(-1, GLib.PRIORITY_DEFAULT, null); let cnt = this._dataStdout.fill_finish(result);
if (cnt === 0) { if (cnt == 0) {
// end of file // end of file
this._showNewStyleDialog(); this._showNewStyleDialog();
this._stdout.close(null); this._stdout.close(null);
return; return;
} }
// Try to read more // Try to read more
this._dataStdout.set_buffer_size(2 * this._dataStdout.get_buffer_size()); this._dataStdout.set_buffer_size(2 * this._dataStdout.get_buffer_size());
this._readStdoutNewStyle(); this._readStdoutNewStyle();
});
} }
_showNewStyleDialog() { _showNewStyleDialog() {
@ -620,17 +621,15 @@ var NetworkAgent = class {
this._native.connect('cancel-request', this._cancelRequest.bind(this)); this._native.connect('cancel-request', this._cancelRequest.bind(this));
this._initialized = false; this._initialized = false;
this._initNative(); this._native.init_async(GLib.PRIORITY_DEFAULT, null, (o, res) => {
} try {
this._native.init_finish(res);
async _initNative() { this._initialized = true;
try { } catch (e) {
await this._native.init_async(GLib.PRIORITY_DEFAULT, null); this._native = null;
this._initialized = true; logError(e, 'error initializing the NetworkManager Agent');
} catch (e) { }
this._native = null; });
logError(e, 'error initializing the NetworkManager Agent');
}
} }
enable() { enable() {

View File

@ -7,14 +7,6 @@ var Tpl = null;
var Tp = null; var Tp = null;
try { try {
({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi); ({ TelepathyGLib: Tp, TelepathyLogger: Tpl } = imports.gi);
Gio._promisify(Tp.Channel.prototype, 'close_async', 'close_finish');
Gio._promisify(Tp.Channel.prototype,
'send_message_async', 'send_message_finish');
Gio._promisify(Tp.ChannelDispatchOperation.prototype,
'claim_with_async', 'claim_with_finish');
Gio._promisify(Tpl.LogManager.prototype,
'get_filtered_events_async', 'get_filtered_events_finish');
} catch (e) { } catch (e) {
log('Telepathy is not available, chat integration will be disabled.'); log('Telepathy is not available, chat integration will be disabled.');
} }
@ -223,7 +215,7 @@ class TelepathyClient extends Tp.BaseClient {
// We can only handle text channel, so close any other channel // We can only handle text channel, so close any other channel
if (!(channel instanceof Tp.TextChannel)) { if (!(channel instanceof Tp.TextChannel)) {
channel.close_async(); channel.close_async(null);
continue; continue;
} }
@ -269,7 +261,7 @@ class TelepathyClient extends Tp.BaseClient {
} }
} }
async _approveTextChannel(account, conn, channel, dispatchOp, context) { _approveTextChannel(account, conn, channel, dispatchOp, context) {
let [targetHandle_, targetHandleType] = channel.get_handle(); let [targetHandle_, targetHandleType] = channel.get_handle();
if (targetHandleType != Tp.HandleType.CONTACT) { if (targetHandleType != Tp.HandleType.CONTACT) {
@ -278,15 +270,17 @@ class TelepathyClient extends Tp.BaseClient {
return; return;
} }
context.accept();
// Approve private text channels right away as we are going to handle it // Approve private text channels right away as we are going to handle it
try { dispatchOp.claim_with_async(this, (o, result) => {
await dispatchOp.claim_with_async(this); try {
this._handlingChannels(account, conn, [channel], false); dispatchOp.claim_with_finish(result);
} catch (err) { this._handlingChannels(account, conn, [channel], false);
log('Failed to Claim channel: %s'.format(err.toString())); } catch (err) {
} log('Failed to Claim channel: %s'.format(err.toString()));
}
});
context.accept();
} }
_delegatedChannelsCb(_client, _channels) { _delegatedChannelsCb(_client, _channels) {
@ -447,14 +441,17 @@ class ChatSource extends MessageTray.Source {
} }
} }
async _getLogMessages() { _getLogMessages() {
let logManager = Tpl.LogManager.dup_singleton(); let logManager = Tpl.LogManager.dup_singleton();
let entity = Tpl.Entity.new_from_tp_contact(this._contact, Tpl.EntityType.CONTACT); let entity = Tpl.Entity.new_from_tp_contact(this._contact, Tpl.EntityType.CONTACT);
const [events] = await logManager.get_filtered_events_async( logManager.get_filtered_events_async(this._account, entity,
this._account, entity, Tpl.EventTypeMask.TEXT, SCROLLBACK_HISTORY_LINES,
Tpl.EventTypeMask.TEXT, SCROLLBACK_HISTORY_LINES, null, this._displayPendingMessages.bind(this));
null); }
_displayPendingMessages(logManager, result) {
let [success_, events] = logManager.get_filtered_events_finish(result);
let logMessages = events.map(e => ChatMessage.newFromTplTextEvent(e)); let logMessages = events.map(e => ChatMessage.newFromTplTextEvent(e));
this._ensureNotification(); this._ensureNotification();
@ -512,7 +509,9 @@ class ChatSource extends MessageTray.Source {
this._ackMessages(); this._ackMessages();
// The chat box has been destroyed so it can't // The chat box has been destroyed so it can't
// handle the channel any more. // handle the channel any more.
this._channel.close_async(); this._channel.close_async((channel, result) => {
channel.close_finish(result);
});
} else { } else {
// Don't indicate any unread messages when the notification // Don't indicate any unread messages when the notification
// that represents them has been destroyed. // that represents them has been destroyed.
@ -610,7 +609,9 @@ class ChatSource extends MessageTray.Source {
} }
let msg = Tp.ClientMessage.new_text(type, text); let msg = Tp.ClientMessage.new_text(type, text);
this._channel.send_message_async(msg, 0); this._channel.send_message_async(msg, 0, (src, result) => {
this._channel.send_message_finish(result);
});
} }
setChatState(state) { setChatState(state) {

View File

@ -278,7 +278,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog'); this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog');
} }
async _onPkOfflineProxyCreated(proxy, error) { _onPkOfflineProxyCreated(proxy, error) {
if (error) { if (error) {
log(error.message); log(error.message);
return; return;
@ -293,12 +293,15 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
} }
// It only makes sense to check for this permission if PackageKit is available. // It only makes sense to check for this permission if PackageKit is available.
try { Polkit.Permission.new(
this._updatesPermission = await Polkit.Permission.new( 'org.freedesktop.packagekit.trigger-offline-update', null, null,
'org.freedesktop.packagekit.trigger-offline-update', null, null); (source, res) => {
} catch (e) { try {
log('No permission to trigger offline updates: %s'.format(e.toString())); this._updatesPermission = Polkit.Permission.new_finish(res);
} } catch (e) {
log('No permission to trigger offline updates: %s'.format(e.toString()));
}
});
} }
_onDestroy() { _onDestroy() {

View File

@ -10,20 +10,11 @@ imports.gi.versions.Gtk = '3.0';
imports.gi.versions.TelepathyGLib = '0.12'; imports.gi.versions.TelepathyGLib = '0.12';
imports.gi.versions.TelepathyLogger = '0.2'; imports.gi.versions.TelepathyLogger = '0.2';
const { Clutter, Gio, GLib, GObject, Meta, Polkit, Shell, St } = imports.gi; const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Gettext = imports.gettext; const Gettext = imports.gettext;
const System = imports.system; const System = imports.system;
Gio._promisify(Gio.DataInputStream.prototype, 'fill_async', 'fill_finish');
Gio._promisify(Gio.DataInputStream.prototype,
'read_line_async', 'read_line_finish');
Gio._promisify(Gio.DBus, 'get', 'get_finish');
Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish'); Gio._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
Gio._promisify(Gio.DBusProxy, 'new', 'new_finish');
Gio._promisify(Gio.DBusProxy.prototype, 'init_async', 'init_finish');
Gio._promisify(Gio.DBusProxy.prototype,
'call_with_unix_fd_list', 'call_with_unix_fd_list_finish');
Gio._promisify(Polkit.Permission, 'new', 'new_finish');
let _localTimeZone = null; let _localTimeZone = null;

View File

@ -229,7 +229,8 @@ var ExtensionManager = class {
null, null,
Gio.DBusCallFlags.NONE, Gio.DBusCallFlags.NONE,
-1, -1,
null); null,
(conn, res) => conn.call_finish(res));
return true; return true;
} }

View File

@ -114,11 +114,8 @@ class BaseIcon extends St.Bin {
if (this._setSizeManually) { if (this._setSizeManually) {
size = this.iconSize; size = this.iconSize;
} else { } else {
const { scaleFactor } =
St.ThemeContext.get_for_stage(global.stage);
let [found, len] = node.lookup_length('icon-size', false); let [found, len] = node.lookup_length('icon-size', false);
size = found ? len / scaleFactor : ICON_SIZE; size = found ? len : ICON_SIZE;
} }
if (this.iconSize == size && this._iconBin.child) if (this.iconSize == size && this._iconBin.child)

View File

@ -90,16 +90,18 @@ class AppMenu extends PopupMenu.PopupMenu {
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this._detailsItem = this.addAction(_('Show Details'), async () => { this._detailsItem = this.addAction(_("Show Details"), () => {
let id = this._app.get_id(); let id = this._app.get_id();
let args = GLib.Variant.new('(ss)', [id, '']); let args = GLib.Variant.new('(ss)', [id, '']);
const bus = await Gio.DBus.get(Gio.BusType.SESSION, null); Gio.DBus.get(Gio.BusType.SESSION, null, (o, res) => {
bus.call( let bus = Gio.DBus.get_finish(res);
'org.gnome.Software', bus.call('org.gnome.Software',
'/org/gnome/Software', '/org/gnome/Software',
'org.gtk.Actions', 'Activate', 'org.gtk.Actions', 'Activate',
new GLib.Variant('(sava{sv})', ['details', [args], null]), GLib.Variant.new('(sava{sv})',
null, 0, -1, null); ['details', [args], null]),
null, 0, -1, null);
});
}); });
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());

View File

@ -204,7 +204,7 @@ var RemoteSearchProvider = class {
g_interface_info: proxyInfo, g_interface_info: proxyInfo,
g_interface_name: proxyInfo.name, g_interface_name: proxyInfo.name,
gFlags }); gFlags });
this.proxy.init_async(GLib.PRIORITY_DEFAULT, null); this.proxy.init_async(GLib.PRIORITY_DEFAULT, null, null);
this.appInfo = appInfo; this.appInfo = appInfo;
this.id = appInfo.get_id(); this.id = appInfo.get_id();

View File

@ -7,13 +7,6 @@ const GrabHelper = imports.ui.grabHelper;
const Lightbox = imports.ui.lightbox; const Lightbox = imports.ui.lightbox;
const Main = imports.ui.main; const Main = imports.ui.main;
Gio._promisify(Shell.Screenshot.prototype, 'pick_color', 'pick_color_finish');
Gio._promisify(Shell.Screenshot.prototype, 'screenshot', 'screenshot_finish');
Gio._promisify(Shell.Screenshot.prototype,
'screenshot_window', 'screenshot_window_finish');
Gio._promisify(Shell.Screenshot.prototype,
'screenshot_area', 'screenshot_area_finish');
const { loadInterfaceXML } = imports.misc.fileUtils; const { loadInterfaceXML } = imports.misc.fileUtils;
const ScreenshotIface = loadInterfaceXML('org.gnome.Shell.Screenshot'); const ScreenshotIface = loadInterfaceXML('org.gnome.Shell.Screenshot');
@ -163,7 +156,7 @@ var ScreenshotService = class {
return [x, y, width, height]; return [x, y, width, height];
} }
async ScreenshotAreaAsync(params, invocation) { ScreenshotAreaAsync(params, invocation) {
let [x, y, width, height, flash, filename] = params; let [x, y, width, height, flash, filename] = params;
[x, y, width, height] = this._scaleArea(x, y, width, height); [x, y, width, height] = this._scaleArea(x, y, width, height);
if (!this._checkArea(x, y, width, height)) { if (!this._checkArea(x, y, width, height)) {
@ -180,17 +173,21 @@ var ScreenshotService = class {
if (!stream) if (!stream)
return; return;
try { screenshot.screenshot_area(x, y, width, height, stream,
let [area] = (o, res) => {
await screenshot.screenshot_area(x, y, width, height, stream); try {
this._onScreenshotComplete(area, stream, file, flash, invocation); let [success_, area] =
} catch (e) { screenshot.screenshot_area_finish(res);
this._removeShooterForSender(invocation.get_sender()); this._onScreenshotComplete(
invocation.return_value(new GLib.Variant('(bs)', [false, ''])); area, stream, file, flash, invocation);
} } catch (e) {
this._removeShooterForSender(invocation.get_sender());
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
}
});
} }
async ScreenshotWindowAsync(params, invocation) { ScreenshotWindowAsync(params, invocation) {
let [includeFrame, includeCursor, flash, filename] = params; let [includeFrame, includeCursor, flash, filename] = params;
let screenshot = this._createScreenshot(invocation); let screenshot = this._createScreenshot(invocation);
if (!screenshot) if (!screenshot)
@ -200,17 +197,21 @@ var ScreenshotService = class {
if (!stream) if (!stream)
return; return;
try { screenshot.screenshot_window(includeFrame, includeCursor, stream,
let [area] = (o, res) => {
await screenshot.screenshot_window(includeFrame, includeCursor, stream); try {
this._onScreenshotComplete(area, stream, file, flash, invocation); let [success_, area] =
} catch (e) { screenshot.screenshot_window_finish(res);
this._removeShooterForSender(invocation.get_sender()); this._onScreenshotComplete(
invocation.return_value(new GLib.Variant('(bs)', [false, ''])); area, stream, file, flash, invocation);
} } catch (e) {
this._removeShooterForSender(invocation.get_sender());
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
}
});
} }
async ScreenshotAsync(params, invocation) { ScreenshotAsync(params, invocation) {
let [includeCursor, flash, filename] = params; let [includeCursor, flash, filename] = params;
let screenshot = this._createScreenshot(invocation); let screenshot = this._createScreenshot(invocation);
if (!screenshot) if (!screenshot)
@ -220,13 +221,18 @@ var ScreenshotService = class {
if (!stream) if (!stream)
return; return;
try { screenshot.screenshot(includeCursor, stream,
let [area] = await screenshot.screenshot(includeCursor, stream); (o, res) => {
this._onScreenshotComplete(area, stream, file, flash, invocation); try {
} catch (e) { let [success_, area] =
this._removeShooterForSender(invocation.get_sender()); screenshot.screenshot_finish(res);
invocation.return_value(new GLib.Variant('(bs)', [false, ''])); this._onScreenshotComplete(
} area, stream, file, flash, invocation);
} catch (e) {
this._removeShooterForSender(invocation.get_sender());
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
}
});
} }
async SelectAreaAsync(params, invocation) { async SelectAreaAsync(params, invocation) {
@ -267,17 +273,19 @@ var ScreenshotService = class {
if (!screenshot) if (!screenshot)
return; return;
const [color] = await screenshot.pick_color(coords.x, coords.y); screenshot.pick_color(coords.x, coords.y, (_o, res) => {
const { red, green, blue } = color; let [success_, color] = screenshot.pick_color_finish(res);
const retval = GLib.Variant.new('(a{sv})', [{ let { red, green, blue } = color;
color: GLib.Variant.new('(ddd)', [ let retval = GLib.Variant.new('(a{sv})', [{
red / 255.0, color: GLib.Variant.new('(ddd)', [
green / 255.0, red / 255.0,
blue / 255.0, green / 255.0,
]), blue / 255.0,
}]); ]),
this._removeShooterForSender(invocation.get_sender()); }]);
invocation.return_value(retval); this._removeShooterForSender(invocation.get_sender());
invocation.return_value(retval);
});
} catch (e) { } catch (e) {
invocation.return_error_literal( invocation.return_error_literal(
Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED, Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,

View File

@ -72,45 +72,46 @@ class Indicator extends PanelMenu.SystemIndicator {
return null; return null;
} }
_getDeviceInfos(adapter) { // nDevices is the number of devices setup for the current default
// adapter if one exists and is powered. If unpowered or unavailable,
// nDevice is "1" if it had setup devices associated to it the last
// time it was seen, and "-1" if not.
//
// nConnectedDevices is the number of devices connected to the default
// adapter if one exists and is powered, or -1 if it's not available.
_getNDevices() {
let adapter = this._getDefaultAdapter();
if (!adapter) if (!adapter)
return []; return [this._hadSetupDevices ? 1 : -1, -1];
let deviceInfos = []; let nConnectedDevices = 0;
let nDevices = 0;
let [ret, iter] = this._model.iter_children(adapter); let [ret, iter] = this._model.iter_children(adapter);
while (ret) { while (ret) {
const isPaired = this._model.get_value(iter, let isConnected = this._model.get_value(iter,
GnomeBluetooth.Column.PAIRED); GnomeBluetooth.Column.CONNECTED);
const isTrusted = this._model.get_value(iter, if (isConnected)
GnomeBluetooth.Column.TRUSTED); nConnectedDevices++;
if (isPaired || isTrusted) {
deviceInfos.push({
connected: this._model.get_value(iter,
GnomeBluetooth.Column.CONNECTED),
name: this._model.get_value(iter,
GnomeBluetooth.Column.ALIAS),
});
}
let isPaired = this._model.get_value(iter,
GnomeBluetooth.Column.PAIRED);
let isTrusted = this._model.get_value(iter,
GnomeBluetooth.Column.TRUSTED);
if (isPaired || isTrusted)
nDevices++;
ret = this._model.iter_next(iter); ret = this._model.iter_next(iter);
} }
if (this._hadSetupDevices !== (deviceInfos.length > 0)) { if (this._hadSetupDevices != (nDevices > 0)) {
this._hadSetupDevices = !this._hadSetupDevices; this._hadSetupDevices = !this._hadSetupDevices;
global.settings.set_boolean(HAD_BLUETOOTH_DEVICES_SETUP, this._hadSetupDevices); global.settings.set_boolean(HAD_BLUETOOTH_DEVICES_SETUP, this._hadSetupDevices);
} }
return deviceInfos; return [nDevices, nConnectedDevices];
} }
_sync() { _sync() {
let adapter = this._getDefaultAdapter(); let [nDevices, nConnectedDevices] = this._getNDevices();
let devices = this._getDeviceInfos(adapter);
const connectedDevices = devices.filter(dev => dev.connected);
const nConnectedDevices = connectedDevices.length;
const nDevices = devices.length;
let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter; let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
this.menu.setSensitive(sensitive); this.menu.setSensitive(sensitive);
@ -123,16 +124,14 @@ class Indicator extends PanelMenu.SystemIndicator {
else else
this._item.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode; this._item.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;
if (nConnectedDevices > 1) if (nConnectedDevices > 0)
/* Translators: this is the number of connected bluetooth devices */ /* Translators: this is the number of connected bluetooth devices */
this._item.label.text = ngettext('%d Connected", "%d Connected', nConnectedDevices).format(nConnectedDevices); this._item.label.text = ngettext("%d Connected", "%d Connected", nConnectedDevices).format(nConnectedDevices);
else if (nConnectedDevices === 1) else if (nConnectedDevices == -1)
this._item.label.text = connectedDevices[0].name; this._item.label.text = _("Off");
else if (adapter === null)
this._item.label.text = _('Bluetooth Off');
else else
this._item.label.text = _('Bluetooth On'); this._item.label.text = _("On");
this._toggleItem.label.text = this._proxy.BluetoothAirplaneMode ? _('Turn On') : _('Turn Off'); this._toggleItem.label.text = this._proxy.BluetoothAirplaneMode ? _("Turn On") : _("Turn Off");
} }
}); });

View File

@ -199,36 +199,36 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
this._reload.bind(this)); this._reload.bind(this));
} }
async _reload() { _reload() {
let props; Gio.DBus.system.call(this._BUS_NAME,
try { this._BUS_PATH,
const result = await Gio.DBus.system.call( this._BUS_PROPS_IFACE,
this._BUS_NAME, 'GetAll',
this._BUS_PATH, new GLib.Variant('(s)', [this._BUS_IFACE]),
this._BUS_PROPS_IFACE, null, Gio.DBusCallFlags.NONE, -1, null,
'GetAll', (conn, result) => {
new GLib.Variant('(s)', [this._BUS_IFACE]), let props;
null, Gio.DBusCallFlags.NONE, -1, null); try {
[props] = result.deep_unpack(); props = conn.call_finish(result).deep_unpack()[0];
} catch (e) { } catch (e) {
log('Could not get properties from %s'.format(this._BUS_NAME)); log('Could not get properties from %s'.format(this._BUS_NAME));
return; return;
} }
let layouts = props['X11Layout'].unpack();
let variants = props['X11Variant'].unpack();
let options = props['X11Options'].unpack();
const layouts = props['X11Layout'].unpack(); if (layouts != this._layouts ||
const variants = props['X11Variant'].unpack(); variants != this._variants) {
const options = props['X11Options'].unpack(); this._layouts = layouts;
this._variants = variants;
if (layouts !== this._layouts || this._emitInputSourcesChanged();
variants !== this._variants) { }
this._layouts = layouts; if (options != this._options) {
this._variants = variants; this._options = options;
this._emitInputSourcesChanged(); this._emitKeyboardOptionsChanged();
} }
if (options !== this._options) { });
this._options = options;
this._emitKeyboardOptionsChanged();
}
} }
get inputSources() { get inputSources() {

View File

@ -15,10 +15,6 @@ const Util = imports.misc.util;
const { loadInterfaceXML } = imports.misc.fileUtils; const { loadInterfaceXML } = imports.misc.fileUtils;
Gio._promisify(NM.Client, 'new_async', 'new_finish');
Gio._promisify(NM.Client.prototype,
'check_connectivity_async', 'check_connectivity_finish');
const NMConnectionCategory = { const NMConnectionCategory = {
INVALID: 'invalid', INVALID: 'invalid',
WIRED: 'wired', WIRED: 'wired',
@ -1631,11 +1627,11 @@ class Indicator extends PanelMenu.SystemIndicator {
this._ctypes[NM.SETTING_GSM_SETTING_NAME] = NMConnectionCategory.WWAN; this._ctypes[NM.SETTING_GSM_SETTING_NAME] = NMConnectionCategory.WWAN;
this._ctypes[NM.SETTING_VPN_SETTING_NAME] = NMConnectionCategory.VPN; this._ctypes[NM.SETTING_VPN_SETTING_NAME] = NMConnectionCategory.VPN;
this._getClient(); NM.Client.new_async(null, this._clientGot.bind(this));
} }
async _getClient() { _clientGot(obj, result) {
this._client = await NM.Client.new_async(null); this._client = NM.Client.new_finish(result);
this._activeConnections = []; this._activeConnections = [];
this._connections = []; this._connections = [];
@ -1986,7 +1982,7 @@ class Indicator extends PanelMenu.SystemIndicator {
} }
} }
async _portalHelperDone(proxy, emitter, parameters) { _portalHelperDone(proxy, emitter, parameters) {
let [path, result] = parameters; let [path, result] = parameters;
if (result == PortalHelperResult.CANCELLED) { if (result == PortalHelperResult.CANCELLED) {
@ -1997,11 +1993,13 @@ class Indicator extends PanelMenu.SystemIndicator {
} else if (result == PortalHelperResult.COMPLETED) { } else if (result == PortalHelperResult.COMPLETED) {
this._closeConnectivityCheck(path); this._closeConnectivityCheck(path);
} else if (result == PortalHelperResult.RECHECK) { } else if (result == PortalHelperResult.RECHECK) {
try { this._client.check_connectivity_async(null, (client, res) => {
const state = await this._client.check_connectivity_async(null); try {
if (state >= NM.ConnectivityState.FULL) let state = client.check_connectivity_finish(res);
this._closeConnectivityCheck(path); if (state >= NM.ConnectivityState.FULL)
} catch (e) { } this._closeConnectivityCheck(path);
} catch (e) { }
});
} else { } else {
log('Invalid result from portal helper: %s'.format(result)); log('Invalid result from portal helper: %s'.format(result));
} }

View File

@ -52,21 +52,22 @@ const BOLT_DBUS_PATH = '/org/freedesktop/bolt';
var Client = class { var Client = class {
constructor() { constructor() {
this._proxy = null; this._proxy = null;
let nodeInfo = Gio.DBusNodeInfo.new_for_xml(BoltClientInterface);
Gio.DBusProxy.new(Gio.DBus.system,
Gio.DBusProxyFlags.DO_NOT_AUTO_START,
nodeInfo.lookup_interface(BOLT_DBUS_CLIENT_IFACE),
BOLT_DBUS_NAME,
BOLT_DBUS_PATH,
BOLT_DBUS_CLIENT_IFACE,
null,
this._onProxyReady.bind(this));
this.probing = false; this.probing = false;
this._getProxy();
} }
async _getProxy() { _onProxyReady(o, res) {
let nodeInfo = Gio.DBusNodeInfo.new_for_xml(BoltClientInterface);
try { try {
this._proxy = await Gio.DBusProxy.new( this._proxy = Gio.DBusProxy.new_finish(res);
Gio.DBus.system,
Gio.DBusProxyFlags.DO_NOT_AUTO_START,
nodeInfo.lookup_interface(BOLT_DBUS_CLIENT_IFACE),
BOLT_DBUS_NAME,
BOLT_DBUS_PATH,
BOLT_DBUS_CLIENT_IFACE,
null);
} catch (e) { } catch (e) {
log('error creating bolt proxy: %s'.format(e.message)); log('error creating bolt proxy: %s'.format(e.message));
return; return;
@ -242,15 +243,14 @@ class Indicator extends PanelMenu.SystemIndicator {
this._source = null; this._source = null;
this._perm = null; this._perm = null;
this._createPermission();
}
async _createPermission() { Polkit.Permission.new('org.freedesktop.bolt.enroll', null, null, (source, res) => {
try { try {
this._perm = await Polkit.Permission.new('org.freedesktop.bolt.enroll', null, null); this._perm = Polkit.Permission.new_finish(res);
} catch (e) { } catch (e) {
log('Failed to get PolKit permission: %s'.format(e.toString())); log('Failed to get PolKit permission: %s'.format(e.toString()));
} }
});
} }
_onDestroy() { _onDestroy() {

View File

@ -1,5 +1,5 @@
project('gnome-shell', 'c', project('gnome-shell', 'c',
version: '3.37.0', version: '3.36.1',
meson_version: '>= 0.47.0', meson_version: '>= 0.47.0',
license: 'GPLv2+' license: 'GPLv2+'
) )

1850
po/lv.po

File diff suppressed because it is too large Load Diff

View File

@ -218,10 +218,17 @@ window_backed_app_get_icon (ShellApp *app,
if (meta_window_get_client_type (window) == META_WINDOW_CLIENT_TYPE_X11) if (meta_window_get_client_type (window) == META_WINDOW_CLIENT_TYPE_X11)
{ {
widget = st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (), StWidget *texture_actor;
G_OBJECT (window),
"icon", texture_actor =
scaled_size); st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
G_OBJECT (window),
"icon",
scaled_size);
widget = g_object_new (ST_TYPE_BIN,
"child", texture_actor,
NULL);
} }
else else
{ {

View File

@ -59,7 +59,6 @@ struct _StIconPrivate
gint theme_icon_size; /* icon size from theme node */ gint theme_icon_size; /* icon size from theme node */
gint icon_size; /* icon size we are using */ gint icon_size; /* icon size we are using */
GIcon *fallback_gicon; GIcon *fallback_gicon;
GIcon *default_gicon;
CoglPipeline *shadow_pipeline; CoglPipeline *shadow_pipeline;
StShadow *shadow_spec; StShadow *shadow_spec;
@ -73,6 +72,8 @@ static gboolean st_icon_update_icon_size (StIcon *icon);
static void st_icon_update_shadow_pipeline (StIcon *icon); static void st_icon_update_shadow_pipeline (StIcon *icon);
static void st_icon_clear_shadow_pipeline (StIcon *icon); static void st_icon_clear_shadow_pipeline (StIcon *icon);
static GIcon *default_gicon = NULL;
#define IMAGE_MISSING_ICON_NAME "image-missing" #define IMAGE_MISSING_ICON_NAME "image-missing"
#define DEFAULT_ICON_SIZE 48 #define DEFAULT_ICON_SIZE 48
@ -168,7 +169,6 @@ st_icon_dispose (GObject *gobject)
g_clear_object (&priv->gicon); g_clear_object (&priv->gicon);
g_clear_object (&priv->fallback_gicon); g_clear_object (&priv->fallback_gicon);
g_clear_object (&priv->default_gicon);
g_clear_pointer (&priv->shadow_pipeline, cogl_object_unref); g_clear_pointer (&priv->shadow_pipeline, cogl_object_unref);
g_clear_pointer (&priv->shadow_spec, st_shadow_unref); g_clear_pointer (&priv->shadow_spec, st_shadow_unref);
@ -295,14 +295,15 @@ st_icon_init (StIcon *self)
{ {
ClutterLayoutManager *layout_manager; ClutterLayoutManager *layout_manager;
if (G_UNLIKELY (default_gicon == NULL))
default_gicon = g_themed_icon_new (IMAGE_MISSING_ICON_NAME);
self->priv = st_icon_get_instance_private (self); self->priv = st_icon_get_instance_private (self);
layout_manager = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_FILL, layout_manager = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_FILL,
CLUTTER_BIN_ALIGNMENT_FILL); CLUTTER_BIN_ALIGNMENT_FILL);
clutter_actor_set_layout_manager (CLUTTER_ACTOR (self), layout_manager); clutter_actor_set_layout_manager (CLUTTER_ACTOR (self), layout_manager);
self->priv->default_gicon = g_themed_icon_new (IMAGE_MISSING_ICON_NAME);
self->priv->icon_size = DEFAULT_ICON_SIZE; self->priv->icon_size = DEFAULT_ICON_SIZE;
self->priv->prop_icon_size = -1; self->priv->prop_icon_size = -1;
@ -419,7 +420,10 @@ st_icon_update (StIcon *icon)
} }
if (priv->gicon == NULL && priv->fallback_gicon == NULL) if (priv->gicon == NULL && priv->fallback_gicon == NULL)
return; {
g_clear_pointer (&priv->icon_texture, clutter_actor_destroy);
return;
}
if (!st_widget_get_resource_scale (ST_WIDGET (icon), &resource_scale)) if (!st_widget_get_resource_scale (ST_WIDGET (icon), &resource_scale))
return; return;
@ -453,7 +457,7 @@ st_icon_update (StIcon *icon)
if (priv->pending_texture == NULL) if (priv->pending_texture == NULL)
priv->pending_texture = st_texture_cache_load_gicon (cache, priv->pending_texture = st_texture_cache_load_gicon (cache,
theme_node, theme_node,
priv->default_gicon, default_gicon,
priv->icon_size, priv->icon_size,
paint_scale, paint_scale,
resource_scale); resource_scale);

View File

@ -1619,18 +1619,3 @@ st_texture_cache_rescan_icon_theme (StTextureCache *cache)
return gtk_icon_theme_rescan_if_needed (priv->icon_theme); return gtk_icon_theme_rescan_if_needed (priv->icon_theme);
} }
/**
* st_texture_cache_invalidate:
* @cache: a #StTextureCache
*
* Invalidates the texture cache, and evicts all icons.
*/
void
st_texture_cache_invalidate (StTextureCache *cache)
{
g_return_if_fail (ST_IS_TEXTURE_CACHE (cache));
st_texture_cache_evict_icons (cache);
}

View File

@ -115,6 +115,4 @@ CoglTexture * st_texture_cache_load (StTextureCache *cache,
gboolean st_texture_cache_rescan_icon_theme (StTextureCache *cache); gboolean st_texture_cache_rescan_icon_theme (StTextureCache *cache);
void st_texture_cache_invalidate (StTextureCache *cache);
#endif /* __ST_TEXTURE_CACHE_H__ */ #endif /* __ST_TEXTURE_CACHE_H__ */

View File

@ -176,11 +176,7 @@ st_theme_context_set_property (GObject *object,
int scale_factor = g_value_get_int (value); int scale_factor = g_value_get_int (value);
if (scale_factor != context->scale_factor) if (scale_factor != context->scale_factor)
{ {
StTextureCache *cache = st_texture_cache_get_default ();
context->scale_factor = scale_factor; context->scale_factor = scale_factor;
st_texture_cache_invalidate (cache);
st_theme_context_changed (context); st_theme_context_changed (context);
} }
@ -301,6 +297,9 @@ on_custom_stylesheets_changed (StTheme *theme,
GHashTableIter iter; GHashTableIter iter;
StThemeNode *node; StThemeNode *node;
if (context->root_node)
_st_theme_node_reset_for_stylesheet_change (context->root_node);
g_hash_table_iter_init (&iter, context->nodes); g_hash_table_iter_init (&iter, context->nodes);
while (g_hash_table_iter_next (&iter, (gpointer *) &node, NULL)) while (g_hash_table_iter_next (&iter, (gpointer *) &node, NULL))
@ -470,3 +469,19 @@ st_theme_context_intern_node (StThemeContext *context,
g_hash_table_add (context->nodes, g_object_ref (node)); g_hash_table_add (context->nodes, g_object_ref (node));
return node; return node;
} }
/**
* st_theme_context_get_scale_factor:
* @context: a #StThemeContext
*
* Return the current scale factor of @context.
*
* Return value: a scale factor
*/
int
st_theme_context_get_scale_factor (StThemeContext *context)
{
g_return_val_if_fail (ST_IS_THEME_CONTEXT (context), -1);
return context->scale_factor;
}

View File

@ -58,6 +58,8 @@ StThemeNode * st_theme_context_get_root_node (StThemeContext
StThemeNode * st_theme_context_intern_node (StThemeContext *context, StThemeNode * st_theme_context_intern_node (StThemeContext *context,
StThemeNode *node); StThemeNode *node);
int st_theme_context_get_scale_factor (StThemeContext *context);
G_END_DECLS G_END_DECLS
#endif /* __ST_THEME_CONTEXT_H__ */ #endif /* __ST_THEME_CONTEXT_H__ */

View File

@ -643,15 +643,13 @@ create_cairo_pattern_of_background_image (StThemeNode *node,
gdouble background_image_width, background_image_height; gdouble background_image_width, background_image_height;
gdouble x, y; gdouble x, y;
gdouble scale_w, scale_h; gdouble scale_w, scale_h;
int scale_factor;
file = st_theme_node_get_background_image (node); file = st_theme_node_get_background_image (node);
texture_cache = st_texture_cache_get_default (); texture_cache = st_texture_cache_get_default ();
g_object_get (node->context, "scale-factor", &scale_factor, NULL);
surface = st_texture_cache_load_file_to_cairo_surface (texture_cache, file, surface = st_texture_cache_load_file_to_cairo_surface (texture_cache, file,
scale_factor, node->cached_scale_factor,
resource_scale); resource_scale);
if (surface == NULL) if (surface == NULL)
@ -1374,7 +1372,6 @@ st_theme_node_load_border_image (StThemeNode *node,
{ {
StBorderImage *border_image; StBorderImage *border_image;
GFile *file; GFile *file;
int scale_factor;
border_image = st_theme_node_get_border_image (node); border_image = st_theme_node_get_border_image (node);
if (border_image == NULL) if (border_image == NULL)
@ -1382,10 +1379,9 @@ st_theme_node_load_border_image (StThemeNode *node,
file = st_border_image_get_file (border_image); file = st_border_image_get_file (border_image);
g_object_get (node->context, "scale-factor", &scale_factor, NULL);
node->border_slices_texture = st_texture_cache_load_file_to_cogl_texture (st_texture_cache_get_default (), node->border_slices_texture = st_texture_cache_load_file_to_cogl_texture (st_texture_cache_get_default (),
file, scale_factor, file,
node->cached_scale_factor,
resource_scale); resource_scale);
if (node->border_slices_texture == NULL) if (node->border_slices_texture == NULL)
goto out; goto out;
@ -1413,17 +1409,15 @@ st_theme_node_load_background_image (StThemeNode *node,
{ {
GFile *background_image; GFile *background_image;
StShadow *background_image_shadow_spec; StShadow *background_image_shadow_spec;
int scale_factor;
background_image = st_theme_node_get_background_image (node); background_image = st_theme_node_get_background_image (node);
if (background_image == NULL) if (background_image == NULL)
goto out; goto out;
g_object_get (node->context, "scale-factor", &scale_factor, NULL);
background_image_shadow_spec = st_theme_node_get_background_image_shadow (node); background_image_shadow_spec = st_theme_node_get_background_image_shadow (node);
node->background_texture = st_texture_cache_load_file_to_cogl_texture (st_texture_cache_get_default (), node->background_texture = st_texture_cache_load_file_to_cogl_texture (st_texture_cache_get_default (),
background_image, scale_factor, background_image,
node->cached_scale_factor,
resource_scale); resource_scale);
if (node->background_texture == NULL) if (node->background_texture == NULL)
goto out; goto out;

View File

@ -118,7 +118,7 @@ struct _StThemeNode {
StThemeNodePaintState cached_state; StThemeNodePaintState cached_state;
int scale_factor; int cached_scale_factor;
}; };
void _st_theme_node_ensure_background (StThemeNode *node); void _st_theme_node_ensure_background (StThemeNode *node);

View File

@ -219,14 +219,13 @@ st_theme_node_new (StThemeContext *context,
if (theme == NULL && parent_node != NULL) if (theme == NULL && parent_node != NULL)
theme = parent_node->theme; theme = parent_node->theme;
g_object_get (context, "scale-factor", &node->scale_factor, NULL);
g_set_object (&node->theme, theme); g_set_object (&node->theme, theme);
node->element_type = element_type; node->element_type = element_type;
node->element_id = g_strdup (element_id); node->element_id = g_strdup (element_id);
node->element_classes = split_on_whitespace (element_class); node->element_classes = split_on_whitespace (element_class);
node->pseudo_classes = split_on_whitespace (pseudo_class); node->pseudo_classes = split_on_whitespace (pseudo_class);
node->inline_style = g_strdup (inline_style); node->inline_style = g_strdup (inline_style);
node->cached_scale_factor = st_theme_context_get_scale_factor (context);
return node; return node;
} }
@ -347,7 +346,7 @@ st_theme_node_equal (StThemeNode *node_a, StThemeNode *node_b)
node_a->context != node_b->context || node_a->context != node_b->context ||
node_a->theme != node_b->theme || node_a->theme != node_b->theme ||
node_a->element_type != node_b->element_type || node_a->element_type != node_b->element_type ||
node_a->scale_factor != node_b->scale_factor || node_a->cached_scale_factor != node_b->cached_scale_factor ||
g_strcmp0 (node_a->element_id, node_b->element_id) || g_strcmp0 (node_a->element_id, node_b->element_id) ||
g_strcmp0 (node_a->inline_style, node_b->inline_style)) g_strcmp0 (node_a->inline_style, node_b->inline_style))
return FALSE; return FALSE;
@ -399,7 +398,7 @@ st_theme_node_hash (StThemeNode *node)
hash = hash * 33 + GPOINTER_TO_UINT (node->context); hash = hash * 33 + GPOINTER_TO_UINT (node->context);
hash = hash * 33 + GPOINTER_TO_UINT (node->theme); hash = hash * 33 + GPOINTER_TO_UINT (node->theme);
hash = hash * 33 + ((guint) node->element_type); hash = hash * 33 + ((guint) node->element_type);
hash = hash * 33 + ((guint) node->scale_factor); hash = hash * 33 + ((guint) node->cached_scale_factor);
if (node->element_id != NULL) if (node->element_id != NULL)
hash = hash * 33 + g_str_hash (node->element_id); hash = hash * 33 + g_str_hash (node->element_id);
@ -994,7 +993,7 @@ get_length_from_term (StThemeNode *node,
{ {
case NUM_LENGTH_PX: case NUM_LENGTH_PX:
type = ABSOLUTE; type = ABSOLUTE;
multiplier = 1 * node->scale_factor; multiplier = 1 * node->cached_scale_factor;
break; break;
case NUM_LENGTH_PT: case NUM_LENGTH_PT:
type = POINTS; type = POINTS;
@ -1128,7 +1127,7 @@ get_length_from_term_int (StThemeNode *node,
result = get_length_from_term (node, term, use_parent_font, &value); result = get_length_from_term (node, term, use_parent_font, &value);
if (result == VALUE_FOUND) if (result == VALUE_FOUND)
*length = (int) ((value / node->scale_factor) + 0.5) * node->scale_factor; *length = (int) ((value / node->cached_scale_factor) + 0.5) * node->cached_scale_factor;
return result; return result;
} }
@ -3122,7 +3121,7 @@ st_theme_node_get_border_image (StThemeNode *node)
node->border_image = st_border_image_new (file, node->border_image = st_border_image_new (file,
border_top, border_right, border_bottom, border_left, border_top, border_right, border_bottom, border_left,
node->scale_factor); node->cached_scale_factor);
g_object_unref (file); g_object_unref (file);
@ -3963,7 +3962,7 @@ st_theme_node_geometry_equal (StThemeNode *node,
g_return_val_if_fail (ST_IS_THEME_NODE (other), FALSE); g_return_val_if_fail (ST_IS_THEME_NODE (other), FALSE);
if (node->scale_factor != other->scale_factor) if (node->cached_scale_factor != other->cached_scale_factor)
return FALSE; return FALSE;
_st_theme_node_ensure_geometry (node); _st_theme_node_ensure_geometry (node);

View File

@ -38,18 +38,19 @@
</description> </description>
<releases> <releases>
<release version="3.37.0" date="2020-03-31"/> <release version="3.36.1" date="2020-03-29"/>
<release version="3.36.0" date="2020-03-07"/>
</releases> </releases>
<screenshots> <screenshots>
<screenshot type="default"> <screenshot type="default">
<image>https://gitlab.gnome.org/GNOME/gnome-shell/raw/master/subprojects/extensions-app/data/metainfo/extensions-main.png</image> <image>https://gitlab.gnome.org/GNOME/gnome-shell/raw/gnome-3-36/subprojects/extensions-app/data/metainfo/extensions-main.png</image>
</screenshot> </screenshot>
<screenshot> <screenshot>
<image>https://gitlab.gnome.org/GNOME/gnome-shell/raw/master/subprojects/extensions-app/data/metainfo/extensions-update.png</image> <image>https://gitlab.gnome.org/GNOME/gnome-shell/raw/gnome-3-36/subprojects/extensions-app/data/metainfo/extensions-update.png</image>
</screenshot> </screenshot>
<screenshot> <screenshot>
<image>https://gitlab.gnome.org/GNOME/gnome-shell/raw/master/subprojects/extensions-app/data/metainfo/extensions-remove.png</image> <image>https://gitlab.gnome.org/GNOME/gnome-shell/raw/gnome-3-36/subprojects/extensions-app/data/metainfo/extensions-remove.png</image>
</screenshot> </screenshot>
</screenshots> </screenshots>
</component> </component>

View File

@ -6,5 +6,5 @@ Icon=@app_id@
Comment=Configure GNOME Shell Extensions Comment=Configure GNOME Shell Extensions
Exec=@bindir@/@prgname@ Exec=@bindir@/@prgname@
DBusActivatable=true DBusActivatable=true
Categories=GNOME;GTK; Categories=GNOME;GTK;Utility;
OnlyShowIn=GNOME; OnlyShowIn=GNOME;

View File

@ -201,7 +201,10 @@ var ExtensionsWindow = GObject.registerClass({
null, null,
Gio.DBusCallFlags.NONE, Gio.DBusCallFlags.NONE,
-1, -1,
null); null,
(o, res) => {
o.call_finish(res);
});
} }
_sortList(row1, row2) { _sortList(row1, row2) {

View File

@ -1,5 +1,5 @@
project('gnome-extensions-app', project('gnome-extensions-app',
version: '3.37.0', version: '3.36.1',
meson_version: '>= 0.47.0', meson_version: '>= 0.47.0',
license: 'GPLv2+' license: 'GPLv2+'
) )

View File

@ -1,5 +1,5 @@
project('gnome-extensions-tool', 'c', project('gnome-extensions-tool', 'c',
version: '3.37.0', version: '3.36.1',
meson_version: '>= 0.47.0', meson_version: '>= 0.47.0',
license: 'GPLv2+' license: 'GPLv2+'
) )

View File

@ -1,5 +1,5 @@
project('shew', 'c', project('shew', 'c',
version: '3.37.0', version: '3.36.1',
meson_version: '>= 0.47.0', meson_version: '>= 0.47.0',
license: 'LGPLv2+', license: 'LGPLv2+',
) )