Enlightenment CVS committal
Author : codewarrior
Project : e17
Module : proto
Dir : e17/proto/etk/src/lib
Modified Files:
etk_window.c
Log Message:
- make the window centering function xinerama aware
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_window.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- etk_window.c 28 Mar 2006 07:24:57 -0000 1.19
+++ etk_window.c 18 Apr 2006 12:33:55 -0000 1.20
@@ -15,6 +15,8 @@
* @{
*/
+#define ETK_INSIDE(x, y, xx, yy, ww, hh) (((x) < ((xx) + (ww))) && ((y) <
((yy) + (hh))) && ((x) >= (xx)) && ((y) >= (yy)))
+
enum _Etk_Widget_Signal_Id
{
ETK_WINDOW_MOVE_SIGNAL,
@@ -234,11 +236,37 @@
else
{
Ecore_X_Window root;
-
- for (root = window_to_center->x_window;
ecore_x_window_parent_get(root) != 0; root = ecore_x_window_parent_get(root));
- ecore_x_window_geometry_get(root, &x, &y, &w, &h);
+ int screens;
+
+ screens = ecore_x_xinerama_screen_count_get();
+ if (screens > 0)
+ {
+ int i;
+
+ for (root = window_to_center->x_window;
ecore_x_window_parent_get(root) != 0; root = ecore_x_window_parent_get(root));
+ ecore_x_pointer_xy_get(root, &x, &y);
+ for (i = 0; i < screens; i++)
+ {
+ int rx, ry, rw, rh;
+
+ root = ecore_x_xinerama_screen_geometry_get(i, &rx, &ry, &rw,
&rh);
+ if (ETK_INSIDE(x, y, rx, ry, rw, rh))
+ {
+ x = rx; y = ry;
+ w = rw; h = rh;
+ goto END;
+ }
+ }
+ goto DEFAULT;
+ }
+ else
+ {
+DEFAULT:
+ for (root = window_to_center->x_window;
ecore_x_window_parent_get(root) != 0; root = ecore_x_window_parent_get(root));
+ ecore_x_window_geometry_get(root, &x, &y, &w, &h);
+ }
}
-
+END:
etk_window_geometry_get(window_to_center, NULL, NULL, &cw, &ch);
ecore_evas_move(window_to_center->ecore_evas, x + (w - cw) / 2, y + (h -
ch) / 2);
}
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs