* Returns: a unique #GnomeRRScreen instance, specific to the @screen, or NULL
* if this could not be created, for instance if the driver does not support
* Xrandr 1.2. Each #GdkScreen thus has a single instance of #GnomeRRScreen.
therefore in gnome-control-center panels/display/cc-diaply-panel.c::cc_display_panel_constructor() the following code is incorrect:
self->priv->screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
g_signal_connect (self->priv->screen, "changed", G_CALLBACK (on_screen_changed), self);
if (!self->priv->screen)
{
error_message (NULL, _("Could not get screen information"), error->message);
g_error_free (error);
if the call to gnome_rr_screen_new() returns NULL, as it will if no RANDR is available, the subsequent setup of the signal:
So when that signal fires it passes a NULL screen pointer to on_screen_changed(). Passing the NULL pointer doesn't matter since it isn't used in the call-back, but self->priv->screen is used:
libgnome- desktop/ gnome-rr. c::gnome_ rr_screen_ new() says:
* Returns: a unique #GnomeRRScreen instance, specific to the @screen, or NULL
* if this could not be created, for instance if the driver does not support
* Xrandr 1.2. Each #GdkScreen thus has a single instance of #GnomeRRScreen.
therefore in gnome-control- center panels/ display/ cc-diaply- panel.c: :cc_display_ panel_construct or() the following code is incorrect:
self- >priv-> screen = gnome_rr_screen_new (gdk_screen_ get_default (), &error); priv->screen, "changed", G_CALLBACK (on_screen_ changed) , self); >priv-> screen)
g_signal_connect (self->
if (!self-
{
error_message (NULL, _("Could not get screen information"), error->message);
g_error_free (error);
if the call to gnome_rr_ screen_ new() returns NULL, as it will if no RANDR is available, the subsequent setup of the signal:
g_signal_connect (self-> priv->screen, "changed", G_CALLBACK (on_screen_ changed) , self);
is done with self->priv->screen == NULL
So when that signal fires it passes a NULL screen pointer to on_screen_ changed( ). Passing the NULL pointer doesn't matter since it isn't used in the call-back, but self->priv->screen is used:
on_screen_changed (GnomeRRScreen *scr,
gpointer data)
{
GnomeRRConfig *current;
CcDisplayPanel *self = data;
current = gnome_rr_ config_ new_current (self-> priv->screen, NULL); rr_config_ ensure_ primary (current);
gnome_
So current will be NULL after calling gnome_rr_ config_ new_current( )