[gnome-control-center/wip/carlosg/calibrator-fixes: 11/12] wacom: Avoid reset on spurious size changes




commit 1ddee9d4a63a55bdb8214fd214d069ffb43fdcae
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Feb 12 14:51:13 2022 +0100

    wacom: Avoid reset on spurious size changes
    
    This is a possible reason for undesired calibration resets.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1613

 panels/wacom/calibrator/calibrator-gui.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/panels/wacom/calibrator/calibrator-gui.c b/panels/wacom/calibrator/calibrator-gui.c
index cde307555..8314f7b65 100644
--- a/panels/wacom/calibrator/calibrator-gui.c
+++ b/panels/wacom/calibrator/calibrator-gui.c
@@ -245,12 +245,16 @@ cc_calib_area_size_allocate (GtkWidget *widget,
 {
   CcCalibArea *calib_area = CC_CALIB_AREA (widget);
 
-  calib_area->calibrator.geometry.width = width;
-  calib_area->calibrator.geometry.height = height;
+  if (calib_area->calibrator.geometry.width != width ||
+      calib_area->calibrator.geometry.height != height)
+    {
+      calib_area->calibrator.geometry.width = width;
+      calib_area->calibrator.geometry.height = height;
 
-  /* reset calibration if already started */
-  reset (&calib_area->calibrator);
-  set_active_target (calib_area, 0);
+      /* reset calibration if already started */
+      reset (&calib_area->calibrator);
+      set_active_target (calib_area, 0);
+    }
 
   GTK_WIDGET_CLASS (cc_calib_area_parent_class)->size_allocate (widget,
                                                                 width,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]