Commit Graph

12956 Commits

Author SHA1 Message Date
Florian Müllner
e357559582 cleanup: Mark globals used from other modules as exported
eslint cannot figure out that those symbols are used from other modules
via imports, so they trigger unused-variable errors. To fix, explicitly
mark those symbols as exported.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
71759a0769 cleanup: Mark unused (but useful) variables as ignored
While we aren't using those destructured variables, they are still useful
to document the meaning of those elements. We don't want eslint to keep
warning about them though, so mark them accordingly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
11b116cb9d cleanup: Remove some unhelpful unused variables in destructuring
We aren't using them, and they don't add much in terms of clarity,
so drop them to fix a couple of eslint errors.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
2f97a1a55d cleanup: Mark unused arguments as unused
This will stop eslint from warning about them, while keeping their
self-documenting benefit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
79cf3a6dd0 cleanup: Remove some unhelpful unused arguments
Those unused arguments aren't bugs - unbeknownst to eslint, they all
correspond to valid signal parameters - but they don't contribute
anything to clarity, so just remove them anyway.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
0257de1b7e lint: Allow marking variables/arguments as unused
Unused variables or arguments can indicate bugs, but they can also
help document the code, in particular in case of signal handlers
and destructuring.

Account for this by keeping the error, but set up patterns that allow
us to opt out of if for individual variables/arguments. For arguments
we pick a '_' prefix, while for variables we go with a suffix instead,
to not accidentally exempt private module-scope variables.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
466dc8da8f build: Automatically bump mutter API version each cycle
Mutter will now bump the API version automatically at the
beginning of a new development cycle; do the same here.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/641
2019-07-23 21:57:21 +00:00
Kristjan SCHMIDT
2c61badc02 Update Esperanto translation 2019-07-23 19:08:49 +00:00
Florian Müllner
3f8d3a7ee2 panel: Remove unused constant
This was left-over in commit 2743f18af, and probably is the real reason
why the busy spinner wasn't using the shared AnimatedIcon.Spinner class:
The animation there was much slower.

Still, let's keep the code as-is for now, if we really need a different
animation time, we can add an optional constructor parameter to the
Spinner class.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/640
2019-07-23 20:05:19 +02:00
Florian Müllner
a455860978 appDisplay: Indent with spaces rather than tabs
Another style nit that sneaked in with commit eaa32090b9.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/640
2019-07-23 20:05:19 +02:00
Florian Müllner
0ecf135a4b appDisplay: Add missing semicolon
This slipped through in commit eaa320 ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/640
2019-07-23 20:05:19 +02:00
Ray Strode
cebb6d40df appDisplay: Keep popup open on refresh
If the list of applications is refreshed we currently close
the open app folder.

This commit adds logic to reopen the app folder on reload.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
2019-07-23 14:53:24 +00:00
Ray Strode
0ee13672ee appDisplay: Add open method to FolderIcon
At the moment the only way to open a folder icon is to click on it;
there's no API to open the icon programmatically.

This commits adds an open method and makes the click handler use
it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
2019-07-23 14:53:24 +00:00
Ray Strode
49260a85ad appDisplay: Stop watching FolderIcon parent view when destroyed
When a FolderIcon is opened, it asks the parent view to allocate
space for it, which takes time.  Eventually, the space-ready
signal is emitted on the view and the icon can make use of the new
space with its popup.  If the icon gets destroyed in the
interim, though, space-ready signal handler still fires.

This commit disconnects the signal handler so it doesn't get called
on a destroyed icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
2019-07-23 14:53:24 +00:00
Ray Strode
da9f37e629 appDisplay: Add destroy handler for FolderIcon
It is important that the FolderView of a FolderIcon always
gets destroyed before the AppFolderPopup, since the view
may or may not be in the popup, and the view should
get cleaned up exactly once in either case.

