Commit Graph

8349 Commits

Author SHA1 Message Date
Florian Müllner
26dc0fcd32 appDisplay: Avoid a warning
At least the last stable release of gjs has an issue with async
handlers for custom (i.e. defined in JS) GObject signals.

The handler still works, but evoking it prints the following warning:

  JS ERROR: Error: Could not guess unspecified GValue type

We can avoid the warning by using the addAction() convenience
method, which makes for a small nice cleanup anyway.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1938>
2021-08-09 14:08:09 +00:00
Florian Müllner
19fc6ef5dd powerProfiles: Tweak profile names
After some more discussion, we settled on slightly different
profile names.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1939>
2021-08-09 13:50:13 +00:00
Florian Müllner
f1320bd250 status/powerProfiles: Add power mode selection
Settings' power panel gained support for switchable power profiles
in GNOME 40. It's useful to have that functionality more readily
available, so expose it in the system status menu as well.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1907>
2021-08-02 16:41:06 +02:00
Florian Müllner
8f42053b5f magnifier: Small cleanup
Use an early return instead of a big if() block to cut down on
indentation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1932>
2021-07-31 17:18:08 +00:00
Florian Müllner
77b175e763 magnifier: Remove unused return value
Before the introduction of PointerWatcher, the method was used as
a timeout handler. That hasn't been the case since 2012, so drop
the return value.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1932>
2021-07-31 17:18:08 +00:00
Florian Müllner
1ea4d72fe5 magnifier: Don't query pointer unless necessary
The PointerWatcher passes the current pointer position to every watch,
so we don't have to query the pointer again scrollToMousePos() is used
as watch callback.

While that should be the only use, be conservative and still query the
pointer when called without arguments.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1932>
2021-07-31 17:18:08 +00:00
Ray Strode
a4123887c1 shellEntry: Don't show "Show Password" menu if entry icon is disabled
Right now the Show Password menu is shown unconditionally for password
entries, ignoring the org.gnome.desktop.lockdown disable-show-password
key.

StShellEntry now honors that key for its peek icon, and there's little
reason for the peek icon and the menu to ever be out of sync.

This commit forces the menu and the icon to always be in sync, and
so makes the menu lock down work automatically, too.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/687>
2021-07-30 14:17:07 +00:00
Jonas Dreßler
67596e7c83 Revert "workspaceAnimation: Allow long swipes in session"
The behavior when switching workspaces now with the touchpad gesture is
very very weird, it almost always swipes to the last workspace instead
of the next one.

So revert this change again and only swipe a single page per gesture. We
can enable long swipes again when we've figured out a proper way to
detect what the user wants (which is going to be quite challenging), see
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4355.

This reverts commit dfae3281b9.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1933>
2021-07-30 13:46:35 +00:00
Sebastian Keller
bb8daaeb2f keyboard: Use microseconds for notify_keyval()
ClutterVirtualInputDevice::notify_keyval() expects time to be in
microseconds but Clutter::get_current_event_time() returns the time in
milliseconds. On Wayland the generated event triggers all the warnings
in MetaDisplay::sanity_check_timestamps() due to the event time
seemingly being in the past.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1926>
2021-07-29 20:18:51 +00:00
Sebastian Keller
eee2ccac7a workspace: Only change opacity of minimized windows during transitions
Dragging a window preview in the overview is supposed to change the
opacity of the dragged actor. This however fails for minimized windows,
because Workspace::allocate() also changes the opacity of those. The
allocation gets triggered by removing the window actor from the
workspace when starting the drag. Avoid this by only changing the
opacity during the overview transitions.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1847>
2021-07-23 12:38:12 +02:00
Ray Strode
118d556991 unlockDialog: Honor switch user lockdown settings
At the moment user switching functionality is controlled by two
settings:

org.gnome.desktop.lockdown disable-user-switching

for the panel when the session is unlocked, and

org.gnome.desktop.screensaver user-switch-enabled

for the unlock dialog when the session is locked.

Having the lockdown setting not apply when the screen is
locked is counterintuitive.

This commit makes the unlock dialog honor both settings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1833>
2021-07-22 16:17:29 -04:00
vanadiae
25ece58538 theme: Add focus indication for dnd switch in message list controls
It currently is difficult to see what's being focused in the messages list
currently because of that.

