princeamd pushed a commit to branch enlightenment-0.17.

commit 1918c5ae8f0c779e69093e104d46aadac80bcee7
Author: Christopher Michael <[email protected]>
Date:   Tue Feb 19 11:00:59 2013 +0000

    Backport: 059a019 :: When we get randr events, check for actual config 
differences.
    
    Signed-off-by: Christopher Michael <[email protected]>
    
    SVN revision: 84223
    Signed-off-by: Deon Thomas <[email protected]>
---
 src/bin/e_randr.c | 39 ++++++++++++++++++++++++++++-----------
 1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/src/bin/e_randr.c b/src/bin/e_randr.c
index 759c6da..cc0f729 100644
--- a/src/bin/e_randr.c
+++ b/src/bin/e_randr.c
@@ -494,14 +494,23 @@ _e_randr_event_cb_crtc_change(void *data EINA_UNUSED, int 
type EINA_UNUSED, void
      {
         if (crtc_cfg->xid == ev->crtc)
           {
-             crtc_cfg->x = ev->geo.x;
-             crtc_cfg->y = ev->geo.y;
-             crtc_cfg->width = ev->geo.w;
-             crtc_cfg->height = ev->geo.h;
-             crtc_cfg->orient = ev->orientation;
-             crtc_cfg->mode = ev->mode;
+             if ((crtc_cfg->x != ev->geo.x) || 
+                 (crtc_cfg->y != ev->geo.y) || 
+                 (crtc_cfg->width != ev->geo.w) || 
+                 (crtc_cfg->height != ev->geo.h) || 
+                 (crtc_cfg->orient != ev->orientation) || 
+                 (crtc_cfg->mode != ev->mode))
+               {
+                  crtc_cfg->x = ev->geo.x;
+                  crtc_cfg->y = ev->geo.y;
+                  crtc_cfg->width = ev->geo.w;
+                  crtc_cfg->height = ev->geo.h;
+                  crtc_cfg->orient = ev->orientation;
+                  crtc_cfg->mode = ev->mode;
+
+                  changed = EINA_TRUE;
+               }
 
-             changed = EINA_TRUE;
              break;
           }
      }
@@ -546,11 +555,19 @@ _e_randr_event_cb_output_change(void *data EINA_UNUSED, 
int type EINA_UNUSED, vo
           {
              if (output_cfg->xid == ev->output)
                {
-                  output_cfg->crtc = ev->crtc;
-                  output_cfg->connected = 
-                    ((ev->connection) ? EINA_FALSE : EINA_TRUE);
+                  Eina_Bool connected = EINA_FALSE;
+
+                  connected = ((ev->connection) ? EINA_FALSE : EINA_TRUE);
+
+                  if ((output_cfg->crtc != ev->crtc) || 
+                      (output_cfg->connected != connected))
+                    {
+                       output_cfg->crtc = ev->crtc;
+                       output_cfg->connected = connected;
+
+                       changed = EINA_TRUE;
+                    }
 
-                  changed = EINA_TRUE;
                   break;
                }
           }

-- 

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

Build for Windows Store.

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

Reply via email to