2009-01-31 10:33:39 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef HAVE_CONFIG_H */
|
2009-01-31 10:33:39 -08:00
|
|
|
|
2007-10-06 01:37:34 -07:00
|
|
|
#include "ecore_x_private.h"
|
|
|
|
#include "Ecore_X.h"
|
|
|
|
|
2010-09-26 10:49:05 -07:00
|
|
|
static Eina_Bool _composite_available = EINA_FALSE;
|
2007-10-06 01:37:34 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_x_composite_init(void)
|
|
|
|
{
|
2010-09-26 10:49:05 -07:00
|
|
|
_composite_available = EINA_FALSE;
|
2007-10-06 01:37:34 -07:00
|
|
|
|
|
|
|
#ifdef ECORE_XCOMPOSITE
|
|
|
|
int major, minor;
|
|
|
|
|
|
|
|
if (XCompositeQueryVersion(_ecore_x_disp, &major, &minor))
|
2010-09-09 23:57:21 -07:00
|
|
|
{
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-09-09 23:57:21 -07:00
|
|
|
# ifdef ECORE_XRENDER
|
|
|
|
if (XRenderQueryExtension(_ecore_x_disp, &major, &minor))
|
|
|
|
{
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-09-09 23:57:21 -07:00
|
|
|
# ifdef ECORE_XFIXES
|
|
|
|
if (XFixesQueryVersion(_ecore_x_disp, &major, &minor))
|
|
|
|
{
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-09-26 10:49:05 -07:00
|
|
|
_composite_available = EINA_TRUE;
|
2010-09-09 23:57:21 -07:00
|
|
|
}
|
|
|
|
# endif
|
|
|
|
}
|
2011-04-20 07:15:33 -07:00
|
|
|
# endif
|
2010-09-09 23:57:21 -07:00
|
|
|
}
|
|
|
|
#endif
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2007-10-06 01:37:34 -07:00
|
|
|
|
2010-09-26 10:49:05 -07:00
|
|
|
EAPI Eina_Bool
|
2007-10-06 01:37:34 -07:00
|
|
|
ecore_x_composite_query(void)
|
|
|
|
{
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2007-10-06 01:37:34 -07:00
|
|
|
return _composite_available;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 03:41:36 -07:00
|
|
|
|
2009-03-24 14:31:05 -07:00
|
|
|
EAPI void
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_composite_redirect_window(Ecore_X_Window win,
|
2010-07-27 22:23:42 -07:00
|
|
|
Ecore_X_Composite_Update_Type type)
|
2009-03-24 14:31:05 -07:00
|
|
|
{
|
2009-10-16 02:25:08 -07:00
|
|
|
#ifdef ECORE_XCOMPOSITE
|
2009-12-07 13:01:26 -08:00
|
|
|
int update = CompositeRedirectAutomatic;
|
2009-03-24 14:31:05 -07:00
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2011-12-03 12:05:48 -08:00
|
|
|
switch (type)
|
2009-03-24 14:31:05 -07:00
|
|
|
{
|
|
|
|
case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
|
2011-10-20 22:40:59 -07:00
|
|
|
update = CompositeRedirectAutomatic;
|
|
|
|
break;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2009-03-24 14:31:05 -07:00
|
|
|
case ECORE_X_COMPOSITE_UPDATE_MANUAL:
|
2011-10-20 22:40:59 -07:00
|
|
|
update = CompositeRedirectManual;
|
|
|
|
break;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 14:31:05 -07:00
|
|
|
XCompositeRedirectWindow(_ecore_x_disp, win, update);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 14:31:05 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_composite_redirect_subwindows(Ecore_X_Window win,
|
2010-07-27 22:23:42 -07:00
|
|
|
Ecore_X_Composite_Update_Type type)
|
2009-03-24 14:31:05 -07:00
|
|
|
{
|
2009-10-16 02:25:08 -07:00
|
|
|
#ifdef ECORE_XCOMPOSITE
|
2009-12-07 13:01:26 -08:00
|
|
|
int update = CompositeRedirectAutomatic;
|
2009-03-24 14:31:05 -07:00
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2011-12-03 12:05:48 -08:00
|
|
|
switch (type)
|
2009-03-24 14:31:05 -07:00
|
|
|
{
|
|
|
|
case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
|
2011-10-20 22:40:59 -07:00
|
|
|
update = CompositeRedirectAutomatic;
|
|
|
|
break;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2009-03-24 14:31:05 -07:00
|
|
|
case ECORE_X_COMPOSITE_UPDATE_MANUAL:
|
2011-10-20 22:40:59 -07:00
|
|
|
update = CompositeRedirectManual;
|
|
|
|
break;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 14:31:05 -07:00
|
|
|
XCompositeRedirectSubwindows(_ecore_x_disp, win, update);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 14:31:05 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_composite_unredirect_window(Ecore_X_Window win,
|
2010-07-27 22:23:42 -07:00
|
|
|
Ecore_X_Composite_Update_Type type)
|
2009-03-24 14:31:05 -07:00
|
|
|
{
|
2009-10-16 02:25:08 -07:00
|
|
|
#ifdef ECORE_XCOMPOSITE
|
2009-12-07 13:01:26 -08:00
|
|
|
int update = CompositeRedirectAutomatic;
|
2009-03-24 14:31:05 -07:00
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2011-12-03 12:05:48 -08:00
|
|
|
switch (type)
|
2009-03-24 14:31:05 -07:00
|
|
|
{
|
|
|
|
case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
|
2011-10-20 22:40:59 -07:00
|
|
|
update = CompositeRedirectAutomatic;
|
|
|
|
break;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2009-03-24 14:31:05 -07:00
|
|
|
case ECORE_X_COMPOSITE_UPDATE_MANUAL:
|
2011-10-20 22:40:59 -07:00
|
|
|
update = CompositeRedirectManual;
|
|
|
|
break;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 14:31:05 -07:00
|
|
|
XCompositeUnredirectWindow(_ecore_x_disp, win, update);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 14:31:05 -07:00
|
|
|
|
|
|
|
EAPI void
|
2011-12-03 12:05:48 -08:00
|
|
|
ecore_x_composite_unredirect_subwindows(Ecore_X_Window win,
|
2010-07-27 22:23:42 -07:00
|
|
|
Ecore_X_Composite_Update_Type type)
|
2009-03-24 14:31:05 -07:00
|
|
|
{
|
2009-10-16 02:25:08 -07:00
|
|
|
#ifdef ECORE_XCOMPOSITE
|
2009-12-07 13:01:26 -08:00
|
|
|
int update = CompositeRedirectAutomatic;
|
2009-03-24 14:31:05 -07:00
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2011-12-03 12:05:48 -08:00
|
|
|
switch (type)
|
2009-03-24 14:31:05 -07:00
|
|
|
{
|
|
|
|
case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
|
2011-10-20 22:40:59 -07:00
|
|
|
update = CompositeRedirectAutomatic;
|
|
|
|
break;
|
2010-07-27 22:23:42 -07:00
|
|
|
|
2009-03-24 14:31:05 -07:00
|
|
|
case ECORE_X_COMPOSITE_UPDATE_MANUAL:
|
2011-10-20 22:40:59 -07:00
|
|
|
update = CompositeRedirectManual;
|
|
|
|
break;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 14:31:05 -07:00
|
|
|
XCompositeUnredirectSubwindows(_ecore_x_disp, win, update);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2009-03-24 14:31:05 -07:00
|
|
|
|
2009-03-24 03:41:36 -07:00
|
|
|
EAPI Ecore_X_Pixmap
|
|
|
|
ecore_x_composite_name_window_pixmap_get(Ecore_X_Window win)
|
|
|
|
{
|
2009-10-16 02:25:08 -07:00
|
|
|
Ecore_X_Pixmap pixmap = None;
|
2009-03-24 03:41:36 -07:00
|
|
|
#ifdef ECORE_XCOMPOSITE
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2009-03-24 03:41:36 -07:00
|
|
|
pixmap = XCompositeNameWindowPixmap(_ecore_x_disp, win);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
2009-03-24 03:41:36 -07:00
|
|
|
return pixmap;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2010-01-06 06:14:23 -08:00
|
|
|
|
2010-08-03 02:02:27 -07:00
|
|
|
EAPI void
|
|
|
|
ecore_x_composite_window_events_disable(Ecore_X_Window win)
|
|
|
|
{
|
|
|
|
#ifdef ECORE_XCOMPOSITE
|
2011-04-13 02:06:05 -07:00
|
|
|
ecore_x_window_shape_input_rectangle_set(win, -1, -1, 1, 1);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-03 02:02:27 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
ecore_x_composite_window_events_enable(Ecore_X_Window win)
|
|
|
|
{
|
|
|
|
#ifdef ECORE_XCOMPOSITE
|
2011-04-13 02:06:05 -07:00
|
|
|
ecore_x_window_shape_input_rectangle_set(win, 0, 0, 65535, 65535);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-03 02:02:27 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
|
|
|
}
|
|
|
|
|
2010-01-06 06:14:23 -08:00
|
|
|
EAPI Ecore_X_Window
|
|
|
|
ecore_x_composite_render_window_enable(Ecore_X_Window root)
|
|
|
|
{
|
|
|
|
Ecore_X_Window win = 0;
|
|
|
|
#ifdef ECORE_XCOMPOSITE
|
|
|
|
win = XCompositeGetOverlayWindow(_ecore_x_disp, root);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2011-04-13 02:06:05 -07:00
|
|
|
ecore_x_composite_window_events_disable(win);
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
2010-01-06 06:14:23 -08:00
|
|
|
return win;
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2010-01-06 06:14:23 -08:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
ecore_x_composite_render_window_disable(Ecore_X_Window root)
|
|
|
|
{
|
|
|
|
#ifdef ECORE_XCOMPOSITE
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2010-01-06 06:14:23 -08:00
|
|
|
XCompositeReleaseOverlayWindow(_ecore_x_disp, root);
|
2013-07-17 22:17:40 -07:00
|
|
|
if (_ecore_xlib_sync) ecore_x_sync();
|
2010-08-02 10:47:49 -07:00
|
|
|
#endif /* ifdef ECORE_XCOMPOSITE */
|
2011-12-03 11:41:12 -08:00
|
|
|
}
|
2010-08-02 10:47:49 -07:00
|
|
|
|