722 Commits

Author SHA1 Message Date
Jason Lynch
412762ae9d window-list: Set visibility based on the target monitor.
Currently, the visibility of the window list on a given monitor is set
according to the fullscreen status of the primary monitor. When a
fullscreen application is on a secondary monitor (but not on the primary
monitor), entering and exiting the overview will lead to the window list
incorrectly being visible on the monitor with the fullscreen
application.

Instead, determine the visibility based on the fullscreen status of the
monitor being evaluated.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/230>
2022-05-19 18:31:33 -07: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
a51145f9db window-list: Fix cleaning up signal on removal
The map uses windows as key, so trying to remove the handler ID
will leave stray windows/signals.

Spotted by Ron Yorston.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/225>
2022-03-29 17:06:40 +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
3c5a56b440 auto-move: Bind list to model
Using a model gives us a clear separation between data and representation,
as well as between regular rows and the "new item" row at the end.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/218>
2022-02-18 13:09:35 +01:00
Florian Müllner
725cf83551 auto-move-windows: Change 'update' action to 'rename'
Limiting the action to the row that changed instead of the list as
a whole makes it easier to only update the changed value and not
recreate the entire list.

This doesn't make a difference right now, because we carefully sync
the list to reuse existing rows, but we are about to back the list
with a GListModel instead of updating it manually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/218>
2022-02-18 13:08:09 +01:00
Florian Müllner
f91275ffd2 workspace-indicator: Bind list to model
Using a model gives us a clear separation between data and representation,
as well as between regular rows and the "new item" row at the end.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/218>
2022-02-18 13:02:17 +01:00
Florian Müllner
f0e46f4b12 workspace-indicator: Change 'update' action to 'rename'
Limiting the action to the row that changed instead of the list as
a whole makes it easier to only update the changed value and not
recreate the entire list.

This doesn't make a difference right now, because we carefully sync
the list to reuse existing rows, but we are about to back the list
with a GListModel instead of updating it manually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/218>
2022-02-18 12:55:57 +01:00
Florian Müllner
57f7f21ecb workspace-indicator: Bind name to action target
Since we now have an override for bind_properties_full(), we can
use that instead of an explicit notify handler.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/218>
2022-02-18 12:42:07 +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
0be8b10995 cleanup: Simplify action handling
GTK4 has dedicated API for widget-specific actions, make use of that
instead of explicitly managing an action group.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/215>
2022-02-18 03:34:06 +00:00
Florian Müllner
f7b5836c75 auto-move-windows: Use custom spin button in prefs
Gtk.SpinButton doesn't look great in lists, so replace it with a
small custom widget based on current mockups from the design team.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/213>
2022-02-12 02:05:50 +00:00
Florian Müllner
ffb2b27477 auto-move-windows: Use libadwaita's row widgets
We get to remove a bunch of boring code, and get something better
looking and more standardized in return.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/213>
2022-02-12 02:05:50 +00:00
Florian Müllner
dd3c524c49 prefs: Replace 'content' list style
It's deprecated in favor of 'boxed-list'.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/213>
2022-02-12 02:05:50 +00:00
Florian Müllner
b92973df00 cleanup: Simplify promisify() calls
If the finish function isn't specified, promisify will now try
to use the async name without '_async'/'_begin' suffix (if any)
and '_finish' appended.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/214>
2022-02-11 16:22:38 +01:00
Florian Müllner
0b7e8f9720 user-theme: Stop using Gio._LocalFilePrototype
Now that promisify() works on interfaces, we don't need this
cludge anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/214>
2022-02-11 16:22:38 +01:00
Florian Müllner
f6342d3b52 cleanup: Replace Promise wrappers
gjs now supports overriding interface methods, which means that
promisify started to work on interfaces.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/214>
2022-02-11 16:22:38 +01:00
Florian Müllner
013b3fb73c apps-menu: Adapt to Clutter.Grab changes
Device grabs are gone, switch to the new API.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/212>
2022-02-10 00:28:04 +01:00
Florian Müllner
69527857f8 window-list: Adapt to Clutter.Grab changes
pushModal() now returns a grab object that has to be passed to
popModal() to release the grab.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/212>
2022-02-10 00:12:22 +01:00
Florian Müllner
e0128a7817 window-list: Use libadwaita for preferences
libadwaita has now become stable and will be part of the GNOME 42
platform. Time to embrace it and get fancier preferences with
less code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/209>
2022-02-08 19:22:41 +00:00
Florian Müllner
62628b25c6 auto-move-windows: Use libadwaita for preferences
libadwaita has now become stable and will be part of the GNOME 42
platform. Time to embrace it and get fancier preferences with
less code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/209>
2022-02-08 19:22:41 +00:00
Florian Müllner
3f89b57c96 workspace-indicator: Use libadwaita for preferences
libadwaita has now become stable and will be part of the GNOME 42
platform. Time to embrace it and get fancier preferences with
less code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/209>
2022-02-08 19:22:41 +00:00
Florian Müllner
01537b401f user-theme: Use libadwaita for preferences
libadwaita has now become stable and will be part of the GNOME 42
platform. Time to embrace it and get fancier preferences with
less code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/209>
2022-02-08 19:22:41 +00:00
Florian Müllner
d340922fea window-list: Track window-created/unmanaged
Shell's WindowTracker switched to those signals instead of tracking
windows through MetaWorkspace's window-added/removed signals.

