import CS gnome-shell-extensions-40.7-19.el9

This commit is contained in:
eabdullin 2024-09-30 15:35:14 +00:00
parent 968a9e9761
commit 208de79030
7 changed files with 4556 additions and 1 deletions

View File

@ -0,0 +1,101 @@
From 13ea90a5f6f5e73d83a2ab04ea70c6263f6d8f5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 21 May 2024 19:01:30 +0200
Subject: [PATCH] Add move-clock extension
---
extensions/move-clock/extension.js | 38 ++++++++++++++++++++++++++
extensions/move-clock/meson.build | 5 ++++
extensions/move-clock/metadata.json.in | 10 +++++++
meson.build | 1 +
4 files changed, 54 insertions(+)
create mode 100644 extensions/move-clock/extension.js
create mode 100644 extensions/move-clock/meson.build
create mode 100644 extensions/move-clock/metadata.json.in
diff --git a/extensions/move-clock/extension.js b/extensions/move-clock/extension.js
new file mode 100644
index 00000000..571567f7
--- /dev/null
+++ b/extensions/move-clock/extension.js
@@ -0,0 +1,38 @@
+/* exported enable disable */
+const Main = imports.ui.main;
+const SessionMode = imports.ui.sessionMode;
+
+class MoveClockExtension {
+ enable() {
+ const panel = SessionMode._modes['user'].panel;
+
+ const clockIndex = panel.center.indexOf('dateMenu');
+ this._modified = clockIndex !== -1;
+
+ if (!this._modified)
+ return;
+
+ panel.center.splice(clockIndex, 1);
+ panel.right.splice(-1, 0, 'dateMenu');
+
+ Main.panel._updatePanel();
+ }
+
+ disable() {
+ if (!this._modified)
+ return;
+
+ const panel = SessionMode._modes['user'].panel;
+ const clockIndex = panel.right.indexOf('dateMenu');
+
+ if (clockIndex !== -1)
+ panel.right.splice(clockIndex, 1);
+ panel.center.unshift('dateMenu');
+
+ Main.panel._updatePanel();
+ }
+}
+
+function init() {
+ return new MoveClockExtension();
+}
diff --git a/extensions/move-clock/meson.build b/extensions/move-clock/meson.build
new file mode 100644
index 00000000..48504f63
--- /dev/null
+++ b/extensions/move-clock/meson.build
@@ -0,0 +1,5 @@
+extension_data += configure_file(
+ input: metadata_name + '.in',
+ output: metadata_name,
+ configuration: metadata_conf
+)
diff --git a/extensions/move-clock/metadata.json.in b/extensions/move-clock/metadata.json.in
new file mode 100644
index 00000000..d872ab63
--- /dev/null
+++ b/extensions/move-clock/metadata.json.in
@@ -0,0 +1,10 @@
+{
+"extension-id": "@extension_id@",
+"uuid": "@uuid@",
+"settings-schema": "@gschemaname@",
+"gettext-domain": "@gettext_domain@",
+"name": "Move notification menu",
+"description": "Move the notification menu to the right",
+"shell-version": [ "@shell_current@" ],
+"url": "@url@"
+}
diff --git a/meson.build b/meson.build
index 7e6ed3e8..ea6efb76 100644
--- a/meson.build
+++ b/meson.build
@@ -53,6 +53,7 @@ all_extensions += [
'dash-to-dock',
'dash-to-panel',
'gesture-inhibitor',
+ 'move-clock',
'native-window-placement',
'panel-favorites',
'systemMonitor',
--
2.45.1

View File

@ -0,0 +1,242 @@
From a796215ddce14ebe80774b99e29d0d28109c818b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 6 Mar 2024 20:14:14 +0100
Subject: [PATCH] desktop-icons: Handle touch events
File icons currently only deal with button events. Split up the
current handlers and use them to handle touch events as well.
---
extensions/desktop-icons/fileItem.js | 181 +++++++++++++++++++--------
1 file changed, 128 insertions(+), 53 deletions(-)
diff --git a/extensions/desktop-icons/fileItem.js b/extensions/desktop-icons/fileItem.js
index 37ee54db..26afddb2 100644
--- a/extensions/desktop-icons/fileItem.js
+++ b/extensions/desktop-icons/fileItem.js
@@ -140,6 +140,7 @@ var FileItem = GObject.registerClass({
this._container.connect('leave-event', (actor, event) => this._onLeave(actor, event));
this._container.connect('enter-event', (actor, event) => this._onEnter(actor, event));
this._container.connect('button-release-event', (actor, event) => this._onReleaseButton(actor, event));
+ this._container.connect('touch-event', (actor, event) => this._onTouchEvent(actor, event));
/* Set the metadata and update relevant UI */
this._updateMetadataFromFileInfo(fileInfo);
@@ -229,6 +230,10 @@ var FileItem = GObject.registerClass({
if (this._iconAllocationIdleId)
GLib.source_remove(this._iconAllocationIdleId);
+ if (this._longPressTimeoutId)
+ GLib.source_remove(this._longPressTimeoutId);
+ delete this._longPressTimeoutId;
+
/* Menu */
this._removeMenu();
}
@@ -731,58 +736,141 @@ var FileItem = GObject.registerClass({
}
_updateClickState(event) {
+ const eventType = event.type();
+ const isButton =
+ eventType === Clutter.EventType.BUTTON_PRESS ||
+ eventType === Clutter.EventType.BUTTON_RELEASE;
+ const button = isButton ? event.get_button() : 0;
+ const time = event.get_time();
+
let settings = Clutter.Settings.get_default();
- if ((event.get_button() == this._lastClickButton) &&
- ((event.get_time() - this._lastClickTime) < settings.double_click_time))
+ if (button === this._lastClickButton &&
+ (time - this._lastClickTime) < settings.double_click_time)
this._clickCount++;
else
this._clickCount = 1;
- this._lastClickTime = event.get_time();
- this._lastClickButton = event.get_button();
+ this._lastClickTime = time;
+ this._lastClickButton = button;
}
_getClickCount() {
return this._clickCount;
}
+ _handlePressEvent(event) {
+ const pressSequence = event.get_event_sequence();
+ if (this._pressSequence &&
+ pressSequence?.get_slot() !== this._pressSequence.get_slot())
+ return Clutter.EVENT_PROPAGATE;
+
+ this._primaryButtonPressed = true;
+ this._pressSequence = pressSequence;
+ this._pressDevice = event.get_device();
+
+ if (this._getClickCount() !== 1)
+ return Clutter.EVENT_STOP;
+
+ const [x, y] = event.get_coords();
+ this._buttonPressInitialX = x;
+ this._buttonPressInitialY = y;
+
+ const shiftPressed = !!(event.get_state() & Clutter.ModifierType.SHIFT_MASK);
+ const controlPressed = !!(event.get_state() & Clutter.ModifierType.CONTROL_MASK);
+ if (controlPressed || shiftPressed)
+ this.emit('selected', true, false, !this._isSelected);
+ else if (!this._isSelected)
+ this.emit('selected', false, false, true);
+
+ return Clutter.EVENT_STOP;
+ }
+
+ _handleSecondaryPress() {
+ if (!this.isSelected)
+ this.emit('selected', false, false, true);
+ this._ensureMenu().toggle();
+ if (this._actionOpenWith) {
+ let allowOpenWith = Extension.desktopManager.getNumberOfSelectedItems() === 1;
+ this._actionOpenWith.setSensitive(allowOpenWith);
+ }
+ const specialFilesSelected =
+ Extension.desktopManager.checkIfSpecialFilesAreSelected();
+ if (this._actionCut)
+ this._actionCut.setSensitive(!specialFilesSelected);
+ if (this._actionCopy)
+ this._actionCopy.setSensitive(!specialFilesSelected);
+ if (this._actionTrash)
+ this._actionTrash.setSensitive(!specialFilesSelected);
+ return Clutter.EVENT_STOP;
+ }
+
+ _handleReleaseEvent(event) {
+ if (this._longPressTimeoutId)
+ GLib.source_remove(this._longPressTimeoutId);
+ delete this._longPressTimeoutId;
+
+ if (!this._primaryButtonPressed || this._pressDevice !== event.get_device())
+ return Clutter.EVENT_PROPAGATE;
+
+ const pressSequence = event.get_event_sequence();
+ if (this._pressSequence &&
+ pressSequence?.get_slot() !== this._pressSequence.get_slot())
+ return Clutter.EVENT_PROPAGATE;
+
+ // primaryButtonPressed is TRUE only if the user has pressed the button
+ // over an icon, and if (s)he has not started a drag&drop operation
+ this._primaryButtonPressed = false;
+ delete this._pressDevice;
+ delete this._pressSequence;
+
+ let shiftPressed = !!(event.get_state() & Clutter.ModifierType.SHIFT_MASK);
+ let controlPressed = !!(event.get_state() & Clutter.ModifierType.CONTROL_MASK);
+ if (!controlPressed && !shiftPressed)
+ this.emit('selected', false, false, true);
+ if (this._getClickCount() === 1 && Prefs.CLICK_POLICY_SINGLE && !shiftPressed && !controlPressed)
+ this.doOpen();
+ if (this._getClickCount() === 2 && !Prefs.CLICK_POLICY_SINGLE)
+ this.doOpen();
+ return Clutter.EVENT_STOP;
+ }
+
+ _onTouchEvent(actor, event) {
+ // on X11, let pointer emulation deal with touch
+ if (!Meta.is_wayland_compositor())
+ return Clutter.EVENT_PROPAGATE;
+
+ const type = event.type();
+ if (type === Clutter.EventType.TOUCH_BEGIN) {
+ Extension.desktopManager.endRubberBand();
+ this._updateClickState(event);
+
+ if (!this._handlePressEvent(event))
+ return Clutter.EVENT_PROPAGATE;
+
+ const { longPressDuration } = Clutter.Settings.get_default();
+ this._longPressTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ longPressDuration,
+ () => {
+ this._handleSecondaryPress();
+ delete this._longPressTimeoutId;
+ return GLib.SOURCE_REMOVE;
+ });
+
+ return Clutter.EVENT_STOP;
+ } else if (type === Clutter.EventType.TOUCH_END) {
+ return this._handleReleaseEvent(event);
+ }
+ return Clutter.EVENT_PROPAGATE;
+ }
+
_onPressButton(actor, event) {
Extension.desktopManager.endRubberBand();
this._updateClickState(event);
let button = event.get_button();
- if (button == 3) {
- if (!this.isSelected)
- this.emit('selected', false, false, true);
- this._ensureMenu().toggle();
- if (this._actionOpenWith) {
- let allowOpenWith = (Extension.desktopManager.getNumberOfSelectedItems() == 1);
- this._actionOpenWith.setSensitive(allowOpenWith);
- }
- let specialFilesSelected = Extension.desktopManager.checkIfSpecialFilesAreSelected();
- if (this._actionCut)
- this._actionCut.setSensitive(!specialFilesSelected);
- if (this._actionCopy)
- this._actionCopy.setSensitive(!specialFilesSelected);
- if (this._actionTrash)
- this._actionTrash.setSensitive(!specialFilesSelected);
- return Clutter.EVENT_STOP;
- } else if (button == 1) {
- if (this._getClickCount() == 1) {
- let [x, y] = event.get_coords();
- this._primaryButtonPressed = true;
- this._buttonPressInitialX = x;
- this._buttonPressInitialY = y;
- let shiftPressed = !!(event.get_state() & Clutter.ModifierType.SHIFT_MASK);
- let controlPressed = !!(event.get_state() & Clutter.ModifierType.CONTROL_MASK);
- if (controlPressed || shiftPressed) {
- this.emit('selected', true, false, !this._isSelected);
- } else {
- if (!this._isSelected)
- this.emit('selected', false, false, true);
- }
- }
- return Clutter.EVENT_STOP;
- }
+ if (button == 3)
+ return this._handleSecondaryPress();
+ if (button == 1)
+ return this._handlePressEvent(event);
return Clutter.EVENT_PROPAGATE;
}
@@ -821,22 +909,9 @@ var FileItem = GObject.registerClass({
_onReleaseButton(actor, event) {
let button = event.get_button();
- if (button == 1) {
- // primaryButtonPressed is TRUE only if the user has pressed the button
- // over an icon, and if (s)he has not started a drag&drop operation
- if (this._primaryButtonPressed) {
- this._primaryButtonPressed = false;
- let shiftPressed = !!(event.get_state() & Clutter.ModifierType.SHIFT_MASK);
- let controlPressed = !!(event.get_state() & Clutter.ModifierType.CONTROL_MASK);
- if (!controlPressed && !shiftPressed)
- this.emit('selected', false, false, true);
- if ((this._getClickCount() == 1) && Prefs.CLICK_POLICY_SINGLE && !shiftPressed && !controlPressed)
- this.doOpen();
- return Clutter.EVENT_STOP;
- }
- if ((this._getClickCount() == 2) && (!Prefs.CLICK_POLICY_SINGLE))
- this.doOpen();
- }
+ if (button == 1)
+ return this._handleReleaseEvent(event);
+
return Clutter.EVENT_PROPAGATE;
}
--
2.44.0

View File

@ -0,0 +1,40 @@
From 8389801814c84c797a29f986f15e7ea4dd27bccc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 6 Mar 2024 13:48:49 +0100
Subject: [PATCH] desktop-icons: Notify icon drags
Components like the message tray will use the signal to hide
their layout actor from picks, so that it does no interfere
with the DND operation.
---
extensions/desktop-icons/desktopManager.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/extensions/desktop-icons/desktopManager.js b/extensions/desktop-icons/desktopManager.js
index 75b2a22a..c3b3f7e4 100644
--- a/extensions/desktop-icons/desktopManager.js
+++ b/extensions/desktop-icons/desktopManager.js
@@ -547,17 +547,20 @@ var DesktopManager = GObject.registerClass({
this._draggableContainer.allocate_preferred_size(0, 0);
this._draggable.startDrag(x, y, global.get_current_time(), event.get_event_sequence());
+ Main.overview.beginItemDrag(this._draggableContainer);
}
_onDragCancelled() {
let event = Clutter.get_current_event();
let [x, y] = event.get_coords();
this._dragCancelled = true;
+ Main.overview.cancelledItemDrag(this._draggableContainer);
}
_onDragEnd() {
this._inDrag = false;
Main.layoutManager.uiGroup.remove_child(this._draggableContainer);
+ Main.overview.endItemDrag(this._draggableContainer);
}
_dragActorDropped(event) {
--
2.44.0

View File

@ -0,0 +1,51 @@
From 64d4841a77293a45e769b868e1109b63811be7d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 2 Jul 2024 19:04:10 +0200
Subject: [PATCH] workspace-indicator: Re-fittsify workspace previews
For the window-list extension, it is important that the workspace
previews extend to the bottom edge for easier click targets.
That broke while merging the code with the workspace-indicator,
fix it again by moving the padding from the parent box into the
thumbnail children.
---
.../workspace-indicator/stylesheet-dark.css | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/extensions/workspace-indicator/stylesheet-dark.css b/extensions/workspace-indicator/stylesheet-dark.css
index fb0e8b1a..017d844a 100644
--- a/extensions/workspace-indicator/stylesheet-dark.css
+++ b/extensions/workspace-indicator/stylesheet-dark.css
@@ -11,7 +11,6 @@
}
.workspace-indicator .workspaces-box {
- padding: 5px;
spacing: 3px;
}
@@ -20,6 +19,20 @@
spacing: 6px;
}
+.workspace-indicator .workspace-box {
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+.workspace-indicator StButton:first-child:ltr > .workspace-box,
+.workspace-indicator StButton:last-child:rtl > .workspace-box {
+ padding-left: 5px;
+}
+.workspace-indicator StButton:last-child:ltr > .workspace-box,
+.workspace-indicator StButton:first-child:rtl > .workspace-box {
+ padding-right: 5px;
+}
+
.workspace-indicator-menu .workspace-box {
spacing: 6px;
}
--
2.45.2

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
From 34d8854677513b016a08a04cdd9973b165146215 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 19 Mar 2024 13:16:50 +0100
Subject: [PATCH 1/2] window-list: Use more appropriate fallback icon
'icon-missing' is not an actual icon name. It somewhat works
because an invalid icon name will fallback to the correct
'image-missing', however for apps the generic app icon is
a better fallback.
---
extensions/window-list/extension.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 91ee3e6b..1f112548 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -188,7 +188,7 @@ class WindowTitle extends St.BoxLayout {
this._icon.child = app.create_icon_texture(ICON_TEXTURE_SIZE);
} else {
this._icon.child = new St.Icon({
- icon_name: 'icon-missing',
+ icon_name: 'application-x-executable',
icon_size: ICON_TEXTURE_SIZE,
});
}
--
2.44.0
From 032cfb3593651c8344a59828a9c674f148329889 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 19 Mar 2024 14:07:12 +0100
Subject: [PATCH 2/2] window-list: Override with window icon if available
---
extensions/window-list/extension.js | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 1f112548..0c28692d 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -192,6 +192,23 @@ class WindowTitle extends St.BoxLayout {
icon_size: ICON_TEXTURE_SIZE,
});
}
+
+ // Override with window icon if available
+ if (this._hasWindowIcon()) {
+ const textureCache = St.TextureCache.get_default();
+ this._icon.child.gicon = textureCache.bind_cairo_surface_property(
+ this._metaWindow, 'icon');
+ }
+ }
+
+ _hasWindowIcon() {
+ // HACK: GI cannot handle CairoSurface, so this
+ // will throw if the icon property is null
+ try {
+ return this._metaWindow.icon !== null;
+ } catch (e) {
+ return true;
+ }
}
_onDestroy() {
--
2.44.0

View File

@ -7,7 +7,7 @@
Name: gnome-shell-extensions
Version: 40.7
Release: 12%{?dist}
Release: 19%{?dist}
Summary: Modify and extend GNOME Shell functionality and behavior
License: GPLv2+
@ -43,6 +43,12 @@ Patch020: 0001-window-list-Explicitly-dispose-settings-on-destroy.patch
Patch021: 0001-desktop-icons-Don-t-try-spawn-with-non-existent-work.patch
Patch022: 0001-docking-Only-remove-spacer-if-necessary.patch
Patch023: 0001-classification-banner-Hide-from-picks.patch
Patch024: 0001-desktop-icons-Notify-icon-drags.patch
Patch025: prefer-window-icon.patch
Patch026: 0001-desktop-icons-Handle-touch-events.patch
Patch027: more-ws-previews.patch
Patch028: 0001-Add-move-clock-extension.patch
Patch029: 0001-workspace-indicator-Re-fittsify-workspace-previews.patch
%description
GNOME Shell Extensions is a collection of extensions providing additional and
@ -60,6 +66,7 @@ Enabled extensions:
* gesture-inhibitor
* launch-new-instance
* heads-up-display
* move-clock
* native-window-placement
* panel-favorites
* places-menu
@ -198,6 +205,15 @@ This GNOME Shell extension modifies the behavior of clicking in the dash and app
launcher to always launch a new application instance.
%package -n %{pkg_prefix}-move-clock
Summary: Move GNOME Shell notification menu to the right
License: GPLv2+
Requires: %{pkg_prefix}-common = %{version}-%{release}
%description -n %{pkg_prefix}-move-clock
This GNOME Shell extension moves the notification menu to the right.
%package -n %{pkg_prefix}-heads-up-display
Summary: Display persistent on-screen message
Group: User Interface/Desktops
@ -391,6 +407,10 @@ workspaces.
%{_datadir}/gnome-shell/extensions/launch-new-instance*/
%files -n %{pkg_prefix}-move-clock
%{_datadir}/gnome-shell/extensions/move-clock*/
%files -n %{pkg_prefix}-heads-up-display
%{_datadir}/glib-2.0/schemas/org.gnome.shell.extensions.heads-up-display.gschema.xml
%{_datadir}/gnome-shell/extensions/heads-up-display*/
@ -443,9 +463,38 @@ workspaces.
%files -n %{pkg_prefix}-workspace-indicator
%{_datadir}/gnome-shell/extensions/workspace-indicator*/
%{_datadir}/glib-2.0/schemas/org.gnome.shell.extensions.workspace-indicator.gschema.xml
%changelog
* Tue Jul 02 2024 Florian Müllner <fmuellner@redhat.com> - 40.7-19
- Extend workspace buttons to screen edge
Resolves: RHEL-43545
* Tue May 21 2024 Florian Müllner <fmuellner@redhat.com> - 40.7-18
- Add "move-clock" extension
Resolves: RHEL-33429
* Fri Apr 19 2024 Florian Müllner <fmuellner@redhat.com> - 40.7-17
- Fix downstream stylesheets
Resolves: RHEL-25016
* Wed Apr 03 2024 Florian Müllner <fmuellner@redhat.com> - 40.7-16
- Improve workspace previews
Resolves: RHEL-25016
* Tue Mar 19 2024 Florian Müllner <fmuellner@redhat.com> - 40.7-15
- Handle touch events in desktop icons
Resolves: RHEL-22713
* Tue Mar 19 2024 Florian Müllner <fmuellner@redhat.com> - 40.7-14
- Prefer window icons in window list
Resolves: RHEL-24713
* Wed Mar 06 2024 Florian Müllner <fmuellner@redhat.com> - 40.7-13
- Notify on desktop icon drags
Resolves: RHEL-26989
* Fri Feb 02 2024 Florian Müllner <fmuellner@redhat.com> - 40.7-12
- Hide classification banners from picks
Resolves: RHEL-22789