all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit] fix drag&drop for pointerType 'pen'
@ 2022-02-23 11:05 Dominik Csapak
  2022-02-23 11:17 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2022-02-23 11:05 UTC (permalink / raw)
  To: pve-devel

some devices (e.g. vms via novnc, and some laptops) get the pointerType
'pen' under chromium.

the DragZone handler tries to ignore touch input for that by
checking for "=== 'mouse'" which does not include 'pen'
so override that to handle it when the pointerType !== 'touch'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/Toolkit.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/Toolkit.js b/src/Toolkit.js
index 3d0eefc..51634d3 100644
--- a/src/Toolkit.js
+++ b/src/Toolkit.js
@@ -685,6 +685,19 @@ Ext.define('Proxmox.Component', {
     clearPropertiesOnDestroy: false,
 });
 
+// Fix drag&drop for vms and desktops that detect 'pen' pointerType
+Ext.define('Proxmox.view.DragZone', {
+    override: 'Ext.view.DragZone',
+
+    onItemMouseDown: function(view, record, item, index, e) {
+        // Ignore touchstart.
+        // For touch events, we use longpress.
+        if (e.pointerType !== 'touch') {
+            this.onTriggerGesture(view, record, item, index, e);
+        }
+    },
+});
+
 // force alert boxes to be rendered with an Error Icon
 // since Ext.Msg is an object and not a prototype, we need to override it
 // after the framework has been initiated
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH widget-toolkit] fix drag&drop for pointerType 'pen'
  2022-02-23 11:05 [pve-devel] [PATCH widget-toolkit] fix drag&drop for pointerType 'pen' Dominik Csapak
@ 2022-02-23 11:17 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2022-02-23 11:17 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

On 23.02.22 12:05, Dominik Csapak wrote:
> some devices (e.g. vms via novnc, and some laptops) get the pointerType
> 'pen' under chromium.
> 
> the DragZone handler tries to ignore touch input for that by
> checking for "=== 'mouse'" which does not include 'pen'
> so override that to handle it when the pointerType !== 'touch'
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  src/Toolkit.js | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-23 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23 11:05 [pve-devel] [PATCH widget-toolkit] fix drag&drop for pointerType 'pen' Dominik Csapak
2022-02-23 11:17 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal