Commit Graph

71 Commits

Author SHA1 Message Date
Florian Müllner
d10b98c4fc extensions: Stop using ClutterContainer API
The methods have long been deprecated in favor of the equivalent
ClutterActor methods, so use the latter instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/288>
2023-11-14 16:26:06 +00:00
Florian Müllner
b7f285d733 Make project compatible with Reuse Software spec
Provide all licenses used in the project in a LICENSES folder and
add SPDX license and copyright information for all files in
accordance with the Reuse Software[0] specification.

The copyright information is based on the file's git history,
using a fairly generous definition of "non-trivial".

As of the spec recommendation, the information is generally added
as comments in the files themselves, except for

 - NEWS, README and similar top-level standard files, so that
   a SPDX code isn't the first thing people encounter
 - files that don't support comments (json) or where they'd
   be a bit awkward (.desktop, .service)
 - anything under po/, to not interfere with translation teams

Those are covered by a .reuse/dep5 files, except for image assets,
where separate .license files are used (It would be possible to
add comments to SVG files, but I don't trust image editors to
preserve them).

[0] https://reuse.software/

Part-of:
<https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/224>
2023-08-17 11:51:48 +00:00
Florian Müllner
a911447375 js: Port to ESM
The shell pulled the trigger and switched to ESM for all its
imports, follow suit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/269>
2023-08-06 15:59:35 +02:00
Florian Müllner
cb8c2eb27f windowsNavigator: Use InjectionManager instead of custom classes
Once the shell is ported to ESM, it will no longer be possible
to replace entire classes (even when exported). Prepare for that
by overriding methods of the regular classes, instead of creating
custom subclasses.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/268>
2023-08-06 13:45:56 +02:00
Florian Müllner
6d8f54a20b js: Really use connectObject()
I forgot in two places to change the actual connect() function
to connectObject() 🤦️

Fixes commit 3bfaf6f88a.
2023-07-10 07:22:25 +02:00
Florian Müllner
93a2e7bdba extensions: Stop using global.log()
It has been deprecated since 3.6(!) in favor of the actually
global log().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/264>
2023-07-10 06:51:45 +02:00
Florian Müllner
3bfaf6f88a js: Use connectObject()
gnome-shell added (dis)connectObject() methods to partially automate
signal handling. It doesn't only save a significant amount of code,
but also makes it harder to miss cleaning up on destroy.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/263>
2023-07-09 18:45:07 +02:00
Florian Müllner
cf007dd472 extensions: Turn extensions into modules
As gnome-shell is moving to ESM, it will now load extensions as
standard modules instead of using legacy imports. The change boils
down to exporting the Extension class as default, but we can also
start using standard imports for introspected modules now, so do
that at the same time.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/259>
2023-07-07 00:35:08 +02:00
Florian Müllner
563d7770d3 lint: Sync with gnome-shell
gnome-shell started transitioning to gjs' object spacing rule,
i.e. `{foo: 42}` instead of `{ foo: 42 }`.

