fix segv's in randr dialog. :)

SVN revision: 77943
This commit is contained in:
Carsten Haitzler 2012-10-13 03:18:58 +00:00
parent d421af2a0b
commit c824b1a1e1
1 changed files with 23 additions and 12 deletions

View File

@ -278,16 +278,19 @@ e_smart_monitor_info_set(Evas_Object *obj, E_Randr_Output_Info *output, E_Randr_
/* fill in list of modes */ /* fill in list of modes */
_e_smart_monitor_modes_fill(sd); _e_smart_monitor_modes_fill(sd);
/* get the min resolution for this monitor */ if (sd->modes)
mode = eina_list_nth(sd->modes, 0); {
sd->min.w = mode->width; /* get the min resolution for this monitor */
sd->min.h = mode->height; mode = eina_list_nth(sd->modes, 0);
sd->min.w = mode->width;
/* get the max resolution for this monitor */ sd->min.h = mode->height;
mode = eina_list_data_get(eina_list_last(sd->modes));
sd->max.w = mode->width; /* get the max resolution for this monitor */
sd->max.h = mode->height; mode = eina_list_data_get(eina_list_last(sd->modes));
if (!crtc) sd->orig.mode = mode; sd->max.w = mode->width;
sd->max.h = mode->height;
if (!crtc) sd->orig.mode = mode;
}
/* set monitor name */ /* set monitor name */
if (output) if (output)
@ -415,8 +418,16 @@ e_smart_monitor_crtc_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y
} }
else else
{ {
if (w) *w = sd->current.mode->width; if (sd->current.mode)
if (h) *h = sd->current.mode->height; {
if (w) *w = sd->current.mode->width;
if (h) *h = sd->current.mode->height;
}
else
{
if (w) *w = 640;
if (h) *h = 640;
}
} }
} }
else else