As ::window-created is only emitted after a window has been added to
its workspace, looking up its app on ::window-added now fails because
the window isn't tracked yet.

Address this by switching to the same signals for window tracking
(which is simpler anyway).

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/207>
2022-01-26 12:33:35 +00:00
Florian Müllner
8dd8d6f561 workspace-indicator: Fix cancelling editing with Esc
The CallbackAction's callback must return true to stop the event
from propagating to the dialog, where it will trigger the close
binding.

It makes sense to still allow closing the dialog with Escape while
not editing a row. The easiest way to achieve that is by moving the
controller to the entry.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/208>
2022-01-26 10:55:59 +00:00
Florian Müllner
02e5029eb6 window-list: Fix OSK
The reveal animation moved from Main.layoutManager.keyboardBox to
the keyboard itself, so instead of applying an additional translation
for the bottom panel, we override the translation that would reveal
the keyboard (and thus prevent it from showing altogether).

Fix this by moving our translation to the keyboardBox instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/199>
2021-11-26 20:01:40 +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
Just Perfection
762ec75601 user-theme: Extensions review guidelines compatibility
Extensions review guidelines enforces extensions to
don't create objects in the constructor of the class
that init() returns. so creating settings object in enable()
can make the extension compatible with the ego review guidelines.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/197>
2021-11-06 21:58:59 +00:00
Florian Müllner
7ba0e5b42c apps-menu: Stop using panel-main-menu shortcut
It's an old GNOME 2 shortcut that's no longer worth supporting in
the regular session. Instead, set up a new shortcut backed by our
own schema.

https://discourse.gnome.org/t/difference-between-show-the-overview-and-show-the-activities-overview-keyboard-shortcuts/6572

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/173>
2021-08-31 23:42:23 +02:00
Florian Müllner
201339345d window-list: Only show at the end of the overview transition
gnome-shell now considers the work area in the overview, so popping
up at the beginning of the overview transition is now more jarring
than at the end.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/185>
2021-08-26 23:36:53 +02:00
Florian Müllner
6ee4205f1e window-list: Fix initial visibility
Mutter uses an undefined initial in-fullscreen state, so it will
always emit the `in-fullscreen-changed` signal when it determines
the actual initial state.

This didn't use to be an issue when the shell started in the session,
but now results in the window list ending up visible in the overview
on startup.

Work around this by hiding ourselves again when the in-fullscreen
state changes in the overview.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/185>
2021-08-26 23:28:44 +02:00
Florian Müllner
cc45bd63ab cleanup: Use new gettext() convenience
gnome-shell now includes convenience helpers for gettext functions that
use an extension's text domain (as initialized by initTranslations()).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/183>
2021-08-14 23:15:56 +02:00
Florian Müllner
1340b209f9 window-list: Simplify radio handling
Instead of handling the active state manually and updating settings
on changes, we can use GActions to leave the nitty-gritty to GTK.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/181>
2021-08-13 05:22:41 +02: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
6284b0c489 window-list: Move functions into base class
The helper functions date back to a time when AppButton and WindowButton
were unconnected classes. But nowadays they share a common base class, so
we have a better place for them than external helper functions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/180>
2021-08-13 04:39:00 +02:00
Florian Müllner
0d06cc685e extensions: Pick up gettext domain from metadata
Since commit a6ee142f21, the extension archives that are uploaded
to extensions.gnome.org only contain strings that are relevant for
the extension, not all translations from all extensions.

