3058 Commits

Author SHA1 Message Date
661e293434 Replace window realm frame decorations with nicer label decorations 2025-04-07 13:52:58 +00:00
ee57f6de95 Implement 'detached' workspace context
There is always at least one workspace context which is the context
that is currently being used by the GNOME desktop. If no running realm
is associated with this context then we consider this context to be
'detached' and store it so that the next time a context is needed to
attach to a running realm, this 'detached' context will be used rather
than asking mutter to create a new fresh context.
2025-04-07 13:52:58 +00:00
5352b200d6 Use ClutterColor instead of GdkRGBA 2025-04-07 13:52:58 +00:00
e63283cb89 Need gtk/gdk for realm window frames 2025-04-07 13:52:58 +00:00
a5e83b2d55 Map windows to realms by calling realmsd pid lookup method 2025-04-07 13:49:08 +00:00
f675f95c67 Citadel changes to gnome-shell 2025-04-07 13:46:32 +00:00
Alessandro Astone
65d38939e2 shell/network-agent: Do not query keyring in greeter mode
When trying to connect to a network from gdm, it doesn't make sense to query
secrets from the gdm user since it's a system user.

Furthermore, gdm runs an isolated dbus-session per gnome-shell instance
(for multi-seat setups). Instead, gnome-keyring-daemon is started by systemd
and so it registers on the _main_ dbus session of the gdm user session.
Then, gnome-shell tries to dbus-activate another gnome-keyring-daemon on its
isolated bus, but gnome-keyring-daemon refuses to start as it sees another
instance already running, exposed at $XDG_RUNTIME_DIR/keyring/control.
After a 25s timeout, gnome-shell aborts the request without ever prompting
for a new password.

Because it is both problematic and pointless to query secrets in this case,
let's avoid it altogether and just prompt the user for the network password.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3646>
2025-02-26 16:06:05 +00:00
Sebastian Wick
11d05c4aea Adjust to MetaCursor changes 2025-02-18 22:20:41 +01:00
Florian Müllner
4265b9c73f st: Add getter/setters for (almost) all properties
Traditionally, getter/setter functions have been considered a
C convenience, and we therefore didn't bother to add them for
many properties that are only consumed from JS.

However now that gjs optimizes property accesses by calling the
appropriate getter/setter instead, it makes sense to add them.

Leave out ScrollView's [vh]scrollbar-policy properties, as they
have a combined `set_policy()` setter that is consistent with
GTK's ScrolledWindow.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3620>
2025-02-12 13:11:11 +00:00
Florian Müllner
dc1298565d st: Annotate getters/setters
Some properties have getters and setters that don't follow the
usual naming scheme, and they are therefore not recognized
automatically. Annotate the properties so that g-ir-scanner
picks up the methods.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3620>
2025-02-12 13:11:11 +00:00
Florian Müllner
4092882005 st/adjustment: Remove return value from private setters
Nothing is using the return value, so the methods can just follow
the usual pattern for setters.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3620>
2025-02-12 13:11:11 +00:00
Florian Müllner
01824a6d4e shell: Add getter/setters for all properties
Traditionally, getter/setter functions have been considered a
C convenience, and we therefore didn't bother to add them for
many properties that are only consumed from JS.

However now that gjs optimizes property accesses by calling the
appropriate getter/setter instead, it makes sense to add them.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3620>
2025-02-12 13:11:11 +00:00
Florian Müllner
51b5358b71 shell: Fix return values in precondition guards
Make sure values returned via `g_return_val_if_fail()` are of
the expected type.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3620>
2025-02-12 13:11:11 +00:00
Florian Müllner
73928c9b29 st: Use consistent type for properties/getters
gjs now optimizes property accesses if possible, by calling the
corresponding getter/setter method. For this to work, the method
not only has to exist (obviously), but also match the type of
the corresponding property.

Both `Label` and `Entry` currently define their `clutter-text`
property as `Clutter.Text`, while the corresponding getter
returns the more generic `Clutter.Actor`.

Fix that so that both property and getter use the more specific type.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3620>
2025-02-12 13:11:11 +00:00
Florian Müllner
f79e5ad42b shell/global: Use consistent type for properties/getters
gjs now optimizes property accesses if possible, by calling the
corresponding getter/setter method. For this to work, the method
not only has to exist (obviously), but also match the type of
the corresponding property.

