Commit Graph

8068 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
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
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
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
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
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
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
Carlos Garnacho
1fa5c63307 edgeDragAction: Change edge trigger threshold to AFTER
For all instances of this gesture, we want this gesture to
activate after some distance, not to eat button presses/releases
right away.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2304>
2022-05-27 09:29:26 +00:00
Carlos Garnacho
da3d4e82e3 keyboard: Set up emoji panel pan gesture in capture phase
We need this to catch events before they reach to the emoji
keys, and the gesture can begin/end properly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2304>
2022-05-27 09:29:26 +00:00
Jonas Dreßler
a3bfe0ab56 keyboard: Reset height before requesting preferred height
If we don't set the height property to -1 before requesting the
preferred height, get_preferred_height() will just return us the fixed
height that has been set before. We don't want this behavior here, so
set the height to -1 before calling get_preferred_height().

This fixes a resizing issue where the keyboard is sized incorrectly
after switching the monitor into portrait mode and back.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2306>
2022-05-26 18:16:03 +02:00
Christian Glombek
b5ace213a1 status/network: Show WireGuard connections in VPN list
With this change, WireGuard connections, and an on/off toggle button
or a status description for each are shown in the VPN section of the
Gnome Shell network status UI.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1995>
2022-05-23 18:11:16 +02:00
Florian Müllner
3e7ce18dcf lockScreen: Extend modal grab to entire uiGroup
Main.pushModal() used to ensure a compositor grab, but didn't
take an input grab. That changed when porting to ClutterGrab,
so by limiting the grab to the shield/dialog, it is no longer
possible to access top bar menus when the screen is locked.

To fix that, take the grab on the whole uiGroup so that the top
bar is included.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2298>
2022-05-18 20:16:10 +02:00
Maksym Hazevych
3290ef4eb6 dateMenu: Align time strings in the World Clocks section
The problem is that " 9:59 AM" (notice the space at the beginning) and
"12:59 AM" strings, when centred, look misaligned —
strings padded with a space look off to the right by nearly
half a character. This happens because the font feature "tnum",
used to make numbers monospace, doesn't work on spaces.

The commit overcomes this by aligning time labels to the end.
However, this won't work for locales with AM/PM strings of different
lengths, so they are aligned to the start instead to minimise offset.

It's too complex to know whether the used locale has different
AM/PM string lengths. Instead, every time the time changes, it
determines whether all the time labels have the same amount of characters.

Fixes #5438

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2294>
2022-05-18 14:59:02 +00:00
Florian Müllner
9400759f25 status/volume: Hide sliders initially
We update the visibility on state or stream changes, but those
changes may never happen if pipewire-pulse/pulseaudio isn't
available (for example when running as root).

Hiding the sliders is preferable in that case to showing non-working
controls.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2295>
2022-05-11 02:40:33 +02:00
Florian Müllner
65831f783e Js: Use new :icon-name property
Now that we have the new convenience property, apply it to all
icon-only buttons.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2254>
2022-05-06 13:39:40 +00:00
Sebastian Keller
8e664a8cbe iconGrid: Add more possible icon sizes
When selecting the largest possible icon size for restricted vertical or
horizontal space the options for low resolution icons were rather coarse
grained. This could often result in seemingly too small icons being
chosen in the app grid on systems with low vertical resolution, because
the next larger size would exceed the limit by a few pixels.

This adds two more commonly used sizes for application icons to have
some more options with restricted space.

Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2173
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2289>
2022-05-04 20:49:15 +00:00
Sebastian Keller
23b4eb459e Require both mouse and keyboard grabs for some grabs to be successful
Commit 7419674b changed some grabs from requiring both mouse and
keyboard grabs to be considered successful to only requiring either of
them.

Due to this it was possible for example to open the overview or the
screenshot UI with a client (such as Chrome when opening a menu) holding
the mouse grab. This then made it impossible to interact with the UI
using the mouse (or keyboard) and if attempted could result in an
unresponsive UI.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5414
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2287>
2022-05-04 17:28:08 +00:00
Sebastian Keller
3e8164cc36 screenshot: Close screenshot UI if we failed to acquire a grab
Otherwise the actors will remain invisible yet reactive covering up the
screen.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5414
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2287>
2022-05-04 17:28:08 +00:00
Florian Müllner
b365eb9936 screenshot: Hide screencast button when recorder is disabled
The screencast D-Bus service that is used for the recordings
is only installed if the necessary gstreamer and pipewire
dependencies are found at build time.

The screencast button cannot work when the service is missing,
so don't show it in the first place.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2285>
2022-04-29 20:22:32 +00:00
Jonas Dreßler
682629e603 status/network: Also show disabled icon when wwan is not connected
Commit ca4f6e0123 was supposed to show the
"cellular-disabled" icon when wwan is disabled. For wwan, just like for
bluetooth wwan networks, we probably want this to include the "not
connected" state, because disconnecting from cellular service de-facto
means disabling it.

So switch the check to show the "cellular-disabled" icon to also use the
icon whether there's no active connection, not only when the wwan device
is turned off.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2283>
2022-04-29 20:02:16 +00:00