[gnome-control-center/wip/carlosg/fix-wacom-crash] wacom: Avoid poking disposed object



commit bf934e45e8cd0b3afec37777007f80ab85d960e1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Dec 5 16:55:55 2019 +0100

    wacom: Avoid poking disposed object
    
    A little above in the function, we update the page UI, maybe destroying
    the bits that allow decoupling display-attached tablets from their display.
    Later on, we unconditionally update its GtkSwitch.
    
    This can't bode well on tablets where the widget was already destroyed.

 panels/wacom/cc-wacom-page.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/panels/wacom/cc-wacom-page.c b/panels/wacom/cc-wacom-page.c
index ab52a8471..d21d5fe5d 100644
--- a/panels/wacom/cc-wacom-page.c
+++ b/panels/wacom/cc-wacom-page.c
@@ -954,7 +954,8 @@ cc_wacom_page_new (CcWacomPanel  *panel,
        /* FIXME move this to construct */
        page->wacom_settings  = cc_wacom_device_get_settings (stylus);
        set_mode_from_gsettings (GTK_COMBO_BOX (WID ("combo-tabletmode")), page);
-       set_display_decoupled_from_gsettings (GTK_SWITCH (WID ("switch-decouple-display")), page);
+       if (get_layout_type (page->stylus) == LAYOUT_SCREEN)
+               set_display_decoupled_from_gsettings (GTK_SWITCH (WID ("switch-decouple-display")), page);
 
        /* Tablet name */
        gtk_label_set_text (GTK_LABEL (WID ("label-tabletmodel")), cc_wacom_device_get_name (stylus));


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