From 73a15589db35ef2b953842ca182814d3d07b6ece Mon Sep 17 00:00:00 2001 From: Domenico Ferraro Date: Mon, 13 Jan 2025 20:23:44 +0100 Subject: [PATCH] version 16.1: ensure windows suggestions are working on gnome 45+ --- resources/metadata.json | 2 +- .../suggestionsTilePreview.ts | 6 +++++- .../tilingLayoutWithSuggestions.ts | 19 ++++++------------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/resources/metadata.json b/resources/metadata.json index 9a5c72c..d119e11 100644 --- a/resources/metadata.json +++ b/resources/metadata.json @@ -11,7 +11,7 @@ "47" ], "version": 99, - "version-name": "16.0", + "version-name": "16.1", "url": "https://github.com/domferr/tilingshell", "settings-schema": "org.gnome.shell.extensions.tilingshell", "gettext-domain": "tilingshell", diff --git a/src/components/windowsSuggestions/suggestionsTilePreview.ts b/src/components/windowsSuggestions/suggestionsTilePreview.ts index 20cf9ac..8f0ab09 100644 --- a/src/components/windowsSuggestions/suggestionsTilePreview.ts +++ b/src/components/windowsSuggestions/suggestionsTilePreview.ts @@ -74,8 +74,12 @@ export default class SuggestionsTilePreview extends TilePreview { x_expand: true, y_expand: true, }); + // @ts-expect-error "add_actor is valid" - this._scrollView.add_actor(this._container); + if (this._scrollView.add_actor) + // @ts-expect-error "add_actor is valid" + this._scrollView.add_actor(this._container); + else this._scrollView.add_child(this._container); this.add_child(this._scrollView); this._scrollView.get_hscroll_bar().opacity = 0; diff --git a/src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts b/src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts index 5a5c2d6..3363ab3 100644 --- a/src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts +++ b/src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts @@ -80,19 +80,11 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget this.close()); - this._signals.connect( - global.stage, - 'button-press-event', - (_: Clutter.Actor, event: Clutter.Event) => { - const isDescendant = this.contains(event.get_source()); - if ( - isDescendant && - (event.get_source() === this || - event.get_source() instanceof St.ScrollView) - ) - this.close(); - }, - ); + this._signals.connect(this, 'button-press-event', () => { + // if a window clone is pressed by a button, it will stop propagating the event + // then if this is called it is not a window clone that was pressed + this.close(); + }); this._signals.connect( global.stage, 'key-press-event', @@ -251,6 +243,7 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget