Commit Graph

79 Commits

Author SHA1 Message Date
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
017c410a6a native-window-placement: Use InjectionManager
The new convenience class was modelled after the code in the
extension, so it's a drop-in replacement.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/268>
2023-08-05 18:53:41 +02:00
Florian Müllner
f2c73329be extensions: Use new convenience classes
Convenience APIs for extensions are now provided as Extension/Prefs
base classes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/268>
2023-08-05 18:53:41 +02:00
Florian Müllner
e75a1a15ac extensions: Import ExtensionUtils as module
ExtensionUtils has been converted to ESM and split into two modules,
for extensions and prefs respectively.

Adjust to those changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/266>
2023-07-15 14:13:25 +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
701b14ecbf extensions: Use extension class for all extensions
This will be the only supported entry point when extension loading
switches to dynamic imports, so prepare for that by wrapping the
remaining standalone enable()/disable() methods in Extension classes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/259>
2023-07-07 00:12:41 +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
f637e81c8c native-window-placement: Minor style fix
JSDoc prefer "object" over "Object", so update the doc comment
accordingly.
2022-07-10 14:20:25 +02:00
Florian Müllner
6e4f4126b6 native-window-placement: Adjust to 42 changes
gnome-shell's new screenshot UI reuses the overview's window
picker layout, but its window previews don't give access to
the underlying MetaWindow.

Adjust to that by using the boundingBox property instead, which
is all we really need from the window anyway.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/229>
2022-05-19 19:08:59 +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
Sebastian Keller
4a26cecd7d native-window-placement: Remove custom styling
The window-picker padding was causing it to become smaller in the
overview resulting in a jump when opening it and caused sizing issues
with the workspace view in the app picker. However it is not needed
anymore with the new overview, so this can be fixed by simply removing
it.

The horizontal- and vertical-spacing properties got replaced with a
spacing property a while ago. However this is only used in
WorkspaceLayout::_createBestLayout() which gets overridden by this
extension which does not use it. So they can simply be removed.

The shell-caption-spacing property got removed when the window captions
got changed to always use the full length and has not been doing
anything since.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/301
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/309
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/189>
2021-11-17 12:37:28 +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
7062acf10f native-window-placement: Adjust to gnome-shell changes
More unsurprising breakage:
 - the workspace layout/strategy relation has been cleaned up
 - window previews now include an icon that influences the
   title position
 - window previews scale up on hover, which again influences
   the title position

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/164>
2021-03-10 15:26:26 +00:00
Florian Müllner
ba7e3fc0b5 cleanup: Remove empty leading/trailing lines in blocks
gjs added a new rule to its eslint ruleset that forbids "block padding",
so make sure we conform to that rule before syncing up the configuration.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/137
2020-11-14 00:58:52 +01:00
Florian Müllner
eff625fcb8 native-window-placement: Adjust to gnome-shell changes
The extension was affected pretty badly by the window picker overhaul;
adjust to all(?) the major and minor changes to get it to work again.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/124
2020-07-07 17:39:36 +02: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
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
63c07bdc73 cleanup: Don't shadow variables
Having variables that share the same name in overlapping scopes is
confusing and error-prone, and is best avoided.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
fdc3dda484 cleanup: Fix stray/missing spaces
Those are wrong according to our style guidelines, but the previous
eslint ruleset didn't catch them.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
fca516e58a cleanup: Disambiguate assignments in arrow functions
As arrow functions have an implicit return value, an assignment of
this.foo = bar could have been intended as a this.foo === bar
comparison. To catch those errors, we will disallow these kinds
of assignments unless they are marked explicitly by an extra pair
of parentheses.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
b6d02f8e1f cleanup: Use operator shorthands where possible
Shorthands like a += b are well-established, so prefer them over the
less concise a = a + b.

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
c721121a2d native-window-placement: Fix weird comment styles
Don't use gtk-doc style comments for regular comments, and WTF is
/// comment ////?!

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
2db4589dea cleanup: Re-order imports
They should be grouped between external (GI/gjs) and shell and in
alphabetical order. Until commit bab4be1a ExtensionUtils was special
as it was required for some imports, but that's no longer the case
for most extensions.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/76
2019-06-28 21:51:38 +02:00
Florian Müllner
e56f1a976e native-window-placement: Reindent to conform with new style
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:19 +02:00
Florian Müllner
81548ced69 native-window-placement: Clarify some code
Add some intermediate variables for better legibility.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/60
2019-03-04 19:35:10 +01:00
Florian Müllner
bab4be1a59 extensions: Drop Convenience library
Its methods are now provided by gnome-shell itself and can be used
as an easy drop-in replacement.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/44
2019-02-06 20:17:59 +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
3effc9cfc2 style: Fix indentation errors
While we have some style inconsistencies - mostly regarding split lines,
i.e. aligning to the first arguments vs. a four-space indent - there are
a couple of places where the spacing is simply wrong. Fix those.

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
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
aaeff6d12b style: Use camelCase for variable names
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
d7414025a5 cleanup: Remove unused variables
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
48399d46c0 cleanup: Port non-GObject classes to ES6 classes
ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:46 +01:00
Florian Müllner
30e7ff5a8f cleanup: Use method syntax
Modern javascript has a short-hand for function properties, embrace
it for better readability and to prepare for porting to ES6 classes.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:28 +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
ef99394ffb nativeWindowPlacement: Use custom strategy to hook into layout
Instead of copying a long function for a single changed line, wrap the
layout algorithm in a LayoutStrategy so the workspace code picks it
up without modifications.

