diff -urN upower-0.9.15/src/linux/up-dock.c upower-0.9.15.mine/src/linux/up-dock.c --- upower-0.9.15/src/linux/up-dock.c 2011-03-03 08:58:01.000000000 -0500 +++ upower-0.9.15.mine/src/linux/up-dock.c 2012-02-15 20:34:42.360787608 -0500 @@ -47,19 +47,17 @@ static gboolean up_dock_device_check (GUdevDevice *d) { - const gchar *status; + gint docked = 0; gboolean ret = FALSE; - /* Get the boolean state from the kernel -- note that ideally - * the property value would be "1" or "true" but now it's - * set in stone as ABI. Urgh. */ - status = g_udev_device_get_sysfs_attr (d, "status"); - if (status == NULL) + /* Get the boolean state from the kernel */ + docked = g_udev_device_get_sysfs_attr_as_int (d, "docked"); + if (docked == NULL) goto out; - ret = (g_strcmp0 (status, "connected") == 0); - g_debug ("graphics device %s is %s", + ret = (docked == 1); + g_debug ("dock_station %s is %s", g_udev_device_get_sysfs_path (d), - ret ? "on" : "off"); + ret ? "docked" : "undocked"); out: return ret; } @@ -75,10 +73,9 @@ GUdevDevice *native; guint count = 0; - /* the metric we're using here is that a machine is docked when - * there is more than one active output */ + /* check to see if there are any docking stations, and if they are docked */ devices = g_udev_client_query_by_subsystem (dock->priv->gudev_client, - "drm"); + "platform/dock_station"); for (l = devices; l != NULL; l = l->next) { native = l->data; count += up_dock_device_check (native); @@ -148,7 +145,7 @@ static void up_dock_init (UpDock *dock) { - const gchar *subsystems[] = { "drm", NULL}; + const gchar *subsystems[] = { "platform/dock_station", NULL}; dock->priv = UP_DOCK_GET_PRIVATE (dock); dock->priv->gudev_client = g_udev_client_new (subsystems); g_signal_connect (dock->priv->gudev_client, "uevent",