[gnome-shell/wip/carlosg/dnd-fixes: 2/2] dnd: Multiply drag threshold by output scale



commit a884444cf7fccfafe7141b2239e1644b41dc4501
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Mar 12 02:14:07 2019 +0100

    dnd: Multiply drag threshold by output scale
    
    So it comes out right on hidpi, and consistent with clients.

 js/ui/dnd.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index f92339dae..be662eec7 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -450,7 +450,8 @@ var _Draggable = class _Draggable {
         let [stageX, stageY] = event.get_coords();
 
         // See if the user has moved the mouse enough to trigger a drag
-        let threshold = St.Settings.get().drag_threshold;
+        let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
+        let threshold = St.Settings.get().drag_threshold * scaleFactor;
         if (Math.abs(stageX - this._dragStartX) > threshold ||
             Math.abs(stageY - this._dragStartY) > threshold) {
             this.startDrag(stageX, stageY, event.get_time(), this._touchSequence, event.get_device());


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]