Compare commits

...

32 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
47a2e58d45 Introduce updates indicator
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/466
2019-03-19 12:18:54 +00:00
Georges Basile Stavracas Neto
20d73be57d Introduce Automatic Updates component
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/466
2019-03-19 12:18:47 +00:00
Carlos Garnacho
62233a4db4 dnd: Multiply drag threshold by output scale
So it comes out right on hidpi, and consistent with clients.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/455
2019-03-13 17:22:35 +00:00
Carlos Garnacho
4a7e2ddff5 dnd: Make startDrag() fail if there is a current grab
This call just went through stomping over previous drag operations if any,
_maybeStartDrag() accounted for this, but other callers (well, WindowClone
in workspace.js) don't. This must bail out early even if a drag operation is
requested, luckily all callers account for it already.

This broke shell state by preserving connected captured-event handlers if
one tried to drag multiple windows simultaneously through multitouch. We
of course don't support that, now more elegantly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/455
2019-03-13 17:22:35 +00:00
Victor Ibragimov
fb737ebde0 Update Tajik Translation 2019-03-13 21:45:05 +05:00
Victor Ibragimov
bf77cb44e7 Merge branch 'master' of gitlab.gnome.org:GNOME/gnome-shell 2019-03-13 21:40:31 +05:00
Victor Ibragimov
c72e2bb4a9 Update Tajik Translation 2019-03-13 21:39:34 +05:00
Victor Ibragimov
68c182b1df Update Tajik Translation 2019-03-13 21:18:10 +05:00
Alex Monday
348d303794 theme: Fix :checked:active page-indicator
Closes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1036
2019-03-12 11:58:36 +00:00
Florian Müllner
ede0fd8660 magnifier: Fix color argument
Clutter.TextureNode takes a Clutter.Color, not a Cogl.Color.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1020
2019-03-12 01:52:22 +00:00
Robert Mader
187c2193e8 st-theme-node-transition: Exclude get_new_paint_state() from introspection
to silence a build warning.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/449
2019-03-12 01:14:52 +00:00
Florian Müllner
706bdd8059 st-widget: Add missing g_return_val_if_fail()
It's a public function, so it's good practice to sanity-check its
input (unless disabled at compile time of course).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1018
2019-03-12 01:00:32 +00:00
Jakub Steiner
436861edc8 theme: improve legibility of error messages
- the login dialog uses warning_color, so be consistent
- nevertheless increase lightness of the error_color

Fixes issue https://gitlab.gnome.org/GNOME/gnome-shell/issues/1016
2019-03-12 00:54:26 +00:00
Florian Müllner
9729a2e772 texture-cache: Apply resource scale to the right dimension
Size matters!

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/444
2019-03-12 00:48:11 +00:00
Florian Müllner
6b924c00c5 layout: Use custom actor for uiGroup
The bind constraint that replaced the Shell.GenericContainer in commit
f4682748fa is subtly different from the previous code:
It forces the actor to have the same size as the stage, rather than just
requesting that size.

This breaks the magnifier which relies on the UI being able to be bigger
than the display size. Fix by going back to using a custom actor.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/646
2019-03-12 00:39:40 +00:00
Florian Müllner
b90f4d29a4 userWidget: Fix avatar size
The texture cache now returns an actor with an appropriate ClutterContent
rather than a ClutterTexture. That actor uses the CONTENT_SIZE request
mode, which means that it will unconditionally request the preferred size
of the content. That is, setting an explicit size no longer has an effect.

Fix this by making sure the image is already loaded with the desired
dimensions.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1024
2019-03-12 00:34:04 +00:00
Florian Müllner
47915f8c11 Bump version to 3.32.0
Update NEWS.
2019-03-11 23:54:15 +01:00
Florian Müllner
5dfdeaa4ea theme: Fix menu arrows
After the latest texture cache changes, loading the icon at its preferred
size and scaling it via the actor size no longer works. Instead, use the
icon-size property which is applied when loading the icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/452
2019-03-10 22:03:05 +01:00
Mart Raudsepp
98a2a81f2a Update Estonian translation 2019-03-10 16:57:52 +00:00
Piotr Drąg
c4850027bc Fix Icon in translations 2019-03-10 17:32:06 +01:00
Florian Müllner
d4202e7f38 theme: Handle fallback app icons in notifications
Since commit 3eb80dc6c0, the size of notification icons is determined
by the theme to make it font-relative. Also handle the case where the
icon isn't an StIcon, but a fallback window icon.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
2019-03-08 16:20:21 +01:00
Florian Müllner
4f65283f31 app: Set styleclass on fallback app icons
For window backed apps, create_icon_texture() doesn't return an StIcon
but a generic widget. Set an appropriate style class to make it easier
to apply a specific style only to fallback icons.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
2019-03-08 16:20:21 +01:00
Florian Müllner
d86d3bbe54 texture-cache: Fall back to actor size for bound textures
With StImageContent, the meaning of passing -1 as size parameter changed
from "load the image at its preferred size" to "abort the session". It
is therefore no longer possible to just load the image and then have it
scaled by applying a CSS size to the texture's parent.

Setting the size from CSS is useful though, so to still allow that, fall
back to the actor's size (which can be determined by the style).

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
2019-03-08 16:20:21 +01:00
Florian Müllner
6f794738e8 texture-cache: Load bound surfaces into StWidgets
Using widgets instead of plain actors will allow us to set the size
from CSS.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
2019-03-08 16:20:21 +01:00
Ryuta Fujii
ef7a93bb07 Update Japanese translation 2019-03-07 11:17:18 +00:00
Victor Ibragimov
5197a992a6 Update Tajik translation 2019-03-06 20:15:01 +05:00
Victor Ibragimov
49d8540f6d Update Tajik Translation 2019-03-06 20:08:28 +05:00
Victor Ibragimov
6e1a1f1a57 Update Tajik Translation 2019-03-06 20:06:55 +05:00
Iain Lane
c73428247c build: Add mutter's private directory to libst's build-time RPATH
We need this to run `test-theme`, otherwise when run as part of the
build tests it fails like:

  error while loading shared libraries: libmutter-cogl-4.so.0: cannot
  open shared object file: No such file or directory

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/442
2019-03-06 12:45:48 +00:00
Gábor Kelemen
fc2caf5794 Update Hungarian translation 2019-03-05 22:05:20 +00:00
Carlos Garnacho
b117826ada keyboard: Add bottom emoji panel row to separate aspect container
So we ensure the row has the right aspect ratio, and buttons neatly aligned
with the bottom row in the alphanumeric view.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/439
2019-03-05 21:11:47 +00:00
Carlos Garnacho
26b44b48ab keyboard: align AspectContainer to bottom if restricting vertically
It is convenient for the OSK so it eg. doesn't appear centered in the
available space (eg. on very narrow portrait layouts), plus it will also
be convenient to align other AspectContainers to the same baseline.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/439
2019-03-05 21:11:47 +00:00
31 changed files with 3111 additions and 2187 deletions

14
NEWS
View File

