Commit Graph

7362 Commits

Author SHA1 Message Date
Florian Müllner
39f61fc41c extensionSystem: Catch errors when updating extensions
Extension updates are installed at startup, so any errors that bubble
up uncaught will prevent the startup to complete.

While the most likely error reason was addressed in the previous commit
(pending update for a no-longer exitent extension), it makes sense to
catch any kind of corrupt updates to not interfere with shell startup.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2343
2020-03-17 14:19:20 +00:00
Florian Müllner
d3939a38a3 extensionDownloader: Remove pending updates with extension
When an extension is uninstalled, there is no point in keeping
a pending update: If the update didn't fail (which it currently
does), we would end up sneakily reinstalling the extension.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2343
2020-03-17 14:19:20 +00:00
Florian Müllner
b97fc02e57 networkAgent: Make searching VPN binaries asynchronous
Doing blocking IO in a graphical UI is bad, doing it in the compositor
is much much worse. So even if handling VPN requests is a relatively
rare event, doing it asynchronously is better.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2386
2020-03-17 14:07:15 +00:00
Florian Müllner
eb7533bbf1 networkAgent: Drop VPN plugin cache
libnm doesn't only search for plugins in the regular VPN plugin directory,
but also in the legacy location and the directory pointed to by the
NM_VPN_PLUGIN_DIR environment variable (if set).

We don't monitor the additional directories, so it's possible for our cache
to become outdated.

Instead of trying to play catch-up with libnm's internals, do what nm-applet
does and use the appropriate API to look up the plugin on each request.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2386
2020-03-17 14:07:15 +00:00
Florian Müllner
69ea038a8f extensionDownloader: Only check server if there's something to update
checkForUpdates() will currently always query the server for updates,
even when passing an empty vardict of installed extensions. We know
there won't be any updates in that case, so avoid a pointless network
request.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1100
2020-03-17 13:56:49 +00:00
Florian Müllner
b80115dc6e dateMenu: Don't ellipsize world clock time/tz
If we need to ellipsize, it should be the location name, not the time
or timezone offset.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1090
2020-03-17 13:44:30 +00:00
Florian Müllner
36b8dcbe07 a11y: Change HC icon theme first
There are two ways for applications to provide a high contrast icon:

 1. install an icon into the HighContrast theme
 2. install a symbolic icon into the default hicolor theme

The latter is preferred nowadays, and implemented in the high-contrast
CSS variant by enforcing the symbolic icon style.

However together with the way we currently enable/disable high-contrast,
this can lead to the following race:
 1. the GTK theme is changed from HighContrast
 2. we reload the default stylesheet
 3. the icon style changes to "regular", so we request a
    new icon from the HighContrast icon theme
 4. the icon theme is changed from HighContrast
 5. we evict existing icons from the cache
 6. we reload icons for the new icon theme; however as we
    find a pending request (from 3), we re-use it
 7. the request from 3 finishes, and we end up with a
    wrong icon in the cache

The simplest fix is to change the icon theme before the GTK theme: Unlike the
theme name, the icon style is encoded in the cache key, so we won't re-use
an old (and incorrect) request in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2414
2020-03-17 12:45:25 +01:00
Cosimo Cecchi
d9a75412c3 modemManager: Look for property on correct object
The SignalQuality property is defined on the GDBusProxy, not the modem
JS object.
Fix this runtime warning:

