After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679794 - Use "Built-in display" instead of "Laptop" as a default display name.
Use "Built-in display" instead of "Laptop" as a default display name.
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
git master
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-07-12 12:24 UTC by Shih-Yuan Lee (FourDollars)
Modified: 2013-03-04 09:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch from `git format-patch HEAD^` (7.75 KB, patch)
2012-07-12 12:26 UTC, Shih-Yuan Lee (FourDollars)
committed Details | Review
gnome-rr: Use "Built-in Display" for internal displays (1009 bytes, patch)
2013-02-25 15:57 UTC, Bastien Nocera
committed Details | Review

Description Shih-Yuan Lee (FourDollars) 2012-07-12 12:24:41 UTC
Nowadays it is not only laptops will use those connectors.
All-in-one PC will also use those connectors.
I think "Built-in display" might be a more generic name.
Comment 1 Shih-Yuan Lee (FourDollars) 2012-07-12 12:26:40 UTC
Created attachment 218616 [details] [review]
Patch from `git format-patch HEAD^`
Comment 2 Bastien Nocera 2013-02-21 11:13:59 UTC
We now (in GNOME 3.8) use the real output's name, instead of "Laptop".

commit 5756c24ce001938ee195252c9d59a42f6cc2ebad
Author: William Jon McCann <jmccann@redhat.com>
Date:   Thu Feb 14 11:23:18 2013 -0500

    gnome-rr: make config use display name from output
Comment 3 Shih-Yuan Lee (FourDollars) 2013-02-25 08:53:04 UTC
I don't see any difference from the latest source code.
It seems still to use "Laptop".

From 5b199e659cbfb39efab6e70eecabbd297777dbf3 of gnome-desktop/libgnome-desktop/gnome-rr.c,

<cite>
const char *
gnome_rr_output_get_display_name (GnomeRROutput *output)
{
    g_return_val_if_fail (output != NULL, NULL);

    ensure_display_name (output);

    return output->display_name;
}

static void
ensure_display_name (GnomeRROutput *output)
{
    if (output->display_name != NULL)
        return;

    if (gnome_rr_output_is_laptop (output))
        output->display_name = g_strdup (_("Laptop"));
...
}

gboolean
gnome_rr_output_is_laptop (GnomeRROutput *output)
{
    g_return_val_if_fail (output != NULL, FALSE);

    if (!output->connected)
        return FALSE;

    /* The ConnectorType property is present in RANDR 1.3 and greater */
    if (g_strcmp0 (output->connector_type, GNOME_RR_CONNECTOR_TYPE_PANEL) == 0)                         
        return TRUE;

    /* Older versions of RANDR - this is a best guess, as @#$% RANDR doesn't have standard output names,
     * so drivers can use whatever they like.
     */
    if (_gnome_rr_output_name_is_laptop (output->name))
        return TRUE;

    return FALSE;
}

gboolean
_gnome_rr_output_name_is_laptop (const char *name)
{
    if (!name)
        return FALSE;

    if (strstr (name, "lvds") ||  /* Most drivers use an "LVDS" prefix... */
        strstr (name, "LVDS") ||
        strstr (name, "Lvds") ||
        strstr (name, "LCD")  ||  /* ... but fglrx uses "LCD" in some versions.  Shoot me now, kthxbye. */
        strstr (name, "eDP")  ||  /* eDP is for internal laptop panel connections */
        strstr (name, "default")) /* Finally, NVidia and all others that don't bother to do RANDR properly */
        return TRUE;

    return FALSE;
}
</cite>

LCD, LVDS, eDP, default are not only available on laptops but they may also be available on all-in-one PCs.
But you can not call the display as "Laptop" on all-in-one PCs because they are not laptops.
Comment 4 Bastien Nocera 2013-02-25 15:57:05 UTC
Created attachment 237362 [details] [review]
gnome-rr: Use "Built-in Display" for internal displays

Instead of "Laptop" as all-in-ones, tablets, etc. are devices
that will get detected as having internal displays, but aren't
laptops.
Comment 5 Shih-Yuan Lee (FourDollars) 2013-02-27 03:26:14 UTC
@Bastien,

Could you also modify the function names of _gnome_rr_output_name_is_laptop and gnome_rr_output_is_laptop to another proper one?
Comment 6 Bastien Nocera 2013-02-27 09:47:30 UTC
(In reply to comment #5)
> @Bastien,
> 
> Could you also modify the function names of _gnome_rr_output_name_is_laptop and
> gnome_rr_output_is_laptop to another proper one?

Not just before the stable release. We're already API-frozen.
Comment 7 Bastien Nocera 2013-03-04 09:42:13 UTC
Comment on attachment 218616 [details] [review]
Patch from `git format-patch HEAD^`

Attachment 218616 [details] pushed as b3b1d5f - gnome-rr: Use "Built-in Display" for internal displays
Comment 8 Bastien Nocera 2013-03-04 09:43:13 UTC
Attachment 237362 [details] pushed as 4c11dc6 - gnome-rr: Use "Built-in Display" for internal displays