For some reason the `Global.stage` property is defined as
`Clutter.Actor` instead of `Clutter.Stage`, which is returned
by the getter.

Fix that so that both property and getter use the more specific type.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3620>
2025-02-12 13:11:11 +00:00
Florian Müllner
829d2fd469 st/theme: Reuse stylesheets if possible
The following happens when processing an `@import()` rule:

 1. `_st_theme_resolve_url()` to resolve file
 2. `insert_stylesheet()` to track file/sheet
   a. take ownership of file/sheet (ref)
   b. use file as key in `stylesheets_by_file` hash table
   c. use file as value in `files_by_stylesheet` hash table
 3. release reference to file

This leads to a refcount error when importing a file that
was already parsed before:

 1. file start with refcount 1
 2. `insert_stylesheet()`
   a. increases refcount to 2
   b. inserting into `stylesheets_by_file` *decreases* the
      passed-in key if the key already exists
   c. `files_by_stylesheet` now tracks a file with recount 1
 3. releases the last reference to file

The file object tracked in `files_by_stylesheet` is now invalid,
and accessing it results in a crash.

Avoid this issue by reusing existing stylesheets, so we don't insert
a stylesheet that's already tracked.

As a side-effect, this also saves us from re-parsing the same file
unnecessarily.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7306
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3619>
2025-01-30 16:43:57 +00:00
Florian Müllner
9beacca329 st/texture-cache: Remove load_sliced_image()
It was only used by the `Animation`/`AnimatedIcon` classes, which
have now been removed since `Spinner` is now an independent
implementation.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3612>
2025-01-28 12:50:00 +00:00
Florian Müllner
f4c46647e6 run-test: Filter out SYSTEM_EXIT errors
Calling `System.exit()` isn't an error, and there isn't much
value in logging a "Exit with code 0" message.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
546f3d65f7 run-test: Always use returned status code if possible
gjs_context_eval_module_file() is a convenience method for

 - register the module (load and parse)
 - evaluate the module (run)

The first can fail, but has no notion of status code; the
second will always set a valid code if provided (either as
returned by the module, or set by gjs itself).

Doing those two steps separately allows us to explicitly
handle failures to register the module, so that we can then
return the original status code from evaluating the module.

That means that if evaluating the module "fails" with a
`GJS_ERROR_SYSTEM_EXIT` error (because it was terminated
with `System.exit()`), we now return the correct status
code instead of `EXIT_FAILURE`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
d192fc984f run-test: Split out module evaluation
The gjs API is slightly odd, in that explicit calls to `System.exit()`
are treated as errors, regardless of the passed status code.

Before addressing this, split out the module evaluation code into
a separate function to separate it from the main logic.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
f42c2d7371 run-test: Switch to new argv API
It's a bit nicer to use than manually defining the legacy ARGV
array.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
699c7c1b2c run-test: Check argc before using argv
We skip the filename argument when defining ARGV before actually
checking that it was provided.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
e7691bd3df run-tests: Add missing newlines in error messages
Unlike the various g_message() macros, the g_print() functions do
not add an implicit newline at the end of the message.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
68fe35d1a2 run-test: Use g_autoptr/autofree
While we don't really care about freeing memory before leaving
main, it doesn't hurt and is good practice anyway.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
696bd09d18 run-test: Fix coding style errors
The original code was likely copied from gjs' console code at the
time, which means that its coding style sneaked in.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3599>
2025-01-28 12:38:30 +00:00
Florian Müllner
e2de46e9ac st/scroll-bar: Remove vertical property
Unlike `StBoxLayout` which is ubiquious, `StScrollBar` is hightly unlikely
to be used outside of `StScrollView`. It therefore seems unnecessary to
deprecate the `vertical` property before removing it, so do just that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
8b8699d1d5 st/scroll-view: Set scrollbar orientation
Use the new `orientation` property instead of `vertical`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
f4f02fe4dd st/scroll-bar: Add orientation property
Like we did for `BoxLayout`, add an `orientation` property that
better expresses the orientation (duh) and is consistent with
Clutter and GTK.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
c5546dbe12 st/box-layout: Deprecate vertical property
BoxLayout is extremely common, so removing the old `vertical` property
in favor of `orientation` would be very disruptive. Instead, deprecate
it to indicate our intention of removing it eventually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 13:55:39 +01:00
Florian Müllner
01541929eb st/box-layout: Add orientation property
Using "vertical: false" to express "horizontal" has always been a
bit awkward. While we have stuck to the existing property for a long
time, transitioning to an `orientation` property like in GTK and
Clutter seems better.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3614>
2025-01-27 12:12:59 +00:00
Florian Müllner
b01d429266 st/theme-context: Make property setter public
There's no good reason to only expose the getter of a READWRITE
property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
794f0bcc75 st/scroll-view: Remove deprecated properties
The `hscroll` and `vscroll` properties were deprecated for GNOME 46.

