Commit Graph

8778 Commits

Author SHA1 Message Date
Florian Müllner
e062e96ae6 rfkill: Consider HasAirplaneMode
`ShouldShowAirplaneMode` only considers whether airplane mode
should be shown for the form factor, not whether there are
any actual kill switches available.

That's tracked in a separate property, `HasAirplaneMode`.

Take that into account for our `:show-airplane-mode` property,
so that it reflects when airplane mode should and *can* be shown.

Right now we only show airplane mode when it is enabled (and
therefore available), but this will change in the future.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2385>
2022-07-19 13:27:39 +00:00
Florian Müllner
98cbc31e86 rfkill: Turn manager into a GObject
That will allow us to use it in property bindings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2385>
2022-07-19 13:27:39 +00:00
Florian Müllner
bb043bb761 rfkill: Use promise to initialize proxy
There's no good reason for waiting for the proxy to be initialized
to connect signals. In fact, connecting the signal beforehand
ensures that the handler is in place when the proxy fetches the
properties, so we don't have to call the handler explicitly.

That in turn will allow us in a follow-up to rely on the signal
parameters to only process changed properties.

To achieve that by constructing the proxy manually, and then
initialize it asynchronously in a Promise.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2385>
2022-07-19 13:27:39 +00:00
Florian Müllner
762b4c2066 status/volume: Add device submenus
In case where there are multiple in- or output devices, pulseaudio
or pipewire can pick the "wrong" one by default.

Allow users to change devices without opening sound settings by
adding a submenu to the sliders when there is more than one device.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Florian Müllner
cf404f76c0 status/volume: Use (dis)connectObject
It makes sense to use this for all MixerControl handlers, not just
some of them.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Florian Müllner
af5bc30dff status/volume: Reindent before making code changes
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Florian Müllner
a768efad06 status/volume: Small cleanup
There is no point in splitting out a function that has one caller
and sets a single property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Florian Müllner
d80a7224cd status/volume: Document public function
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
2022-07-19 14:56:46 +02:00
Carlos Garnacho
b0187d4261 inputMethod: Update to set_preedit_text() API change
Since IBus does not provide this information right away, we
so far cannot do much about providing a truthful anchor position
for the preedit text. But with the Mutter API in place it will
be up to this object to do so in the future.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2384>
2022-07-19 12:20:28 +00:00
Georges Basile Stavracas Neto
19f11ae328 accessDialog: Allow body label to wrap lines
Allow the body label of the access dialog to wrap, and avoid
ellipsizing it.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2377>
2022-07-14 16:51:52 +00:00
Florian Müllner
12a203a1db notificationDaemon: Stop auto-dismissing on focus changes
This behavior dates back all the way to the original gnome-shell
release, and it did make sense at the time:

 - we were first to make notifications persistent instead of
   closing them after a timeout; apps were therefore used to
   treat notifications as fire-and-forget instead of closing
   them when no longer relevant

 - neither web notifications not portals did exist yet, so the
   D-Bus API was only used directly, instead of as a backend
   for other APIs; as a result, focusing the app was more likely
   than not to put the source of the event that the user was
   notified about into view

Nowadays both persistent notifications and web notifications
are wide-spread, so the original reasons no longer apply.

This change helps web notifications in particular, as it reduces
the differences between XDG and portal-based implementations.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2332>
2022-07-14 11:39:55 +00:00
Matthew Jakeman
789e1b288a extensions: Allow updating with only extension-manager installed
GNOME Shell will only update extensions if the org.gnome.Extensions
app is present. This commit adds alternative support for
com.mattjakeman.ExtensionManager to the extension updating mechanism.

It enables updates to occur when extension-manager is the sole installed
tool on the system. When both applications are installed,
org.gnome.Extensions is preferred at all times.

Fixes #5564

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2358>
2022-07-11 17:43:11 +00:00
Florian Müllner
97b2079257 endSessionDialog: Small cleanup
Array.prototype.push() returns the new number of elements, so
no need to track the number separately.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2369>
2022-07-11 14:14:37 +00:00
Florian Müllner
415349c852 systemActions: Disable power-off if querying support fails
Treating failure as success is weird. It's also most likely wrong,
as the most likely reason is that gnome-session isn't running.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2372>
2022-07-09 14:01:17 +02:00
Maksym Hazevych
2a3d409114 dateMenu: Remove custom aligning of time strings in the World Clocks
Since now Glib uses tabular space for aligning numbers (merged in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2698), there is no
more need for custom aligning.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2340>
2022-07-07 12:40:30 +00:00
Evan Welsh
4257fc9522 environment: Remove inline import of extensionUtils
The logging function cannot be asynchronous, so move the override
into main.js where ExtensionUtils can be imported at the top level.
Importing ExtensionUtils in environment.js at the top level is not
possible because it would import Main prematurely.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2363>
2022-07-06 13:40:44 -04:00
Evan Welsh
61eef2fb9b extensionUtils: Add utility for setting the current extension
ES modules do not allow exports to be overriden, in anticipation
of the ESM port add a `setCurrentExtension` utility which will
throw if used in the shell. This is tested using a conditional
import of Main.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2363>
2022-07-06 13:40:44 -04:00
Marco Trevisan (Treviño)
71765a1056 js/main: Use warning log level for notifyError
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/697>
2022-07-06 17:14:56 +00:00
Marco Trevisan (Treviño)
9abf3508fd signalTracker: Use a const variable to hold the tracked object value
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2366>
2022-07-06 18:24:41 +02:00
Marco Trevisan (Treviño)
371da8d394 signalTracker: Correctly guard against invalid GObject.ConnectFlags
We considered any ConnectFlag value major than SWAPPED as invalid, while
it's technically not fully true as we need to ensure that the passed
value is respecting the whole flags mask.
In fact, per se SWAPPED|AFTER (> SWAPPED) is a valid value (even if we
don't support the AFTER value).

But this makes the check more future-proof.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2366>
2022-07-06 18:24:15 +02:00
Marco Trevisan (Treviño)
ad0f11f024 signalTracker: Avoid getting the same owner object proto multiple times
While untracking an object we used to compute it's proto for each signal
we were disconnecting from, while this is not needed when we're just
iterating over all the same owner signals, so let's add few more
functions to compute an object prototype, and repeat the disconnections
in the simplest way we can.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2366>
2022-07-06 18:24:12 +02:00
Marco Trevisan (Treviño)
74720f250e signalTracker: Avoid creating a temporary keys array when clearing
We used to create a temporary array of signal tracker keys and then to
iterate through them in order to untrack the objects, but the Map's can
be iterated directly so let's just use their native forEach.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2366>
2022-07-06 18:24:08 +02:00
Marco Trevisan (Treviño)
68ceed5c28 signalTracker: Avoid doing two maps lookups once they're initialized
Avoid checking if a map contains a value, given that in the case it's
not there, get() will just return an undefined value. And only in such
case we need to set the value.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2366>
2022-07-06 18:24:04 +02:00
Evan Welsh
83c08e17cf dbusServices: Refactor service utilities from fileUtils into dbusUtils
To enable porting services to ECMAScript modules independently of
the shell, split DBus service utility functions into a new file,
dbusUtils.js

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2365>
2022-07-05 03:41:41 -04:00
Evan Welsh
a88e59c1a8 Adopt EventEmitter class instead of injecting Signal methods
Introduce a new class, EventEmitter, which implements signal
handling for pure JavaScript classes. EventEmitter still
utilizes GJS' addSignalMethods internally.

EventEmitter allows static typechecking to understand the
structure of event-emitting JS classes and makes creating
child classes simpler.

The name 'EventEmitter' mirrors a common name for this pattern
in Node and in JS libraries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2043>
2022-07-04 18:30:49 -04:00
Alynx Zhou
d14bb7b536 screenshot: Always raise UI to top when opening
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2331>
2022-07-04 13:38:15 +00:00
Alynx Zhou
67a1d3b262 ibusCandidatePopup: Prevent it from covering screenshot UI
If we only raise screenshot UI to top, ibusCandidatePopup can still
cover screenshot UI because each time ibusCandidatePopup updates it's
visibility it will raise it to top and this also happens if we open
screenshot UI via keybinding. This commit fixes it by only raising it
above keyboardBox, because keyboardBox is above all entries in modal
dialogs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2331>
2022-07-04 13:38:15 +00:00
Alynx Zhou
07d9408420 ibusCandidatePopup: Init it as a top chrome
ibusCandidatePopup actually works as a top chrome because it always
raises itself above top_window_group when updating visibility, so just
initing it as a top chrome instead of initing it below top_window_group.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2331>
2022-07-04 13:38:15 +00:00
Florian Müllner
eff23a87c3 keyboard: Fix updating suggestions visibility
Commit 237ba24dbe added corresponding API to the keyboard actor,
but ended up calling it on the KeyboardManager.

Add the expected method to KeyboardManager that forwards the request
to the keyboard.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2359>
2022-07-03 16:47:12 +02:00
Florian Müllner
2defa96198 layout: Force size of overviewGroup
The overviewGroup's size is currently determined by the coverPane
actor. That actor is only shown during transitions, so we rely on
ClutterFixedLayout including hidden children in its size request.

That odd behavior is about to change, so we need to make sure the
overview still requests the correct size.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2351>
2022-07-02 22:18:19 +00:00
Florian Müllner
abe9ba4b0f layout: Use constraint to resize screenShieldGroup
We want the actor to always fill the entire uiGroup. It seems
better and simpler to express that with a contraint than resizing
it explicitly on every monitor change.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2351>
2022-07-02 22:18:19 +00:00
oreo639
8e87ff2975 ibusManager: Avoid double fork triggering parent death in ibus
Use DO_NOT_REAP_CHILD to avoid a double-fork internally since ibus-daemon
refuses to start with init as its parent.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2345>
2022-07-02 11:04:43 +00:00
oreo639
be52477610 ibusManager: Pass on envrionment variables to ibus-daemon
Previously only DISPLAY was being passed on to ibus, which results in issues
with missing the WAYLAND_DISPLAY or the DBUS_SESSION_BUS_ADDRESS environemnt
variables for example.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2345>
2022-07-02 11:04:43 +00:00
oreo639
4097f9f836 ibusManager: Don't use GNOME_SETUP_DISPLAY
GNOME_SETUP_DISPLAY is only necessary when using xwayland on demand,
which is only supported on systemd, in which case you should consider
using the user service provided by ibus.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2345>
2022-07-02 11:04:43 +00:00
Jonas Dreßler
4fd2719dc5 windowManager: Handle window dimming animation getting cancelled
When a window with a modal dialog gets minimized and at the same time
the dialog is closed, the WindowDimmer undim animation starts and gets
cancelled when the minimize animation is done, because that unmaps the
window actor.

In this case we want ensure the dimming effect still goes into a
proper state instead of being stuck mid-animation, so listen to
onStopped instead of onComplete for syncing state of the window dimmer.

While at it, clean things up a little and move the check for the
attach-modal-dialogs pref inside the _syncEnabled() function.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2349>
2022-07-02 00:39:49 +00:00
Jonas Dreßler
31acf30bfa Revert "windowManager: Undim parent when minimizing attached modal"
This reverts commit 78a7cc1836.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2349>
2022-07-02 00:39:49 +00:00
Carlos Garnacho
237ba24dbe ibusCandidatePopup: Set OSK candidates list visibility correctly
Right now, we don't pay much attention to visibility hints from IBus
about the candidates list for the OSK suggestions bar. Since some
IMs rely on this visibility being honored, do that.

To fix this, the visibility hints for the lookup table are now
propagated to the keyboard, so the Suggestions actor hides its
internal candidate buttons. Since the Suggestions actor gets its
minimum height from CSS, this does not result in OSK size jumps.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5601
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2347>
2022-06-29 13:44:36 +00:00
Carlos Garnacho
35ff4bfe3c keyboard: Set ornament on selected item in OSK languages popup menu
There is no hint about the currently selected language, but this exists
in the mockups. Add a dot ornament on the language that is currently
selected at the time of showing the OSK languages popup.

Since this popup is created from scratch every time it is shown, and
the popup is torn down with the OSK during replacement. This also
works for further times the languages popup is shown.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5598
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2346>
2022-06-27 16:50:51 +02:00
Florian Müllner
78a7cc1836 windowManager: Undim parent when minimizing attached modal
Minimizing modal dialogs is highly unconventional - and in fact
disabled in our own code - but apps can still do it programmatically.

The parent window shouldn't remain dimmed in that case, so make
sure to re-check dimming when minimizing an attached modal.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2337>
2022-06-21 22:06:01 +00:00
Florian Müllner
c24785ce9f portalHelper: Switch to soup3-based WebKitGTK
The soup2-based version will be discontinued soon, so simply
switch to the (API-compatible) soup3-based version.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2338>
2022-06-21 19:29:02 +00:00
Sam Hewitt
68653d5e61 nm-dialog: Fix icon spacing issue
- fixes #4928

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2309>
2022-06-20 07:43:31 +00:00
Olivier Fourdan
ed910a7216 kbdA11yDialog: Use MetaKeyboardA11yFlags
The change in mutter to move keyboard accessibility into backends needs
to be applied in gnome-shell as well, otherwise the keyboard
accessibility dialog cannot work.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2306
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2334>
2022-06-16 09:38:20 +00:00
PhilProg
9eef6ec44c appMenu: Hide overview when pressing on 'Show Details'
If the 'Show Details' in the app menu is pressed, the overview
will hide now, making it consistent with other launch actions.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2329>
2022-06-09 17:51:46 +02:00
Sam Uong
ea60bf4bc7 screenshot: Fall back to home if Pictures directory is not available
GLib.get_user_special_dir() returns null if user directories are
disabled. Instead of failing silently, fall back to saving screenshots
in $HOME/Screenshots in that case

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2327>
2022-06-06 20:54:19 +02:00
PhilProg
795723fe85 messageList: Only close messages via delete key if they can be closed
If the delete key is pressed while a message/MPRIS indicator is focused
GNOME now asks whether the message/MPRIS indicator is closable.
If yes it will be closed but if not it won't be closed.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2323>
2022-06-04 15:23:45 +02:00
Sebastian Keller
1952549788 magnifier: Include SSD when calculating screen coordinates for events
When calculating the on screen coordinates of events from the window
relative coordinates, using the frame rect will include the decorations
added by the WM for SSD windows. This was causing the calculated
coordinates to be slightly off. Fix this by using the client rect for
SSD windows.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2319>
2022-05-31 18:55:18 +00:00
Jonas Ådahl
4592337ce5 runDialog: Use single quotes for Wayland restart warning
The API was changed to take a pointer to a MetaContext, in order to have
a better way to fetch the MetaDisplay instance it needs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2316>
2022-05-31 18:35:41 +00:00
Jonas Ådahl
a6995a3892 runDialog: Pass context to Meta.restart()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2316>
2022-05-31 18:35:41 +00:00
Sebastian Keller
8b5d027724 magnifier: Request window-relative coordinates for focus/caret events
Absolute screen coordinates are impossible for Wayland clients to
provide, because the clients don't know where the window is positioned.
Some clients, such as the ones using GTK 3 were providing window
relative coordinates even when screen coordinates were requested,
while others, such as GTK 4 clients, were just returning an error for
caret events or also window-relative coordinates for focus events.

So for this to work on Wayland we have to request window-relative
coordinates and translate them to the current focus window.

To ensure the correct coordinates, we have to only consider events
coming from the current focus window. All other events are filtered out
now. As a side effect this also fixes the magnifier always jumping
to a terminal cursor whenever there was some output, even if the window
was not focused.

This also needs some special handling for events coming from the shell
itself, which should not be translated to the focus window either. As
another side effect this fixes another bug that was caused by these
events already including scaling and getting scaled again.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5509
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2301>
2022-05-28 10:47:01 +00:00
Carlos Garnacho
9a0935305d keyboard: Set up OSK edge drag gesture on capture phase
This makes the gesture able to get the events that would otherwise
be meant for the background actor or client window.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5335
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2304>
2022-05-27 09:29:26 +00:00