Package: release.debian.org
Affects: linuxcnc

The <URL: https://tracker.debian.org/pkg/linuxcnc > packaging in stable,
version 2.9.0~pre1+git20230208.f1270d6ed7-1, got a bug that can cause
unexpected and dangerous physical movement when used with some GUIs.
The LinuxCNC team would like to update the stable release with a fix for
<URL: https://bugs.debian.org/1053251 >, which include a patch.

The change is already in the git repo on
<URL: https://github.com/LinuxCNC/linuxcnc-gbp.git > in the
debian/bookworm branch.  The problem is already fixed in unstable with a
new version of the upstream code.  The proposed fix to stable is only
the minimal patch to solve the issue, plus an update documenting the
current gbp branches used to build the package.

I thus propose to use the version number
2.9.0~pre1+git20230208.f1270d6ed7-1+deb12u1, but am open to better
proposals.  The version in unstable is 2.9.3-1.

diff --git a/debian/changelog b/debian/changelog
index 1ca0921..21f354b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+linuxcnc (2.9.0~pre1+git20230208.f1270d6ed7-1+deb12u1) stable; urgency=medium
+
+  [ CMorley ]
+  * qtvcp -mdi_line: fix multi axes movement on single axis G0 MDI call
+    (Closes: #1053251).
+
+  [ Petter Reinholdtsen ]
+  * Added d/gbp.conf documenting branches used.
+
+ -- Petter Reinholdtsen <p...@debian.org>  Sun, 07 Jul 2024 16:08:51 +0200
+
 linuxcnc (2.9.0~pre1+git20230208.f1270d6ed7-1) unstable; urgency=medium
 
   * New upstream version 2.9.0~pre1+git20230208.f1270d6ed7 (Closes: #1023651).
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..3796750
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+debian-branch   = debian/bookworm
+upstream-branch = upstream
diff --git a/lib/python/qtvcp/widgets/mdi_line.py 
b/lib/python/qtvcp/widgets/mdi_line.py
index c6aa865..0c68764 100644
--- a/lib/python/qtvcp/widgets/mdi_line.py
+++ b/lib/python/qtvcp/widgets/mdi_line.py
@@ -66,6 +66,8 @@ class MDI(QLineEdit):
         except:
             self.mdiLast = None
             pass
+        # return callback GObject id
+        self._return_id = None
 
     def submit(self):
         self.mdiError = False
@@ -115,8 +117,20 @@ class MDI(QLineEdit):
         elif self.spindleInhibit and self.inhibit_spindle_commands(text):
             return
         else:
+
+            # make sure we didn't miss an display update callback.
+            # shouldn't be an update pending before the coming mdi command call
+            if self._return_id is not None:
+                STATUS.handler_disconnect(self._return_id)
+
             ACTION.CALL_MDI(text+'\n')
-            ACTION.RELOAD_DISPLAY()
+
+            # reloading the display causes a task_plan_synch()
+            # set up a callback so the display is updated only after the 
command is run.
+            # other wise the next MDI command could have stale linuxcnc state, 
causing
+            # multiple axes to move when ony issuing one axis to move.
+            self._return_id = STATUS.connect('command-stopped', lambda w: 
self.update_display())
+
         t = time.time() + 0.1
         while time.time() < t:
             QApplication.processEvents()
@@ -132,6 +146,14 @@ class MDI(QLineEdit):
             self.mdiLast = text.lower()
             STATUS.emit('mdi-history-changed')
 
+    # only reload after the command is run
+    # remove the callback handler so this is only run once
+    # per MDI command 9nect MDI command will issue another callback)
+    def update_display(self):
+        ACTION.RELOAD_DISPLAY()
+        STATUS.handler_disconnect(self._return_id)
+        self._return_id = None
+
     # Gcode widget can emit a signal to this
     def external_line_selected(self, w, text, filename):
         LOG.debug('Ext line selected: {}, {}'.format(text, filename))
-- 
Happy hacking
Petter Reinholdtsen

Reply via email to