From 7f03061ce64b7d6416c8a95065728f570d9094d7 Mon Sep 17 00:00:00 2001 From: alfrix Date: Thu, 3 Mar 2022 12:22:22 -0300 Subject: [PATCH] graph: fix error when touching the graph area Contrary to people beliefs, this is not the issue when their touchscreen doesn't work --- ks_includes/widgets/graph.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/ks_includes/widgets/graph.py b/ks_includes/widgets/graph.py index a23b8403..8f9df353 100644 --- a/ks_includes/widgets/graph.py +++ b/ks_includes/widgets/graph.py @@ -33,18 +33,10 @@ class HeaterGraph(Gtk.DrawingArea): self.max_length = max(self.max_length, len(self.printer.get_temp_store(name, type))) def event_cb(self, da, ev): - if ev.get_source_device().get_source() == Gdk.InputSource.MOUSE: - if ev.type == Gdk.EventType.BUTTON_PRESS: - x = ev.x - y = ev.y - # logging.info("Drawing area clicked: %s %s" % (x, y)) - - if ev.get_source_device().get_source() == Gdk.InputSource.TOUCHSCREEN: - if ev.touch.type == Gdk.EventType.TOUCH_BEGIN: - x = ev.touch.x - y = ev.touch.y - # logging.info("Drawing area clicked: %s %s" % (x, y)) - + if ev.type == Gdk.EventType.BUTTON_PRESS: + x = ev.x + y = ev.y + logging.info("Graph area: %s %s" % (x, y)) def get_max_length(self): n = []