Enlightenment CVS committal Author : moom Project : e17 Module : libs/etk
Dir : e17/libs/etk/src/lib Modified Files: etk_window.c etk_window.h Log Message: * [Window] center-on-window should be fixed (patch from saturn_vk) =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_window.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- etk_window.c 13 Jan 2007 19:29:19 -0000 1.42 +++ etk_window.c 6 Feb 2007 21:45:36 -0000 1.43 @@ -212,16 +212,27 @@ if (!window_to_center) return; + if (window_to_center->center_on_window) + { + etk_object_weak_pointer_remove(ETK_OBJECT(window), (void **)(&window_to_center->center_on_window)); + window_to_center->center_on_window = NULL; + } + + /* If the window has not been been resized yet, we can't center it already, + * so we queue the center-action for later */ if (window_to_center->wait_size_request) { - window_to_center->center = ETK_TRUE; window_to_center->center_on_window = window; if (window) etk_object_weak_pointer_add(ETK_OBJECT(window), (void **)(&window_to_center->center_on_window)); } + /* Otherwise we center it right now */ else { - etk_engine_mouse_screen_geometry_get(&x, &y, &w, &h); + if (window) + etk_window_geometry_get(window, &x, &y, &w, &h); + else + etk_engine_mouse_screen_geometry_get(&x, &y, &w, &h); etk_window_geometry_get(window_to_center, NULL, NULL, &cw, &ch); etk_window_move(window_to_center, x + (w - cw) / 2, y + (h - ch) / 2); } @@ -535,7 +546,6 @@ return; window->wait_size_request = ETK_TRUE; - window->center = ETK_FALSE; window->center_on_window = NULL; window->delete_event = _etk_window_delete_event_handler; @@ -700,12 +710,8 @@ window->wait_size_request = ETK_FALSE; if (etk_widget_is_visible(ETK_WIDGET(window))) etk_engine_window_show(window); - if (window->center) - { + if (window->center_on_window) etk_window_center_on_window(window, window->center_on_window); - window->center = ETK_FALSE; - window->center_on_window = NULL; - } } } } =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_window.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- etk_window.h 27 Jan 2007 05:14:32 -0000 1.21 +++ etk_window.h 6 Feb 2007 21:45:36 -0000 1.22 @@ -40,7 +40,6 @@ Etk_Bool (*delete_event)(Etk_Window *window); Etk_Bool wait_size_request; - Etk_Bool center; Etk_Window *center_on_window; }; ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs