690 Commits

Author SHA1 Message Date
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
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
1e44941db6 drive-menu: Remove unused style class
The .single-indicator class was added to add extra spacing to
lone top bar items when removing the arrows, but dropped again
after solving the extra spacing differently.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/161>
2021-02-24 00:45:58 +00:00
Florian Müllner
f71da9e843 window-list: Replace WorkspaceBackground as well
The shell now scales down the backgrounds and adds a rounded corner
clip. Undo both those changes with another override.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/160>
2021-02-24 01:24:11 +01:00
Florian Müllner
1b4a20a8af window-list: Replace Workspace prototype
This is arguably more elegant than injecting into individual methods, and
will be consistent with an upcoming override that cannot be implemented
as method injection.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/160>
2021-02-24 01:24:11 +01:00
Florian Müllner
d8e179ed09 window-list: Adjust to OSK changes
Visibility changes are now handled internally, without an easy way
for us to hook into. We can resort to a hack though, as the gesture
action to bring up the keyboard is only enabled while the keyboard
is hidden.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/160>
2021-02-24 01:24:11 +01:00
Florian Müllner
9fa522c29a window-list: Adjust to overview changes
The overview code changed significantly, including the bits we re-use
to implement the window picker in the classic session. Adjust to those
changes to unbreak the extension.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/159>
2021-02-12 02:20:20 +01:00
Florian Müllner
d7c8a5d193 extensions: Remove horizontal-workspaces extension
Workspaces are now horizontal by default, so we don't need to change
the layout for classic mode anymore.

That was the only reason why the extension was added, so it has now
outlived its usefulness.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/158>
2021-01-29 16:09:59 +00:00
Michael Lawton
0d8d6dceb0 places-menu: Mark mounts that can be unmounted as removable
While the eject() code falls back to unmount() for mounts that
don't support ejecting, it's not possible to actually do so
because we hide the eject button.

Fix this by treating all mounts as removable that can either be
ejected or unmounted.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/152>
2021-01-28 12:25:26 +01:00
Daniel van Vugt
8a5e793b3d auto-move-windows: Don't move windows already on all workspaces
This fixes a particular case of mutter#992.

Although gnome-shell will also be softened to not crash in future, it's
also a good idea for the extension to explicitly decide how it wants to
handle windows that are already on all workspaces.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/157>
2021-01-28 16:33:50 +08:00
Florian Müllner
ac2ed286e1 extensions: Remove arrows from top bar menus
... following the corresponding gnome-shell change.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3567

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/156>
2021-01-26 16:59:43 +01:00
Florian Müllner
3c3c1f702d window-list: Add tooltips to workspace thumbnails
When showing previews instead of the menu, the workspace names
don't appear anywhere. Some users care strongly about those, so
expose them as tooltip on hover.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/155>
2021-01-20 23:58:13 +01:00
Florian Müllner
c33be29f56 workspace-indicator: Add tooltips to workspace thumbnails
When showing previews instead of the menu, the workspace names from
our preferences don't appear anywhere. Some users care strongly about
those, so expose them as tooltip on hover.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/155>
2021-01-20 23:58:13 +01:00
Florian Müllner
d8ae2dcba2 window-list: Drop height override
gnome-shell's top bar got taller, and is now just 1px smaller than
our size override. We don't need that additional pixel to fit our
UI, so remove the override to make the sizes of both bars consistent.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/154>
2021-01-18 22:43:52 +01:00
Florian Müllner
d381a0b89b auto-move-windows: Use Gtk.Button.icon_name property
Image buttons are a very common pattern, so GTK4 added some
convenience API we can use to construct them.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
5df0fa145b workspace-indicator: Use Gtk.Button.icon_name property
Image buttons are a very common pattern, so GTK4 added some
convenience API we can use to construct them.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
f0ff0e1400 workspace-indicator: Stop using header func for separators
GTK4 added built-in support for this common pattern, so use that
instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
53f5a92dc8 user-theme: Stop using header func for separators
GTK4 provides built-in support for this common pattern, so use
that instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
d5c31273ee auto-move-windows: Stop using header func for separators
GTK4 added built-in support for this common pattern, so use that
instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
22ea58a849 workspace-indicator: Port to GTK4
With this port, all extensions now use GTK4 for their preferences.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
67d96993ce auto-move-windows: Port to GTK4
Just like the previous ports, this consists mostly of
replacing the old Gtk.Container methods.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
96dd4f9835 window-list: Port to GTK4
Another easy port:
 - replace Gtk.Container methods
 - stop using show_all()
 - Gtk.CheckButton now provides the
   Gtk.RadioButton functionality as well

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
3bef6be7c1 user-theme: Port to GTK4
With the previous preparations in place, the actual GTK4 port is
now trivial:
 - replace Gtk.Container methods with widget-specific methods
 - stop using show_all()

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:55 +01:00
Florian Müllner
b83d38a72e user-theme: Track GSettings to sync checkmark
GTK4 removes the generic GtkWidget API for accessing an inserted
action group, so we need an alternative for tracking the currently
selected theme.

Using the underlying GSettings object looks like the easiest option,
so do that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:54 +01:00
Florian Müllner
5b73960f34 extensions: Stop using :margin shortcut
The property has been removed in GTK4, so prepare for a port by
setting the four individual margin properties instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/148>
2021-01-14 14:40:54 +01:00
Florian Müllner
50d3ee5703 workspace-indicator: Use overlap to determine preview visibility
In order to better reflect the actual workspace, show any preview
that is at least partially located on the monitor, not only those
that have the major part on that monitor.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/142>
2020-12-02 19:27:44 +01:00
Florian Müllner
08dfb78815 window-list: Use overlap to determine preview visibility
In order to better reflect the actual workspace, show any preview
that is at least partially located on the monitor, not only those
that have the major part on that monitor.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/142>
2020-12-02 19:22:51 +01:00
Florian Müllner
6949a5d075 workspace-indicator: Account for monitor offset in window previews
Windows' frame rects are in screen coordinates, while the workspace
thumbnails are based on the monitor work area. Unless we account
for the difference, previews end up mispositioned in multi-monitor
setups.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/142>
2020-12-02 19:22:12 +01:00
Florian Müllner
893d3b0473 window-list: Account for monitor offset in window previews
Windows' frame rects are in screen coordinates, while the workspace
thumbnails are based on the monitor work area. Unless we account
for the difference, previews end up mispositioned in multi-monitor
setups.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/142>
2020-12-02 19:20:08 +01:00
Florian Müllner
f5128e13f2 workspace-indicator: Round calculated preview sizes
While not strictly necessary, there's no reason to differ from the
copy in the window-list extension ...

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/142>
2020-12-02 19:17:36 +01:00
Ray Strode
8318ea919f window-list: Stop monitoring drag operation if window list is destroyed
If a user is in the middle of a drag in the window list and the
window list associated with the drag gets destroyed, the drag
monitor gets leaked.

Later when the drag motion is processed, spew goes to the log:

clutter_actor_contains: assertion 'CLUTTER_IS_ACTOR (self)' failed

Examples of triggers for this bug:

- The monitor topology changes
- The screen gets locked during the drag

This commit fixes the spew and the leak by ensuring any pending
drag monitoring is disabled when the window lists are destroyed.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/145>
2020-11-25 17:48:21 +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
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