# HG changeset patch # User giacomo # Date 1170849145 28800 # Node ID 354389b85dce0b148f55a6cf4a69b6b5588a1dde # Parent 85a70ace8c02583539f2125d2fe89ed048a33ece [svn] - aosd, further work on ghosd source: do not use a override_redirect=true window and give the WM information about initial pos/size of osd (prevents flickering with normal windows); now the osd won't be displayed in multiple workspaces, only in the one where it's initially triggered diff -r 85a70ace8c02 -r 354389b85dce ChangeLog --- a/ChangeLog Wed Feb 07 01:10:37 2007 -0800 +++ b/ChangeLog Wed Feb 07 03:52:25 2007 -0800 @@ -1,3 +1,15 @@ +2007-02-07 09:10:37 +0000 Yoshiki Yazawa + revision [1312] + - press F5 on not yet played stream no longer hangs. + - some cleanups. + + trunk/src/madplug/TODO | 4 +- + trunk/src/madplug/fileinfo.c | 5 +-- + trunk/src/madplug/input.c | 1 + trunk/src/madplug/plugin.c | 65 +++++++++++++++++++++++++++---------------- + 4 files changed, 47 insertions(+), 28 deletions(-) + + 2007-02-07 05:01:15 +0000 Yoshiki Yazawa revision [1310] - fix for audmad_is_our_fd() diff -r 85a70ace8c02 -r 354389b85dce src/aosd/ghosd.c --- a/src/aosd/ghosd.c Wed Feb 07 01:10:37 2007 -0800 +++ b/src/aosd/ghosd.c Wed Feb 07 03:52:25 2007 -0800 @@ -15,6 +15,30 @@ #include "ghosd.h" #include "ghosd-internal.h" +static unsigned long +get_current_workspace(Ghosd *ghosd) { + Atom cur_workspace_atom; + Atom type; + int format; + unsigned long nitems, bytes_after; + unsigned char *data; + + cur_workspace_atom = XInternAtom(ghosd->dpy, "_NET_CURRENT_DESKTOP", False); + XGetWindowProperty(ghosd->dpy, DefaultRootWindow(ghosd->dpy), cur_workspace_atom, + 0, ULONG_MAX, False, XA_CARDINAL, &type, &format, &nitems, &bytes_after, &data); + + if ( type == XA_CARDINAL ) + { + unsigned long cur_workspace = (unsigned long)*data; + g_print("debug: %i\n", cur_workspace); + XFree( data ); + return cur_workspace; + } + + /* fall back to desktop number 0 */ + return 0; +} + static Pixmap take_snapshot(Ghosd *ghosd) { Pixmap pixmap; @@ -96,6 +120,7 @@ /* turn off window decorations. * we could pull this in from a motif header, but it's easier to * use this snippet i found on a mailing list. */ + XSizeHints *sizehints; Atom mwm_hints = XInternAtom(dpy, "_MOTIF_WM_HINTS", False); #define MWM_HINTS_DECORATIONS (1<<1) struct { @@ -116,6 +141,17 @@ }; XChangeProperty(dpy, win, win_state, XA_ATOM, 32, PropModeReplace, (unsigned char*)&win_state_setting, 3); + + /* give initial pos/size information to window manager + about the window, this prevents flickering */ + sizehints = XAllocSizeHints(); + sizehints->flags = USPosition | USSize; + sizehints->x = -1; + sizehints->y = -1; + sizehints->width = 1; + sizehints->height = 1; + XSetWMNormalHints(dpy, win, sizehints); + XFree( sizehints ); } static Window @@ -131,7 +167,7 @@ att.background_pixmap = None; att.save_under = True; att.event_mask = ExposureMask | StructureNotifyMask | ButtonPressMask; - att.override_redirect = True; + att.override_redirect = False; win = XCreateWindow(dpy, DefaultRootWindow(dpy), -1, -1, 1, 1, 0,