https://bugzilla.gnome.org/show_bug.cgi?id=787934
2017-10-13 16:08:07 +02:00
Florian Müllner
778eebc421 nativeWindowPlacement: Handle captions-on-top settings changes
Currently the injection to move title captions to the top depends on
the value of the setting at the time the extension is enabled.
Instead, do the injections unconditionally and query the setting
inside the function to pick up settings changes.

https://bugzilla.gnome.org/show_bug.cgi?id=787934
2017-10-13 16:08:07 +02:00
Florian Müllner
97d1cbca19 naturalWindowPlacement: Don't copy relayout() function
To move title captions to the top, we can simply apply a translation
before calling the unmodified original function.

https://bugzilla.gnome.org/show_bug.cgi?id=787934
2017-10-13 16:08:07 +02:00
Florian Müllner
a0cae3d130 naturalWindowPlacement: Remove unused stuff
https://bugzilla.gnome.org/show_bug.cgi?id=787934
2017-10-13 16:08:07 +02:00
Florian Müllner
530b165ddf nativeWindowPlacement: Adjust to overview changes
title._spacing is no longer defined, so we end up with bogus positions
when window-captions-on-top is set to true. Adjust the positioning to
do without that for now, though the whole extension could use a rewrite
to not copy everything-and-the-kitching-sink, or be killed off as yet
another extension from the original random collection that turned out
too expensive to keep dragging along ...

https://bugzilla.gnome.org/show_bug.cgi?id=787604
2017-10-04 01:06:42 +02:00
Florian Müllner
db3e910b76 build: Say good-bye to intltool
intltool is unmaintained nowadays while upstream gettext gained
support for everything we used it for, so make the switch.

https://bugzilla.gnome.org/show_bug.cgi?id=769077
2016-08-19 22:17:07 +02:00
Florian Müllner
2b9ea7519b native-window-placement: Make sure that the border does not overlap the title
https://bugzilla.gnome.org/show_bug.cgi?id=758976
2015-12-04 11:38:35 +01:00
Florian Müllner
1634af39dc native-window-placement: Cut down on copy-pasted code
https://bugzilla.gnome.org/show_bug.cgi?id=758976
2015-12-04 11:38:35 +01:00
Florian Müllner
11b151e5e0 native-window-placement: Update for mutter API changes 2015-03-17 19:46:05 +01:00
Florian Müllner
f38d76db06 native-window-placement: Fix 'button-layout' schema
The defaults have been shifted around so that the normal session
uses the regular schema and classic mode overrides it, so the
key is no longer present in 'org.gnome.shell.overrides'.
2014-06-10 12:26:14 +02:00
Giovanni Campagna
2e5d8c7384 Fix a number of undeclared variable warnings
"for (prop in object)" needs a "var prop" before, or it declares
a global property.
2013-07-30 13:23:47 +02:00