Hi.

I have a dual screen system (using Nvidia:s xinerama emulation) with
screen 0 to the right of screen 1.
Entrance handles the screens nicely when moving the cursor between them
 but initially it always start up as if it tries to center over both
screens but using screen 0 as origin (ie. half ends up outside the screen).
The problem was that the "ui" object was resized after the workspace
size in window_resize_cb, not the screen size (as in screen_switch_cb).

Attached patch fixes this at least for me...

/JK
Index: src/client/main.c
===================================================================
--- src/client/main.c	(revision 35672)
+++ src/client/main.c	(working copy)
@@ -135,6 +135,23 @@
    ecore_main_loop_quit();
 }
 
+static void
+resize_object_after_screen(Evas_Object *o, int s, int screens, int w, int h)
+{
+   if (screens > 1)
+   {
+      int sx, sy, sw, sh;
+
+      ecore_x_xinerama_screen_geometry_get(s, &sx, &sy, &sw, &sh);
+      evas_object_move(o, sx, sy);
+      evas_object_resize(o, sw, sh);
+   }
+   else
+   {
+      evas_object_resize(o, w, h);
+   }
+}
+
 /**
  * handle when the ecore_evas needs to be resized
  * @param ee - The Ecore_Evas we're resizing 
@@ -142,15 +159,14 @@
 static void
 window_resize_cb(Ecore_Evas * ee)
 {
-   Evas_Object *o = NULL;
+   Evas_Object *o = NULL, *ui = NULL;
    int w, h;
    int screens, i;
    char buf[50];
 
    ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
 
-   if ((o = evas_object_name_find(ecore_evas_get(ee), "ui")))
-      evas_object_resize(o, w, h);
+   ui = evas_object_name_find(ecore_evas_get(ee), "ui");
 
    screens = ecore_x_xinerama_screen_count_get();
    if (!screens)
@@ -160,19 +176,12 @@
       snprintf(buf, sizeof(buf), "background%d", i);
       if ((o = evas_object_name_find(ecore_evas_get(ee), buf)))
       {
-         if (screens > 1)
-         {
-            int sx, sy, sw, sh;
-
-            ecore_x_xinerama_screen_geometry_get(i, &sx, &sy, &sw, &sh);
-            evas_object_move(o, sx, sy);
-            evas_object_resize(o, sw, sh);
-         }
-         else
-         {
-            evas_object_resize(o, w, h);
-         }
+	 resize_object_after_screen(o, i, screens, w, h);
       }
+      if (i == session->current_screen && ui != NULL)
+      {
+	 resize_object_after_screen(ui, i, screens, w, h);
+      }
    }
 }
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to