9467 Commits

Author SHA1 Message Date
Leleat
d429ab5e08 windowManager: Add shortcuts to open new window of nth pinned app
Add new shortcuts to open a new instance of an app by pressing
Super + Ctrl + Number. This is analogous to ctrl-activating
(LMB/Enter) an app icon.

Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4129

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1829>
2023-12-24 10:56:09 +00:00
Florian Müllner
dc655b9ed0 main: Override global logError() function
logError() prints an exception with an optional prefix, and is
used fairly commonly through-out the code base.

The problem is that by being defined in gjs, it uses "Gjs" as the
GLib log domain, not our own as expected.

Address this by adding a small override that implements the function
with console.error().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3072>
2023-12-21 19:17:32 +00:00
Georges Basile Stavracas Neto
ee150f2949 screenshot: Add and implement new D-Bus method
The new InteractiveScreenshot() D-Bus method is implemented using
the signals introduced by the previous commit, and is fundamentally
very simple: take the screenshot, and return the GFile URI.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
2023-12-21 17:59:17 +00:00
Georges Basile Stavracas Neto
c80f3af79b screenshot: Add signals to ScreenshotUI
These signals will let the yet to be introduced D-Bus method to
be notified of when either a screenshot has been taken, or if
the screenshot UI has been closed without taking a screenshot.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
2023-12-21 17:59:17 +00:00
Georges Basile Stavracas Neto
75dafd8d9c screenshot: Add SCREENSHOT_ONLY UI mode
Add a screenshot-exclusive mode that makes the screencast button
unreactive, and therefore disables screencasting. It doesn't change
the visibility of the button though, as that's done by the codepath
that checks if screencasting is supported.

This will be used by the D-Bus callback to take interactive
screenshots.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
2023-12-21 17:59:17 +00:00
Georges Basile Stavracas Neto
52a7ee7590 screenshot: Make captureScreenshot() return the GFile
Make the captureScreenshot() auxiliary function return the GFile at
which the texture was saved. This file will be used to return the
screenshot URI to the new D-Bus method to take interactive
screenshots.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>
2023-12-21 17:59:17 +00:00
Julian Sparber
b66dee80f6 panel: Ensure signal is disconnected when the panel is destroyed
This fixes a warning when terminating GNOME Shell

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3064>
2023-12-21 15:17:28 +00:00
Florian Müllner
070e712508 extensionSystem: Add debug logging
Now that we can use console.debug() to log messages that aren't
shown by default, we can be a lot more verbose without spamming
the system log.

Use that to all extension state changes, which can be useful for
debugging.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3058>
2023-12-21 15:12:14 +00:00
Florian Müllner
3351cd2f07 panelMenu: Remove SystemIndicator class
It was used by components in the aggregate menu. That menu no
longer exists, and the class has been superseded by the class of
the same name in quick settings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3068>
2023-12-21 13:35:50 +00:00
Florian Müllner
9c2da01a95 userWidget: Expand child
More fallout from commit c290a38730eb2 …

Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7264

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3061>
2023-12-16 23:57:48 +01:00
Sundeep Mediratta
3b4e3af6fa extensionSystem: Sort extensions before loading
When an extension is disabled, we "rebase" all extensions that
were enabled afterwards, in case they override the same method.

This can be fairly expensive, in particular when disabling many
extensions at once, for instance when locking the screen.

Help with that by sorting extensions by the number of session-modes,
as extensions that support multiple modes are less likely to be
disabled on session mode changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2851>
2023-12-16 17:33:47 +00:00
Florian Müllner
38d9026bc7 lookingGlass: Set expand of DebugFlags children
Since commit c290a38730eb2a, St.Bin respects the child's
expand properties instead of basing expansion on the
alignment.

Commit b02800f8 updated a number of callers to prepare for the
change, but the "Flags" tab in looking glass was missed.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3060>
2023-12-15 20:58:38 +01:00
Florian Müllner
b02800f8b5 js: Explicitly set expand of St.Bin children
Right now, St.Bin ignores the child's expand properties, and
instead expands the child if its alignment is set to FILL.

