From 32834e5874af799aed0ff9f2717dfdc89d7573e0 Mon Sep 17 00:00:00 2001 From: lenemter Date: Mon, 28 Jul 2025 22:13:39 +0900 Subject: [PATCH 1/5] Initiate window drag only after drag threshold is reached --- wingpanel-interface/FocusManager.vala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/wingpanel-interface/FocusManager.vala b/wingpanel-interface/FocusManager.vala index fc4a2ddc..ac19c853 100644 --- a/wingpanel-interface/FocusManager.vala +++ b/wingpanel-interface/FocusManager.vala @@ -120,6 +120,8 @@ public class WingpanelInterface.FocusManager : Object { var proxy = wm.push_modal (stage); ulong handler = 0; + var started_drag = false; + float start_x = 0, start_y = 0; handler = stage.captured_event.connect ((event) => { if (event.get_type () == LEAVE || event.get_type () == ENTER) { // We need to filter ENTER for X because reasons I don't understand :( (I think something with pushing modal) /* We get leave emitted when beginning a grab op, so we have @@ -128,6 +130,21 @@ public class WingpanelInterface.FocusManager : Object { } if (event.get_type () == MOTION || event.get_type () == TOUCH_UPDATE) { + if (!started_drag) { + started_drag = true; + event.get_coords (out start_x, out start_y); + + return Clutter.EVENT_PROPAGATE; + } + + float current_x, current_y; + event.get_coords (out current_x, out current_y); + + var drag_threshold = Clutter.Settings.get_default ().dnd_drag_threshold; + if ((start_x - current_x).abs () <= drag_threshold && (start_y - current_y).abs () <= drag_threshold) { + return Clutter.EVENT_PROPAGATE; + } + #if HAS_MUTTER46 window.begin_grab_op ( Meta.GrabOp.MOVING, From f6990a1b17277ae6b5de8e705c926ad2e33f4788 Mon Sep 17 00:00:00 2001 From: lenemter Date: Mon, 28 Jul 2025 22:16:03 +0900 Subject: [PATCH 2/5] Restart CI From 0fb1e77480ae7ce9c40583eae38d3a7ec9718c0a Mon Sep 17 00:00:00 2001 From: lenemter Date: Mon, 28 Jul 2025 23:01:07 +0900 Subject: [PATCH 3/5] Update copyright header --- wingpanel-interface/FocusManager.vala | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/wingpanel-interface/FocusManager.vala b/wingpanel-interface/FocusManager.vala index ac19c853..6c207b40 100644 --- a/wingpanel-interface/FocusManager.vala +++ b/wingpanel-interface/FocusManager.vala @@ -1,20 +1,7 @@ /* - * Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. + * SPDX-License-Identifier: GPL-2-or-later + * SPDX-FileCopyrightText: 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel) + * 2025 elementary, Inc. (https://elementary.io) */ public class WingpanelInterface.FocusManager : Object { From 95cc5c44de99b162ec37d985d92bb19c3a50b367 Mon Sep 17 00:00:00 2001 From: lenemter Date: Sun, 21 Sep 2025 10:52:27 +0300 Subject: [PATCH 4/5] Fix distance check --- wingpanel-interface/FocusManager.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wingpanel-interface/FocusManager.vala b/wingpanel-interface/FocusManager.vala index beacbb43..92ee10c6 100644 --- a/wingpanel-interface/FocusManager.vala +++ b/wingpanel-interface/FocusManager.vala @@ -127,8 +127,10 @@ public class WingpanelInterface.FocusManager : Object { float current_x, current_y; event.get_coords (out current_x, out current_y); + var dx = start_x - current_x; + var dy = start_y - current_y; var drag_threshold = Clutter.Settings.get_default ().dnd_drag_threshold; - if ((start_x - current_x).abs () <= drag_threshold && (start_y - current_y).abs () <= drag_threshold) { + if (dx * dx + dy * dy < drag_threshold * drag_threshold) { return Clutter.EVENT_PROPAGATE; } From ed7d0929543ceca8723f305d727b99cde3d6059c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 2 Dec 2025 09:52:05 -0800 Subject: [PATCH 5/5] Update wingpanel.metainfo.xml.in --- data/wingpanel.metainfo.xml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/wingpanel.metainfo.xml.in b/data/wingpanel.metainfo.xml.in index 615d9423..a24ba106 100644 --- a/data/wingpanel.metainfo.xml.in +++ b/data/wingpanel.metainfo.xml.in @@ -44,7 +44,9 @@ + Don't initiate focus/drag on click/release Wingpanel stays black until hovering over dock after minimizing all windows using wmctrl + Window switch on wingpanel click Less heavy "scroll to change desktop" Whitelist/Blacklist: still relevant? Use dark style in greeter session