From 7680b85ea916642da8e5600a9b72f837b5f4030e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Thu, 18 Feb 2021 19:02:34 +0100 Subject: [PATCH] Reveal controls only with touch or pen --- src/widget.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/widget.js b/src/widget.js index 89cbc126..c2c4b902 100644 --- a/src/widget.js +++ b/src/widget.js @@ -742,8 +742,18 @@ class ClapperWidget extends Gtk.Grid _onReleased(gesture, nPress, x, y) { /* Reveal if touch was not a swipe or was already revealed */ - if(!this.isSwipePerformed || this.revealerBottom.child_revealed) - this.revealControls(); + if(!this.isSwipePerformed || this.revealerBottom.child_revealed) { + const { source } = gesture.get_device(); + + switch(source) { + case Gdk.InputSource.PEN: + case Gdk.InputSource.TOUCHSCREEN: + this.revealControls(); + break; + default: + break; + } + } } _onDragUpdate(gesture, offsetX, offsetY)