Only when part of it is actually visible.
Because the central rectangle is generally the largest part, this
eliminates most of the shadow's render time. For example, animating
`.workspace-background` by tapping Super, the shell's overall render
time is reduced about 15%.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1915>
WorkspaceBackground's allocate is a hot function called every frame
during overview animations. Port it to C.
While we're at it, cache the work area and the monitor geometry, which
do not need to be re-fetched on every allocation.
This reduces the average WorkspaceBackground allocation time from
0.134 ms to 0.017 ms. With four workspaces, scrolling the overview sees
an average WorkspacesView allocation time improvement from
1.104 ms to 0.678 ms.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2394>
The iterator was pointing to NULL when going out of scope, leading to
autofree not clearing the list.
==300183== 32 bytes in 2 blocks are definitely lost in loss record 14,798 of 38,939
==300183== at 0x484586F: malloc (vg_replace_malloc.c:381)
==300183== by 0x4D7D980: g_malloc (gmem.c:127)
==300183== by 0x4D95AB3: g_slice_alloc (gslice.c:1074)
==300183== by 0x4D96D96: g_slist_prepend (gslist.c:282)
==300183== by 0x487854F: shell_app_get_windows (shell-app.c:794)
==300183== by 0x48791A1: shell_app_get_pids (shell-app.c:1201)
==300183== by 0x488B293: shell_window_tracker_get_app_from_pid (shell-window-tracker.c:702)
==300183== by 0x488B632: get_app_from_window_pid (shell-window-tracker.c:370)
==300183== by 0x488B632: get_app_for_window (shell-window-tracker.c:436)
==300183== by 0x488B632: track_window (shell-window-tracker.c:549)
==300183== by 0x4CDBB75: g_cclosure_marshal_VOID__OBJECTv (gmarshal.c:1910)
==300183== by 0x4CD8BE9: _g_closure_invoke_va (gclosure.c:893)
==300183== by 0x4CF2A28: g_signal_emit_valist (gsignal.c:3406)
==300183== by 0x4CF2C2C: g_signal_emit (gsignal.c:3553)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2367>
Even though GNOME Shell is not explicitly using structured logging via
G_LOG_USE_STRUCTURED, GLib uses it as default since 2016 [1], and so
we're de facto using it.
As per this, if backtrace on warnings is enabled, it is ignored since the
log handler isn't used anymore, and no dump is printed.
Thus, replace the default log handlers with writer functions instead, honoring
backtrace-warnings debug string.
[1] https://gitlab.gnome.org/GNOME/glib/-/commit/fce7cfaf40b6e1e50c9140aa0397f5
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/697>
Applications launched using D-Bus activation will have a returned PID of
0, which systemd interprets as moving the requesting process to a new
scope, causing GNOME Shell to be moved to another scope. Fix this by not
creating a systemd scope when PID is 0.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2305>
GTK4 added a convenience property for icon-only buttons. While that
use case is not quite as common in the shell as in GTK apps, it still
seems common enough to mirror the GTK API.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2254>
We started tracking all windows to make sure the assumption that any
window can be match to an app holds. It is not expected however to
ever represent OR windows in the UI, so it seems better to exclude
them from get_windows() instead of expecting everyone to filter the
return value themselves.
(The returned list still includes "uninteresting" windows like attached
dialogs, which can be important for cases like the correct MRU order in
alt-tab)
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5233
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2252>
When neither the theme node itself nor any of its parents specifies
an explicit text direction, we default to aligning to the left.
That's a good default for LTR locales, but for RTL aligning to the
right is a better one.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2247>
As first mentioned in commit 672171093, the CSS spec defines shadow
colors independently from the colors casting the shadow. It's not
a physical light simulation so a shadow is allowed to be a different
color from texture casting it.
This means we only care about the shape of the source where alpha
values of zero are adjacent to alpha values of non-zero. And all such
non-zero pixels should be treated as fully opaque for the purpose of
shadow generation. While this would be wrong for a physical light
simulation it does allow us to cast shadows around semi-translucent
shapes and better support CSS.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4477
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1918>
ClutterEffects are responsible for queueing redraws when their
properties change (and StScrollViewFade is a good citizen already), also
Clutter itself should queue a redraw when adding/removing an effect.
Users of Clutter should never have to queue redraws themselves (unless
they're implementing a custom ClutterEffect or ClutterContent), so don't
queue a redraw here.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2189>
The fade effect can also be added to the scroll view programatically
instead of using CSS via the st_scroll_view_update_fade_effect() API.
We make use of this API in the appDisplay, but since commit ba547ec1d
the fade margins get overridden to 0.0 from the ::style-changed handler.
Fix this by only setting the fade margins when CSS actually defines a
custom vfade/hfade offset.
Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5079
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2189>
Since now the resource consumption of the "style-changed" signal
handlers should be significantly lower, we can start emitting the signal
in all cases again as it was originally intended. This fixes some small
visual issues, like the battery percentage in the panel only being shown
on hover or updating the size of StIcons on scale-factor changes.
This effectively reverts f74c07b9ac
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1708
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2099>
Just like with the last commit, listen to some ClutterText property
changes to catch style changes that were trigerred by
_st_set_text_from_style() and invalidate the shadow spec on changes.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1744>
We update a few properties of ClutterText when the CSS changes via
_st_set_text_from_style() (which we call when receiving the
style-changed signal).
Right now we simply invalidate the text shadow every time we receive the
style-changed signal, but we're going to change that with the next
commits. To ensure the shadow still gets invalidated on CSS changed that
might affect the shadow, listen to a bunch of property changes that will
get notified when any property that affects the shadow changes.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1744>
When text shadows are used, the cursor indicating the current position
also casts a shadow.
This means we have to regenerate the shadow texture after the cursor
position changed, so invalidate the shadow in that case.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1744>
It's slightly more efficient not having to do property lookups. While
that is unlikely to be a concern for the properties in question, it's
still good practice and makes the code base a bit more consistent.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2168>
We are now consistently calling notify() when a property does change.
With that we can opt out of g_object_set()'s implicit change notifications,
so that notify is only emitted when a property *actually* changes.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2168>
It's slightly more efficient not having to do property lookups. While
that is unlikely to be a concern for the properties in question, it's
still good practice and makes the code base a bit more consistent.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2168>
- 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>