We have a much smaller code base than the shell and aren't using
a secondary "allowed-but-deprecated" configuration that allows a
gradual transition, so just pull the switch and update to the new
style.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/240>
2022-08-20 19:00:32 +02:00
Florian Müllner
72a9696249 build: Remove unused stylesheets
The only reason for installing empty stylesheets is minimizing
build system differences between extensions. That's not a very
good reason and we don't do this for other optional files like
schemas.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/223>
2022-03-24 00:53:13 +01:00
Florian Müllner
9f673f27ef cleanup: Use static class blocks for gtype registration
gjs enabled support for static class blocks, which gives us a
less error-prone and more readable alternative to _classInit(),
provided we make sure to call registerClass() first.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/215>
2022-02-18 03:34:06 +00:00
Florian Müllner
08db193b31 cleanup: Use regular constructors in GObject subclasses
As a side-effect of supporting class fields, regular constructors
now work in GObject subclasses. Using _init() still works and
there's no functional difference, but it's simply much nicer
to use the same syntax for all classes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/215>
2022-02-18 03:34:06 +00:00
Florian Müllner
d0b9c9b54a cleanup: Document functions
gjs now enforces this in its eslint configuration. Adding type
information generally is a good idea, so add appropriate comments
to public functions before picking up that configuration change.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/180>
2021-08-13 04:48:22 +02:00
Florian Müllner
e094dead91 windowsNavigator: Adjust to gnome-shell change
Parts of WindowPreview were moved to C for performance reasons, which
turned a formerly private JS property into a GObject property.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/302

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/170>
2021-04-08 16:38:40 +02:00
Florian Müllner
cf3690a434 windowsNavigator: Adjust to gnome-shell changes
Unsurprisingly, the big overview changes in gnome-shell broke the
extension. Make the necessary adjustments to get it working again:
 - changed constructor parameters for Workspace/WorkspacesView
 - overall state handling done by adjustment
 - window preview layout changes

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/296

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/163>
2021-03-10 15:28:37 +00:00
Thun Pin
737c897624 window-navigator: Adjust to 3.38 overview changes
gnome-shell's overview code changed significantly in 3.38,
adjust the extension to work without the separate overlay.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/259
2020-11-18 23:54:18 +00:00
Florian Müllner
330e7b312d windowsNavigator: Adjust to deprecated API removal
The old raise/lower methods have been deprecated for years, and
mutter finally removed those APIs.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/104
2020-01-26 23:30:55 +01:00
Florian Müllner
01f921541f windowsNavigator: Use normal inheritance for non-GObject class
More fallout from commit 63615cb657.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/104
2020-01-26 23:30:55 +01:00
Florian Müllner
cc52f4a260 windowsNavigator: Add missing imports
Commit 63615cb657 missed that, which is an easy mistake to make.

But how on earth did CI not catch this?!

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/104
2020-01-26 23:25:38 +01:00
Florian Müllner
30ad3d670f extensions: Stop setting GTypeName
The type name generated by gjs now includes the filename, so we
don't have to set it ourselves to make sure it's unique.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/95
2019-11-21 22:25:43 +01:00
Marco Trevisan (Treviño)
63615cb657 cleanup: Use inheritance for Actor classes instead of composition
Use GObject types when inheriting from native actor classes.

Related to https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/89
2019-11-21 21:22:26 +00:00
Florian Müllner
7c170e7e90 cleanup: Always use type-safe comparisons
The type coercion performed by the regular == and != operators can
have surprising results. It is therefore considered good practice
to use the type-safe === and !== variants instead.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
ed7a292805 cleanup: Don't use comparison operator when checking falsy values
We mostly use the regular == and != comparison operators over their
type-safe === and !== counterparts. This is about to change, but there
are some places where we don't care whether a value is null, undefined
or 0; just check for falsiness there instead of using operators, so
we can start to consistently use the type-safe operators everywhere
else in a follow-up commit.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
eb79f5b512 cleanup: Require "dangling" commas
Since ES5, trailing commas in arrays and object literals are valid.
We generally haven't used them so far, but they are actually a good
idea, as they make additions and removals in diffs much cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
eceff51ba1 cleanup: Use consistent brace style of blocks
Our coding style has always been to avoid braces when all blocks
are single-lines. Make sure we apply that style consistently.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
2497dc6d31 cleanup: Use object destructuring where possible
ES6's destructuring is a nice way of assigning a variable in a concise way,
without duplicating the name of the object property. Use it consistently
where possible.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
e217f23767 cleanup: Avoid unnecessary parentheses
Extra parentheses usually add noise rather than clarity, so avoid
them.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
376502e952 windowsNavigator: Don't add linebreak before operator
When breaking overly long conditions into multiple lines, the operator
should end the previous line instead of starting the new one.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
3671d5a299 cleanup: Use an extension object instead of globals
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/143
2019-04-08 06:00:29 +00:00
Florian Müllner
a024d9f005 windowsNavigator: Use subclasses instead of injections
gnome-shell moved to ES6 classes, which means the constructor is
no longer a regular method that we can swap out with an injected
version.