This will change when we replace the custom allocation code
with a layout manager, so to prepare for that, set the expand
property where needed to keep the expected behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3046>
2023-12-15 14:45:37 +00:00
Scott Buchanan
95daa577cf screenshot: Allow any enter key activate capture
We currently only consider enter/return on the main keyboard
area, but not on the numpad.

Fix that.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2777>
2023-12-14 23:39:11 +01:00
Sam Hewitt
745667a825 style: Rewrote app grid tile drawing functions
- updated mixin for tile_button
- dropped the overview_button mixin
- minor changes to dash, appDisplay and switcherPopup JS to accommodate new stylesheet
- new focus style for all tile buttons
- improved high contrast style support for app grid and dash
- renamed some style-classes
- tidied up dash stylesheet

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3017>
2023-12-14 18:30:52 +00:00
Daniel van Vugt
76dfff1012 Pass 'radius' to blur APIs instead of 'sigma'
Requires mutter!1908 first.

So now consumers of the clutter blur code don't have to know the
implementation is Gaussian and no longer need to convert the intended
blur radius to a sigma value.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1905>
2023-12-14 18:20:59 +00:00
Florian Müllner
ebe1a4d303 dbusService: Exempt org.gnome.Shell from sender tracking
If an interface has any signals, we don't want to auto-shutdown
while a caller is still connected to a signal.

Unfortunately we can't tell whether there are any signal connections,
so we track all callers instead, and keep the service alive while
any of them is still on the bus.

For services that we call from gnome-shell itself - like screencasts
or extensions - this has the unintended side effect of effectively
disabling auto-shutdown.

Address this by exempting the org.gnome.Shell name from sender
tracking.

Services that we expect to keep running for the lifetime of the
shell already disable auto-shutdown, so the only downside is a
small startup delay to resolve the well-known shell name.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3052>
2023-12-13 01:27:51 +01:00
Florian Müllner
39d2988865 windowPreview: Don't hide overlay while hovering icon
We should treat the icon like we do the caption or close button,
and still consider the preview hovered when the pointer is over
the icon.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3049>
2023-12-11 15:10:59 +00:00
Sam Hewitt
49c0b849c4 style: Improve text scaling support
- new drawing function to convert px to em, for select instances
- updated fontsize function to convert fonts in pt to em
- replace instances of discrete sizes with defined values
- fix instances where assets or icons did not scale along with text
- rework panel buttons to accommodate the scaling padding and icons
- new 'scalable' definitions for elements that follow text scaling

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3033>
2023-12-05 12:14:53 +00:00
Sam Hewitt
8e1241c29b popupMenu: Use less ambiguous symbols for radio options
- new checked and unchecked dot ornament assets
- updated JS with a NO_DOT ornament state, replaced instances of NONE with this

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3027>
2023-12-02 10:11:10 +00:00
Peter Hutterer
e367a2713b padOsd: Fix rings and strips event handling
JS ERROR: TypeError: event.get_pad_event_details is not a function
    vfunc_captured_event@resource:///org/gnome/shell/ui/padOsd.js:824:53
    @resource:///org/gnome/shell/ui/init.js:21:20

These were renamed in mutter@97213041e8e7

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3029>
2023-11-26 23:31:14 +00:00
Sam Hewitt
ac7ef665a1 Use dedicated assets for ctrlAltTab
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3019>
2023-11-23 13:33:08 +00:00
Florian Müllner
7f7ae31fa3 dbusServices/extensions: Only show dialog when loaded
After the port to ESM, an extension's `prefs.js` file is imported
asynchronously. An unintended side effect of that is that we now
show the dialog before anything can be added to the window (either
by the extension, or the fallback error UI).

The delay almost always won't be noticeable to users, but it's
bad practice and prevents extensions from using some API that
only works before the window is realized.

To address the issue, add a `loaded` signal to the dialog that allows
the caller to postpone showing the window until the UI is ready.

