GNOME Bugzilla – Bug 704487
display: prevent the built in display being turned on if the lid is closed
Last modified: 2013-07-19 16:20:55 UTC
If the laptop lid is closed and an external display is connected, it is possible to turn on the laptop display and turn off the external display, leaving the user without a visible display.
Created attachment 249549 [details] [review] display: prevent the built in display being turned on if the lid is closed
Review of attachment 249549 [details] [review]: No need for the libgd changes in this patch. ::: panels/display/cc-display-panel.c @@ +155,3 @@ cc_display_panel_dispose (GObject *object) { + g_clear_object (&(CC_DISPLAY_PANEL (object))->priv->up_client); Split this up into an assignment and your function call. @@ +714,3 @@ sensitive = FALSE; + whitespace change @@ +2730,3 @@ + self->priv->up_client = up_client_new (); + g_signal_connect (self->priv->up_client, "changed", + G_CALLBACK (cc_display_panel_up_client_changed), self); You'll want to set the current state here and avoid it altogether if up_client_get_lid_is_present() == FALSE. Also, monitoring "notify::lid-is-closed" will stop it from rebuilding the list on every event.
Created attachment 249628 [details] [review] display: prevent the built in display being turned on if the lid is closed Updated patch with suggested changes, except for using the notify::lid-is-closed signal, which is currently only emitted when the UpClient properties are explicitly synchronised. See https://bugs.freedesktop.org/show_bug.cgi?id=43001 for more details.
Review of attachment 249628 [details] [review]: Please mention the non use of notify::lid-is-closed in the commit message, and add a link to the bugzilla in the sources. Looks good otherwise.
Attachment 249628 [details] pushed to master and gnome-3-8. I added a comment to the source code with the full details of the issue with the notify signal.