From 42e27e7b5b49a8611b689685a7d7437d11c26a47 Mon Sep 17 00:00:00 2001 From: david mueller Date: Mon, 15 Dec 2025 11:09:46 +0100 Subject: [PATCH] gmoccapy: fix homing abort on focus out event Don't cancel joint jogging on focus out if the joint is currently homing. This fixes https://github.com/LinuxCNC/linuxcnc/issues/2630 --- src/emc/usr_intf/gmoccapy/gmoccapy.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py index 45f95e00a1c..44f7eb1de43 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.py +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py @@ -3175,13 +3175,16 @@ def on_window1_destroy(self, widget, data=None): Gtk.main_quit() def on_focus_out(self, widget, data=None): + LOG.debug("focus-out-event") self.stat.poll() if self.stat.enabled and self.stat.task_mode == linuxcnc.MODE_MANUAL and self.stat.current_vel > 0: # cancel any joints jogging JOGMODE = self._get_jog_mode() for jnum in range(self.stat.joints): - self.command.jog(linuxcnc.JOG_STOP, JOGMODE, jnum) - LOG.debug("Stopped jogging on focus-out-event") + # don't cancel if the joint is homing + if not self.stat.joint[jnum]["homing"]: + self.command.jog(linuxcnc.JOG_STOP, JOGMODE, jnum) + LOG.debug("Stopped jogging for joint %d on focus-out-event" % (jnum)) # What to do if a macro button has been pushed def _on_btn_macro_pressed( self, widget = None, data = None ):