This commit adds a destroy handler on FolderIcon to ensure
things get taken down in the right order, and to make sure
the view isn't leaked if it's not yet part of the popup.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
2019-07-23 14:53:24 +00:00
Ray Strode
164f3fa3fd appDisplay: Clear AllView reference to current popup when destroyed
AllView contains a reference to the current popup that lingers after
the popup is destroyed.

This commit fixes that, by explicitly nullifying when appropriate.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
2019-07-23 14:53:24 +00:00
Ray Strode
8e75d81a44 appDisplay: Add AppFolderPopup destroy handler
At the moment AppFolderPopup calls popdown on destruction,
which leads to open-state-changed getting emitted after
the actor associated with the popup is destroyed.

This commit handles ungrabbing and closing from an
actor destroy handler to side-step the open-state-changed
signal.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
2019-07-23 14:53:24 +00:00
Ray Strode
1d60c4d9d4 iconGrid: Clear meta_later callback on destruction
The IconGrid code sometimes sets up a callback to be invoked
later right before being destroyed.

This commit adds a destroy handler to cancel the callback.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
2019-07-23 14:53:24 +00:00
Ray Strode
eaa32090b9 appDisplay: Don't leak duplicate items in AppView
If an icon already exists in an app view with the same id, the
duplicate is not added on a call to addItem.  Unfortunately,
since it's not added, the icon actor gets orphaned and leaked.

This commit address the problem by introducing a new hasItem
method and disallowing callers to call addItem with a duplicate
in the first place.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
2019-07-23 14:53:24 +00:00
Daniel van Vugt
32ddb6f739 iconGrid: Add missing import for GLib
To silence warnings:

JS ERROR: ReferenceError: GLib is not defined
_updateIconSizes@resource:///org/gnome/shell/ui/iconGrid.js:771:9

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1462
2019-07-23 09:29:56 +00:00
Florian Müllner
2653402c5c js: Add missing return values to later_add() handlers
meta_later_add() is modelled after g_idle_add() and friends, and
the handler's boolean return value determines whether it should
be scheduled again or removed. There are some places where we omit
the return value, add them (although the implicit return value of
"undefined" already gives us the intended result).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/637
2019-07-22 20:48:16 +02:00
Florian Müllner
2743f18af4 panel: Use dedicated Spinner class
The startup/busy indication in the app menu was left out of commit
22e21ad7d1 because it doesn't use a hard-coded image, but as the
image in the CSS is actually the same used by the spinner class,
drop the "custom" styling and use the regular spinner.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/636
2019-07-22 17:50:52 +02:00
Florian Müllner
dd1fdf88ff extensionPrefs: Add missing return value
When commit a7ec7583aa merged two functions into one, it left
out the expected return value from one branch.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/635
2019-07-22 13:18:55 +00:00
Florian Müllner
2a041e9d8d lint: Enforce consistent return
While all javascript functions have a return value - either an explicit
one from a return statement, or an implicit "undefined" - mixing both in
the same function is almost certainly an oversight, and more often than
not a bug.

Enable the corresponding eslint rule to catch those errors.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/635
2019-07-22 13:18:55 +00:00
Rafael Fontenelle
1117f4760c Update Brazilian Portuguese translation 2019-07-22 02:49:59 +00:00
Asier Sarasua Garmendia
7dda7abf5e Update Basque translation 2019-07-21 18:27:36 +00:00
Florian Müllner
7ca3cca306 build: Bump gsettings-desktop-schemas requirement
... for the new disable-hot-corners setting.
2019-07-20 18:25:29 +02:00
Florian Müllner
d471e3a23b Bump version to 3.33.4
Update NEWS.
2019-07-20 17:47:10 +02:00
Didier Roche
ce1bee727a extensionSystem: Allow disabling session mode extensions
Trying to disable an extension that is enabled by the session mode
currently has no effect, which is clearly confusing. We could update
the various extension UIs to reflect that via sensitivity, but being
unable to configure extensions based on which session the user picked
at login isn't obvious either.

