Commit Graph

8725 Commits

Author SHA1 Message Date
Olivier Fourdan
3fc7357e3f util: Restore the NOFILE limit before spawning apps
Make sure the restore the original NOFILE limit prior to run the
commands so those don't inherit from the raised value.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2117>
2022-02-08 08:25:25 +00:00
Olivier Fourdan
bafacdf629 ibusManager: Restore the NOFILE limit
Use GLib's spawn_async() instead of Gio.SubprocessLauncher() which does
not support the child setup function to start ibus-daemon.

This way we can restore the NOFILE limit prior to run the ibus-daemon.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2117>
2022-02-08 08:25:25 +00:00
Olivier Fourdan
7c394b0512 networkAgent: Restore the NOFILE limit
Restore the original NOFILE limit prior to spawn the VPN helper.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2117>
2022-02-08 08:25:25 +00:00
Florian Müllner
8d8eba000f dbusServices: Allow replacement
The REPLACE flag we currently pass is useless, as replacing the service
is disallowed when not started with the ALLOW_REPLACEMENT flag.

Fix this by adopting a more standard pattern where replacement is always
allowed, but only actually requested when `--replace` is passed on the
command line.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2152>
2022-02-07 18:44:34 +00:00
Rachit Keerti Das
a67877f520 dash: Use pin instead of favorites
Use the term 'pin' for adding new items to the dash
Note that this is only a string change.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2136>
2022-02-07 14:12:04 +00:00
Alexander Mikhaylenko
a619eb55bf background: Support dark wallpapers
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1174

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2137>
2022-02-07 10:20:51 +00:00
Sam Hewitt
d9f3596592 lookingGlass: Fix visual papercuts
- change icon size to 16px
- give those icons a buttonized style

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2156>
2022-02-06 20:59:38 +01:00
Florian Müllner
a92f749daf lookingGlass: Turn toolbar icons into actual buttons
Yes, we can use reactive icons with a `button-press-event` handler,
but really, there's a standard control for that kind of behavior ...

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2156>
2022-02-06 20:59:35 +01:00
Florian Müllner
35466b0e0a dbusServices/notifications: Disallow acting on "foreign" IDs
The Notify() and CloseNotification() methods act on a notification,
identified by the passed ID. Just like it makes sense to only emit
notification signals to the original sender, those methods should
be restricted to the notification owner.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2153>
2022-02-05 12:17:23 +00:00
Florian Müllner
0cbab09044 dbusServices/notifications: Stop broadcasting signals
All fd.o Notifications signals are emitted for a particular notification,
so debugging aside, only the owner of said notification has a legitimate
reason to act on it.

So far we (and other implementations like the old notification-daemon)
have relied on the client-side to properly filter the signals (like
libnotify), but at least the QT implementation is known to not do
that.

Enforce correct client behavior by only emitting the signal to the
original sender.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2153>
2022-02-05 12:17:23 +00:00
Sam Hewitt
1944af4013 calendar: Use symbolic icon for No Notifications
- drop old assets
- use symbolic icon for no notifications

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2157>
2022-02-04 13:29:36 -03:30
Sam Hewitt
0e3ddb1f02 theme: Remove icon resources from theme
- move all icons to the icons directory
- rename some icons to be more meaningful
- put all icons on a resource sheet
- update references to icon name changes
- deprecate icons for those in standard set

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2141>
2022-02-04 13:59:20 +00:00
Florian Müllner
7a58f76278 keyboard: Reindent key definitions
... to match the non-legacy eslint config.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2141>
2022-02-04 13:59:20 +00:00
Sam Hewitt
372ccc3e29 status/a11y: Update deprecated icon name
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2155>
2022-02-04 13:08:42 +00:00
Ivan Molodetskikh
a0206dcc3f systemActions: Add a screenshot UI action
It waits for the overview to close because otherwise the screenshot UI
would capture the overview.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2106>
2022-02-04 13:03:09 +00:00
Ivan Molodetskikh
6765fac76a screenshot: Move close button to the panel
CSS and JS adapted from the Overview window close buttons, but with some
style tweaks requested by the designers.