Close: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7201
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3025>
2023-11-21 22:45:40 +00:00
Charles Wong
6ff08fd9bd main: Instantiate EndSessionDialog
Using an exported `init()` function to create the object is an odd
pattern, and not having the object referenced anywhere makes it harder
to access for debugging or extensions.

Just export the `EndSessionDialog` class and instantiate it like we
do for other objects.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2997>
2023-11-21 20:19:41 +00:00
Florian Müllner
99d49f787b slider: Request a size
Sliders (and level bars) currently don't request any size, so it's
up to the caller (or stylesheet) to explicitly set a size big
enough to fit the bar/handle.

That's rather unexpected, we should request the size we need ourselves.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
a6706bd2ca slider: Cache custom style properties
Custom properties are not cached by the theme node itself, so
looking them up repeatedly at every repaint is relatively
expensive.

Avoid this by caching the values ourselves at style changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
a639fb0fc4 barLevel: Cache custom style properties
Custom properties are not cached by the theme node itself, so
looking them up repeatedly at every repaint is relatively
expensive.

Avoid this by caching the values ourselves at style changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
77a72cec1e barLevel: Stop capping border-width at 1 pixel
I can't think of a reason why limiting the border to a maximum
would make any sense.

The original intention was probably to set a minimum border width
to avoid having to deal with border/no-border complexity in the code,
but as cairo accepts a line width of 0, it just works.

However limiting the size to the overall height seems reasonable,
as at that size a bigger height and different fill color can
achieve the same effect without requires special handling of
other values like the radius.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2994>
2023-11-21 18:55:47 +00:00
Florian Müllner
7a04d92bc0 status/volume: Always look up device objects
Gvc may clean its device cache after we set up the device menu,
which can lead to failed assertions when using the "old" object
to later switch the device from a callback.

Make sure this doesn't happen by looking up the ID again from
the callback.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7173
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3011>
2023-11-21 18:50:46 +00:00
Florian Müllner
f2601e6888 shellDBus: Await Eval() result
The Eval() method currently evaluates the provided string, and
returns the result immediately. This isn't useful when a promise
is returned, which has become much more likely now that accessing
any module requires import().

Simply await the result, to handle both sync and async code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3021>
2023-11-19 02:20:01 +00:00
Florian Müllner
eb8861e9b8 js: Rely on default scroll policy where appropriate
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
998d703bc2 js: Stop using {v,h}scroll properties
We only use them to access the corresponding adjustments, and
ScrollView now exposes those directly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Florian Müllner
5b84967deb lookingGlass: Don't hide scroll bar manually
The code predates the policy properties, which provide a cleaner
way of achieving the desired behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>
2023-11-18 18:00:43 +00:00
Zander Brown
d013555392 iconGrid: Use class handlers for ::child-{added,removed}
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:11:03 +00:00
Zander Brown
596efc3fa9 js: Adapt for ::child-{added,removed}
These were previously known as ::actor-{added,removed}

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3014>
2023-11-14 11:09:02 +00:00
Sebastian Keller
ee5819f870 searchController: Use ClutterText::cursor_position instead of position
The deprecated position property has been removed in mutter commit
31849868 in favor of the otherwise identical cursor_position property.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7186
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3015>
2023-11-11 22:36:02 +01:00
Zander Brown
a830edf8cf js: Cleanup use of StBin
StBins (inc StButton) should have their content managed via :child
rather than add_child()

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
49cca32ca5 js: Cleanup usage of StScrollView
Whilst you *can* use add_actor() with ScrollView, it's more idiomatic to
work on :child

Cleanup a few extras along the way

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
c72742486f environment: Stop patching StBoxLayout
Child properties are long gone, and add() can be directly replaced with
add_child()

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
350cd296fa js: Stop using ClutterContainer API
These have been long deprecated over in clutter, and (via several
vtables) simply forward the call to the equivalent ClutterActor methods

Save ourselves the hassle and just use ClutterActor methods directly

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Zander Brown
35cb2b5385 screenshot: Don't abuse StButton
It's an StBin, so can only have one child, yet we are adding multiple —
something we get away with by overriding allocate

