dnd: Multiply drag threshold by output scale

So it comes out right on hidpi, and consistent with clients.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/455
This commit is contained in:
Carlos Garnacho 2019-03-12 02:14:07 +01:00 committed by Georges Basile Stavracas Neto
parent 4a7e2ddff5
commit 62233a4db4

View File

@ -450,7 +450,8 @@ var _Draggable = class _Draggable {
let [stageX, stageY] = event.get_coords(); let [stageX, stageY] = event.get_coords();
// See if the user has moved the mouse enough to trigger a drag // 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 (!currentDraggable && if (!currentDraggable &&
(Math.abs(stageX - this._dragStartX) > threshold || (Math.abs(stageX - this._dragStartX) > threshold ||
Math.abs(stageY - this._dragStartY) > threshold)) { Math.abs(stageY - this._dragStartY) > threshold)) {