@@ -1,3 +1,17 @@
3.32.0
======
* Fix sizing issues in on-screen-keyboard emoji panel [Carlos; !439]
* Fix test linker failure on Debian/Ubuntu [Iain; !442]
* Avoid assertion when sizing fallback app icons from CSS [Florian; #1027]
* Fix mis-sized menu arrows after texture cache changes [Florian; !452]
Contributors:
Carlos Garnacho, Iain Lane, Florian Müllner
Translators:
Gábor Kelemen [hu], Victor Ibragimov [tg], Ryuta Fujii [ja], Piotr Drąg [af,
tg], Mart Raudsepp [et]
3.31.92
=======
* Fix visual glitch in submenus [Alex; #987]

View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/shell/theme">
<file>automatic-updates-off-symbolic.svg</file>
<file>automatic-updates-on-symbolic.svg</file>
<file>automatic-updates-scheduled-symbolic.svg</file>
<file>calendar-today.svg</file>
<file>checkbox-focused.svg</file>
<file>checkbox-off-focused.svg</file>

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>EOS_symbolic-icons_v0.1auto-updates_OFF</title><path d="M11.03,10.074a.125.125,0,0,0-.086.213l1.347,1.35a5.733,5.733,0,0,1-4.238,1.9,5.6,5.6,0,0,1-2.282-.484l-1.11,1.11a7.024,7.024,0,0,0,3.392.875,7.3,7.3,0,0,0,5.3-2.339l1.357,1.36a.125.125,0,0,0,.213-.086L15,10Z" style="fill:#999"/><path d="M12.921,5.9a6.354,6.354,0,0,1,.326,1.863.248.248,0,0,0,.244.244h1a.261.261,0,0,0,.257-.265,7.543,7.543,0,0,0-.677-2.991Z" style="fill:#999"/><path d="M6.286,9.707a.994.994,0,0,0,.715.3H9a1,1,0,0,0,1-1v-2A.994.994,0,0,0,9.7,6.3l2.175-2.175,0,0L12.93,3.067l0,0,1.4-1.4a.25.25,0,0,0,0-.354L13.617.608a.25.25,0,0,0-.354,0L11.772,2.1A6.97,6.97,0,0,0,7.948.961,7.3,7.3,0,0,0,2.651,3.3L1.293,1.94a.125.125,0,0,0-.214.086L1,6l3.971-.074a.125.125,0,0,0,.086-.213L3.71,4.363a5.733,5.733,0,0,1,4.238-1.9,5.523,5.523,0,0,1,2.723.739L7.86,6.011H7a1,1,0,0,0-1,1V7.87L3.291,10.58a6,6,0,0,1-.537-2.346.248.248,0,0,0-.244-.245h-1a.261.261,0,0,0-.257.265A7.329,7.329,0,0,0,2.172,11.7L.608,13.263a.25.25,0,0,0,0,.354l.707.707a.25.25,0,0,0,.354,0l1.4-1.4,0,0,1.056-1.056,0,0Z" style="fill:#999"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>EOS_symbolic-icons_v0.1auto-updates_ON</title><rect x="6.001" y="6.011" width="4" height="4" rx="1" ry="1" style="fill:#999"/><path d="M5.057,5.713,3.71,4.362a5.733,5.733,0,0,1,4.238-1.9,5.173,5.173,0,0,1,5.3,5.305.248.248,0,0,0,.244.244h1a.261.261,0,0,0,.257-.265A6.684,6.684,0,0,0,7.948.961,7.3,7.3,0,0,0,2.65,3.3L1.293,1.94a.125.125,0,0,0-.213.086L1,6l3.971-.074A.125.125,0,0,0,5.057,5.713Z" style="fill:#999"/><path d="M11.03,10.074a.125.125,0,0,0-.086.213l1.347,1.35a5.733,5.733,0,0,1-4.238,1.9,5.173,5.173,0,0,1-5.3-5.305.248.248,0,0,0-.244-.245h-1a.261.261,0,0,0-.257.265,6.684,6.684,0,0,0,6.8,6.785,7.3,7.3,0,0,0,5.3-2.339l1.357,1.36a.125.125,0,0,0,.214-.086L15,10Z" style="fill:#999"/></svg>

After

Width:  |  Height:  |  Size: 767 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>EOS_symbolic-icons_v0.1update-scheduled_OUTLINE</title><path d="M7.99,15.054A6.7,6.7,0,0,1,1.06,8,6.7,6.7,0,0,1,7.99.954,6.71,6.71,0,0,1,14.948,8,6.71,6.71,0,0,1,7.99,15.054Zm0-12.6A5.2,5.2,0,0,0,2.56,8a5.2,5.2,0,0,0,5.43,5.55A5.215,5.215,0,0,0,13.448,8,5.216,5.216,0,0,0,7.99,2.454Z" style="fill:#999"/><path d="M9.209,10.443,7.2,8.437a.25.25,0,0,1-.073-.177l0-4.01A.25.25,0,0,1,7.379,4h1.25a.25.25,0,0,1,.25.25l0,3.283a.25.25,0,0,0,.073.177l1.5,1.494a.25.25,0,0,1,0,.354l-.883.884A.25.25,0,0,1,9.209,10.443Z" style="fill:#999"/></svg>

After

Width:  |  Height:  |  Size: 603 B

View File

@@ -16,7 +16,7 @@ $link_visited_color: if($variant == 'light', darken($selected_bg_color, 20%), li
$top_hilight: $borders_edge;
$warning_color: #f57900;
$error_color: #cc0000;
$error_color: #ff8080;
$success_color: if($variant == 'light', #33d17a, darken(#33d17a, 10%));
$destructive_color: if($variant == 'light', #e01b24, darken(#e01b24, 10%));

View File

@@ -392,7 +392,7 @@ StScrollBar {
.prompt-dialog-error-label {
font-size: 10pt;
color: $error_color;
color: $warning_color;
padding-bottom: 8px;
}
@@ -1031,6 +1031,11 @@ StScrollBar {
-st-icon-style: symbolic;
}
.message-icon-bin > .fallback-window-icon {
width: 1.09em;
height: 1.09em;
}
.message-secondary-bin {
padding: 0 0.82em;;
}
@@ -1138,7 +1143,7 @@ StScrollBar {
.ripple-box:rtl { border-radius: 0 0 0 52px; } // just a simple change to the border radius position
// not really top bar only
.popup-menu-arrow { width: 16px; height: 16px; }
.popup-menu-arrow { icon-size: 1.09em; }
.popup-menu-icon { icon-size: 1.09em; }
//close buttons
@@ -1448,13 +1453,13 @@ StScrollBar {
height: 12px;
background-color: transparent;
border: 2px solid rgba(255, 255, 255, 0.4);
border-radius:12px;
border-radius: 12px;
}
&:hover .page-indicator-icon { border-color: white; }
&:active .page-indicator-icon { border: none; margin: 2px; background-color:#fff; }
&:active .page-indicator-icon { border: none; margin: 2px; background-color: white; }
&:checked .page-indicator-icon,
&:checked:active { background-color: #fff;}
&:checked:active .page-indicator-icon { background-color: white;}
}
.no-frequent-applications-label { @extend %status_text; }

View File

@@ -9,6 +9,7 @@
<file>gdm/realmd.js</file>
<file>gdm/util.js</file>
<file>misc/updateManager.js</file>
<file>misc/config.js</file>
<file>misc/extensionUtils.js</file>
<file>misc/fileUtils.js</file>
@@ -116,9 +117,11 @@
<file>ui/components/networkAgent.js</file>
<file>ui/components/polkitAgent.js</file>
<file>ui/components/telepathyClient.js</file>
<file>ui/components/updates.js</file>
<file>ui/components/keyring.js</file>
<file>ui/status/accessibility.js</file>
<file>ui/status/automaticUpdates.js</file>
<file>ui/status/brightness.js</file>
<file>ui/status/location.js</file>
<file>ui/status/keyboard.js</file>

338
js/misc/updateManager.js Normal file
View File

@@ -0,0 +1,338 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
//
// Copyright (C) 2019 Endless Mobile, Inc.
//
// This is a GNOME Shell component to wrap the interactions over
// D-Bus with the Mogwai system daemon.
//
// Licensed under the GNU General Public License Version 2
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
const { Clutter, Gio, GLib,
GObject, Gtk, NM, Shell, St } = imports.gi;
const NM_SETTING_AUTOMATIC_UPDATES_NOTIFICATION_TIME = "connection.automatic-updates-notification-time";
const NM_SETTING_ALLOW_DOWNLOADS = 'connection.allow-downloads';
const NM_SETTING_TARIFF_ENABLED = "connection.tariff-enabled";
const SchedulerInterface = '\
<node> \
<interface name="com.endlessm.DownloadManager1.Scheduler"> \
<property name="ActiveEntryCount" type="u" access="read" /> \
<property name="EntryCount" type="u" access="read" /> \
</interface> \
</node>';
const SchedulerProxy = Gio.DBusProxy.makeProxyWrapper(SchedulerInterface);
let _updateManager = null;
function getUpdateManager() {
if (_updateManager == null)
_updateManager = new UpdateManager();
return _updateManager;
}
var State = {
UNKNOWN: 0,
DISCONNECTED: 1,
DISABLED: 2,
IDLE: 3,
SCHEDULED: 4,
DOWNLOADING: 5
};
function stateToIconName(state) {
switch (state) {
case State.UNKNOWN:
case State.DISCONNECTED:
return null;
case State.DISABLED:
return 'resource:///org/gnome/shell/theme/automatic-updates-off-symbolic.svg';
case State.IDLE:
case State.DOWNLOADING:
return 'resource:///org/gnome/shell/theme/automatic-updates-on-symbolic.svg';
case State.SCHEDULED:
return 'resource:///org/gnome/shell/theme/automatic-updates-scheduled-symbolic.svg';
}
return null;
}
var UpdateManager = GObject.registerClass ({
Properties: {
'last-notification-time': GObject.ParamSpec.int('last-notification-time',
'last-notification-time',
'last-notification-time',
GObject.ParamFlags.READWRITE,
null),
'icon': GObject.ParamSpec.object('icon', 'icon', 'icon',
GObject.ParamFlags.READABLE,
Gio.Icon.$gtype),
'state': GObject.ParamSpec.uint('state', 'state', 'state',
GObject.ParamFlags.READABLE,
null),
},
}, class UpdateManager extends GObject.Object {
_init() {
super._init();
this._activeConnection = null;
this._settingChangedSignalId = 0;
this._updateTimeoutId = 0;
this._state = State.UNKNOWN;
NM.Client.new_async(null, this._clientGot.bind(this));
}
_clientGot(obj, result) {
this._client = NM.Client.new_finish(result);
this._client.connect('notify::primary-connection', this._sync.bind(this));
this._client.connect('notify::state', this._sync.bind(this));
// Start retrieving the Mogwai proxy
this._proxy = new SchedulerProxy(Gio.DBus.system,
'com.endlessm.MogwaiSchedule1',
'/com/endlessm/DownloadManager1',
(proxy, error) => {
if (error) {
log(error.message);
return;
}
this._proxy.connect('g-properties-changed',
this._sync.bind(this));
this._updateStatus();
});
this._sync();
}
_sync() {
if (!this._client || !this._proxy)
return;
if (this._updateTimeoutId > 0) {
GLib.source_remove(this._updateTimeoutId);
this._updateTimeoutId = 0;
}
// Intermediate states (connecting or disconnecting) must not trigger
// any kind of state change.
if (this._client.state == NM.State.CONNECTING || this._client.state == NM.State.DISCONNECTING)
return;
// Use a timeout to avoid instantly throwing the notification at
// the user's face, and to avoid a series of unecessary updates
// that happen when NetworkManager is still figuring out details.
this._updateTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT,
2,
() => {
this._updateStatus();
this._updateTimeoutId = 0;
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._updateTimeoutId, '[update] updateStatus');
}
_updateStatus() {
// Update the current active connection. This will connect to the
// NM.SettingUser signal to sync every time someone updates the
// NM_SETTING_ALLOW_DOWNLOADS setting.
this._updateActiveConnection();
let state = this._getState();
if (state != this._state) {
this._state = state;
this.notify('state');
this._updateIcon();
}
}
_updateActiveConnection() {
let currentActiveConnection = this._getActiveConnection();
if (this._activeConnection == currentActiveConnection)
return;
// Disconnect from the previous active connection
if (this._settingChangedSignalId > 0) {
this._activeConnection.disconnect(this._settingChangedSignalId);
this._settingChangedSignalId = 0;
}
this._activeConnection = currentActiveConnection;
// Connect from the current active connection
if (currentActiveConnection)
this._settingChangedSignalId = currentActiveConnection.connect('changed', this._updateStatus.bind(this));
}
_ensureUserSetting(connection) {
let userSetting = connection.get_setting(NM.SettingUser.$gtype);
if (!userSetting) {
userSetting = new NM.SettingUser();
connection.add_setting(userSetting);
}
return userSetting;
}
_getState() {
if (!this._activeConnection)
return State.DISCONNECTED;
let userSetting = this._ensureUserSetting(this._activeConnection);
// We only return true when:
// * Automatic Updates are on
// * A schedule was set
// * Something is being downloaded
let allowDownloadsValue = userSetting.get_data(NM_SETTING_ALLOW_DOWNLOADS);
if (allowDownloadsValue) {
let allowDownloads = (allowDownloadsValue === '1');
if (!allowDownloads)
return State.DISABLED;
} else {
// Guess the default value from the metered state. Only return
// if it's disabled - if it's not, we want to follow the regular
// code paths and fetch the correct state
let connectionSetting = this._activeConnection.get_setting_connection();
if (!connectionSetting)
return State.DISABLED;
let metered = connectionSetting.get_metered();
if (metered == NM.Metered.YES || metered == NM.Metered.GUESS_YES)
return State.DISABLED;
}
// Without the proxy, we can't really know the state
if (!this._proxy)
return State.UNKNOWN;
let scheduleSet = userSetting.get_data(NM_SETTING_TARIFF_ENABLED) === '1';
if (!scheduleSet)
return State.IDLE;
let downloading = this._proxy.ActiveEntryCount > 0;
if (downloading)
return State.DOWNLOADING;
// At this point we're not downloading anything, but something
// might be queued
let downloadsQueued = this._proxy.EntryCount > 0;
if (downloadsQueued)
return State.SCHEDULED;
else
return State.IDLE;
}
_getActiveConnection() {
let activeConnection = this._client.get_primary_connection();
return activeConnection ? activeConnection.get_connection() : null;
}
_updateIcon() {
let state = this._state;
let iconName = stateToIconName(state);
if (iconName) {
let iconFile = Gio.File.new_for_uri(iconName);
this._icon = new Gio.FileIcon({ file: iconFile });
} else {
this._icon = null;
}
this.notify('icon');
}
get state() {
return this._state;
}
get lastNotificationTime() {
let connection = this._getActiveConnection();
if (!connection)
return -1;
let userSetting = connection.get_setting(NM.SettingUser.$gtype);
if (!userSetting)
return -1;
let time = userSetting.get_data(NM_SETTING_AUTOMATIC_UPDATES_NOTIFICATION_TIME);
return time ? parseInt(time) : -1;
}
set lastNotificationTime(time) {
if (!this._activeConnection)
return;
let userSetting = this._ensureUserSetting(this._activeConnection);
userSetting.set_data(NM_SETTING_AUTOMATIC_UPDATES_NOTIFICATION_TIME,
'%s'.format(time));
this._activeConnection.commit_changes(true, null);
}
get active() {
return this._active;
}
set active(_active) {
if (this._active == _active)
return;
this._active = _active;
this.notify('active');
}
get icon() {
return this._icon;
}
toggleAutomaticUpdates() {
if (!this._activeConnection)
return;
let userSetting = this._ensureUserSetting(this._activeConnection);
let state = this._getState();
let value;
if (state == State.IDLE ||
state == State.SCHEDULED ||
state == State.DOWNLOADING) {
value = '0';
} else {
value = '1';
}
userSetting.set_data(NM_SETTING_ALLOW_DOWNLOADS, value);
this._activeConnection.commit_changes_async(true, null, (con, res, data) => {
this._activeConnection.commit_changes_finish(res);
this._updateStatus();
});
}
});

135
js/ui/components/updates.js Normal file
View File

@@ -0,0 +1,135 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
//
// Copyright (C) 2018 Endless Mobile, Inc.
//
// This is a GNOME Shell component to wrap the interactions over
// D-Bus with the Mogwai system daemon.
//
// Licensed under the GNU General Public License Version 2
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
const { Gio, GLib, Shell } = imports.gi;
const UpdateManager = imports.misc.updateManager;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
var UpdateComponent = class {
constructor() {
this._notification = null;
this._state = UpdateManager.State.UNKNOWN;
this._manager = UpdateManager.getUpdateManager();
this._manager.connect('notify::state', this._updateState.bind(this));
this._updateState();
}
enable() {
}
disable() {
}
_updateState() {
let newState = this._manager.state;
if (this._state == newState)
return;
this._updateNotification(newState);
this._state = newState;
}
_updateNotification(newState) {
// Don't notify when starting up
if (this._manager.state == UpdateManager.State.UNKNOWN)
return;
let alreadySentNotification = this._manager.lastNotificationTime != -1;
let wasDisconnected = this._state == UpdateManager.State.DISCONNECTED;
let wasActive = this._state >= UpdateManager.State.IDLE;
let isActive = newState >= UpdateManager.State.IDLE;
// The criteria to notify about the Automatic Updates setting is:
// 1. If the user was disconnected and connects to a new network; or
// 2. If the user was connected and connects to a network with different status;
if ((wasDisconnected && alreadySentNotification) || (!wasDisconnected && isActive == wasActive))
return;
if (this._notification)
this._notification.destroy();
if (newState == UpdateManager.State.DISCONNECTED)
return;
let source = new MessageTray.SystemNotificationSource();
Main.messageTray.add(source);
// Figure out the title, subtitle and icon
let title, subtitle, iconFile;
if (isActive) {
title = _("Automatic updates on");
subtitle = _("Your connection has unlimited data so automatic updates have been turned on.");
iconFile = UpdateManager.stateToIconName(UpdateManager.State.IDLE);
} else {
title = _("Automatic updates are turned off to save your data");
subtitle = _("You will need to choose which updates to apply when on this connection.");
iconFile = UpdateManager.stateToIconName(UpdateManager.State.DISABLED);
}
let gicon = new Gio.FileIcon({ file: Gio.File.new_for_uri(iconFile) });
// Create the notification.
// The first time we notify the user for a given connection,
// we set the urgency to critical so that we make sure the
// user understands how we may be changing their settings.
// On subsequent notifications for the given connection,
// for instance if the user regularly switches between
// metered and unmetered connections, we set the urgency
// to normal so as not to be too obtrusive.
this._notification = new MessageTray.Notification(source, title, subtitle, { gicon: gicon });
this._notification.setUrgency(alreadySentNotification ?
MessageTray.Urgency.NORMAL : MessageTray.Urgency.CRITICAL);
this._notification.setTransient(false);
this._notification.addAction(_("Close"), () => {
this._notification.destroy();
});
this._notification.addAction(_("Change Settings…"), () => {
// FIXME: this requires the Automatic Updates panel in GNOME
// Settings. Going with the Network panel for now…
let app = Shell.AppSystem.get_default().lookup_app('gnome-network-panel.desktop');
Main.overview.hide();
app.activate();
});
source.notify(this._notification);
this._notification.connect('destroy', () => {
this._notification = null;
});
// Now that we first detected this connection, mark it as such
this._manager.lastNotificationTime = GLib.get_real_time();
}
};
var Component = UpdateComponent;

View File

@@ -306,6 +306,9 @@ var _Draggable = class _Draggable {
* for the draggable.
*/
startDrag(stageX, stageY, time, sequence, device) {
if (currentDraggable)
return;
if (device == undefined) {
let event = Clutter.get_current_event();
@@ -447,7 +450,8 @@ var _Draggable = class _Draggable {
let [stageX, stageY] = event.get_coords();
// See if the user has moved the mouse enough to trigger a drag
let threshold = St.Settings.get().drag_threshold;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
let threshold = St.Settings.get().drag_threshold * scaleFactor;
if (!currentDraggable &&
(Math.abs(stageX - this._dragStartX) > threshold ||
Math.abs(stageY - this._dragStartY) > threshold)) {

View File

@@ -73,12 +73,9 @@ class AspectContainer extends St.Widget {
box.x1 += Math.floor(diff / 2);
box.x2 -= Math.ceil(diff / 2);
} else {
/* Restrict vertically */
/* Restrict vertically, align to bottom */
let height = box.get_width() / this._ratio;
let diff = box.get_height() - height;
box.y1 += Math.floor(diff / 2);
box.y2 -= Math.floor(diff / 2);
box.y1 = box.y2 - Math.floor(height);
}
}
@@ -884,7 +881,7 @@ var EmojiSelection = class EmojiSelection {
this._pageIndicator.setReactive(false);
let bottomRow = this._createBottomRow();
this.actor.add(bottomRow, { x_fill: true, y_fill: false });
this.actor.add(bottomRow, { expand: true, x_fill: false, y_fill: false });
this._emojiPager.setCurrentPage(0);
}
@@ -973,7 +970,16 @@ var EmojiSelection = class EmojiSelection {
row.appendKey(key.actor);
row.layoutButtons();
return row;
let actor = new AspectContainer({ layout_manager: new Clutter.BinLayout(),
x_expand: true, y_expand: true });
actor.add_child(row);
/* Regular keyboard layouts are 11.5×4 grids, optimize for that
* at the moment. Ideally this should be as wide as the current
* keymap.
*/
actor.setRatio(11.5, 1);
return actor;
}
};
Signals.addSignalMethods(EmojiSelection.prototype);

View File

@@ -160,6 +160,19 @@ var Monitor = class Monitor {
}
};
const UiActor = GObject.registerClass(
class UiActor extends St.Widget {
vfunc_get_preferred_width (forHeight) {
let width = global.stage.width;
return [width, width];
}
vfunc_get_preferred_height (forWidth) {
let height = global.stage.height;
return [height, height];
}
});
const defaultParams = {
trackFullscreen: false,
affectsStruts: false,
@@ -200,12 +213,8 @@ var LayoutManager = GObject.registerClass({
global.stage.no_clear_hint = true;
// Set up stage hierarchy to group all UI actors under one container.
this.uiGroup = new St.Widget({ name: 'uiGroup' });
this.uiGroup = new UiActor({ name: 'uiGroup' });
this.uiGroup.set_flags(Clutter.ActorFlags.NO_LAYOUT);
this.uiGroup.add_constraint(new Clutter.BindConstraint({
source: global.stage,
coordinate: Clutter.BindCoordinate.ALL,
}));
global.stage.remove_actor(global.window_group);
this.uiGroup.add_actor(global.window_group);

View File

@@ -1,6 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const { Atspi, Clutter, Cogl, GDesktopEnums,
const { Atspi, Clutter, GDesktopEnums,
Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
@@ -65,9 +65,7 @@ var MouseSpriteContent = GObject.registerClass({
if (!this._texture)
return;
let color = new Cogl.Color();
color.init_from_4ub(0, 0, 0, 0);
let color = new Clutter.Color();
let textureNode = new Clutter.TextureNode(this._texture,
color,
Clutter.ScalingFilter.NEAREST,

View File

@@ -774,10 +774,17 @@ class AggregateMenu extends PanelMenu.Button {
this._nightLight = new imports.ui.status.nightLight.Indicator();
this._thunderbolt = new imports.ui.status.thunderbolt.Indicator();
if (Main.sessionMode.components.includes('updates'))
this._automaticUpdates = new imports.ui.status.automaticUpdates.Indicator();
else
this._automaticUpdates = null;
this._indicators.add_child(this._thunderbolt.indicators);
this._indicators.add_child(this._screencast.indicators);
this._indicators.add_child(this._location.indicators);
this._indicators.add_child(this._nightLight.indicators);
if (this._automaticUpdates)
this._indicators.add_child(this._automaticUpdates.indicators);
if (this._network) {
this._indicators.add_child(this._network.indicators);
}
@@ -796,6 +803,8 @@ class AggregateMenu extends PanelMenu.Button {
if (this._network) {
this.menu.addMenuItem(this._network.menu);
}
if (this._automaticUpdates)
this.menu.addMenuItem(this._automaticUpdates.menu);
if (this._bluetooth) {
this.menu.addMenuItem(this._bluetooth.menu);
}

View File

@@ -92,9 +92,11 @@ const _modes = {
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
components: Config.HAVE_NETWORKMANAGER ?
['networkAgent', 'polkitAgent', 'telepathyClient',
'keyring', 'autorunManager', 'automountManager'] :
'keyring', 'autorunManager', 'automountManager',
'updates'] :
['polkitAgent', 'telepathyClient',
'keyring', 'autorunManager', 'automountManager'],
'keyring', 'autorunManager', 'automountManager',
'updates'],
panel: {
left: ['activities', 'appMenu'],

View File

@@ -0,0 +1,144 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
//
// Copyright (C) 2018 Endless Mobile, Inc.
//
// This is a GNOME Shell component to wrap the interactions over
// D-Bus with the Mogwai system daemon.
//
// Licensed under the GNU General Public License Version 2
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
const { Gio, GLib, Shell, St } = imports.gi;
const UpdateManager = imports.misc.updateManager;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const NM_SETTING_AUTOMATIC_UPDATES_NOTIFICATION_TIME = "connection.automatic-updates-notification-time";
const NM_SETTING_ALLOW_DOWNLOADS = 'connection.allow-downloads';
const NM_SETTING_TARIFF_ENABLED = "connection.tariff-enabled";
const SchedulerInterface = '\
<node> \
<interface name="com.endlessm.DownloadManager1.Scheduler"> \
<property name="ActiveEntryCount" type="u" access="read" /> \
<property name="EntryCount" type="u" access="read" /> \
</interface> \
</node>';
const SchedulerProxy = Gio.DBusProxy.makeProxyWrapper(SchedulerInterface);
var Indicator = class extends PanelMenu.SystemIndicator {
constructor() {
super();
this._indicator = this._addIndicator();
this._indicator.visible = false;
this._item = new PopupMenu.PopupSubMenuMenuItem("", true);
this._toggleItem = this._item.menu.addAction("", this._toggleAutomaticUpdates.bind(this));
this._item.menu.addAction(_("Updates Queue"), () => {
let params = new GLib.Variant('(sava{sv})', [ 'set-mode', [ new GLib.Variant('s', 'updates') ], {} ]);
Gio.DBus.session.call('org.gnome.Software',
'/org/gnome/Software',
'org.gtk.Actions',
'Activate',
params,
null,
Gio.DBusCallFlags.NONE,
5000,
null,
(conn, result) => {
try {
conn.call_finish(result);
} catch (e) {
logError(e, 'Failed to start gnome-software');
}
});
});
this._item.menu.addSettingsAction(_("Set a Schedule"), 'gnome-updates-panel.desktop');
this.menu.addMenuItem(this._item);
this._manager = UpdateManager.getUpdateManager();
this._manager.connect('notify::state', this._updateState.bind(this));
this._updateState();
}
_updateState() {
this._updateStatus();
}
_sessionUpdated() {
let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
this.menu.setSensitive(sensitive);
}
_updateStatus() {
// Toggle item name
this._updateItem();
// Icons
let icon = this._getIcon()
this._item.icon.gicon = icon;
this._indicator.gicon = icon;
// Only show the Automatic Updates icon at the bottom bar when it is
// both enabled, and there are updates being downloaded or installed.
this._updateVisibility();
// The status label
this._item.label.text = _("Automatic Updates");
}
_updateItem() {
let state = this._manager.state;
if (state == UpdateManager.State.DISABLED)
this._toggleItem.label.text = _("Turn On");
else
this._toggleItem.label.text = _("Turn Off");
}
_toggleAutomaticUpdates() {
this._manager.toggleAutomaticUpdates();
}
_getIcon() {
let state = this._manager.state;
let iconName = UpdateManager.stateToIconName(state);
if (!iconName)
return null;
let iconFile = Gio.File.new_for_uri(iconName);
let gicon = new Gio.FileIcon({ file: iconFile });
return gicon;
}
_updateVisibility() {
let state = this._manager.state;
this._item.actor.visible = (state != UpdateManager.State.DISCONNECTED);
this._indicator.visible = (state == UpdateManager.State.DOWNLOADING);
}
};

View File

@@ -46,15 +46,14 @@ var Avatar = class {
if (iconFile) {
let file = Gio.File.new_for_path(iconFile);
this.actor.child = null;
this.actor.style = 'background-image: url("%s");'.format(iconFile);
this.actor.style = `
background-image: url("${iconFile}");
background-size: ${this._iconSize}px`;
} else {
this.actor.style = null;
this.actor.child = new St.Icon({ icon_name: 'avatar-default-symbolic',
icon_size: this._iconSize });
}
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this.actor.set_size(this._iconSize * scaleFactor, this._iconSize * scaleFactor);
}
};

View File

@@ -1,5 +1,5 @@
project('gnome-shell', 'c',
version: '3.31.92',
version: '3.32.0',
meson_version: '>= 0.47.0',
license: 'GPLv2+'
)
@@ -23,7 +23,7 @@ gi_req = '>= 1.49.1'
gjs_req = '>= 1.54.0'
gtk_req = '>= 3.15.0'
json_glib_req = '>= 0.13.2'
mutter_req = '>= 3.31.92'
mutter_req = '>= 3.32.0'
polkit_req = '>= 0.100'
schemas_req = '>= 3.27.90'
startup_req = '>= 0.11'

View File

@@ -52,6 +52,7 @@ js/ui/search.js
js/ui/shellEntry.js
js/ui/shellMountOperation.js
js/ui/status/accessibility.js
js/ui/status/automaticUpdates.js
js/ui/status/bluetooth.js
js/ui/status/brightness.js
js/ui/status/keyboard.js

View File

@@ -330,7 +330,7 @@ msgstr "Netwerkaanmelding"
#. Translators: Do NOT translate or transliterate this text (this is an icon file name)!
#: data/org.gnome.Shell.PortalHelper.desktop.in.in:9
msgid "network-workgroup"
msgstr "netwerk-werkgroep"
msgstr "network-workgroup"
#: js/extensionPrefs/main.js:120
#, javascript-format

1067
po/et.po

File diff suppressed because it is too large Load Diff

765
po/hu.po

File diff suppressed because it is too large Load Diff

757
po/ja.po

File diff suppressed because it is too large Load Diff

1909
po/tg.po

File diff suppressed because it is too large Load Diff

View File

@@ -184,7 +184,7 @@ window_backed_app_get_icon (ShellApp *app,
int size)
{
MetaWindow *window = NULL;
ClutterActor *actor;
StWidget *widget;
gint scale;
ShellGlobal *global;
StThemeContext *context;
@@ -204,16 +204,20 @@ window_backed_app_get_icon (ShellApp *app,
if (window == NULL)
{
ClutterActor *actor;
actor = clutter_actor_new ();
g_object_set (actor, "opacity", 0, "width", (float) size, "height", (float) size, NULL);
return actor;
}
actor = st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
G_OBJECT (window),
"icon",
size);
return actor;
widget = st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
G_OBJECT (window),
"icon",
size);
st_widget_add_style_class_name (widget, "fallback-app-icon");
return CLUTTER_ACTOR (widget);
}
/**

View File

@@ -126,6 +126,7 @@ libst = shared_library('st-1.0',
sources: st_gir_sources + st_non_gir_sources,
c_args: st_cflags,
dependencies: [clutter_dep, gtk_dep, croco_dep, x11_dep, m_dep],
build_rpath: mutter_typelibdir,
install_rpath: mutter_typelibdir,
install_dir: pkglibdir,
install: true

View File

@@ -502,7 +502,7 @@ pixbuf_to_st_content_image (GdkPixbuf *pixbuf,
width *= paint_scale;
if (height < 0)
height = ceilf (gdk_pixbuf_get_width (pixbuf) / resource_scale);
height = ceilf (gdk_pixbuf_get_height (pixbuf) / resource_scale);
else
height *= paint_scale;
@@ -700,10 +700,14 @@ st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
{
g_autoptr(ClutterContent) image = NULL;
g_autoptr(GError) error = NULL;
int size = bind->size;
if (size < 0)
clutter_actor_get_preferred_width (bind->actor, -1, NULL, (float *)&size);
image = clutter_actor_get_content (bind->actor);
if (!image || !CLUTTER_IS_IMAGE (image))
image = st_image_content_new_with_preferred_size (bind->size, bind->size);
image = st_image_content_new_with_preferred_size (size, size);
else
g_object_ref (image);
@@ -767,27 +771,30 @@ st_texture_cache_free_bind (gpointer data)
* If the source object is destroyed, the texture will continue to show the last
* value of the property.
*
* Return value: (transfer none): A new #ClutterActor
* Return value: (transfer none): A new #StWidget
*/
ClutterActor *
StWidget *
st_texture_cache_bind_cairo_surface_property (StTextureCache *cache,
GObject *object,
const char *property_name,
gint size)
{
ClutterActor *actor;
StWidget *widget;
gchar *notify_key;
StTextureCachePropertyBind *bind;
actor = create_invisible_actor ();
clutter_actor_set_size (actor, size, size);
widget = g_object_new (ST_TYPE_WIDGET,
"opacity", 0,
"width", (float)size,
"height", (float)size,
NULL);
bind = g_slice_new0 (StTextureCachePropertyBind);
bind->cache = cache;
bind->actor = actor;
bind->actor = CLUTTER_ACTOR (widget);
bind->size = size;
bind->source = object;
g_object_weak_ref (G_OBJECT (actor), st_texture_cache_bind_weak_notify, bind);
g_object_weak_ref (G_OBJECT (widget), st_texture_cache_bind_weak_notify, bind);
bind->weakref_active = TRUE;
st_texture_cache_reset_texture (bind, property_name);
@@ -797,7 +804,7 @@ st_texture_cache_bind_cairo_surface_property (StTextureCache *cache,
bind, (GClosureNotify)st_texture_cache_free_bind, 0);
g_free (notify_key);
return actor;
return widget;
}
/**

View File

@@ -32,6 +32,7 @@
#include <st/st-types.h>
#include <st/st-theme-node.h>
#include <st/st-widget.h>
#define ST_TYPE_TEXTURE_CACHE (st_texture_cache_get_type ())
G_DECLARE_FINAL_TYPE (StTextureCache, st_texture_cache,
@@ -63,10 +64,10 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
GFunc load_callback,
gpointer user_data);
ClutterActor *st_texture_cache_bind_cairo_surface_property (StTextureCache *cache,
GObject *object,
const char *property_name,
gint size);
StWidget *st_texture_cache_bind_cairo_surface_property (StTextureCache *cache,
GObject *object,
const char *property_name,
gint size);
ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
StThemeNode *theme_node,

View File

@@ -119,6 +119,10 @@ st_theme_node_transition_new (StThemeNode *from_node,
return transition;
}
/**
* st_theme_node_transition_get_new_paint_state: (skip)
*
*/
StThemeNodePaintState *
st_theme_node_transition_get_new_paint_state (StThemeNodeTransition *transition)
{

View File

@@ -579,7 +579,11 @@ get_root_theme_node (ClutterStage *stage)
StThemeNode *
st_widget_get_theme_node (StWidget *widget)
{
StWidgetPrivate *priv = st_widget_get_instance_private (widget);
StWidgetPrivate *priv;
g_return_val_if_fail (ST_IS_WIDGET (widget), NULL);
priv = st_widget_get_instance_private (widget);
if (priv->theme_node == NULL)
{