So instead, add a 'disabled-extensions' gsettings key to list extensions
that should not be enabled which takes precedence over 'enabled-extensions'
and can be used to disable session mode extensions.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Florian Müllner
43cb3754d9 extensionSystem: Store extensions in a Map
After making the extensions map private to the ExtensionManager, we can
switch it to a proper hash table which is more appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Florian Müllner
1d6ddf060b extensionSystem: Move extension loading into ExtensionManager
Now that extension loading and the extensions map are no longer shared
between the gnome-shell and gnome-shell-extension-prefs processes, we
can move both into the ExtensionManager which makes much more sense
conceptually.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Didier Roche
9928125e7d extensionPrefs: Switch to D-Bus API to get extension live state
By direclty using the underlying GSetting, whether or not an extension
appears as enabled or disabled currently depends only on whether it is
included in the 'enabled-extensions' list or not.

However this doesn't necessarily reflect the real extension state, as an
extension may be in error state, or enabled via the session mode.

Switch to the extensions D-Bus API to ensure that the list of extensions
and each extension's state correctly reflects the state in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Florian Müllner
1c63893c4b extensionPrefs: Override getCurrentExtension() for extensions
Extensions are used to calling the getCurrentExtension() utility function,
both from the extension itself and from its preferences. For the latter,
that relies on the extensions map in ExtensionUtils being populated from
the separated extension-prefs process just like from gnome-shell.

This won't be the case anymore when we switch to the extensions D-Bus API,
but as we know which extension we are showing the prefs dialog for, we
can patch in a simple replacement that gives extensions the expected API.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Didier Roche
a7ec7583aa extensionPrefs: Attach extension object to each row
Each row represents an extension, so it makes sense to associate the
rows with the actual extensions instead of linking rows and extensions
by looking up the UUID in the external extensions map in ExtensionUtils.

This will also make it much easier to stop using the shared extension
loading / map in favor of the extension D-Bus API.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Didier Roche
4a3476266f extensionSystem: Add canChange property to extensions
Whether or not an extension can be enabled/disabled depends on various
factors: Whether the extension is in error state, whether user extensions
are disabled and whether the underlying GSettings keys are writable.

This is complex enough to share the logic, so add it to the extension
properties that are exposed over D-Bus.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Florian Müllner
32e0b895a4 shellDBus: Add new 'ExtensionStateChanged' signal
The existing 'ExtensionStatusChanged' signal has a fixed set of parameters,
which means we cannot add additional state without an API break.  Deprecate
it in favor of a new 'ExtensionStateChanged' signal which addresses this
issue by taking the full serialized extension as parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Didier Roche
58806359ee extensionUtils: Add functions to (de)serialize extensions
Serializing an extension for sending over D-Bus is currently done by the
appropriate D-Bus method implementations. Split out the code as utility
function and add a corresponding deserialization function, which we will
soon use when consuming the D-Bus extension API from the extension-prefs
tool.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Didier Roche
4589da957b extensionSystem: Add methods to enable/disable extensions
Extensions are currently enabled or disabled by directly changing the
list in the 'enabled-extensions' GSettings key. As we will soon add
an overriding 'disabled-extensions' key as well, it makes sense to
offer explicit API for enabling/disabling to avoid duplicating the
logic.

For the corresponding D-Bus API, the methods were even mentioned in
the GSettings schema, albeit unimplemented until now.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Florian Müllner
6a4c55b852 extensionSystem: Make methods to call extension functions private
While public methods to enable/disable extensions make sense for an
extension manager, the existing ones are only used internally. Make
them private and rename them, so that we can re-use the current
names for more useful public methods.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Florian Müllner
ea17740719 extensionSystem: Turn into a class
The extension system started out as a set of simple functions, but
gained more state later, and even some hacks to emit signals without
having an object to emit them on.