Instead of doing that, move the content to it's own actor

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
2023-11-10 20:19:13 +00:00
Sebastian Keller
4722dd0d32 keyboard: Fix backspace not getting released after deleting preedit
When deleting is toggled while a preedit string is present, this causes
_toggleDelete() to use keyvalPress(). After the entire preedit string
has been deleted, _toggleDelete() will no longer hit the code path that
would call keyvalRelease() due to hasPreedit() now being false.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7171
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3009>
2023-11-08 15:01:10 +01:00
Carlos Garnacho
a93465ed69 networkAgent: Fetch environment from launch context before spawn_async()
This will fetch the right environment for the launched application,
without using GNOME Shell's environment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2993>
2023-11-03 20:47:44 +00:00
Carlos Garnacho
7b1223a254 misc: Fetch environment from launch context before spawn_async()
This will fetch the right environment for the launched application,
without using GNOME Shell's environment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2993>
2023-11-03 20:47:44 +00:00
Sebastian Keller
9153876764 search: Allow grid using search providers to specify maximum of results
When GridSearchResults::_getMaxDisplayedResults() is called after the
first character has been entered in the search, GridSearchResults has
no children yet. _getMaxDisplayedResults() tries to determine the
maximum number of search results based on how often the largest child
would fit into the allocated size or -1 (i.e. no limit) if there are no
children. So for the initial search there is no limit and in the app
search all matching apps get added as possible results, which due to the
search term being only a single character is almost all installed apps.
This now causes allocation to be run for all these results, despite the
vast majority of them never being visible, which on slower machines can
cause noticeable delays before the search results are displayed.

This now adds the ability for search providers to specify a maximum
number of results that gets used instead of -1 when specified. By being
provider specific this means extensions implementing their own providers
will not be affected by this.

Further this sets the maximum for the app search provider to 6 as per
the current designs.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7155
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3004>
2023-11-03 20:39:28 +00:00
Sebastian Keller
f1b7af2ab0 popupMenu: Only connect to notify::key-focus when needed
PopupMenuManager was connecting to notify::key-focus on the stage on
construction, but only ever reacting to it when one of its menus was
open. Given that every single app icon and text entry creates a
PopupMenuManager this was causing a lot of these handlers to be created.
Every single handler meant calling into JS code only for the vast
majority of them to determine that they would not do anything.

Additionally these handlers were leaked for the whole lifetime of the
stage due to never getting disconnected.

This now only connects the handler when a menu is open and disconnects
again when it is closed, significantly reducing the number of active
handlers at a time.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7143
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3001>
2023-11-03 20:33:23 +00:00
Florian Müllner
5fa08fe533 config: Add missing semicolon
The .in file isn't valid javascript, so it's excluded from eslint
and style issues like this can slip through.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3005>
2023-11-02 17:50:04 +01:00
Bilal Elmoussaoui
198dde2696 st: Stop using Clutter cairo helpers
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2808>
2023-10-25 21:35:18 +02:00
Bilal Elmoussaoui
ef9113da43 ui/environment: Add a setSourceColor helper
To simplify porting away from Clutter cairo helpers

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2808>
2023-10-25 21:35:18 +02:00
Sebastian Keller
23bcff3348 calendar: Emit selected-date-changed before rebuilding the calendar
If the cursor was placed on one of the widgets that get removed when
rebuilding the calendar due to a month change, destroying the hovered
widget will trigger a repick. This repick can then trigger an allocation
while not all buttons of the calendar are present.

If the last allocation before selected-date-changed is emitted was from
such an incomplete state, DateMenuButton will still freeze the layout in
this state in its signal handler.

What freezing the layout in DateMenuButton is supposed to do is to
prevent size changes of the menu when changing days, but for this the
layout needs to be frozen before potentially rebuilding calendar. This
change ensures that by emitting the signal earlier.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5411
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5469
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2989>
2023-10-23 01:29:12 +02:00