Unfortunately all extensions still share a common gettext domain,
so the extension with the last bind_textdomain() call wins and
leaves the others without translations.

We'll address this by using distinct domains when not installed
system-wide. That becomes easier if there is a canonical place
for the text domain, with the existing metadata key being the
natural choice.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/179>
2021-08-11 18:42:43 +02:00
Florian Müllner
d421bbfa60 drive-menu: Hide items initially
Now that the check for network mounts is non-blocking, the initial
sync doesn't take effect immediately. We don't want hidden items
to briefly flash the indicator, so create them initially hidden.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/176>
2021-07-13 11:54:21 +02:00
Florian Müllner
3539ce1139 drive-menu: Fix indicator visibility
Commit 519269be9d made the check for network mounts non-blocking, and
we now update the indicator's visibility before a newly-added network
mount is hidden.

Address this by monitoring the item itself for visibility changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/176>
2021-07-13 11:46:16 +02:00
Florian Müllner
94b907f46d window-list: Init translations
Whoops, we are missing the bindtextdomain() call, which means translations
won't work when no other extension that shares the same domain is used
(like in GNOME Classic for instance).

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/174>
2021-07-12 16:04:50 +00:00
Florian Müllner
519269be9d drive-menu: Avoid blocking I/O when querying filesystem
The last commit improved the heuristics for detecting network mounts,
but at the price of potentially blocking the shell. Avoid that drawback
by making the code in question async.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/27>
2021-06-23 18:15:42 +02:00
Florian Müllner
7d6670ce3c drive-menu: Don't assume mounts without volume are local
The intention of the code is to only expose actually plugged in
devices rather than network mounts, but the existing heuristics are
based on GVolume and simply assume a local mount where there's no
associated volume. Fill that gap by querying the ::remote filesystem
attribute in that case.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/27>
2021-06-23 17:52:19 +02:00
Adam Goode
d6648b0b5c window-list: Don't use panel-button class for the workspace indicator
The panel-button introduces some horizontal padding which is insensitive
to scroll events. Without this change, there is a small dead zone in the
corner that cannot be used to switch workspaces with the mouse wheel.

For useMenu mode, this has the effect of removing all of the horizontal
space to the edge of the screen, so I add some back with the
status-label-bin margin.

This a is similar change to 8bad8a3b63.

Fixes #315.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/171>
2021-05-26 11:57:41 +00: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
5be44705f7 window-list: Improve preview styling
The current styling doesn't indicate the active workspace very well, and
makes it difficult to differentiate empty workspaces from workspaces with
maximized windows.

Tweak the styling to address those issues.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/166>
2021-03-11 12:08:38 +00:00
Florian Müllner
fdfa46099b workspace-indicator: Improve preview styling
The current styling doesn't indicate the active workspace very well, and
makes it difficult to differentiate empty workspaces from workspaces with
maximized windows.

Tweak the styling to address those issues.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/166>
2021-03-11 12:08:38 +00:00
Florian Müllner
f987e5f13d workspace-indicator: Reindent stylesheet
For some reason the CSS here uses a different indentation than
gnome-shell or the other extensions, fix that.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/166>
2021-03-11 12:08:38 +00:00
Florian Müllner
c766230118 window-list: Only show previews for up to six workspaces
On request of GNOME Classic users, we add GNOME2-like workspace previews
when using a horizontal workspace layout. The previews scale a lot worse
than the menu though, with the risk that they take up all the available
width in extreme cases.

Address this by also taking the number of workspaces into account, and
switch to the menu when we have more than six.

This is particularly important now that we switched to a horizontal
layout by default.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/165>
2021-03-10 20:11:18 +01:00
Florian Müllner
bb2b1204b4 workspace-indicator: Only show previews for up to six workspaces
On request of GNOME Classic users, we add GNOME2-like workspace previews
when using a horizontal workspace layout. The previews scale a lot worse
than the menu though, with the risk that they take up all the available
width in extreme cases.

Address this by also taking the number of workspaces into account, and
switch to the menu when we have more than six.

This is particularly important now that we switched to a horizontal
layout by default.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/165>
2021-03-10 20:11:18 +01: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