We usually consider two stable cycles enough of a heads-up, so remove
them for GNOME 48.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
094caeeeef shell/window-preview: Make window-container construct-only
It is tightly coupled to the preview, and not meant to be unset
or replaced during the lifetime of the object; size requests
and allocation assume that it exists.

Make that explicit by marking the property as construct-only.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
eae1e8b170 shell/window-tracker: Simplify updating focus-app
It's a text-book use case for `g_set_object()` …

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
e2f4a9b512 shell/workspace-background: Remove unnecessary notify
The `monitor-index` property is construct-only, so it can only
be set before the caller has an object on which to connect
the `notify` signal.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
959888c601 shell/global: Remove unnecessary CONSTRUCT flag
There's nothing special about the `force-animations` property that
requires it to be set unconditionally during construction.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:04 +00:00
Florian Müllner
1c98283e09 shell/global: Remove imagedir property
The property has long lost its usefulness: It hasn't been
used since 2011, and we nowadays we use resources for any
image assets.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:03 +00:00
Florian Müllner
6c47cea2b9 build: Clean up handling of internal dependencies
We currently only specify the library to link with when declaring
a dependency, which means that satisfying other requirements like
dependencies or includes is left to the targets.

Move everything required by libshell/libst to the declared dependency,
so other targets only need to care about their own requirements.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3615>
2025-01-27 12:06:03 +00:00
Florian Müllner
0c20407f57 st/box-layout: Remove unnecessary notify
We already notify via the `notify::orientation` handler on the
layout manager, so there is no need to also do so from our own
setter.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3613>
2025-01-26 22:55:55 +01:00
Florian Müllner
a80e5a8c39 st/box-layout: Fix forwarding vertical changes
Our code to "forward" `notify` signals from the underlying layout
manager for the `vertical` property broke when ClutterLayoutManager
removed its own `vertical` property.

Property changes via the underlying layout manager should be rare,
but still worth fixing, so explicitly connect to `notify::orientation`
now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3613>
2025-01-26 22:55:55 +01:00
Bilal Elmoussaoui
1471733dfd st/widget: Adapt to upstreamed accessible state tracking
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3510>
2025-01-20 14:38:06 +00:00
Bilal Elmoussaoui
44b84e458a st/image-content: Take a CoglContext on set_bytes/set_data functions
This avoids retrieving it from the global clutter backend and instead
pass things around.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:31 +00:00
Bilal Elmoussaoui
76f2262d9c st/texture-cache: Remove unused helper
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:31 +00:00
Bilal Elmoussaoui
a8496dc90f st/theme-node: Get resolution from context
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:30 +00:00
Bilal Elmoussaoui
eaee51ff16 st/theme-context: Keep a pointer to ClutterBackend
Allows avoiding the usage of the global one and would also be used in
the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:30 +00:00
Bilal Elmoussaoui
f5b58cf102 st/theme-context: Drop constructor
Nothing really uses it except internally.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:30 +00:00
Bilal Elmoussaoui
343761e70e st/node-drawing: Pass CoglContext around
We already have access to it in most of places, just pass it around
instead of going through globals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Bilal Elmoussaoui
084a1b3be7 plugin: Remove unused CoglContext field
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Bilal Elmoussaoui
0e92689801 Remove re-shadowed variable
Drops a call to get_default_backend

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00
Bilal Elmoussaoui
b3f5f9601b Go through global stage for getting ClutterBackend
Instead of using the default backend.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3528>
2025-01-20 11:50:29 +00:00