Mercurial > audlegacy-plugins
changeset 909:cb0bb8e6d6e9 trunk
[svn] - aosd: added function to detect if a composite manager is active for a certain screen; this is not used for now, cause the _NET_WM_CM_Sn hint is pretty new; it will certainly prove useful at some time
author | giacomo |
---|---|
date | Mon, 02 Apr 2007 10:35:45 -0700 |
parents | 8b4b381b4399 |
children | 5aaf6c282617 |
files | ChangeLog src/aosd/ghosd.c |
diffstat | 2 files changed, 38 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Apr 02 04:03:06 2007 -0700 +++ b/ChangeLog Mon Apr 02 10:35:45 2007 -0700 @@ -1,3 +1,17 @@ +2007-04-02 11:03:06 +0000 Giacomo Lozito <james@develia.org> + revision [1916] + aosd: added compile option in configure for composite support; this way, if support is compiled in, we can safely check if the composite module is loaded + trunk/configure.ac | 24 +++++++++++++++++++++++- + trunk/mk/rules.mk.in | 4 ++++ + trunk/src/aosd/Makefile | 4 ++-- + trunk/src/aosd/aosd_osd.c | 23 ++++++++++++++++++++++- + trunk/src/aosd/aosd_osd.h | 4 ++++ + trunk/src/aosd/aosd_ui.c | 23 ++++++++++++++++++++--- + trunk/src/aosd/ghosd.c | 32 ++++++++++++++++++++++++++++++++ + trunk/src/aosd/ghosd.h | 7 ++++++- + 8 files changed, 113 insertions(+), 8 deletions(-) + + 2007-04-01 18:36:52 +0000 Giacomo Lozito <james@develia.org> revision [1914] aosd: added some more error checking
--- a/src/aosd/ghosd.c Mon Apr 02 04:03:06 2007 -0700 +++ b/src/aosd/ghosd.c Mon Apr 02 10:35:45 2007 -0700 @@ -48,8 +48,29 @@ } #ifdef HAVE_XCOMPOSITE -Visual * -find_argb_visual (Display *dpy, int scr) +static Bool +composite_find_manager(Display *dpy, int scr) +{ + Atom comp_manager_atom; + char comp_manager_hint[32]; + Window win; + + snprintf(comp_manager_hint, 32, "_NET_WM_CM_S%d", scr); + comp_manager_atom = XInternAtom(dpy, comp_manager_hint, False); + win = XGetSelectionOwner(dpy, comp_manager_atom); + + if (win != None) + { + return True; + } + else + { + return False; + } +} + +static Visual * +composite_find_argb_visual(Display *dpy, int scr) { XVisualInfo *xvi; XVisualInfo template; @@ -391,7 +412,7 @@ screen_num = DefaultScreen(dpy); root_win = RootWindow(dpy, screen_num); - visual = find_argb_visual(dpy, screen_num); + visual = composite_find_argb_visual(dpy, screen_num); if (visual == NULL) return NULL; colormap = XCreateColormap(dpy, root_win, visual, AllocNone);