From: Marty J. <mar...@co...> - 2009-03-23 04:16:01
|
In addition to the bugs that Juergen Hoetzel fixed, there are two others. The flow that handles _NET_WM_ICON needs to handle the case where a valid icon isn't actually isolated, so that the fallback code will be executed. Also, the return status from XGetGeometry is nonzero success, zero failure. With these changes, the code that tries the "legacy WM hints" is actually executed and all the applications I run that didn't have taskbar icons before now have them. Here is a patch that incorporates the previous. I hope it survives the trip to the mailing list. If there is some other way you would prefer getting patches, please advise. I claim the uninitialized variable probably accounts for all the cases of lxpanel crashing including the one reported by Ian Whyman. - Marty diff -Naur lxpanel-0.3.999.orig/src/plugins/taskbar.c lxpanel-0.3.999/src/plugins/taskbar.c --- lxpanel-0.3.999.orig/src/plugins/taskbar.c 2009-01-26 08:37:22.000000000 -0500 +++ lxpanel-0.3.999/src/plugins/taskbar.c 2009-03-22 23:59:39.000000000 -0400 @@ -473,7 +473,7 @@ Window win; unsigned int w, h; int sd, result, format; - GdkPixbuf *ret, *masked, *pixmap, *mask = NULL; + GdkPixbuf *ret, *masked, *pixmap = NULL, *mask = NULL; Atom type = None; gulong *data = NULL; gulong nitems; @@ -505,7 +505,7 @@ LOG(LOG_WARN, "lxpanel : type is not XA_CARDINAL"); if(data) XFree(data); - result = 0; + result = -1; } if(result == Success) @@ -575,6 +575,10 @@ free_pixels, NULL); } + else + { + result = -1; + } XFree(data); } @@ -583,7 +587,7 @@ LOG(LOG_WARN, "lxpanel : Can't read _NET_WM_ICON, try to read pixmap icon\n"); hints = XGetWMHints(GDK_DISPLAY(), tkwin); - result = (hints != NULL) ? Success : 0; + result = (hints != NULL) ? Success : -1; if(result == Success) { @@ -592,7 +596,7 @@ if ((hints->flags & IconMaskHint)) xmask = hints->icon_mask; XFree(hints); - result = (xpixmap != None)?Success:0; + result = (xpixmap != None)?Success:-1; } if(result != Success) @@ -611,13 +615,13 @@ { if( icons ) XFree(icons); - result = 0; + result = -1; } if(result == Success) { xpixmap = icons[0]; xmask = icons[1]; - result = (xpixmap != None) ? Success : 0; + result = (xpixmap != None) ? Success : -1; } } @@ -626,7 +630,7 @@ result = XGetGeometry(GDK_DISPLAY(), xpixmap, &win, &sd, &sd, &w, &h, - (guint *)&sd, (guint *)&sd); + (guint *)&sd, (guint *)&sd) ? Success : -1; } if(result != Success) @@ -637,7 +641,7 @@ { DBG("tkwin=%x icon pixmap w=%d h=%d\n", tkwin, w, h); pixmap = _wnck_gdk_pixbuf_get_from_pixmap (NULL, xpixmap, 0, 0, 0, 0, w, h); - result = pixmap?Success:0; + result = pixmap?Success:-1; } if(result == Success) |
From: Jürgen H. <ju...@ar...> - 2009-03-23 19:07:23
|
Hi Marty, On Mon, Mar 23, 2009 at 12:15:58AM -0400, Marty Jack wrote: > In addition to the bugs that Juergen Hoetzel fixed, there are two > others. The flow that handles _NET_WM_ICON needs to handle the case > where a valid icon isn't actually isolated, so that the fallback > code will be executed. Also, the return status from XGetGeometry is > nonzero success, zero failure. With these changes, the code that > tries the "legacy WM hints" is actually executed and all the > applications I run that didn't have taskbar icons before now have > them. Good catch! I just committed to SVN trunk. Thanks for your contribution! > Here is a patch that incorporates the previous. I hope it survives > the trip to the mailing list. If there is some other way you would > prefer getting patches, please advise. Yes. Please use the SF tracker: http://sourceforge.net/tracker/?group_id=180858 Jürgen |