diff options
author | Chris Michael <devilhorns@comcast.net> | 2013-10-17 18:07:22 +0100 |
---|---|---|
committer | Chris Michael <devilhorns@comcast.net> | 2013-10-17 18:07:22 +0100 |
commit | ee0a87773c41252de8452b708ea99954ad5e3bcc (patch) | |
tree | 7af722c018ff3cdc8dc7f651e5e04500eee9a1a3 /src/modules/conf_randr | |
parent | 87dd451353ca26698a6997694047371b5c8301af (diff) | |
download | enlightenment-ee0a87773c41252de8452b708ea99954ad5e3bcc.tar.gz |
Fix rare bug where getting refresh rate may cause a crash if
mode->name is NULL by checking mode id instead of name.
Also if we are disabling a monitor, set current mode to 0.
Signed-off-by: Chris Michael <devilhorns@comcast.net>
Diffstat (limited to 'src/modules/conf_randr')
-rw-r--r-- | src/modules/conf_randr/e_smart_monitor.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index 28dda0aba2..080ed94c9e 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -836,6 +836,7 @@ e_smart_monitor_changes_apply(Evas_Object *obj) noutputs = 0; if (outputs) free(outputs); outputs = NULL; + sd->current.mode = 0; } cx = sd->current.x; @@ -862,15 +863,12 @@ e_smart_monitor_changes_apply(Evas_Object *obj) } } -// else - { - /* try to apply the settings */ - printf("Applying Settings: %d %d %d %d\n", sd->crtc.id, cx, cy, mode); + /* try to apply the settings */ + printf("Applying Settings: %d %d %d %d\n", sd->crtc.id, cx, cy, mode); - if (!ecore_x_randr_crtc_settings_set(root, sd->crtc.id, outputs, - noutputs, cx, cy, mode, orient)) - printf("FAILED TO APPLY MONITOR SETTINGS !!!\n"); - } + if (!ecore_x_randr_crtc_settings_set(root, sd->crtc.id, outputs, + noutputs, cx, cy, mode, orient)) + printf("FAILED TO APPLY MONITOR SETTINGS !!!\n"); /* free any allocated memory from ecore_x_randr */ if (outputs) free(outputs); @@ -1556,8 +1554,8 @@ _e_smart_monitor_mode_refresh_rates_fill(Evas_Object *obj) /* loop the modes and find the current one */ EINA_LIST_FOREACH(sd->modes, m, mode) { - /* compare mode names */ - if (!strcmp(cmode->name, mode->name)) + /* compare mode IDs */ + if (cmode->xid == mode->xid) { Evas_Object *ow; double rate = 0.0; |