Fixes #2447

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1920>
2021-07-20 20:58:59 +02:00
vanadiae
7dd7714fd2 popupMenu: Remove can_focus=True from Switch
Since this is a bin and not a button, and it doesn't have any click/keyboard
handling on its own (as in that case it needs a parent button wired like in
the messages list controls), it is confusing that it has can_focus set to
True. To avoid any confusion, this commit removes it without breaking anything
since it had no real use.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1920>
2021-07-20 14:11:28 +02:00
Florian Müllner
df76c3fd11 Update links to use HEAD instead of master
That way the link will keep working when projects change their
default branch name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1914>
2021-07-18 21:45:46 +00:00
Florian Müllner
56da0f6561 js: Replace removed Meta.quit()
This one was moved to Meta.Context as well.

I don't know why the `debugexit` command quit with an error code
(it dates back all the way to commit 98bd590a5d). Terminating on
request by the user doesn't sound like an error, so don't replicate
that particular behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1917>
2021-07-18 23:11:43 +02:00
Florian Müllner
d8be637dca main: Replace Meta.register_with_session()
The functionality moved into the new Meta.Context.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1917>
2021-07-18 23:11:43 +02:00
Ian Douglas Scott
e3a1d84992 location: Split Location.Indicator into a seperate GeoclueAgent
Before this, creating a separate instance of `Location.Indicator` failed
because it tries to create export the same DBus path.

This is useful for extensions adding panels on multiple monitors. But
it also seems like a cleaner design to separate the indicator widget
from the logically separate role as a Geoclue agent.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1919>
2021-07-16 17:51:17 -07:00
Ian Douglas Scott
51a8bbddd5 location: Add GObject properties to Location.Indicator
Makes `enabled`, `in-use`, and `max-accuracy-level` GObject properties
that can be used for property binding, etc.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1919>
2021-07-16 16:07:30 -07:00
Marco Trevisan (Treviño)
81a1e294f8 ControlsManagerLayout: Allocate respecting the work area
We build controls layout using the whole monitor vertical space as
available, however extensions or external apps in X11 may reduce the
workarea size horizontally and the shell should always take care of it.

Given that we're already assuming that the allocation is monitor-based
and that we're adjusting it to the workarea, we can just make it more
explicit by using a workarea box that is used as the allocation area.

As per this, we also apply the same logic of applied to the vertical
dimension to the horizontal one.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1892>
2021-07-17 00:25:50 +02:00
Marco Trevisan (Treviño)
2b074882f4 ControlsManagerLayout: Consider workarea height for the available space
We always consider the whole workarea space to be available when
computing the controls manager layout, however this may not be the truth
when using extensions such as Window List which are reducing the work
area size.

So take care of it, reducing the box height.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4330
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1892>
2021-07-17 00:25:50 +02:00
Marco Trevisan (Treviño)
f164e08688 ControlsManagerLayout: Use the workarea size to compute the available height
To compute the available height for the layout we're currently using the
panel position, while this works for the current and default setup, the
shell may be configured to use a different workarea, so we should rely on
it to compute the available space, instead of a specific widget.

So get the current monitor index for the current view and use its coordinates
instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1892>
2021-07-17 00:25:50 +02:00
Marco Trevisan (Treviño)
f30fa1adc7 WorkspaceBackground: Fully take care of workarea geometry on allocation
The background group is currently allocated taking care of the workarea
x, y offset but not of its width/height and this may lead to building a
wrongly sized workspace view when the workarea size is not matching the
monitor size (like when there are struts set).

So, take care of the difference between the workarea and monitor
absolute end coordinates to allocate the background scaled content box.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1892>
2021-07-17 00:25:50 +02:00
Florian Müllner
28a42da947 status/network: Do not disable on login screen
We currently disable all network items on both the lock- and login
screen. While it makes sense to be very restrictive on the lock screen,
there are some (fringe) use cases for being more permissive on the
login screen (like remote home directories only accessible via VPN).

