Use window icons in overview if available

Resolves: RHEL-24713
This commit is contained in:
Florian Müllner 2024-03-19 14:12:03 +01:00
parent 300358e159
commit c44a28d57d
No known key found for this signature in database
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,46 @@
From 1cad6c8d47fb9f0b17a2c47f93e5f923d1cb32c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 7 Mar 2024 18:22:32 +0100
Subject: [PATCH] windowPreview: Override with window icon if available
---
js/ui/windowPreview.js | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/js/ui/windowPreview.js b/js/ui/windowPreview.js
index e67ec9ec0f..db325258b4 100644
--- a/js/ui/windowPreview.js
+++ b/js/ui/windowPreview.js
@@ -123,6 +123,12 @@ var WindowPreview = GObject.registerClass({
const tracker = Shell.WindowTracker.get_default();
const app = tracker.get_window_app(this.metaWindow);
this._icon = app.create_icon_texture(ICON_SIZE);
+ // Override with window icon if available
+ if (this._hasWindowIcon()) {
+ const textureCache = St.TextureCache.get_default();
+ this._icon.gicon = textureCache.bind_cairo_surface_property(
+ this.metaWindow, 'icon');
+ }
this._icon.add_style_class_name('icon-dropshadow');
this._icon.set({
reactive: true,
@@ -226,6 +232,16 @@ var WindowPreview = GObject.registerClass({
});
}
+ _hasWindowIcon() {
+ // HACK: GI cannot handle CairoSurface, so this
+ // will throw if the icon property is non-null
+ try {
+ return this.metaWindow.icon !== null;
+ } catch (e) {
+ return true;
+ }
+ }
+
_updateIconScale() {
const { ControlsState } = OverviewControls;
const { currentState, initialState, finalState } =
--
2.44.0

View File

@ -2,7 +2,7 @@
Name: gnome-shell
Version: 40.10
Release: 17%{?dist}
Release: 18%{?dist}
Summary: Window management and application launching for GNOME
License: GPLv2+
@ -60,6 +60,7 @@ Patch56: owe-support.patch
Patch57: 0001-windowMenu-Ignore-release.patch
Patch58: optional-portal-helper.patch
Patch59: 0001-extensionSystem-Support-locking-down-extension-insta.patch
Patch60: 0001-windowPreview-Override-with-window-icon-if-available.patch
%define eds_version 3.33.1
%define gnome_desktop_version 3.35.91
@ -279,6 +280,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/evolution-calendar.de
%{_mandir}/man1/gnome-shell.1*
%changelog
* Tue Mar 19 2024 Florian Müllner <fmuellner@redhat.com> - 40.10-18
- Use window icon in overview if available
Resolves: RHEL-24713
* Sat Feb 10 2024 Florian Müllner <fmuellner@redhat.com> - 40.10-17
- Allow restricting extension installation
Resolves: RHEL-25017