JS WARNING: [resource:///org/gnome/shell/misc/modemManager.js 252]: reference to undefined property "SignalQuality"
JS ERROR: TypeError: this.SignalQuality is undefined
_reloadSignalQuality@resource:///org/gnome/shell/misc/modemManager.js:252:34
_init@resource:///org/gnome/shell/misc/modemManager.js:234:14
NMDeviceModem@resource:///org/gnome/shell/ui/status/network.js:517:34
_deviceAdded@resource:///org/gnome/shell/ui/status/network.js:1755:27

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1097
2020-03-14 22:59:59 +01:00
Florian Müllner
66f9a9df81 js: Always use AppSystem to lookup apps
There is no good reason for bypassing the application cache in
AppSystem and loading .desktop files again.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1093
2020-03-14 20:33:36 +01:00
Florian Müllner
4bfdd677e3 calendar: Adjust for evolution changes
When launching the default calendar application, we special-case
evolution to make sure it starts up with the calendar component.

This is currently broken in two ways:

 - evolution changed its .desktop file to use reverse DNS notation

 - as evolution can now be distributed via flatpak, we can no longer
   assume that 'evolution-calendar.desktop' exists when evolution does
   (even though we ship the .desktop file ourselves, it is considered
   invalid if the executable isn't found)

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1093
2020-03-14 20:31:00 +01:00
Florian Müllner
002160e524 main: Unwatch notification proxy name after auto-start
We only "watch" the 'org.gnome.Shell.Notifications' name to start the
service, not to actually monitor name owner changes; so unwatch the
name once that's done.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2381
2020-03-12 23:29:40 +01:00
Florian Müllner
f2df347ddb main: Activate notification proxy on start
At least for the time being, this looks like the easiest option to
launch the service:

 - we could add a systemd unit, but then we'd need to update the
   RequiredComponents in the fallback session definition as well,
   making it necessary for gnome-shell, gnome-shell-extensions and
   gnome-session to be updated to 3.36.1 in lockstep

 - autostart is problematic as it would make gnome-shell conflict
   with other notification daemons; also autostart is most useful
   with automatic shutdown, which would require tracking signal
   subscriber to determine when the service is unused

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/547
2020-03-12 16:09:27 +00:00
Florian Müllner
799bbdb503 dbusServices/notifications: Add a separate notification daemon
Add a small service that exposes the Fdo notification API under the
well-known name, and forwards any requests to the actual implementation
in the shell.

That way any app with permission to talk to org.freedesktop.Notifications
will get exactly that, and nothing more.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/547
2020-03-12 16:09:27 +00:00
Florian Müllner
574c560677 dbusServices: Add some base classes for small stand-alone services
There are a couple of D-Bus services that are currently provided by
gnome-shell for which it makes sense to move them fully or partially
into separate processes:

 - screen recording (performance)
 - FDO notifications (security)
 - Extensions (portalization)

Add some base classes and build system glue to take care of the
common boilerplate.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/547
2020-03-12 16:09:27 +00:00
Christian Hergert
f8db5aa106 app-cache: add ShellAppCache for GAppInfo caching
This caches GAppInfo so that the compositor thread does not have to perform
costly disk access to load them. Instead, they are loaded from a worker
thread and the ShellAppCache notifies of changes.

To simplify maintenance, ShellAppCache manages this directly and the
existing ShellAppSystem wraps the cache. We may want to graft these
together in the future, but now it provides the easiest way to backport
changes to older Shell releases.

Another source of compositor thread disk access was in determining the
name for an application directory. Translations are provided via GKeyFile
installed in "desktop-directories". Each time we would build the name
for a label (or update it) we would have to load all of these files.

Instead, the ShellAppCache caches that information and updates the cache
in bulk when those change. We can reduce this in the future to do less
work, but chances are these will come together anyway so that is probably
worth fixing if we ever come across it.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2282
2020-03-11 18:06:15 -07:00
Carlos Garnacho
72c4f148ef windowManager: Do not shutdown ibus/xsettings on X11 compositor restart
These paths are meant for Xwayland, not for X11 compositors being restarted
through alt-f2 + r. Maybe some signal analogous to init-xserver should be
added for Xwayland shutdown paths, but this signal we are currently
listening for is backend agnostic.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/2329
2020-03-11 11:31:45 +00:00
Alynx Zhou
94f6976ddd ibusManager: fix ibus launch error because of wrong method name
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1080
2020-03-11 09:30:15 +00:00
Florian Müllner
a5a6c699c3 fileUtils: Remove some compatibility code
The condition was added to keep working with the then-stable version
of gjs. We already require a more recent version now, so the compat
code is effectively dead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1077
2020-03-09 13:18:48 +00:00
Florian Müllner
a0467bf875 js: Remove unused files from resources
fileUtils hasn't used Params since 2013, but was still importing it
until commit a1534dab02 ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1077
2020-03-09 13:18:48 +00:00
Florian Müllner
3d443d5b17 extensionPrefs: Stop escaping extension name
The corresponding label no longer uses markup, so we can and should use
the unescaped name.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2305
2020-03-08 01:07:18 +00:00
Jonas Dreßler
3155d03d9e appDisplay: Reload folder views on installed app changes
Since the FolderViews are not connected to the "installed-changed"
signal, we need to reload their apps by calling _redisplay() when an app
is removed or installed. We can't connect to "installed-changed" inside
FolderView because we need to ensure _redisplay() of the FolderView is
called before AppView tries to access the apps of the folder inside
_refilterApps(). So reload the FolderViews inside AllViews _redisplay()
implementation to ensure everything is up to date before accessing the
apps of the folder.

Since the "apps-changed" signal of FolderIcon now indirectly triggers a
_redisplay() of the FolderViews, the 'changed' handler of FolderView is
now redundant and can be removed. Because of this, we also need to move
the emission of the "apps-changed" signal to the start of the signal
handler to make sure the view is updated before we try to access items
of the view.

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

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
989c0ee49e appDisplay: Disconnect folder "changed" signal when actors are destroyed
We should disconnect the folders "changed" signal from the folder in
case the FolderView or FolderIcon is destroyed. While at it, also remove
the unused this._spaceReadySignalId of FolderIcon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
69f6c43b60 appDisplay: Implement an addApp() method for FolderViews
Similar to removeApp(), implement addApp() in FolderView to make adding
folders to views a bit more obvious.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
bf2d012e40 appDisplay: Rename _redisplay() functions unrelated to BaseAppView
The _redisplay() function is usally used for subclasses of BaseAppView
which want to implement their own _redisplay() function, having that
function name in two classes which have nothing to do with BaseAppView
can be quite confusing. Make those names less confusing and call the
functions  _sync() and _rebuildMenu() instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
711d4ba65c appDisplay: Properly hide overlay scrollbar in folders
Use the scroll-view policy ST_POLICY_EXTERNAL to hide the scrollbar
instead of setting its css properties to hidden, where it can still be
clicked but isn't visible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
4490463513 appDisplay: Remove the top padding from folder app grid
There already is a bottom padding defined for the name container of the
folder, so remove the top padding of the appGrid and make sure we can
show a few more icons inside the folder.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
1ec5117715 appDisplay: Take the viewBox into account for the contentBox of folders
The viewBox has a border applied, so when we call adaptToSize using only
the content box of the container, the width of the border is not removed
from the content box and the grid will be allocated less space than what
we told it before using adaptToSize.

Fix that by adjusting the content box for the size of the viewBox, too.
This makes sure the correct amount of columns can be shown inside a
folder, since right now we only show 3 colums even though 4 would fit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1011
2020-03-08 00:42:40 +00:00
Jonas Dreßler
3ddae9d815 slider: Include handle border radius when calculating center offset
Since 38da479ee we correctly ceil the non-integer radius of the slider
handle when calculating the offset for drawing the circle. Since the
handle also has a border with a width of 1px by default, we should also
factor that in when calculating the offset.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1569
2020-03-06 19:29:06 +00:00
Sebastian Keller
09a1e61c63 location: Update desktop file name for privacy settings
The location settings have been moved to their own panel with a
different desktop file:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/commit/f92f6f5c

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2316
2020-03-06 19:16:47 +00:00
Marco Trevisan (Treviño)
7345a6f276 main: Get the theme resource name from sessionMode
Along the lines of `styleSheetName`, a session mode may want to provide its
own gresource file, so make this possible via a `themeResourceName` session
mode parameter, defaulted to gnome-shell-theme.gresource

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1063
2020-03-06 19:09:25 +00:00
Florian Müllner
fda938175e shellDBus: Add new OpenExtensionPrefs method
Unlike any other methods in the Extensions API, LaunchExtensionPrefs()
opens what appears to be an application dialog, except that it is
really a separate application that the caller has no control over.

In order to address that, add a new OpenExtensionPrefs() method that
takes additional parameters (modelled after the desktop portal APIs)
that will make it possible to improve the behavior in the future.

The new parameters are ignored for now, but pushing the API out now
will allow us to fill in the functionality post the .0 release.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1074
2020-03-06 19:03:02 +00:00
Florian Müllner
3a39fb5ab8 shellDBus: Add UserExtensionsEnabled property
The 'disable-user-extensions' GSettings key is the last extensions-related
setting that isn't exposed over D-Bus, and therefore requires consumers
to access the GSettings directly.

Expose the setting as UserExtensionsEnabled readwrite property in the
org.gnome.Shell.Extensions interface to allow consumers to manage
extensions purely via D-Bus.

The 'disable-user-extensions' setting is the last extension-related
bit from the org.gnome.shell GSettings schema that is not exposed
via D-Bus.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1074
2020-03-06 19:03:02 +00:00
Carlos Garnacho
1a0ec782b5 ibusManager: Ensure to spawn --xim on non-wayland sessions
This (mistakenly) now only depends on signals triggered on Wayland
sessions. Hardcoding the XIM support on X11 sessions will make input
in some clients work again.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1690
2020-03-06 18:57:23 +00:00
Olivier Fourdan
a96753f085 windowManager: X11 can work without gsd-xsettings
Currently, a failure to start the Systemd unit `gsd-xsettings.target`
would be considered a failure to start Xwayland.

That means that if `gsd-xsettings.target` fails to start for whatever
reason, no X11 client can be used on Wayland.

However, XSettings is by no mean mandatory for X11 clients and many
legacy X11 clients do not implement XSettings. Those who do always have
a fallback path and therefore can still work without XSettings.

Make a failure to start the Systemd unit `gsd-xsettings.target` non
blocking for Xwayland, and just log a warning message.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1065
2020-03-06 18:50:52 +00:00
Florian Müllner
0dd171a7c8 environment: Fix date conversion
This is a regression from commit 06b690ff21:

GLib.DateTime.new() expects the full four-digit year, so passing
the abbreviated year from Date() will result in a bogus datetime.

Today is *not* Saturday March 2nd, 120 ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1061
2020-03-02 13:54:23 +01:00
Florian Müllner
ff2a736193 unlockDialog: Transition switch-user button with prompt
We ended up always showing the switch-user button on the lock screen,
as showing and hiding it with the prompt was too visually distracting.

But now that we have a fancy transition in place, we can easily extend
it to the switch-user button as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1029
2020-03-01 01:21:04 +00:00
Florian Müllner
c6cf81f28b unlockDialog: Simplify sensitivity handling
We only call _updateSensitivity() to make elements sensitive, and
nothing ever touches the sensitivity of the switch-user button; so
just call the corresponding authPrompt method directly, which is the
only bit that has an actual effect.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1029
2020-03-01 01:21:04 +00:00
Carlos Garnacho
104d1ae151 windowManager: Fix shutdown signal connection
This signal relied on mutter changes that were withdrawn
and it was unintended to use here. Restore the usage of
good old MetaDisplay::x11-display-closing.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1056
2020-02-29 23:47:46 +01:00
Carlos Garnacho
12e14884ef windowManager: Implement MetaDisplay::init-xserver hook
We do spawn gsd-xsettings, and watch its name before notifying on the
given task, so the mutter bits can proceed with X11 startup.

One notable change is that we only start gsd-xsettings, instead of the
generic gnome-session-x11-services target. We do so as we have to wait
on a dbus name to appear in order to deem the initialization done, and
making it all depend on gsd-xsettings seems tidier.

Less notably, we also use ::shutdown-xserver to shutdown the related
services. Its major benefit is that it'd allow us to ensure the olderly
shutdown of those services, but it's unused at the moment.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/836
2020-02-29 18:58:55 +01:00
Carlos Garnacho
3c4a5a67e2 ibusManager: Use setup X11 display for ibus-x11
(re)spawning ibus to get ibus-x11 will be part atm of Xwayland
initialization process. For it to be set up before the client
it needs using the GNOME_SETUP_DISPLAY.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/836
2020-02-29 18:58:47 +01:00
Daniel van Vugt
bd197789c1 js/ui: Subscribe touchpad gesture handlers to only touchpad events
The touchpad gesture handlers were receiving all events, all the time.
This meant that even mouse movements were getting translated into
JavaScript calls and then discarded by the handlers, which wasted CPU.

Now we subscribe the touchpad gesture handlers to only touchpad events.

Prequisite: https://gitlab.gnome.org/GNOME/mutter/merge_requests/1000

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/283

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/925
2020-02-29 13:39:17 +00:00
Jonas Dreßler
da05c85f3c windowManager: Show window resizing clone on "size-changed"
When a window is being resized by the compositor, with Wayland the
compositor first asks the window to change its size and emits the
"size-change" signal, and then emits the "size-changed" signal after
the window acknowledges the new size. To show a fancy resize animation,
gnome-shell creates a "screenshot" of the resizing window on the
"size-change" signal, and later animates that "screenshot" to the new
window size on the "size-changed" signal.

Now if a client is not responding to our requests asking it to change
its size, we get a "size-change" signal and start showing the
window-clone, but never a "size-changed" signal, animating and hiding
the clone again. This causes a so called "ghost window" that is shown
above everything else and never disappears again.

To fix that, start showing the window clone once we get the
"size-changed" signal instead of the "size-change" signal. This makes
sure the window actually updates its size and the clone is going to be
hidden again.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/1078

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1055
2020-02-28 18:08:24 +00:00
Florian Müllner
06b690ff21 environment: reduce calls to g_time_zone_new_local()
Creating a new GTimeZone for the local timezone can be quite expensive if
done repeatedly. It requires an open(), mmap(), and parsing of
/etc/localtime.

This patch was provided by Florian, and I've tested it as far back as
3.28.4 to ensure that we are really reducing the number of open() calls
on the compositor thread.

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

Signed-off-by: Christian Hergert <chergert@redhat.com>
2020-02-27 13:48:26 -08:00
Jonas Dreßler
51b7eb7a2b altTab: Don't fade out thumbnails on destroy
The thumbnails actor `this._thumbnails` has already been destroyed when
calling `_destroyThumbnails()` from the `destroy` signal handler because
it is a child actor of the AppSwitcherPopup. So stop destroying the
thumbnails separately (fading them out inside a destroy handler wouldn't
make sense anyway).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
023859ee4b switcherPopup: Use correct scroll-direction property
The correct property for the scroll-direction with scrolling events is
`direction`, no `scroll_direction`. This fixes scrolling in the alt-tab
popup, which broke with the actorization changes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
09acd0a3db switcherPopup: Always return true when the popup finished early
When the switcherPopup was initiated successfully, we return true,
otherwise the WindowManager will try to destroy it. Since an early
release of the keystroke will also switch to another application and
close the switcher just fine, we should return true to indicate success
here.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
bf213af362 switcherPopup: Lookup index of items when hovering or clicking
Right now the index that gets selected on click and motion events is set
when connecting the event inside the addItem function. If items are
added or removed (for example when an application is closed by pressing
"q"), this index isn't valid anymore and has to be updated.

To fix this, use the items themselves instead of the index as arguments
for the event handlers and lookup the index of the item inside the event
handler.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
bfb0bc7a29 switcherPopup: Implement functions to add and remove accessible states
Set the accessible states of the switcherList items by calling a
function instead of manipulating class-internal variables from outside
the class, which is considered bad practice.

The check whether the item at `_selectedIndex` exists can also be
removed since we always select a new index after an item was removed
(i.e. an app was closed) and destroy the alt-tab switcher right away if
no more items exist (see `SwitcherPopup._itemRemovedHandler`).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
c00f1d040b switcherPopup: Select correct item after removal of item
If an item was removed, make sure the selected item is still selected or
select the last one if the selected item was removed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00
Jonas Dreßler
ba7cfff90c switcherPopup: Disable hover on scrolling events
Just like with keyboard events, disable hover on scrolling events. Mouse
movements should not mess up the selection while scrolling.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
2020-02-26 22:46:51 +00:00