There's precedence with the power-off/restart actions to be less
restrictive on the login screen, and since we started respecting
the `network-control` polkit action, it's possible to restore the
old behavior if desired.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Florian Müllner
4440a8210b sessionMode: Enable networkAgent on login screen
We will soon enable the network sections in the status menu on the
login screen, so enable the network agent to handle authentication
requests (like wifi/VPN passwords).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Florian Müllner
d1333cb249 status/network: Consider network-control action
NetworkManager installs a `network-control` polkit action that can
be used to disallow network configuration, except that we happily
ignore it. Add it to the conditions that turn a network section
insensitive.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Florian Müllner
d53285d71b status/network: Only list wifi networks that can be activated
Setting up a connection for an Enterprise WPA(2) encrypted wireless
network requires Settings. That's not available when windows are
disabled via the session mode, so filter out affected entries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Florian Müllner
25793b9d97 status/network: Disable modem connection when windows aren't allowed
The item launches the corresponding Settings panel when activated, which
doesn't work when windows are disabled by the session mode. Rather than
failing silently, turn the item insensitive.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1874>
2021-07-16 22:21:12 +00:00
Alexander Mikhaylenko
b156cabdc9 swipeTracker: Use unaccelerated deltas
Unaccelerated deltas make sure the gesture works the same regardless of how
fast the fingers move; this is what we were already doing for scrolling.

Remove the swipe multiplier as the deltas already match scrolling other than
the 1/10 multiplier Clutter applies to scrolling specifically.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1763>
2021-07-16 19:37:20 +00:00
Florian Müllner
20d99c69cb search: Exclude hidden results from keynav
Since commit 3fb02843, we no longer skip allocation for
results that don't fit the width, and give them a 0x0
allocation instead.

That has the unintended side effect of those children now
being available to keynav. There are cases where we want
0-sized actors to be part of the focus chain (e.g. FocusTrap),
but this isn't one of them, so explicitly exclude 0-sized
children from keynav.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1916>
2021-07-15 19:15:36 +02:00
Florian Müllner
6995c2fa9f shellInfo: Don't destroy source on undo
Destroying the source from an action callback will result in the
notification being destroyed twice:

 - source.destroy() destroys all its notifications

 - a notification destroys itself after an action
   was activated

This results in unwanted log spam when attempting to dispose the
notification for a second time.

There is actually no good reason for destroying the source explicitly,
as sources already self-destruct with their last notification.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1908>
2021-07-13 12:38:51 +00:00
Florian Müllner
1f4eea12a5 messageTray: Always remove destroyed banners
Currently we only mark the banner as removed if it is destroyed
while in SHOWN or SHOWING state, but not if we're already HIDING
(for example in response to `NotificationBanner::done-displaying`).

If this happens, we'll try to destroy the notification again at
the end of the transition, which leads to (harmless but annoying)
log spam since Notifications were turned into GObjects (that are
disposed when destroyed).

Address this by always marking destroyed banners as removed, while
still only triggering a state update while shown (or in the process
of being shown).

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1908>
2021-07-13 12:38:51 +00:00
Florian Müllner
dc1aec5673 overviewControls: Fix warning on shutdown
ClutterActor unsets its layout manager's :container property during
dispose, so the corresponding vfunc should handle being passed NULL.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1909>
2021-07-08 23:17:01 +00:00
Florian Müllner
30e49cc3ca iconGrid: Disconnect signals on destroy
Otherwise the handler will trip over unset properties on an object
that is being disposed. Avoid the resulting log spam by disconnecting
the handler in question.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1909>
2021-07-08 23:17:01 +00:00
Florian Müllner
f51fb4bed0 ibusCandidatePopup: Use plain actor as dummy cursor
Now that source actors no longer have to be widgets, we can use
a plain actor for the dummy cursor and save a bit of overhead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1903>
2021-06-29 22:47:58 +02:00
Florian Müllner
16d3718735 boxpointer: Handle non-widget source actors
There is no convincing reason why source actors must be widgets,
so lift that restriction.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1903>
2021-06-29 22:47:50 +02:00
Lee
006d206f98 Magnifier: Filter caret tracking in gnome magnifier
Add a check to filter out caret tracking events that result in a caret
location of 0,0.