Instead, do our modifications in subclasses and use them to replace
the original classes.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/143
2019-04-08 06:00:29 +00:00
Florian Müllner
db35d7ae7c style: Change indentation style of object literals
Instead of keeping the first property on the same line as the opening
brace and aligning the properties, use a four-space indent. This brings
us closer to gjs' coding style, and as a bonus helps keeping lines in
the soft 80 character limit.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/57
2019-02-28 23:29:24 +01:00
Florian Müllner
0d41643866 cleanup: Use destructuring for imports from GI
This is *much* nicer than repetitive "imports.gi" lines ...

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/54
2019-02-16 00:49:44 +01:00
Florian Müllner
3861ffae31 extensions: Mark exported symbols
eslint obviously doesn't know about gnome-shell's extension API, so
the various entry points trigger unused-variable errors. To fix,
explicitly mark those symbols as exported.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50
2019-01-28 06:51:20 +01:00
Florian Müllner
08a04b2f02 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-extensions/merge_requests/50
2019-01-28 06:51:09 +01:00
Florian Müllner
7b363fd659 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-extensions/merge_requests/50
2019-01-28 06:51:02 +01:00
Florian Müllner
1be7061da0 style: Fix stray/missing spaces
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
f75d1d75af style: Fix stray/missing semi-colons
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
b741b1bbe2 cleanup: Remove empty init() functions
The method is optional, so there's no point at all in letting the
shell call an empty method during initialization.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
a317d75f70 cleanups: Clean up unused imports
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Jonas Ådahl
6583eae622 Remove usage of MetaScreen
As of the libmutter API version 3 MetaScreen does no longer exist.
Functionality that previously depended on MetaScreen has been moved
elsewhere (e.g. MetaDisplay or MetaWorkspaceManager etc).

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:53:08 +02:00
Florian Müllner
ba27cc4a64 cleanup: Get rid of Lang.bind()
After replacing Lang.Class with ES6 classes and adopting arrow notation
for anonymous callbacks, we only use the Lang module to bind `this` to
named callbacks. However since ES5, this functionality is already provided
by Function.prototype.bind() - in fact, Lang.bind() itself uses it when
no extra arguments are specified.

So just use the built-in function directly instead of the wrapper.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:52 +01:00
Florian Müllner
968ae427f1 cleanup: Use arrow-notation for anonymous functions
Arrow notation is great, but as we only started using it recently,
we currently have a wild mix of Lang.bind(), function() and () => {}.
To make the style consistent again, change all anonymous functions
to arrow notation.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:40:32 +01:00
Florian Müllner
ba38019049 build: Remove autotools support
Complete the switch to meson and drop autotools support ...

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31
2017-12-01 17:43:21 +01:00
Florian Müllner
3ab01aebec build: Support the meson build system
Meson is on track to replace autotools as the build system of choice,
so support it in addition to autotools.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31
2017-12-01 17:41:04 +01:00
Florian Müllner
8c551ba8ee windowsNavigator: Use regular for() loops
"for each ... in" has been deprecated for a long time and won't be
supported in upcoming SpiderMonkey versions, so replace it with
"for ... of" instead.
2017-10-26 20:03:12 +02:00
Giovanni Campagna
01f168341f windowsNavigator: update for gnome-shell changes 2013-09-03 10:36:31 +02:00
Giovanni Campagna
274a6f040c Update descriptions of extensions
Mark classic mode extensions as such, so bug reports don't go
lost in my inbox.
2013-05-20 19:06:59 +02:00
Giovanni Campagna
5052c6d350 windowsNavigator: update for gnome-shell changes
The position of a workspace is not part of a geometry object.
2013-05-01 00:45:06 +02:00
Giovanni Campagna
348f0faf22 windowsNavigator: fix a warning in disable() 2013-02-04 23:58:33 +01:00
Giovanni Campagna
b907e44fdf windowsNavigator: update for gnome-shell changes
Update for the new way to layout window overlays
2013-02-04 23:52:17 +01:00