Since the screenshot UI is long-lived (it's created once at startup,
rather than every time it's opened), we need to refresh the close button
position, as it can change at runtime. Subscribing to preference changes
seems to be skipped for bindings generation in Mutter, but simply
refreshing upon opening the UI should do the job.

Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4997

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2147>
2022-02-03 16:43:02 +00:00
Ivan Molodetskikh
3cc045b6b8 screenshot: Close on lock
Since the screenshot UI cannot open in GDM or on the lock screen, it
seems that simply closing it on any session mode update is sufficient,
without adding extra variables.

Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4996

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2149>
2022-02-03 16:24:43 +00:00
Florian Müllner
4f27a6e520 panel: Remove panel corners
They were a cute gimmick for a decade, now it's time to say
goodbye ... 😢https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5010

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2151>
2022-02-03 00:19:25 +01:00
Carlos Garnacho
61b34ffe78 dnd: Drop captured event handler
This was here exclusively to silence out events from other pointing
devices in the stage. Since ClutterGrab being used now is global to
all devices and events are coerced to an invisible actor, there is
no need to explicitly do this.

Also, this event handler was set on the stage, while the grab happened
on a child, so it was fairly uneffective already.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2146>
2022-02-02 17:22:20 +01:00
Carlos Garnacho
d32005b3a4 dnd: Make event handler actor reactive
Even though we coerce events on it through a grab, it does require
to be reactive to be considered a keyboard focus. Make it reactive
so it can handle key events again.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5005
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2146>
2022-02-02 17:14:37 +01:00
Carlos Garnacho
939e26eb43 popupMenu: Ensure to let focus manager handle key events
Since the grab no longer lets events bubble up to the stage unstopped,
we should be forwarding the key events that bubbled up to the dialog
to maybe cycle focus.

Fixes broken keyboard navigation in several context menus around the
shell, other than the panel ones.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2140>
2022-02-01 14:30:24 +00:00
Carlos Garnacho
fcf70aa021 modalDialog: Ensure to let focus manager handle key events
Since the grab no longer lets events bubble up to the stage unstopped,
we should be forwarding the key events that bubbled up to the dialog
to maybe cycle focus.

Fixes focus cycling on keyboard navigation inside dialogs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2140>
2022-02-01 14:30:24 +00:00
Carlos Garnacho
b3f5fdcb6b endSessionDialog: Connect to events in the dialog itself
Connecting to stage events won't work from a modal dialog, since the
grab will take events from the portions of the actor hierarchy above
the grabbing actor.

Connect to events from the dialog itself, so that the end session
dialog can again show the "boot options" easter egg.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2140>
2022-02-01 14:30:24 +00:00
Carlos Garnacho
e374a4957f grabHelper: Fix handling of events within the grabbed actor
Commit d92b71d2b2 went overeager in the removal of the additional
actors that were allowed to handle events (since the new grab
infrastructure makes them unable to see events in the first place),
and removed an early return in the captured event handler meant to
let events go through in those cases.

Since the grabbing actor was also part of this group, this was also
the code path where child actors of the grabbing actor could handle
events. Removing these made the captured event handler eat most
events meant for children. Add this check back, specifically for the
grabbing actor.

While at it, explicitly check (and propagate) crossing events,
since these are now enforced to be propagated (and warned about) in
Mutter.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4991
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2140>
2022-02-01 14:30:24 +00:00
Alexander Mikhaylenko
f6edfd503b status/a11y: Use the new high-contrast gsettings key
With the new boolean setting, the "High Contrast" toggle can now
simply toggle the setting instead of the current gtk/icon-theme
shenanigans.

This isn't only much simpler, but will also make switching between
high-contrast and a non-default theme reliable at last.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2069>
2022-02-01 14:11:07 +00:00
Alexander Mikhaylenko
f67418c682 st/settings: Use the new high-contrast gsettings key
We now have a dedicated "high-contrast" setting that we can
use instead of a "magic" theme name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2069>
2022-02-01 14:11:07 +00:00
Daniel van Vugt
ed7fe756ef workspace: Fix a signal leak in WorkspaceBackground
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2143>
2022-02-01 12:11:54 +00:00
kyte
1260e35093 swipeTracker: Ignore Meta key while workspace scroll gesture is in progress
Workspace transition stopped midway when the Meta key
was released while the two-finger scroll gesture was
in progress. This commit ignores the Meta key once
the gesture has been confirmed and is in motion.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2135>
2022-01-31 22:09:28 +00:00
Ivan Molodetskikh
5b83ed59dd screenshot: Enable opacity redirect for the panel
This makes the panel look correct when it fades out (e.g. while dragging
the area selection around or while the screenshot UI is fading in and
out).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2138>
2022-01-31 12:39:18 +00:00
Ivan Molodetskikh
0d1f6b0eb9 screenshot: Remove _dragDevice
It went unused since
21cc534add

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2139>
2022-01-31 11:49:40 +03:00
Ivan Molodetskikh
1e4bbc9cd4 screenshot-ui: Put screencasts into a subdirectory
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:49 +00:00
Ivan Molodetskikh
6f252657fd screenshot-ui: Add screencast done notification
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:49 +00:00
Ivan Molodetskikh
1107fc50ca screenshot-ui: Add screencast area indicator
It shows the screencast area during recording.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:49 +00:00
Ivan Molodetskikh
003eb4c4e0 screenshot-ui: Add area and screen recording
It works by passing the selected area to org.gnome.Shell.ScreencastArea.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:49 +00:00
Ivan Molodetskikh
6d0c2ae697 status/remote-access: Add menu for stopping screencasts
This is specifically for stopping the screenshot UI screencasts for now.
It's possible to stop arbitrary screen recording handles, however due to
an issue with pipewiresrc, this method cannot currently work for cleanly
stopping Shell's own screen recordings. Hence the best we can do is to
handle just the screenshot UI screencasts to let them stop cleanly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:49 +00:00
Ivan Molodetskikh
fc0bff5e48 screenshot-ui: Add a screencast in progress property
The screen recording menu entry will use this to check if a screencast
is currently active and to stop the screencast.

Use a GObject property so we can bind to notify; specifically we'll bind
the visibility of a screencast area indicator.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:49 +00:00
Ivan Molodetskikh
eb60fa2908 screenshot-ui: Bind button to shot/cast
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:48 +00:00
Ivan Molodetskikh
497d9f32eb screenshot-ui: Add screenshot/screencast toggle
Currently does nothing. When we're in screencast mode, we hide the
screenshot preview because screencast doesn't start until the capture
button is pressed.

The window selection is currently left as is, but it should probably be
changed to something closer to a real overview, showing windows in
real-time.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2103>
2022-01-29 14:43:48 +00:00
Carlos Garnacho
d92b71d2b2 grabHelper: Drop addActor/removeActor calls
These no longer do what they meant to do, and are now unused.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2046>
2022-01-29 02:19:14 +01:00
Carlos Garnacho
1673e87de4 appDisplay: Drop grabHelper.addActor() call
This no longer does what it advertises to do, the folder dialog
is already modal and handles clicks outside to dismiss the dialog,
so this does not seem necessary either.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2046>
2022-01-29 02:19:14 +01:00
Carlos Garnacho
1dcc6d1b6b js/main: Add docs to private function
Oh, well...

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:32:42 +01:00
Carlos Garnacho
21cc534add screenshot: Port to Clutter.Grab
Stop using device/sequence grabs for corner handles. Also
make the toplevel actor reactive, so it can handle the key events
it means to.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
21913b45af dialog: Handle key events on self
And set the dialog actor reactive. Specifically, we do not know whether
the parent actor is reactive or not, and we should not be changing that
from here, so do not use that actor to handle key events.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
7419674bd3 js: Change main.pushModal to return the Clutter.Grab handle
All callers have been updated to keep this handle to identify their
own grab.

Also, optionally use the windowing state to determine whether
the grab is suitable for the specific uses. This removes the need
to trying to grab twice in the places where we settle for a keyboard
grab.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
2709f6c102 popupMenu: Refactor focus and key management
With the presence of Clutter.grab(), this behaves differently enough
that needs some redoing. The larger difference is what actors are
eligible for handling events.

In the older code, a PopupMenuManager would ask the grabHelper to
capture events from all the stage, and selectively silence events
on any actor that is not the currently shown popup menu or the
"source" actor for any other popup in the group (i.e. those that
would pop up another menu).

But we don't want to just silence events, we want to emit the
correct set of crossing events when a popup menu is shown or closed,
this requires a backing ClutterGrab() on the currently shown menu.
Since the presence of a grab also affects the ability to have actors
outside the grab area to handle events, the PopupMenuManager now
must detect hovering and focus changes to other menu sources by
handling events on the grabbed popup itself.

Redo the grabbing over Main.pushModal/popModal (i.e. ClutterGrab,
plus keyboard focus restoration) and a captured event handler on
the currently shown menu, to make PopupMenuManager behave as it
is expected with this new kind of grabs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
63725ef0ef popupMenu: Drop unused blockSourceEvents switch
This could be used to selectively ignore events on the source
actor, but is now unused.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
0f315a63f3 grabHelper: Use Clutter.grab() underneath
This is subject to further possible simplifications. Use Clutter.grab
to redirect input and focus, a fundamental difference here is that
we do redirect input to the topmost owner of the grabhelper stack,
instead of the stage. This is better behaved with the presence of
other grabs, at the cost of some behavioral changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
3a77d78b42 loginDialog: Perform grab on the stage actor
Despite this grab happening in the dialog, we are also interested in
things happening outside of it. Move this grab to happen in the stage
itself, so the changed grab semantics don't make it impossible to
interact with parts of the login screen.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
f2cca5cccb padOsd: Capture events on itself
This actor is setting itself modal, should also stop listening to
events from above it, since none will be gotten.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
5305bee94c dnd: Use Clutter.grab() for DnD grab
We still listen to an specific device or touch sequence, but we
don't grab it specifically.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:30 +01:00
Carlos Garnacho
bad385d15c lookingGlass: Use lookingGlass dialog for modal grab
We want the whole dialog to handle events while shown. To compensate
for the entry not being "grabbed", make it take focus when showing.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
05a6b35991 overview: Propagate crossing events in cover pane
When animating the overview we temporarily cover it with an actor that
ignores events. This actor should still allow crossing events to go through
as per Mutter requirements.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
35d293df6c overview: Grab on the stage
This is more in line with the places where we want events to be
handled (i.e. all). So make the overview take a grab on the
stage itself.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
f4cae72d17 main: Use Clutter.grab() underneath Main.push/popModal
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
49b9ae08d8 appDisplay: Explicitly highlight selected app icon
While the menu is popped up, we artificially keep the icon highlighted
by ensuring it's hovered, and muting events on the app icon until the
menu is popped down.

This is somewhat convoluted and won't work with Clutter.grab(), where
it will be the menu itself that is the owner of input events while
shown, so cut some corners and explicitly tell the app icon to be
highlighted.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
876765dbe1 boxPointer: Do not mute key events while showing
We want to mute things like pointers hovering the BoxPointer while
it does open. However keyboard events should still be handled
promptly.

Since Clutter.grab() will involve different actors being grabbed
and focused, this will have some more presence, e.g. when navigating
panel menus. We want to be able to navigate outside a menu while it
is still being shown.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
0e4cd3bc79 lookingGlass: Use Clutter.grab() for actor picking
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
81179bbf84 authPrompt: Make actor reactive
The actor is non-reactive, but has a key event handler to handle
the Esc key on the auth prompt. Mark this actor as reactive, so
it can handle the events.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
88d60a70a3 modalDialog: Make reactive
Some dialogs like the runDialog expect this actor to receive
key events while it is not reactive. Whatever that black magic was
it will no longer work.

Make the actor reactive, so it can simply handle key events.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Carlos Garnacho
88a8ba0869 slider: Use Clutter.grab() for implicit grab
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
2022-01-29 01:16:29 +01:00
Florian Müllner
c256ca443e style: Handle sections in submenus
If a menu item in a submenu is part of a section, it should have
rounded bottom corners if both the item and the section are the
last child of its respective parent.

To express that, add a new .popup-menu-section class and use that
to undo/redo the rounding for items inside a section.

It would be possible to do without a new class with a selector like

 > StBoxLayout > .popup-menu-item:last-child:hover,
 :last-child > .popup-menu-item:last-child:hover

but that's hardly better with its heavy reliance on implementation
details.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2126>
2022-01-27 22:54:14 +00:00
Florian Müllner
1cee7e6760 overviewControls: Handle keyboard navigation
The old view selector used to handle initiating keynav into pages.
That code became inactive when non-search related functionality
was moved elsewhere, and was finally removed in commit cf41f4a527.

We still want the keynav behavior it provided, so add similar code
to overview's control manager.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2124>
2022-01-27 22:49:42 +00:00
Ivan Molodetskikh
7d43038312 screenshot-ui: Add support for disable-save-to-disk
When disable-save-to-disk is set, we only save the screenshot to the
clipboard, and therefore don't add the "open file" and "open folder"
actions to the notification.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
27bcf0da48 screenshot-ui: Use ImageContent for notification icon
StImageContent specifically, when used as a notification icon, preserves
the screenshot aspect ratio and avoids ugly scaling.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
4442ced760 screenshot-ui: Make screenshots appear in recent items
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
0b83541a3b screenshot-ui: Show a notification on capture
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
95df526996 screenshot-ui: Store screenshots to files
Screenshots are always stored to (xdg-)Pictures/Screenshots as discussed
in https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1950#note_655669

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
77eeaf6dbe screenshot-ui: Extract _saveScreenshot()
For simpler handling of screenshot/screencast.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
4e93d35037 screenshot-ui: Add tooltips to buttons
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
941774b786 screenshot-ui: Add cursor capturing option
The cursor texture, scale and position is captured separately and
overlaid on top of the preview, and on top of the final screenshot
image. This allows toggling it on and off post-factum.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
639a346c1e screenshot-ui: Add keyboard navigation
Allow switching the screenshot mode by pressing the "s", "c", or "w" key. Also
implement arrow-key navigation between monitors in the screen screenshot mode
and between windows in the window screenshot mode.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
1321bb7557 screenshot-ui: Add a check icon to selected window
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
4c198fe2c7 screenshot-ui: Add new selector icons
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
d10e626de9 screenshot-ui: Add window selection
UIWindowSelectorLayout is a stripped-down subclass of WorkspaceLayout
(we don't have to deal with windows disappearing or appearing or
changing size). UIWindowSelectorWindow is a heavily stripped-down
version of WindowPreview. UIWindowSelector is analogous to the Workspace
class.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
f3d59912ec screenshot-ui: Add area selection
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
e12689108a screenshot-ui: Bind Ctrl-C, Enter, Space to capture
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
6f42eaf17d screenshot-ui: Add capturing and screen selection
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
7245f95165 screenshot-ui: Add IconLabelButton
A button that has an icon and a subtitle label.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
df0cd3457f screenshot-ui: Add close button
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
3b4fe9af31 screenshot-ui: Add the control panel
The (currently empty) panel resides on the primary monitor.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Ivan Molodetskikh
8ebc478f0f Add scaffolding for the new screenshot UI
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
2022-01-27 22:25:42 +00:00
Jonas Dreßler
81f62e9df8 lightbox: Fix banding issues with the vignette shader
Just as https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/352
did for the MetaBackgroundActor in mutter, let's fix the vignette shader
in gnome-shell, too.

Based on a patch originally propsed by Nikita Churaev, see
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/59.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3942
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2133>
2022-01-27 22:16:50 +01:00
Jonas Dreßler
7c49ac5242 altTab: Also use getWindows() for AppSwitcher
Use our custom filtering for meta_display_get_tab_list() in AppSwitcher
to be consistent and make sure the thumbnail list also includes the
remapping done in getWindows().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2098>
2022-01-25 20:03:01 +00:00
Jonas Dreßler
c8f3db31b8 altTab: Only calculate iconSize once
Right now, _setIconSize() calculates the icon size everytime the
preferred height of AppSwitcher is calculated, which happens quite
often.

Reduce the perfomance impact by only calculating the icon size once.
This has the added benefit of preventing unexpected changes to the icon
sizes while the switcher is open.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2098>
2022-01-25 20:03:01 +00:00
Jonas Dreßler
7f65fa49db altTab: Check for reentrancy in override function of _onItemMotion()
Just like in the parent _onItemMotion() function, we should check for
reentrancy in our override.

Because the hover timeout will prevent a new selection from happening
for some time, in addition to checking for this._highlighted reentrancy,
we also need to track the item that's being hovered during the timeout.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2098>
2022-01-25 20:03:01 +00:00
Florian Müllner
1e2a10f83b shellDBus: Return error on invalid app IDs
When passing an invalid or unknown app ID to FocusApp(), we currently
open the app picker and silently fail to select the desired app.
Instead of half-working like that, make it clear that the argument
was invalid by returning an appropriate error. (It's easy to get the
ID wrong, as unlike appstream/flatpak IDs, we include the ".desktop"
suffix).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/337>
2022-01-25 20:18:35 +01:00
Daniel van Vugt
e38a416246 lightbox: GLSL requires real numbers, not integers
At least backward-compatible GLSL requires real numbers only. It's a
fatal shader compilation error to use integers in GLES and older GL
versions like that of i915.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2115
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2125>
2022-01-25 15:38:04 +00:00
Leleat
f4b75d02cc popupMenu: Center labels vertically
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2113>
2022-01-25 15:32:31 +00:00
Florian Müllner
b54111ef88 cleanup: Use logical assignments
gjs updated mozjs to a version that support assignment operators
for logical operators, so use those where appropriate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2115>
2022-01-25 15:21:16 +00:00
Georges Basile Stavracas Neto
87927b8281 ui: Rename gnome-control-center to org.gnome.Settings
The app-id has changes since  [1].

[1] https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1153

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2123>
2022-01-21 10:44:37 -03:00
Naïm Favier
3de418ea3b loginDialog: Fix timing issue
Fix the first task of the timed login batch not returning the hold on
`_waitForItemForUser`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2116>
2022-01-20 20:40:40 +00:00
Florian Müllner
6a10f2f2f1 panel: Fix corner transition when slowed down
Both ease() and CSS durations take the slow-down factor into account,
so the corners currently end up using the square of the factor in their
transition.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2118>
2022-01-20 19:18:15 +01:00
Ivan Molodetskikh
0e4b87fe5a screencastService: Create directory if it doesn't exist
Instead of testing if the videos directory exists and using the home
directory otherwise, just try to create the target directory. This
aligns with how the screenshot UI handles the screenshots folder, and
it's convenient for putting screencasts into a subdirectory.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2102>
2022-01-14 18:42:47 +00:00
Aleksandr Mezin
12c300a7a2 extensionSystem: Ignore spurious disable-extension-version-validation change
Ignore spurious change notificatons, when the setting didn't actually change
(triggered by `dconf update`)

Workaround for https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4808

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2047>
2022-01-14 15:23:09 +00:00
Ray Strode
11401c13ed gdmUtil: Enable support for GDM's ChoiceList PAM extension
This commit hooks up support for GDM's ChoiceList PAM extension.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1978>
2022-01-13 15:31:32 -05:00
Ray Strode
051a6be121 gdm: Add AuthList control
Ultimately, we want to add support for GDM's new ChoiceList
PAM extension.  That extension allows PAM modules to present
a list of choices to the user. Before we can support that
extension, however, we need to have a list control in the
login-screen/unlock screen.  This commit adds that control.

For the most part, it's a copy-and-paste of the gdm userlist,
but with less features.  It lacks API specific to the users,
lacks the built in timed login indicator, etc. It does feature
a label heading.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1978>
2022-01-13 15:03:02 -05:00
Jonas Dreßler
7ae694990b altTab: Use this._highlighted instead of this._curApp in AppSwitcher
Thanks to the parent class (SwitcherPopup), we already have a property
for the currently highlighted item, let's use it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2097>
2022-01-12 12:25:19 +00:00
Jonas Dreßler
98e270e698 altTab: Remove override of _itemEnteredHandler()
This override function is identical to the original function, so remove
it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2097>
2022-01-12 12:25:19 +00:00
Jonas Dreßler
d8a38672f1 altTab: Also return EVENT_PROPAGATE in override of _onItemMotion()
Clutter expects a return value here, so make sure we also return
Clutter.EVENT_PROPAGATE just like the function we override does.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2097>
2022-01-12 12:25:19 +00:00
Jonas Dreßler
87101cf165 switcherPopup: Rename _onItemEnter() to _onItemMotion()
Since commit e94de67b, this is called by a motion-event handler instead
of enter-event, so let's adjust the function name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2097>
2022-01-12 12:25:19 +00:00
Sebastian Keller
ac4412e4aa lookingGlass: Add switches for debug flags
This adds a new "Flags" tab to looking glass where several debug flags
can be toggled at run time. This includes:

ClutterDebugFlags
ClutterDrawDebugFlags
MetaDebugPaintFlags
MetaDebugTopics
MetaContext::unsafe-mode

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3968
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1994>
2022-01-11 21:39:28 +00:00
Evan Welsh
828da18b72 background: Don't override synchronous load() with an async version
Instead, override the asynchronous version to avoid conflicting with
the parent signature.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2040>
2022-01-11 21:24:26 +01:00
Robert Mader
ee41dfdb8c ControlsManager: Propagate unmap before hiding the WorkspacesDisplay
Hiding the `WorkspacesDisplay` triggers a reallocation of the
`ControlsManagerLayout` which can fail with the following error:
```
JS ERROR: TypeError: workspace is undefined
_getSpacing@resource:///org/gnome/shell/ui/workspacesView.js:229:13
vfunc_allocate@resource:///org/gnome/shell/ui/workspacesView.js:355:18
vfunc_allocate@resource:///org/gnome/shell/ui/overviewControls.js:200:33
vfunc_hide@resource:///org/gnome/shell/ui/workspacesView.js:1070:38
vfunc_unmap@resource:///org/gnome/shell/ui/overviewControls.js:672:33
hideOverview@resource:///org/gnome/shell/ui/layout.js:312:28
_hideDone@resource:///org/gnome/shell/ui/overview.js:617:32
onComplete@resource:///org/gnome/shell/ui/overview.js:390:37
_makeEaseCallback/<@resource:///org/gnome/shell/ui/environment.js:134:13
_easeActorProperty/<@resource:///org/gnome/shell/ui/environment.js:298:60
```

This can be reproduced by closing the overview with the three-finger
gesture.

Thus propagate the unmap before hiding the `WorkspacesDisplay`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2088>
2022-01-09 16:50:48 +01:00
Joan Torres
f3eb01642f main: Don't terminate remote session in headless mode
Now gnome-shell can know if it is on headless mode
(depends on https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2130) and not terminate
a headless remote session when the session is locked.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2057>
2022-01-08 18:18:55 +00:00
Sebastian Keller
f322e00ca5 windowManager: Set correct unfullscreen gesture enabled state on startup
The unfullscreen gesture was defaulting to enabled until the first
window focus change. With it now being run in the capture phase, the
gesture was preventing clicks in the top panel except on the activities
button before the first window was opened.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2087>
2022-01-06 04:53:23 +01:00
Florian Müllner
8c1cf3fa3d dbusServices/extensions: Instruct gjs to generate unique GType names
Like the main gnome-shell process, the extensions service loads code from
extensions. It therefore makes sense to prevent GType name clashes there
as well, just like we already to in the gnome-shell process.

This may break some extensions that use the old type name in .ui files,
but they can be fixed easily by specifying an explicit GTypeName.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2024>
2022-01-05 19:28:25 +00:00
Sebastian Keller
2801d0bfe3 messageTray: Close SHOWING banner when its notification is destroyed
Currently only banners in the SHOWN state are hidden when the underlying
notification is destroyed, but if they are in the SHOWING state, they
remain visible. Because the 'notification' member has already been set
to null when the notification got destroyed, closing the banner by
clicking on the close button, will not do anything and clicking on the
notification itself will result in an error message. For notifications
without a timeout, i.e. critical ones, this will result in an
uncloseable notification.

This can happen if the program creating a critical notification
immediately closes it again, as might happen with power notifications
from gnome-settings-daemon in some situations.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4855
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2079>
2022-01-05 15:51:14 +00:00
Evan Welsh
f04914ac15 js: Remove dead code in loginDialog and workspacesView
- this._scrolling no longer exists
- _getBannerAllocation takes a single argument

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2042>
2022-01-05 15:44:28 +00:00
Emily Gonyer
f752be2bfe docs: Use gender-neutral pronouns
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2031>
2022-01-05 16:34:23 +01:00
Florian Müllner
ab52ce4591 dateMenu: Port to GWeather 4.0
Besides dropping its GTK dependency (which doesn't affect us),
GWeather 4.0 replaces its own timezone type with GTimeZone.

It's easy enough to adjust to that, so port over to the new
version.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2083>
2022-01-05 04:07:25 +01:00
Florian Müllner
f07a40d5ee environment: Require libgweather 3.0
GWeather did a major version bump on its main branch, so it is
now possible that multiple versions are installed in parallel,
and we should explicitly pick the one we are using.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2083>
2022-01-05 03:39:57 +01:00
Sebastian Keller
dff5bef45c iconGrid: Remove unused spring animation code
The spring animation has not been used since 40.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2081>
2022-01-02 16:24:14 +01:00
Sebastian Keller
e21b4ad04a appDisplay: Remove leftover code from the spring animation
These are some leftovers from when the shell stopped using the spring
animation in 40.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2081>
2022-01-02 16:24:14 +01:00
kyte
920714008c lockScreen: Don't wake up screen in DND mode
Screen woke up whenever a new notification popped up
on lock screen even when DND was turned on.
This commit changes this behaviour to not wake
the screen up in such case.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2051>
2021-12-23 17:20:49 +01:00
Florian Müllner
daf729de11 build: Replace deprecated meson functions
Replace deprecated functions with their direct replacements:

 - dep.get_pkgconfig_variable() → dep.get_variable()
 - prg.path() → prg.full_path()
 - source/build_root() → project_source/build_root()

In one case we need meson.global_source_root() that was only
added in meson 0.58, so bump the requirement to that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2077>
2021-12-23 15:52:21 +00:00
Sergio Costas
8b3f74bb7d workspaceAnimation: Make WorkspaceGroup public
The WorkspaceGroup class in defined as CONST, which means that,
strictly speaking, is inaccessible from outside the file
workspaceAnimation.js. But Desktop Icons NG needs access to it.

Although the current Javascript engine "tolerates" this access,
a warning message is shown in the log advertising that it's
incorrect, and that although it is still allowed, the code
should be fixed.

This patch changes the definition from CONST to VAR to allow
accessing it from extensions.

jk

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2068>
2021-12-22 18:27:07 +00:00
Sebastian Keller
3d8b866a9d util: Properly handle markup in highlighter
The code to highlight matches did not properly escape the passed in text
as for markup before adding its highlighting markup. This lead to some
search result descriptions not showing up, because their descriptions
contained characters, such as "<", that would have to be escaped when
used in markup or otherwise lead to invalid markup.

To work around this some search providers wrongly started escaping the
description on their end before sending them to gnome-shell. This lead
to another issue. Now if the highlighter was trying to highlight the
term "a", and the escaped description contained "&apos;", the "a" in
that would be considered a match and surrounded by "<b></b>". This
however would also generate invalid markup, again leading to an error
and the description not being shown.

Fix this by always escaping the passed in string before applying the
highlights in such a way that there are no matches within entities.

This also means that search providers that escaped their description
strings will now show up with the markup syntax. This will have to be
fixed separately in the affected search providers.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4791
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2033>
2021-12-22 16:47:18 +00:00
Sebastian Keller
5e0c842429 search: Split out the description highlighter into its own class
No functional change yet, only preparation to allow adding a unit test
later on.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2033>
2021-12-22 16:47:18 +00:00
Daniel van Vugt
9069183cec windowManager: Use one consistent animation mode for minimize/unminimize
Firstly don't use EASE_IN for any minimize/unminimize animations because
those start slow and end fast. The effect of that was minimize/unminimize
appearing to be unresponsive to user clicks for a little while before
accelerating away. All such animations should be EASE_OUT for an immediate
response followed by deceleration at the end.

Secondly we replace the shallow 200ms QUADratic curves with a steeper
400ms EXPOnetial curve. Because it's steeper and twice as long the fast part
feels the same as 200ms QUAD, but there's an extra 200ms after that in which
to slow down smoothly giving a more fluid appearance. No sudden stops.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=786789
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2066>
2021-12-22 16:16:23 +00:00
Daniel van Vugt
ca1291e418 windowManager: Unminimize a window to its buffer rect geometry
If you slow down the unminimize animation you will notice it overshoots and
then snaps back, but only for decorated windows. Undecorated windows would
unminimize to their correct position. So we remove decorations from the
equation and now all window types unminimize to their correct position.

This wasn't noticeable because the unminimize animation velocity is usually
so high at the end (EASE_IN_EXPO) that there are no frames rendered near the
end of the curve to show it had overshot.

This appears to be consistent with the Mutter source - associating the
actor geometry with `buffer_rect` and not `frame_rect`. See
`meta_window_actor_sync_actor_geometry` for example.

Related to: https://bugzilla.gnome.org/show_bug.cgi?id=786789#c1

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2066>
2021-12-22 16:16:23 +00:00
Florian Müllner
5106ca9291 windowManager: Use MetaWindow.has_attached_dialogs()
Now that MetaWindow itself exposes a method for checking for
attached dialogs, we can use that instead of our own helper
method.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2054>
2021-12-21 12:11:33 +00:00
Sebastian Keller
85609a232d util: Wait for initial name owners in DBusSenderCheck before checking
Otherwise an allowed caller might get rejected if the call is right
after a gnome-shell restart and the watchers have not finished running
their callbacks yet.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4813
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2048>
2021-12-04 16:57:25 +00:00
Jonas Ådahl
37271ffe70 switchMonitor: Only show 'mirror' and 'join' modes when not a laptop
The 'external only' and 'builtin only' options makes no sense if there
are only external monitors.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3276
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2056>
2021-12-04 16:21:31 +00:00
Dylan McCall
4a23ddffa8 messageList: Give focus to next message on delete
When the user deletes a message using the keyboard, set the keyboard
focus to the next message, or to the list container itself, so it
remains possible to navigate using the keyboard.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/502
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2053>
2021-12-01 10:19:54 +00:00
Sebastian Keller
72a6450017 calendar-server: Remove the all-day property of events
The way it is currently calculated is broken for days with DST changes
or leap seconds and it is not needed anymore anyway. This will also make
the fix in the following commit simpler.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2023>
2021-11-30 02:13:24 +00:00
Sebastian Keller
d8efce0ffd dateMenu: Ignore the allDay property of an event
Given the correct end date this code would be able to determine this
correctly itself and doesn't need to rely on that property. And events
without correct end dates are currently not shown anyway. This prepares
for removing the allDay property entirely.

This also fixes events going from 13:00 the current day to 01:00 not
showing "...". It also fixes multi-day events wrongly detected as
all-day events by the calendar-server showing up as "All day", despite
only covering 1 hour of the day.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2023>
2021-11-30 02:13:24 +00:00
Sebastian Keller
2250653673 calendar: Fix inclusion of zero-length events
Events with a date time (not just a date) where the end time is missing
or matching the start time were considered to not overlap the selected
interval if they were happening on the start time of the interval. This
was causing such zero-length events to be omitted from the calendar if
they were starting at 0:00.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2023>
2021-11-30 02:13:24 +00:00
Sebastian Keller
9604778343 calendar: Start ranges at 0:00 and iterate in whole days
Using a starting time other than 0:00 will prevent events before the
chosen starting time from showing up for that range. This was causing
events before 12:00 to be missing in the shell calendar on the first day
of a range.

Fix this by always starting at 0:00 and then incrementing by days rather
than a time value that depending on DST or leap seconds may or may not
correspond to a day.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2023>
2021-11-30 02:13:24 +00:00
Sebastian Keller
2fffe91488 dateMenu: Use intervals with non-inclusive ends for date ranges
The ical events, we are comparing these intervals to use the first point
in time after the end of the event as their end time, while the code in
gnome-shell was using the last point in time within the range. This was
causing multi-day events ranging from 0:00 to 0:00 to have a trailing
"..." shown on the last day.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2023>
2021-11-30 02:13:24 +00:00
Florian Müllner
aba0d0bb1b main: Warn when unsafe mode is toggled
MetaContext:unsafe-mode was added as a debugging tool to temporarily
remove restrictions on privileged APIs. But as it turns out, there
are now extensions that toggle the property permanently. Right now
none of them are malicious (as far as I can see), but it's still a
bad idea and should be discouraged.

Do this with a notification that warns the user when unsafe mode is
enabled non-interactively (i.e. via looking glass), and hopefully
also clarifies what the weird lock icon in the top bar is about.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2050>
2021-11-26 16:14:39 +00:00
Carlos Garnacho
254b0ca2ad windowManager: Set up unfullscreen/app-switch gestures in the capture phase
Use the new API to specify the gesture phase.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1992>
2021-11-24 22:33:18 +00:00
Carlos Garnacho
748fe074c4 swipeTracker: Set up TouchSwipeGesture in the capture phase
Use the new API to specify the gesture phase.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1992>
2021-11-24 22:33:18 +00:00
Florian Müllner
7d895874b6 layout: Removed unused method
Commit a6b4d4945 removed the only caller in 2013(!)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2034>
2021-11-21 20:46:20 +00:00
Evan Welsh
826083d763 appDisplay: Remove unused animate() implementations
Usages were removed in gnome-shell!1593

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2041>
2021-11-17 10:31:42 +00:00
Evan Welsh
f8f37e0161 modalDialog: Consistently return correct boolean for open() in ModalDialogs
Previously these calls either ignored the return from super.open() or
implicitely returned false.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2038>
2021-11-17 10:24:47 +00:00
Evan Welsh
75e57749f0 keyring: Fix incorrect reference to the label instead of string
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2036>
2021-11-17 10:19:08 +00:00
Evan Welsh
01a23b0553 calendar: Use boolean operations instead of bitwise operators
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2039>
2021-11-17 10:13:44 +00:00
Sebastian Keller
34bf17ad27 magnifier: Remove call to dropped Clutter::get_default_frame_rate()
Clutter::get_default_frame_rate() has been removed in mutter!2002, but
it is still being used here. Given that this was basically hardcoded to
60 in mutter with the only way of changing this being an obscure
environment variable, just use that value here directly. This avoids a
crash when starting gnome-shell with the magnifier enabled.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4761
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2025>
2021-11-16 23:34:38 +00:00
Georges Basile Stavracas Neto
795312b8d5 environment: Require gnome-desktop 3.0
Pretty much the exact same case of 9ce6756235.

libgnome-desktop saw a major version bump, and we have to
stick with 3.0 for a while.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2030>
2021-11-11 16:20:39 -03:00
Georges Basile Stavracas Neto
9ce6756235 environment: Require GnomeBluetooth 1.0
libgnome-bluetooth will start to offer a 2.0 library version
depending on GTK4. Given that GNOME Shell already depends on
GTK3, it cannot use this next version of gnome-bluetooth. And
since GJS will automatically try and use the latest version
available of any library, Shell must specify it wants 1.0
explicitly.

Add a required GnomeBluetooth version number when importing it
for the status indicator.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2015>
2021-11-11 19:13:40 +00:00
Sebastian Keller
34b6cd0bea magnifier: Disable desaturation effect when not in use
The desaturation effect was always enabled, regardless of the specified
factor. This was causing the magnifier to always hit offscreen
rendering, even when not necessary. Additionally offscreen rendering is
currently also causing glitches in MetaWindowGroup which this helps to
avoid in some cases.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1678
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2026>
2021-11-08 15:39:34 +00:00
Sebastian Keller
2e275cca25 shellMountOperation: Remove unused volume monitor
It seems to have never been used since 6b5f9a647a, the commit that
introduced it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2021>
2021-11-03 22:13:00 +00:00
Carlos Garnacho
0177560952 inputMethod: Do not reset invisible preedit on focus_out
If the preedit is in invisible state, the last preedit string that
was sent around is already null, so there is no need to clear the preedit
in that case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2011>
2021-11-01 17:02:50 +00:00
Carlos Garnacho
047691b0d3 inputMethod: Do not communicate preedit text change on reset
This is now done in the ClutterInputFocus for us, since
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1940. There
is no need to duplicate this call, and it happens to cause undesired
scrolling to content in some cases when this reset happens during
a change in the IM focused client state.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4647
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2011>
2021-11-01 17:02:50 +00:00
Carlos Garnacho
286cfdc6d4 inputMethod: Equate empty preedit string to null
If we get '' from the IM as the preedit string, it is pretty safe
to handle it as "no preedit" altogether.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2011>
2021-11-01 17:02:50 +00:00
Florian Müllner
b93342f72e dbusServices/extensions: Only allow one dialog at a time
Showing multiple preference dialogs at the same time (for instance
by repeated `gnome-extensions prefs` calls) may or may not work as
expected, depending on whether any of the dialogs is modal or not
(read: opened via the Extensions app).

The easiest way to address this is to disallow more than a single
dialog at the time. It's arguably also the more predictable behavior,
and means extensions don't have to deal with inconsistent state
caused by multiple dialogs.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2013>
2021-10-30 21:50:47 +00:00
Florian Müllner
4d2b008966 dbusServices/extensions: Fix shutdown after showing prefs
GTK4 relies entirely on refcounting for cleanup (that is,
there is no longer a destroy() method that forces a dispose
run regardless of the refcount).

Unfortunately that makes cleanup harder in (some) language
bindings, where an object may be kept alive implicitly by
closures etc.

Address this by releasing the hold count when the window
is closed rather than when it is destroyed.

This isn't the most elegant, but it ensure that the service
doesn't get stuck if an extension doesn't carefully clean
up everything in its prefs widget.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2013>
2021-10-30 21:50:47 +00:00
Florian Müllner
cc5cc0d653 environment: Apply autoReverse/repeatCount to all transitions
Like the old Tweener API, ease() allows to transition multiple
properties at once. If autoReverse or repeatCount are specified,
they should apply to all transitions, but right now we only set
them for the first one.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2007>
2021-10-21 19:52:33 +02:00
Ray Strode
d7b1264897 sessionMode: Drop allowExtensions property
Now that we allow extensions at the lock screens, extensions
are allowed for every session mode gnome-shell would typically
change to at runtime.

This means there's little advantage to having an allowExtensions
property in the session mode definition.

This commit simplifies the code a bit by dropping the property.

Third party session modes can still lock down extensions through
gsettings if they need to.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1967>
2021-10-14 18:40:53 +00:00
Ray Strode
2bf31dc49f sessionMode: Allow extensions at the login and unlock screens
Now extensions can specify which session modes they work in,
but specifying the login screen or unlock screen session modes in
an extensions metadata still won't work, because those session
modes disallow extensions.

This commit fixes that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1967>
2021-10-14 18:40:53 +00:00
Ray Strode
242cff7abf extensionSystem: Allow extensions to run on the login screen
At the moment it's not realy possible to extend the login screen to do
things it doesn't have built-in support for. This means in order
to support niche use cases, those cases have to change the main
code base. For instance, oVirt and Vmware deployments want to be able
to automaticaly log in guest VMs when a user pre-authenticates through a
console on a management host. To support those use cases, we added
code to the login screen directly, even though most machines will never
be associated with oVirt or Vmware management hosts.

We also get requests from e.g. government users that need certain features
at the login screen that wouldn't get used much outside of government
deployments. For instance, we've gotten requests that a machine contains
prominently displays that it has "Top Secret" information.

All of these use cases seem like they would better handled via
extensions that could be installed in the specific deployments. The
problem is extensions only run in the user session, and get
disabled at the login screen automatically.

This commit changes that. Now extensions can specify in their metadata
via a new sessionModes property, which modes that want to run in. For
backward compatibility, if an extension doesn't specify which session
modes it works in, its assumed the extension only works in the user
session.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1967>
2021-10-14 18:40:53 +00:00
Ray Strode
7e5ee2c282 extensionSystem: Get rid of _enabled boolean optimization
At the moment a session mode either allows extensions or it doesn't.
If it allows extensions, then the entire available list of
configured extensions get enabled as soon as the session mode is
entered.

Since enabling or disabling extensions is an all or nothing situation,
the code tracks whether extensions are already enabled when entering
the session mode, and if so, avoids iterating through the extension list
needlessly. It does this using a boolean named _enabled.

In the future, the extensions themselves will be given some say on
whether or not they should be enabled in a given session mode. This
means, the configured extension list may contain extensions that
shouldn't be enabled for a given session mode, and the _enabled boolean
will no longer be appropriated.

This commit drops the _enabled boolean optimization.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1967>
2021-10-14 18:40:53 +00:00
Ray Strode
ceee53aa0a unlockDialog: Properly reset auth prompt when showing it
If a user hits escape twice really fast when coming back to
their machine to unlock it, they made end up getting presented
with a non-functional unlock screen that doesn't show their
user icon and doesn't ask for a password.

This is because showPrompt assumes that if an auth prompt already
exists, it's ready to go. That may not be true, if it's in the
process of getting torn down at the time because it's in the middle
of a cancel animation.

This commit solves the problem by ensuring the auth prompt is always
in a fresh reset state before showing it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1999>
2021-10-08 11:56:23 -04:00
Ray Strode
5d5bfe492c unlockDialog: Don't create AuthDialog just to finish it
If the the unlock dialog gets finished before an auth dialog is
created, the code currently creates one just to tell it to finish.

This commit changes the code to skip creating the auth dialog in
that case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1999>
2021-10-08 11:13:11 -04:00
Florian Müllner
4d1ce0de41 notificationDaemon: Fix sound-file support
When commit 25bfe99ed5 replaced the thin libcanberra wrapper
with the (then) new MetaSoundPlayer API, it missed that the latter
expects files as GFile instead of a file path.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1991>
2021-10-06 17:39:01 +00:00
Florian Müllner
a3dcdaae30 screenshot: Unrestrict PickColor
Commit dd2cd6286c restricted callers of the screenshot methods to
portal implementations, gnome-settings-daemon and gnome-screenshot.

That restriction does make sense for the actual screenshot methods,
but `PickColor` is actually used by GTK in its color picker (and
therefore may be called from arbitrary applications).

Fix this by unrestricting access to `PickColor` again. Considering that
the method is always interactive, it's not very privacy/security-sensitive
anyway.

https://gitlab.gnome.org/GNOME/gtk/-/issues/4283

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1990>
2021-10-06 17:34:18 +00:00
Florian Müllner
7f77b6f054 welcomeDialog: Fix title translation
Translators translate the format string ('... GNOME %s'), not the
substituted one ('... GNOME 41').

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1998>
2021-10-05 15:05:18 +02:00
Christian Hergert
380d2db1d9 inputMethod: Clear preeditStr before reset
Previously, these were performed in a different order before GNOME 41.
During some other changes they were swapped.

However, this causes both GTK 3 and GTK 4 applications to scroll to
incorrect positions from the preedit change.

Fixes #4647
Fixes GNOME/gtk#4289
Fixes GNOME/gnome-builder#1536
Fixes GNOME/gnome-builder#1531

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1993>
2021-09-30 17:12:02 +00:00
Jonas Ådahl
563437de91 Always assume GLSL is supported
The support for GLSL has been advertised as unconditionally supported by
mutter for a while, and has now lost the 'GLSL' feature completely. Lets
remove the checks.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1985>
2021-09-21 16:37:01 +02:00
Robert Mader
36a1fb78cd windowManager: Use MetaWindowActor.paint_to_content() for window effects
Previously we used `get_image()`, which returned `cairo_surface`,
in order to create a `ClutterContent` with a screenshot of the
`MetaWindowActor`. This added a roundtrip from GPU to CPU memory.

Instead, use the new `paint_to_content()` API which lets us use a
`CoglTexture` directly as source of our `ClutterContent`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1879>
2021-09-04 10:08:10 +00:00
Carlos Garnacho
46f2c29acc inputMethod: Use update-preedit-with-mode signal
This signal announces the preferred commit mode of the preedit text when
the input context is reset. Keep this mode around, and ensure to honor this
mode (e.g. maybe commit the preedit string) whenever the input method would
be reset.

This is delegated to the internal layers, so propagate this mode via
clutter_input_method_set_preedit_text().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1929>
2021-09-03 22:32:36 +00:00
Florian Müllner
dd2cd6286c screenshot: Restrict callers
The shell D-Bus API was always meant as a private API for core
components, so enforce that by limiting caller to a list of
allowed well-known names.

Applications that want to request a screenshot can use the corresponding
desktop portal.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
a628bbc485 shellDBus: Restrict callers
The org.gnome.Shell interface provides a private API to other core
components to implement desktop functionalities like Settings or
global keybindings. It is not meant as a public API, so limit it
to a set of expected callers.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
3adad0da81 shellDBus: Implement all methods asynchronously
In order to restrict callers, we will need access to the invocation,
not just the unpacked method parameters.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
2a3e297218 introspect: Split out DBusSenderChecker
Restricting callers to a list of allowed senders is useful for
other D-Bus services as well, so split out the existing code
into a reusable class.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
317f0f5fe0 introspect: Use MetaContext:unsafe-mode instead of setting
The property was added precisely for this purpose, except that its
name isn't tied to the introspect API.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
3b9e672a09 introspect: Make invocation check error-based
If we throw an error when the invocation isn't allowed instead of
returning false, we can simply return that error instead of duplicating
the error handling.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
7298ee23e9 shellDBus: Use MetaContext:unsafe-mode to restrict Eval()
The Eval() method is unarguably the most sensitive D-Bus method
we expose, since it allows running arbitrary code in the compositor.

It is currently tied to the `development-tools` settings that is
enabled by default. As users have become accustomed to the built-in
commands that are enabled by the same setting (restart, lg, ...),
that default cannot easily be changed.

In order to restrict the method without affecting the rather harmless
commands, guard it by the new MetaContext:unsafe-mode property instead
of the setting.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
3bee7c7f4b panel: Show warning indicator when unsafe-mode is on
MetaContext added an unsafe-mode property, which we will use to restrict
a number of privileged operations unless it is enabled. It is meant to
only be enabled temporarily for development/debugging purposes, so add
a scary icon to the top bar as a reminder to turn it off again.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
0fd205ce54 boxpointer: Fix positioning with non-widget sources
Commit 16d371873 lifted the requirement for source actors to be
widgets, then got it wrong :rolling_eyes:

The content box is expected to be in actor coordinates, so the
allocation must be translated to (0, 0).

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1969>
2021-09-01 20:22:58 +00:00
José Expósito
757e766a11 windowManager: Discard workspace scroll smooth events
Since touchpad smooth scroll events with source finger are handled by
the swipeTracker, the workspace scroll handler can focus on discrete
events.

Thanks to Mutter emulating discrete scroll events, see
meta_seat_impl_notify_scroll_continuous_in_impl in meta-seat-impl.c,
it is safe to ignore smooth scroll in the workspace scroll handler
and handle exclusively discrete events.

In addition, once high-resolution scroll events land in Mutter [1], a
mouse will be able generate non emulated smooth scroll events that
should be ignored in favour of the discrete scroll events.
Otherwise, a single mouse wheel click will scroll through multiple
workspaces at once.

[1] https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1962

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1959>
2021-09-01 17:25:01 +00:00
Florian Müllner
cd1102ff30 layout: Exclude hidden actors from struts
Currently we only exclude hidden actors from the input region,
but not from struts. This is an oversight that went unnoticed
until now, probably because we didn't consider the work area
in the overview until recently.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1963>
2021-09-01 17:15:40 +00:00
Sebastian Keller
2ee323e37e keyboard: Ensure chrome input region is updated after slide animation
The keyboard is placed outside of the screen when shown and then slides
in via a transition that changes the translate-y property. This
translation does not affect the allocation of the Keyboard actor and as
such does not trigger any of the signals LayoutManager is connected to
to update the input region. This means the input region remains at the
original position of the actor outside of the screen and as a result on
X11 clicks will go through to the underlying window.

There was a workaround for this by queuing a relayout at the end of the
transition, but this stopped working due to optimizations avoiding
unnecessary allocation changes.

This updates that workaround to toggle the visibility of the actor
instead, which is the other signal that LayoutManager reacts to. Once
ClutterActor provides better ways to react to transforms this can
hopefully be removed entirely.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4556
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1955>
2021-09-01 18:37:56 +02:00
Raghuveer Kasaraneni
07579f05f6 dash: Fixes wrong separator position
Sometimes when an icon is dragged and dropped in Dash, one Favourite app icon
can appear to the right of Dash separator. This can happen when available system
resources are low and the PlaceHolder destroy animation is delayed and the
corresponding container child is still present. With this commit the separator
position is calculated correctly, even when the animation is pending.

Fixes #3966, #3799

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1804>
2021-09-01 15:10:14 +00:00
Sebastian Keller
b90a6d6b14 workspace: Move fading minimized windows out of allocation
eee2ccac fixed window opacity being changed outside of transitions but
resulted in the final step of the transition, that would set the window
to fully opaque, being missed.

This change now moves the opacity change entirely out of allocation and
instead follows the adjustment changes directly, which still fixes the
original bug and ensures the opacity is also applied for the last step
in the transition.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4561
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1957>
2021-09-01 15:02:47 +00:00
Evan Welsh
0d8e0025d6 init: Set console log domain
GJS added a console module that extensions may start using. To ensure that
extensions using console.log() and similar functions don't show up as
'Gjs-Console' in users' system logs, we should call setConsoleLogdomain()
with 'GNOME Shell'.

This GJS API addition is only accessible using ECMAScript Modules (ESM),
this commit moves shell startup to a small init.js module and adapts
CI jobs to either handle or ignore it.

We can drop the .jscheckignore file when future versions of SpiderMonkey
allow for compile checks without validating module specifiers.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1958>
2021-09-01 14:55:47 +00:00
Florian Müllner
ef70364e81 cleanup: Replace non-standard ByteArray module
gjs landed support for TextDecoder/TextEncoder. Use those instead
of gjs' own ByteArray module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1946>
2021-09-01 14:49:30 +00:00
Ivan Molodetskikh
b21b43e318 workspace: Update bg border radius in constructor
Otherwise non-zero initial value of stateAdjustment will produce
incorrect radius.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1964>
2021-09-01 11:01:04 +00:00
Florian Müllner
1d607cf18f build: Add soup2 option
!1940 added support for soup 3, including a fallback to soup 2.4
where the newer version isn't available.

Unfortunately it missed that libgweather has a hidden soup dependency,
and now gnome-shell fails to start if a weather location has been set
up and soup 3 is available.

We don't have a good way to detect that case, so hide the soup 3 support
behind a build option. Distributors are expected to switch it at the
same time as libgweather.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1966>
2021-09-01 12:26:15 +02:00
Florian Müllner
b158e9676d main: Stop handling old 'panel-main-menu' shortcut
It's a shortcut from the GNOME 2 days that few users will remember.
And if anyone really wants to keep it, they can use Settings to
assign <Alt>F1 to 'toggle-overview'.

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/-/merge_requests/1871>
2021-08-31 19:01:25 +00:00
Ivan Molodetskikh
c6bcc74649 notificationDaemon: Remove rewriteRules
It's not really Shell's business to fix bad app notification contents.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1962>
2021-08-26 14:45:19 +03:00
Ivan Molodetskikh
6c4089025f networkAgent: Fix order of _() and format()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1961>
2021-08-26 08:19:59 +00:00
Florian Müllner
d562c70f4e environment: Fallback to Soup 2.4
We cannot assume yet that Soup3 is available everywhere. Until that
is the case, allow falling back to Soup 2.4 by imitating the bits
of the Soup3 API we use with monkey-patching.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1940>
2021-08-25 01:54:07 +02:00
Florian Müllner
ae90b50dc7 extensionDownloader: Port to Soup3
After 13 years, Soup will release a new, API-incompatible
version[0]. This is a good thing, make sure we support it.

[0] https://blog.tingping.se/2021/02/23/future-of-libsoup.html

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1940>
2021-08-25 01:54:07 +02:00
Florian Müllner
3ad569f426 extensionDownloader: Use plain Soup.Session
Unlike for the old Soup.SessionSync/SessionAsync classes,
Soup.Session:ssl-use-system-ca-file already defaults to true.

In Soup3, the behavior was made unconditional and the property
removed.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1940>
2021-08-25 01:54:07 +02:00
Florian Müllner
f14960ff03 extensionDownloader: Stop setting proxy resolver explicitly
Quoting the documentation:

  In libsoup 2.44 and later, you can set the session's “proxy-resolver”
  property to the resolver returned by g_proxy_resolver_get_default() to
  get the same effect. Note that for "plain" SoupSessions (ie, not
  SoupSessionAsync or SoupSessionSync), this is done for you automatically.

libsoup 2.44 was released in 2013, so we can safely assume that Soup is
new enough to handle this for us.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1940>
2021-08-25 01:54:07 +02:00
Florian Müllner
50a14caf1b portalHelper: Replace Soup.URI with GLib.Uri
GLib.Uri was added a while ago, and can replace our usage of Soup.URI.
In fact, the upcoming Soup3 drops its own URI type in favor of GLib.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1940>
2021-08-25 01:54:07 +02:00
Florian Müllner
6bf20837c0 extensionDownloader: Use async code for extracting archive
The code that handles extracting extension archives currently uses
an awkward double-callback system. We can do significantly better
by using an async function and exceptions.

Partially based on code from Marco Trevisan.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1940>
2021-08-25 01:54:07 +02:00
Florian Müllner
f16fda5ea1 extensionDownloader: Stop returning distinct errors
Nothing looks at our made-up errors, so we can just as well return
a generic "ExtensionError".

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1940>
2021-08-24 15:48:04 +00:00
Florian Müllner
b3bdcbcf3f extensionDownloader: Fix up style
Move all remaining bits to the new coding style before making
further changes.

The let → const changes are selectively done to the bits that'll
still be around at the end of the patch series.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1940>
2021-08-24 15:48:04 +00:00
Florian Müllner
0b8514dc7d messageTray: Do not show low priority notifications
Low priority notifications are meant for information that doesn't require
immediate attention, so it makes sense to not show a banner for them;
they'll still appear in the notification list in the calendar.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1893>
2021-08-22 19:20:37 +00:00
Daniel van Vugt
88b2c9a046 windowManager: Animate the appearance of new windows after overview closes
So that the animation doesn't get skipped if the overview is visible but
in the process of closing.

In this case the overview being visible also means that it is closing,
because if it's visible and not already closing then `_shouldAnimateActor`
would have returned false and exited `_mapWindow` earlier.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1814,
       https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3242

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1440>
2021-08-19 15:53:57 +08:00
Daniel van Vugt
956db078c3 overview: Emit 'hidden' after it's *really* hidden
Previously we would emit 'hidden' before the overview was fully hidden,
so any attempts to animate windows on that signal could still fail.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1440>
2021-08-19 15:44:34 +08:00
Daniel van Vugt
ea9c4e589d windowManager: Allow animations to start if the overview is closing
So the `WindowManager._mapWindow` animation doesn't get skipped if the
overview is visible but closing.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1440>
2021-08-19 15:44:34 +08:00
Daniel van Vugt
7c1b30b272 workspace: Ignore new windows that appear while the overview is closing
This can easily happen if an app launches and maps a window faster than
the overview closes. We don't want the window clone appearing and then
suddenly disappearing in that case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1440>
2021-08-19 15:44:34 +08:00
Daniel van Vugt
74d0b066e9 overview: Add a 'closing' getter
Which better communicates what we are checking for, and is a little more
elegant than repeatedly writing:
```
Main.overview.animationInProgress && Main.overview.visibleTarget == false
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1440>
2021-08-19 15:44:34 +08:00
Daniel van Vugt
af03314f20 magnifier: Avoid painting a desktop that's fully occluded by its clone
This significantly reduces the render time for fullscreen zoom mode.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3305
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1899>
2021-08-18 14:12:34 +00:00
nitinosiris
a4d2f5d8b4 windowMenu: Use consistent terminology
Because we don't have a dock or panel to minimize to, the `minimize`
shortcut was renamed to `hide` a long time ago.

Likewise, `unmaximize` appears as `restore` in keyboard shortcuts.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1834>
2021-08-18 00:43:12 +02:00
Florian Müllner
b496c9f956 appDisplay: Replace AppIconMenu
We are finally ready to share the app menu between the top bar and
context menus in the dash/app grid. Notably that means that it is
now possible to quit an app from its context menu.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1948>
2021-08-16 21:28:22 +00:00
Florian Müllner
414ed9128f appMenu: Support launching on the non-default GPU
Changing the GPU to launch an app on is the last feature from the
app context menu that is still missing. Add support for it now,
and we are ready for some unifying cleanup!

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1948>
2021-08-16 21:28:22 +00:00