Fixes #4177

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1823>
2021-06-28 21:28:10 +00:00
Florian Müllner
8430aa59da status/power: Always sync after creating proxy
Otherwise the menu remains in an inconsistent state in case of an
error, until something else triggers a call to _sync() (like a
settings change).

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1901>
2021-06-28 20:49:43 +00:00
Florian Müllner
9e9ed42263 status/power: Update to new coding style
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4431

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1901>
2021-06-28 20:49:43 +00:00
Carlos Garnacho
c449058d44 magnifier: Remove needless actor
For the pointer clone, we actually have 2 actors (one that contains
the sprite, another that moves around). These can just be the same.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1902>
2021-06-28 20:53:57 +02:00
Carlos Garnacho
3df4b5ec7c magnifier: Add method to enable/disable crosshairs
These do some some signals connection and monitor layout tracking
that we forget to disconnect when the magnifier is disconnected.
This causes warnings if enabling the magnifier, disabling it,
switching to another tty, and back. (Presumably also happens for
monitor hotplugs).

This signal should just stay connected as long as it's needed,
so add a setEnabled() method on the CrossHairs actor that we
can hook on the magnifier.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1902>
2021-06-28 20:53:36 +02:00
Carlos Garnacho
a363f1343a magnifier: Unset variable holding GSource ID
Otherwise we try to remove the no longer existing GSource
later on.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1902>
2021-06-28 19:54:07 +02:00
Florian Müllner
54a71944ba boxpointer: Disable unredirection while visible
Some popovers like the ibus candidate popover may be requested while
showing an unredirected fullscreen window. Disable unredirection
while the popover is visible so that it can actually be shown.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1900>
2021-06-28 12:07:12 +02:00
Georges Basile Stavracas Neto
f5259a5ce4 introspect: Allowlist GNOME portal
It too implements app listing and introspection, so list it in the allowlist.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1894>
2021-06-21 16:32:50 -03:00
Florian Müllner
158920924d shellDBus: Properly return from D-Bus methods
When implementing a D-Bus method synchronously, regular JS methods are
used. That is, whatever the method returns is passed as return value
to the method invocation.

However for asynchronous implementations, we need to explicitly return
a value to the invocation, otherwise the caller will wait until it times
out eventually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1891>
2021-06-17 21:03:58 +00:00
Florian Müllner
6813e246cd shellDBus: Remove bogus return statements
g_dbus_method_invocation_return_value() doesn't have a return value.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1891>
2021-06-17 21:03:58 +00:00
Florian Müllner
c90fb27a2f shellDBus: Fix FocusApp()
The appDisplay used to be accessible via the viewSelector, but
that is gone now. Commit c09c070b15 adjusted the code, but the
replacement uses a Main.overview.appDisplay accessor that never
existed, whoops.

Fix this by exposing a new selectApp() method directly on the
overview, so we don't have to shuffle the appDisplay through
controls → overviewActor → overview.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1891>
2021-06-17 21:03:58 +00:00
Olivier Fourdan
8be5d33611 windowManager: Remove timeout on starting X11 services
With Xwayland started on demand, mutter/gnome-shell will spawn Xwayland
and GNOME settings daemon Xsettings.

Currently, gnome-shell uses a timeout of 5 seconds before canceling the
launch and declare failure to start X11 services.

While 5 seconds may seem like a lot of time, when this is executed on a
virtual machine part of a QA tests under load, this causes random
failures.

There is no good value here, we could increase the timeout but it will
always remain racy. Instead, remove the timeout, systemd itself already
has a timeout mechanism (with a much longer wait time).

Thanks to Benjamin Berg <bberg@redhat.com> for finding the root cause
and suggesting the fix.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1888>
2021-06-15 11:24:59 +02:00
Chris Mayo
8d042459ee lookingGlass: Use symbolic icons on the toolbar
Replace gtk-color-picker, a private GTK 3 icon, with
find-location-symbolic as used in GTK Inspector.

As suggested by Daniel van Vugt.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1671>
2021-06-14 18:51:30 +00:00
Harshad Gavali
177b36f82b overviewControls: Avoid hiding early AppDisplay when transitioning to Session
When transitioning from AppDisplay to Session,
AppDisplay should be visible throughout the transition.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1886>
2021-06-13 00:51:35 +02:00
Florian Müllner
5be67eb190 lookingGlass: Only pop modal after the transition
Right now we pop the modal immediately when closing, so the key-release
event of the Escape key ends up in the focus window which may consume it
for leaving fullscreen mode or similar.

We can avoid that in many cases by keeping the modal grab until the end
of the transition, as the key-release event will then likely occur while
the grab is still in place (provided animations are enabled).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1880>
2021-06-10 00:18:00 +00:00