Skip to content

Commit 2bacfd4

Browse files
TimP4wdomferr
authored andcommitted
feat: add touch support
1 parent bfd9dde commit 2bacfd4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget<Suggestion
8080
this._recursivelyShowPopup(nontiledWindows, monitorIndex);
8181

8282
this._signals.disconnect();
83+
this._signals.connect(this, 'touch-event', () => this.close());
8384
this._signals.connect(this, 'key-focus-out', () => this.close());
8485
this._signals.connect(this, 'button-press-event', () => {
8586
// if a window clone is pressed by a button, it will stop propagating the event
@@ -188,8 +189,7 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget<Suggestion
188189
});
189190
});
190191

191-
// when the clone is selected by the user
192-
winClone.connect('button-press-event', () => {
192+
const onSuggestionPress = () => {
193193
// we will focus it later, after the animation and if any other window is tiled
194194
this._lastTiledWindow = nonTiledWin;
195195
// place this window on TOP of everyone ()
@@ -246,7 +246,12 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget<Suggestion
246246
preview.close(true);
247247
this._recursivelyShowPopup(nontiledWindows, monitorIndex);
248248
return Clutter.EVENT_STOP; // Blocca la propagazione
249-
});
249+
};
250+
251+
// when the clone is selected by the user
252+
winClone.connect('button-press-event', onSuggestionPress);
253+
winClone.connect('touch-event', onSuggestionPress);
254+
250255
return winClone;
251256
});
252257

0 commit comments

Comments
 (0)