3 #endif /* ifdef HAVE_CONFIG_H */
5 #include "ecore_x_private.h"
8 static Eina_Bool _composite_available = EINA_FALSE;
11 _ecore_x_composite_init(void)
13 _composite_available = EINA_FALSE;
15 #ifdef ECORE_XCOMPOSITE
18 if (XCompositeQueryVersion(_ecore_x_disp, &major, &minor))
20 if (_ecore_xlib_sync) ecore_x_sync();
22 if (XRenderQueryExtension(_ecore_x_disp, &major, &minor))
24 if (_ecore_xlib_sync) ecore_x_sync();
26 if (XFixesQueryVersion(_ecore_x_disp, &major, &minor))
28 if (_ecore_xlib_sync) ecore_x_sync();
29 _composite_available = EINA_TRUE;
39 ecore_x_composite_query(void)
42 return _composite_available;
46 ecore_x_composite_redirect_window(Ecore_X_Window win,
47 Ecore_X_Composite_Update_Type type)
49 #ifdef ECORE_XCOMPOSITE
50 int update = CompositeRedirectAutomatic;
55 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
56 update = CompositeRedirectAutomatic;
59 case ECORE_X_COMPOSITE_UPDATE_MANUAL:
60 update = CompositeRedirectManual;
63 XCompositeRedirectWindow(_ecore_x_disp, win, update);
64 if (_ecore_xlib_sync) ecore_x_sync();
65 #endif /* ifdef ECORE_XCOMPOSITE */
69 ecore_x_composite_redirect_subwindows(Ecore_X_Window win,
70 Ecore_X_Composite_Update_Type type)
72 #ifdef ECORE_XCOMPOSITE
73 int update = CompositeRedirectAutomatic;
78 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
79 update = CompositeRedirectAutomatic;
82 case ECORE_X_COMPOSITE_UPDATE_MANUAL:
83 update = CompositeRedirectManual;
86 XCompositeRedirectSubwindows(_ecore_x_disp, win, update);
87 if (_ecore_xlib_sync) ecore_x_sync();
88 #endif /* ifdef ECORE_XCOMPOSITE */
92 ecore_x_composite_unredirect_window(Ecore_X_Window win,
93 Ecore_X_Composite_Update_Type type)
95 #ifdef ECORE_XCOMPOSITE
96 int update = CompositeRedirectAutomatic;
101 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
102 update = CompositeRedirectAutomatic;
105 case ECORE_X_COMPOSITE_UPDATE_MANUAL:
106 update = CompositeRedirectManual;
109 XCompositeUnredirectWindow(_ecore_x_disp, win, update);
110 if (_ecore_xlib_sync) ecore_x_sync();
111 #endif /* ifdef ECORE_XCOMPOSITE */
115 ecore_x_composite_unredirect_subwindows(Ecore_X_Window win,
116 Ecore_X_Composite_Update_Type type)
118 #ifdef ECORE_XCOMPOSITE
119 int update = CompositeRedirectAutomatic;
124 case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
125 update = CompositeRedirectAutomatic;
128 case ECORE_X_COMPOSITE_UPDATE_MANUAL:
129 update = CompositeRedirectManual;
132 XCompositeUnredirectSubwindows(_ecore_x_disp, win, update);
133 if (_ecore_xlib_sync) ecore_x_sync();
134 #endif /* ifdef ECORE_XCOMPOSITE */
138 ecore_x_composite_name_window_pixmap_get(Ecore_X_Window win)
140 Ecore_X_Pixmap pixmap = None;
141 #ifdef ECORE_XCOMPOSITE
143 pixmap = XCompositeNameWindowPixmap(_ecore_x_disp, win);
144 if (_ecore_xlib_sync) ecore_x_sync();
145 #endif /* ifdef ECORE_XCOMPOSITE */
150 ecore_x_composite_window_events_disable(Ecore_X_Window win)
152 #ifdef ECORE_XCOMPOSITE
153 ecore_x_window_shape_input_rectangle_set(win, -1, -1, 1, 1);
154 if (_ecore_xlib_sync) ecore_x_sync();
155 #endif /* ifdef ECORE_XCOMPOSITE */
159 ecore_x_composite_window_events_enable(Ecore_X_Window win)
161 #ifdef ECORE_XCOMPOSITE
162 ecore_x_window_shape_input_rectangle_set(win, 0, 0, 65535, 65535);
163 if (_ecore_xlib_sync) ecore_x_sync();
164 #endif /* ifdef ECORE_XCOMPOSITE */
168 ecore_x_composite_render_window_enable(Ecore_X_Window root)
170 Ecore_X_Window win = 0;
171 #ifdef ECORE_XCOMPOSITE
172 win = XCompositeGetOverlayWindow(_ecore_x_disp, root);
173 if (_ecore_xlib_sync) ecore_x_sync();
174 ecore_x_composite_window_events_disable(win);
175 #endif /* ifdef ECORE_XCOMPOSITE */
180 ecore_x_composite_render_window_disable(Ecore_X_Window root)
182 #ifdef ECORE_XCOMPOSITE
184 XCompositeReleaseOverlayWindow(_ecore_x_disp, root);
185 if (_ecore_xlib_sync) ecore_x_sync();
186 #endif /* ifdef ECORE_XCOMPOSITE */