princeamd pushed a commit to branch enlightenment-0.17.

commit a3990e5108ee0ba2f34e3608832bc1ad4bc5f119
Author: Chris Michael <[email protected]>
Date:   Thu Jun 27 07:39:23 2013 +0100

    Backport: bba201a :: If a monitor is disabled by the user, then we need to 
set number of outputs to zero, and free any allocated outputs before trying to 
apply settings.
    
    Also, check for valid mode (not 0) before trying to fetch mode_info.
    
    Signed-off-by: Chris Michael <[email protected]>
    Signed-off-by: Deon Thomas <[email protected]>
---
 src/modules/conf_randr/e_smart_monitor.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/modules/conf_randr/e_smart_monitor.c 
b/src/modules/conf_randr/e_smart_monitor.c
index 62809bd..9cd7d2d 100644
--- a/src/modules/conf_randr/e_smart_monitor.c
+++ b/src/modules/conf_randr/e_smart_monitor.c
@@ -807,7 +807,12 @@ e_smart_monitor_changes_apply(Evas_Object *obj)
 
    /* record current values */
    mode = sd->current.mode;
-   if (!sd->current.enabled) mode = 0;
+   if (!sd->current.enabled)
+     {
+        mode = 0;
+        noutputs = 0;
+        free(outputs);
+     }
 
    cx = sd->current.x;
    cy = sd->current.y;
@@ -852,7 +857,7 @@ e_smart_monitor_changes_apply(Evas_Object *obj)
    sd->crtc.orient = orient;
    sd->crtc.enabled = sd->current.enabled;
 
-   if ((mode_info = ecore_x_randr_mode_info_get(root, sd->crtc.mode)))
+   if ((sd->crtc.mode) && (mode_info = ecore_x_randr_mode_info_get(root, 
sd->crtc.mode)))
      {
         sd->crtc.refresh_rate = 
           _e_smart_monitor_mode_refresh_rate_get(mode_info);

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to