Skip to content

Commit

Permalink
version 16.1: ensure windows suggestions are working on gnome 45+
Browse files Browse the repository at this point in the history
  • Loading branch information
domferr committed Jan 13, 2025
1 parent a8d95ba commit 73a1558
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion resources/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion src/components/windowsSuggestions/suggestionsTilePreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 6 additions & 13 deletions src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,11 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget<Suggestion

this._signals.disconnect();
this._signals.connect(this, 'key-focus-out', () => 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',
Expand Down Expand Up @@ -251,6 +243,7 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget<Suggestion
nontiledWindows.splice(nontiledWindows.indexOf(nonTiledWin), 1);
preview.close(true);
this._recursivelyShowPopup(nontiledWindows, monitorIndex);
return Clutter.EVENT_STOP; // Blocca la propagazione
});
return winClone;
});
Expand Down

0 comments on commit 73a1558

Please sign in to comment.