Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_window.c ewl_window.h ewl_menu.c 


Log Message:
Provide override windows to avoid flicker on repositioning.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_window.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ewl_window.c        25 Oct 2005 03:21:33 -0000      1.18
+++ ewl_window.c        27 Oct 2005 05:32:54 -0000      1.19
@@ -538,6 +538,57 @@
        DRETURN_INT(grab, DLEVEL_STABLE);
 }
 
+/**
+ * @param win: the window to change override settings
+ * @param override: TRUE or FALSE to indicate override state.
+ * @return Returns no value.
+ * @brief Changes the override state on the specified window.
+ */
+void
+ewl_window_override_set(Ewl_Window *win, int override)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("win", win);
+       DCHECK_TYPE("win", win, "window");
+
+       if (override) {
+               win->flags |= EWL_WINDOW_OVERRIDE;
+       }
+       else {
+               win->flags &= ~EWL_WINDOW_OVERRIDE;
+       }
+
+       if (VISIBLE(win) && win->window) {
+#ifdef ENABLE_EWL_SOFTWARE_X11
+               /* FIXME: Should probably unrealize and re-realize here. */
+#endif
+       }
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param win: window to retrieve override state
+ * @return Returns TRUE if window is an override window, FALSE otherwise.
+ * @brief Retrieves the current override state on a window.
+ */
+int
+ewl_window_override_get(Ewl_Window *win)
+{
+       int override;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("win", win, FALSE);
+       DCHECK_TYPE_RET("win", win, "window", FALSE);
+
+       if (win->flags & EWL_WINDOW_OVERRIDE)
+               override = TRUE;
+       else
+               override = FALSE;
+
+       DRETURN_INT(override, DLEVEL_STABLE);
+}
+
 void
 ewl_window_realize_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
                                        void *user_data __UNUSED__)
@@ -592,10 +643,18 @@
                                                  EWL_ENGINE_GL_X11))) {
                int width, height;
                Ecore_X_Window xwin;
-               xwin = ecore_x_window_new(0, window->x,
-                                         window->y,
-                                         ewl_object_current_w_get(o),
-                                         ewl_object_current_h_get(o));
+               if (window->flags & EWL_WINDOW_OVERRIDE) {
+                       xwin = ecore_x_window_override_new(0, window->x,
+                                                 window->y,
+                                                 ewl_object_current_w_get(o),
+                                                 ewl_object_current_h_get(o));
+               }
+               else {
+                       xwin = ecore_x_window_new(0, window->x,
+                                                 window->y,
+                                                 ewl_object_current_w_get(o),
+                                                 ewl_object_current_h_get(o));
+               }
 
                ecore_x_icccm_name_class_set(xwin, window->name,
                                             window->classname);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_window.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewl_window.h        25 Oct 2005 03:21:33 -0000      1.5
+++ ewl_window.h        27 Oct 2005 05:32:54 -0000      1.6
@@ -70,6 +70,8 @@
 int             ewl_window_keyboard_grab_get(Ewl_Window *win);
 void            ewl_window_pointer_grab_set(Ewl_Window *win, int grab);
 int             ewl_window_pointer_grab_get(Ewl_Window *win);
+void            ewl_window_override_set(Ewl_Window *win, int override);
+int             ewl_window_override_get(Ewl_Window *win);
 
 /*
  * Internally used callbacks, override at your own risk.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_menu.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ewl_menu.c  26 Oct 2005 03:37:51 -0000      1.12
+++ ewl_menu.c  27 Oct 2005 05:32:54 -0000      1.13
@@ -62,6 +62,7 @@
        menu->base.popup = ewl_window_new();
        ewl_window_keyboard_grab_set(EWL_WINDOW(menu->base.popup), TRUE);
        ewl_window_pointer_grab_set(EWL_WINDOW(menu->base.popup), TRUE);
+       ewl_window_override_set(EWL_WINDOW(menu->base.popup), TRUE);
        ewl_window_borderless_set(EWL_WINDOW(menu->base.popup));
        ewl_widget_internal_set(menu->base.popup, TRUE);
        ewl_widget_appearance_set(EWL_WIDGET(menu->base.popup), "menu");




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to