I could get the bug reproduced, and tryed to craft a patch (attached,
it's mainly Matej Vela's patch replacing some 'unsigned long' with
'Window') but it's still not it (even if skippy doesn't crash
anymore).
I do not have a amd64 at hand, so debuging this is quite hard, if you
have such machine and wish to test things please patch with this :
http://cxhome.ath.cx/~xaiki/999_gruick_make_xsync.patch
(adding it to debian/patches should do, yes I should make it a runtime
flag ...)
Thanks to maxyz for the help he provided !
diff -Nur skippy-0.5.1rc1/clientwin.c skippy-0.5.1rc1.new/clientwin.c
--- skippy-0.5.1rc1/clientwin.c 2005-10-18 13:15:02.000000000 -0300
+++ skippy-0.5.1rc1.new/clientwin.c 2006-06-27 14:05:35.000000000 -0300
@@ -32,8 +32,8 @@
int
clientwin_validate_func(dlist *l, void *data)
{
- ClientWin *cw = (ClientWin *)l->data;
- CARD32 desktop = (*(CARD32*)data),
+ ClientWin *cw = (ClientWin *)l->data;
+ Window desktop = (*(Window*)data),
w_desktop = wm_get_window_desktop(cw->mainwin->dpy, cw->client.window);
#ifdef XINERAMA
@@ -43,7 +43,7 @@
return 0;
#endif
- return (w_desktop == (CARD32)-1 || desktop == w_desktop) &&
+ return (w_desktop == (Window)-1 || desktop == w_desktop) &&
wm_validate_window(cw->mainwin->dpy, cw->client.window);
}
diff -Nur skippy-0.5.1rc1/skippy.c skippy-0.5.1rc1.new/skippy.c
--- skippy-0.5.1rc1/skippy.c 2006-04-25 15:37:44.000000000 -0300
+++ skippy-0.5.1rc1.new/skippy.c 2006-06-27 14:05:35.000000000 -0300
@@ -75,7 +75,7 @@
int die = 0;
dlist *iter, *tmp;
Window dummy_w, *tree_windows;
- CARD32 desktop = wm_get_current_desktop(mw->dpy);
+ Window desktop = wm_get_current_desktop(mw->dpy);
Bool refocus = False;
/* Update the main window's geometry (and Xinerama info if applicable) */
diff -Nur skippy-0.5.1rc1/wm.c skippy-0.5.1rc1.new/wm.c
--- skippy-0.5.1rc1/wm.c 2005-10-18 13:15:02.000000000 -0300
+++ skippy-0.5.1rc1.new/wm.c 2006-06-27 14:05:35.000000000 -0300
@@ -260,7 +260,7 @@
return 0;
for(i = 0; i < items_read; i++)
- l = dlist_add(l, (void*)((CARD32*)data)[i]);
+ l = dlist_add(l, (void*)((Window*)data)[i]);
XFree(data);
@@ -295,10 +295,10 @@
return rootpmap;
}
-CARD32
+Window
wm_get_current_desktop(Display *dpy)
{
- CARD32 desktop = 0;
+ Window desktop = 0;
unsigned char *data;
int status, real_format;
Atom real_type;
@@ -311,7 +311,7 @@
if(status != Success)
return 0;
if(items_read)
- desktop = ((CARD32*)data)[0];
+ desktop = ((Window*)data)[0];
XFree(data);
return desktop;
@@ -493,7 +493,7 @@
return result;
} else {
- CARD32 attr;
+ unsigned char attr;
status = XGetWindowProperty(dpy, win, _WIN_STATE,
0L, 1L, False, XA_CARDINAL, &real_type, &real_format,
@@ -504,9 +504,9 @@
XFree(data);
return 0;
}
- attr = (((CARD32*)data)[0]) & (WIN_STATE_MINIMIZED |
- WIN_STATE_SHADED |
- WIN_STATE_HIDDEN);
+ attr = ((data)[0]) & (WIN_STATE_MINIMIZED |
+ WIN_STATE_SHADED |
+ WIN_STATE_HIDDEN);
if(attr)
result = 0;
XFree(data);
@@ -524,7 +524,7 @@
XFree(data);
return 1; /* If there's no _WIN_HINTS, assume it's 0, thus valid */
}
- attr = ((CARD32*)data)[0];
+ attr = data[0];
if(attr & WIN_HINTS_SKIP_TASKBAR)
result = 0;
XFree(data);
@@ -534,14 +534,14 @@
}
}
-CARD32
+Window
wm_get_window_desktop(Display *dpy, Window win)
{
int status, real_format;
Atom real_type;
unsigned long items_read, items_left;
unsigned char *data;
- CARD32 desktop = 0;
+ Window desktop = 0;
if(WM_PERSONALITY == WM_PERSONALITY_GNOME)
{
@@ -551,7 +551,7 @@
if(status == Success)
{
if(items_read)
- desktop = (((CARD32*)data)[0] & WIN_STATE_STICKY) ? (CARD32)-1 : 0;
+ desktop = (((Window*)data)[0] & WIN_STATE_STICKY) ? (Window)-1 : 0;
XFree(data);
@@ -569,7 +569,7 @@
return wm_get_current_desktop(dpy);
if(items_read)
- desktop = ((CARD32*)data)[0];
+ desktop = ((Window*)data)[0];
else
desktop = wm_get_current_desktop(dpy);
diff -Nur skippy-0.5.1rc1/wm.h skippy-0.5.1rc1.new/wm.h
--- skippy-0.5.1rc1/wm.h 2005-10-18 13:15:02.000000000 -0300
+++ skippy-0.5.1rc1.new/wm.h 2006-06-27 14:05:35.000000000 -0300
@@ -74,12 +74,12 @@
void wm_sawfish_focus(Bool b);
dlist *wm_get_stack(Display *dpy);
Pixmap wm_get_root_pmap(Display *dpy);
-CARD32 wm_get_current_desktop(Display *dpy);
+Window wm_get_current_desktop(Display *dpy);
FcChar8 *wm_get_window_title(Display *dpy, Window window, int *length_return);
Window wm_get_group_leader(Display *dpy, Window window);
void wm_set_fullscreen(Display *dpy, Window window, int x, int y, unsigned int width, unsigned int height);
int wm_validate_window(Display *dpy, Window win);
-CARD32 wm_get_window_desktop(Display *dpy, Window win);
+Window wm_get_window_desktop(Display *dpy, Window win);
Window wm_get_focused(Display *dpy);
void wm_ignore_skip_taskbar(Bool b);
void wm_prepare_snap(Display *dpy, Window win, wm_snap_state_t *state);
--
Niv Sardi-Altivanik <[EMAIL PROTECTED]>
- = Debian::GNU/Linux::Addict = -
> Random Fortune (To make your day better if not wiser) <
That which is not good for the swarm, neither is it good for the bee.