princeamd pushed a commit to branch enlightenment-0.17.

commit 39587299c2e8e6176c2983813eba412332aef846
Author: Chris Michael <[email protected]>
Date:   Wed Jul 31 10:52:06 2013 +0100

    Backport: b0e3605 :: Implement rudamentary monitor snapping after move.
    
    After a monitor has been moved, snap it to the closest monitor.
    
    NB: This should fix cases where a monitor could not be positioned next
    to another monitor which had a resolution of 1368. Previously, the
    second monitor could only move to 1366 due to a rounding issue when
    converting coordinates to virtual. Now, the second monitor (when
    finished moving) will Snap to the proper position.
    
    NB: (Currently) In order for the snapping to work, either the
    monitors' X axis or Y axis must be equal. Ideally, this should be
    fixed to allow for some percentage of position flexibility.
    
    Signed-off-by: Chris Michael <[email protected]>
    Signed-off-by: Deon Thomas <[email protected]>
---
 src/modules/conf_randr/e_smart_randr.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/modules/conf_randr/e_smart_randr.c 
b/src/modules/conf_randr/e_smart_randr.c
index 4a92979..5257283 100644
--- a/src/modules/conf_randr/e_smart_randr.c
+++ b/src/modules/conf_randr/e_smart_randr.c
@@ -656,7 +656,8 @@ static void
 _e_smart_randr_monitor_cb_moved(void *data, Evas_Object *obj EINA_UNUSED, void 
*event EINA_UNUSED)
 {
    E_Smart_Data *sd;
-   Evas_Object *randr;
+   Evas_Object *randr, *mon;
+   Eina_List *l = NULL;
 
    if (!(randr = data)) return;
 
@@ -667,6 +668,22 @@ _e_smart_randr_monitor_cb_moved(void *data, Evas_Object 
*obj EINA_UNUSED, void *
     * outputs is at 0,0 */
    _e_smart_randr_monitor_position_normalize(sd);
 
+   /* move any monitors which are adjacent to this one to their new 
+    * positions due to the resize, specifying this resized monitor as 
+    * the one to skip */
+   _e_smart_randr_monitor_position_update(sd, randr, randr);
+
+   EINA_LIST_FOREACH(sd->monitors, l, mon)
+     {
+        /* skip the monitor which was currently resized */
+        if ((mon == randr)) continue;
+
+        /* move any monitors which are adjacent to this one to their new 
+         * positions due to the resize, specifying this resized monitor as 
+         * the one to skip */
+        _e_smart_randr_monitor_position_update(sd, mon, randr);
+     }
+
    /* tell main dialog that something changed and to enable apply button */
    evas_object_smart_callback_call(randr, "randr_changed", NULL);
 }

-- 

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk

Reply via email to