Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_misc.c ewl_window.c 


Log Message:
Realize windows more smoothly, reduce resizes.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_misc.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_misc.c  16 Feb 2005 04:23:41 -0000      1.2
+++ ewl_misc.c  6 Mar 2005 05:48:22 -0000       1.3
@@ -700,6 +700,20 @@
                 */
                if (VISIBLE(w))
                        ewl_callback_call(w, EWL_CALLBACK_SHOW);
+
+               /*
+                * Give the top level widgets their initial preferred size.
+                */
+               if (ewl_object_flags_get(EWL_OBJECT(w),
+                                        EWL_FLAG_PROPERTY_TOPLEVEL)) {
+                       ewl_object_size_request(EWL_OBJECT(w),
+                               ewl_object_preferred_w_get(EWL_OBJECT(w)),
+                               ewl_object_preferred_h_get(EWL_OBJECT(w)));
+               }
+
+               /*
+                * Indicate widget no longer on the realize queue.
+                */
                ewl_object_queued_remove(EWL_OBJECT(w),
                                         EWL_FLAG_QUEUED_RSCHEDULED);
        }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_window.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_window.c        9 Feb 2005 04:31:56 -0000       1.1
+++ ewl_window.c        6 Mar 2005 05:48:22 -0000       1.2
@@ -430,6 +430,7 @@
        if (strstr(render, "x11") &&
                        (ewl_engine_mask_get() & (EWL_ENGINE_SOFTWARE_X11 |
                                                  EWL_ENGINE_GL_X11))) {
+               int width, height;
                window->window = (void *)ecore_x_window_new(0, window->x,
                                                window->y,
                                                ewl_object_current_w_get(o),
@@ -443,6 +444,17 @@
 
                if (window->flags & EWL_WINDOW_BORDERLESS)
                        
ecore_x_window_prop_borderless_set((Ecore_X_Window)window->window, 1);
+
+               width = ewl_object_maximum_w_get(EWL_OBJECT(window));
+               height = ewl_object_maximum_h_get(EWL_OBJECT(window));
+               if (width == EWL_OBJECT_MAX_SIZE && width == height) {
+                       ecore_x_window_geometry_get(0, NULL, NULL, &width,
+                                                   &height);
+                       ewl_object_maximum_size_set(EWL_OBJECT(window),
+                                                   width, height);
+                       printf("Setting maximum window size to %dx%d\n",
+                                       width, height);
+               }
        }
 #endif
 
@@ -634,20 +646,6 @@
                DRETURN(DLEVEL_STABLE);
 
        /*
-        * Adjust the maximum window bounds to match the widget
-        */
-#ifdef HAVE_EVAS_ENGINE_SOFTWARE_X11_H
-       if (strstr(win->render, "x11")) {
-               ecore_x_window_prop_min_size_set((Ecore_X_Window)win->window,
-                               ewl_object_minimum_w_get(EWL_OBJECT(w)),
-                               ewl_object_minimum_h_get(EWL_OBJECT(w)));
-               ecore_x_window_prop_max_size_set((Ecore_X_Window)win->window,
-                               ewl_object_maximum_w_get(EWL_OBJECT(w)),
-                               ewl_object_maximum_h_get(EWL_OBJECT(w)));
-       }
-#endif
-
-       /*
         * Find out how much space the widget accepted.
         */
        width = ewl_object_current_w_get(EWL_OBJECT(w));
@@ -683,6 +681,22 @@
                                 width, height);
 
        /*
+        * Adjust the minimum and maximum window bounds to match the widget.
+        * Do this after the resize to prevent early mapping, and the object
+        * keeps the bounds respected.
+        */
+#ifdef HAVE_EVAS_ENGINE_SOFTWARE_X11_H
+       if (strstr(win->render, "x11")) {
+               ecore_x_window_prop_min_size_set((Ecore_X_Window)win->window,
+                               ewl_object_minimum_w_get(EWL_OBJECT(w)),
+                               ewl_object_minimum_h_get(EWL_OBJECT(w)));
+               ecore_x_window_prop_max_size_set((Ecore_X_Window)win->window,
+                               ewl_object_maximum_w_get(EWL_OBJECT(w)),
+                               ewl_object_maximum_h_get(EWL_OBJECT(w)));
+       }
+#endif
+
+       /*
         * Configure each of the child widgets.
         */
        ecore_list_goto_first(EWL_CONTAINER(w)->children);




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to