[gnome-settings-daemon] power: Stop treating tablets specially



commit 2e508928f99715cbdf424af93fd50130bf82a992
Author: Hans de Goede <hdegoede redhat com>
Date:   Fri May 3 13:27:25 2019 +0200

    power: Stop treating tablets specially
    
    Quite some time ago special handling for tablets was added to
    gsd-power-manager to automatically suspend the tablet when the
    screen was blanked to save power.
    
    With the more recent auto-suspend (when on battery power) support, this
    hardcoded behavior really is no longer necessary, if the auto-suspend
    timeout gets set to the same value as the blank timeout the same result
    is achieved, but now under user control, rather then being hardcoded.
    
    Not having this hardcoded is desirable because suspend is not always
    desirable, e.g. when ongoing downloads are active, or other network
    connections are open such as an irc client.
    
    The hardcoded behavior is especially troublesome because it not only
    triggers on actual tablets, but also on various non tablet devices,
    both surface like devices, which are often used as one would use a
    laptop, as well as on some actual laptops. On laptops one may typically
    have an irc-client open, network downloads ongoing, etc. and then lock
    the screen when walking away. The current hardcoded suspend behavior
    causes the downloads to abort, irc messages to be missed, etc. and
    with this not being configurable there is nothing the user can do to
    avoid this.
    
    I've looked into making gsd_power_is_hardware_a_tablet() more reliable,
    but this relies on the DMI chassis type, which ultimately simply is
    unreliable
    
    Since the auto-suspend on screen blank functionality is duplicate with
    the auto-suspend and the tablet-identification is unreliable, lets just
    remove the special handling for tablets.

 plugins/power/gpm-common.c        | 13 -------------
 plugins/power/gpm-common.h        |  1 -
 plugins/power/gsd-power-manager.c |  7 -------
 3 files changed, 21 deletions(-)
---
diff --git a/plugins/power/gpm-common.c b/plugins/power/gpm-common.c
index 4458c187..0934a205 100644
--- a/plugins/power/gpm-common.c
+++ b/plugins/power/gpm-common.c
@@ -210,19 +210,6 @@ out:
         return ret;
 }
 
-gboolean
-gsd_power_is_hardware_a_tablet (void)
-{
-        char *type;
-        gboolean ret = FALSE;
-
-        type = gnome_settings_get_chassis_type ();
-        ret = (g_strcmp0 (type, "tablet") == 0);
-        g_free (type);
-
-        return ret;
-}
-
 /* This timer goes off every few minutes, whether the user is idle or not,
    to try and clean up anything that has gone wrong.
 
diff --git a/plugins/power/gpm-common.h b/plugins/power/gpm-common.h
index ea02596a..88a8e00e 100644
--- a/plugins/power/gpm-common.h
+++ b/plugins/power/gpm-common.h
@@ -32,7 +32,6 @@ gchar           *gpm_get_timestring                     (guint           time);
 
 /* Power helpers */
 gboolean         gsd_power_is_hardware_a_vm             (void);
-gboolean         gsd_power_is_hardware_a_tablet         (void);
 guint            gsd_power_enable_screensaver_watchdog  (void);
 void             reset_idletime                         (void);
 
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 7d5dc71b..f30475bc 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -191,7 +191,6 @@ struct _GsdPowerManager
         gboolean                 inhibit_suspend_taken;
         guint                    inhibit_lid_switch_timer_id;
         gboolean                 is_virtual_machine;
-        gboolean                 is_tablet;
 
         /* Idles */
         GnomeIdleMonitor        *idle_monitor;
@@ -1063,9 +1062,6 @@ backlight_disable (GsdPowerManager *manager)
                 g_error_free (error);
         }
 
-        if (manager->is_tablet)
-                action_suspend (manager);
-
         g_debug ("TESTSUITE: Blanked screen");
 }
 
@@ -2488,9 +2484,6 @@ on_rr_screen_acquired (GObject      *object,
         /* don't blank inside a VM */
         manager->is_virtual_machine = gsd_power_is_hardware_a_vm ();
 
-        /* Suspend when the screen is turned off on tablets */
-        manager->is_tablet = gsd_power_is_hardware_a_tablet ();
-
         /* queue a signal in case the proxy from gnome-shell was created before we got here
            (likely, considering that to get here we need a reply from gnome-shell)
         */


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