There is no good reason for that weirdness, so rather than imitating an
object, wrap the existing system into a real ExtensionManager object.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Florian Müllner
d82810240f extensionUtils: Move ExtensionState definition here
It makes sense to keep extension-related enums in the same module instead
of spreading them between ExtensionSystem and ExtensionUtils.

More importantly, this will make the type available to the extensions-prefs
tool (which runs in a different process and therefore only has access to
a limited set of modules).

https://bugzilla.gnome.org/show_bug.cgi?id=789852
2019-07-20 14:17:35 +00:00
Florian Müllner
2768b73015 build: Clean out unused version requirements
We haven't linked to those libraries in years ...
2019-07-20 12:39:16 +02:00
Florian Müllner
f9a7718dda background: Adjust to gnome-desktop API break
gnome-desktop broke API in commit ca5d61cf24, as it didn't *add* a property
as incorrectly stated in the commit message, but *replaced* an existing one.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1457
2019-07-20 12:26:28 +02:00
Ting-Wei Lan
d9d9778a98 main: Avoid missing braces warnings when compiling with clang
Since -Werror=missing-braces is used, having missing braces warnings
aren't allowed. However, the first member of struct sigaction is a union
whose first member is a pointer, causing clang to produce warnings when
it is initialized to { 0 }.

Instead of initializing to a zero value, we can specify values of
members directly in the initializer to avoid warnings.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/633
2019-07-20 16:45:49 +08:00
Florian Müllner
bd5162105e power: Make sure we fall back to the correct icon
Commit bd18313d12 changed to a new naming scheme for battery icons,
and used to old icon names as fallback-icon-name for compatibility
with older/other icon themes.

However that fallback code isn't working correctly, as GThemedIcon's
default fallbacks will transform a name of `battery-level-90-symbolic`
to a list of names:
 - `battery-level-90-symbolic`
 - `battery-level-symbolic`
 - `battery-symbolic`

The last one frequently exists, so instead of the intended fallback,
we end up with a generic battery icon.

Address this by specifying the icon as GIcon instead of an icon-name,
where we have more control over how the icon is resolved.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1442
2019-07-19 19:11:37 +00:00
Florian Müllner
208c5e9562 shell: Don't use g_memmove()
Glib stopped providing any fallback implementations on systems without
memmove() all the way back in 2013. Since then, the symbol is a simple
macro around memmove(); use that function directly now that glib added
a deprecation warning.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/632
2019-07-19 17:43:56 +00:00
Florian Müllner
305e63750e workspacesView: Support horizontal layout
Just as we did for the workspace switcher popup, support workspaces
being laid out in a single row in the window picker.

Note that this takes care of the various workspace switch actions in
the overview (scrolling, panning, touch(pad) gestures) as well as the
switch animation, but not of the overview's workspace switcher component.

There are currently no plans to support other layouts there, as the
component is inherently vertical (in fact, it was the whole reason for
switching the layout in the first place).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/575
2019-07-19 11:01:24 +02:00
Florian Müllner
ab0f74aa15 workspaceSwitcherPopup: Support horizontal layout
While mutter supports a variety of different grid layouts (n columns/rows,
growing vertically or horizontally from any of the four corners), we
hardcode a fixed vertical layout of a single column.

Now that mutter exposes the actual layout to us, add support for a more
traditional horizontal layout as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/575
2019-07-19 11:01:24 +02:00
Jakub Steiner
43443d08ae theme: app icon helper tweaks
Shell cannot composite multiple shadows, simplify to only use one.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/168
2019-07-18 05:17:56 +02:00
Marco Trevisan (Treviño)
b82b553b9e extensionPrefs: Inherit from Gtk.Application
Extension preferences Application class is just a container for a GtkApplication
so instead of using composition we can inherit from the base GObject class.

Also replace signal connections with vfunc's.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/631
2019-07-17 12:59:08 +00:00