darcs patch: NamedWindows: removed getClassHint that is the cause o...

Hi,
this patch soft of fixes the crash issue. It removes the work aroung I
proposed for non latin window's names: using the reasourse name provided by
getClassHint. This one is causing the problem. So, we need to fix this
first.
To XMonad core team: I don't know if this patch must be applied: probably it
can be used by Tabbed users till when getClassHint is fixed. I don't know...
you see!
Ciao
Andrea who's going to have some breackfast now
Thu Jul 12 07:47:52 CEST 2007 Andrea Rossato

On Thu, Jul 12, 2007 at 07:55:40AM +0200, Andrea Rossato wrote:
Hi, this patch soft of fixes the crash issue. It removes the work aroung I proposed for non latin window's names: using the reasourse name provided by getClassHint. This one is causing the problem. So, we need to fix this first.
To XMonad core team: I don't know if this patch must be applied: probably it can be used by Tabbed users till when getClassHint is fixed. I don't know... you see!
Ah, getClassHint, one of the "extremely fishy functions from X11-extras". data ClassHint = ClassHint { resName :: String , resClass :: String } instance Storable ClassHint where sizeOf _ = #{size XClassHint} -- I really hope this is right too :) : alignment _ = alignment (undefined :: CInt) peek p = do p_res_name <- (#{peek XClassHint, res_name} p) :: IO CString p_res_class <- (#{peek XClassHint, res_class} p) :: IO CString res_name <- peekCString p_res_name res_class <- peekCString p_res_class xFree p_res_name xFree p_res_class return $ ClassHint res_name res_class getClassHint :: Display -> Window -> IO ClassHint getClassHint d w = alloca $ \ p -> do xGetClassHint d w p peek p foreign import ccall unsafe "XlibExtras.h XGetClassHint" xGetClassHint :: Display -> Window -> Ptr ClassHint -> IO Status Giving peek side effects is just so *wrong* :) According to my copy of the Xlib sources, those free calls are erroneous if the window does not have a WM_CLASS property; xprop confirms this is the case with glxgears. (Now if only the manual described this corner case! Having to look in /usr/src/libx11-1.0.3/src/GetHints.c is a Bad Sign :) ) Stefan

On Thursday 12 July 2007 01:06:14 Stefan O'Rear wrote:
On Thu, Jul 12, 2007 at 07:55:40AM +0200, Andrea Rossato wrote:
Hi, this patch soft of fixes the crash issue. It removes the work aroung I proposed for non latin window's names: using the reasourse name provided by getClassHint. This one is causing the problem. So, we need to fix this first.
To XMonad core team: I don't know if this patch must be applied: probably it can be used by Tabbed users till when getClassHint is fixed. I don't know... you see!
Ah, getClassHint, one of the "extremely fishy functions from X11-extras".
Yep, this was the problem. A fix for X11-extras has just been pushed. Cheers, Spencer Janssen

On Thu, Jul 12, 2007 at 01:09:42AM -0500, Spencer Janssen wrote:
Yep, this was the problem. A fix for X11-extras has just been pushed.
I confirm that X11 is now fixed. Please forget this patch. Quick job guys! Thanks Andrea

On Thursday 12 July 2007 00:55:40 Andrea Rossato wrote:
Hi, this patch soft of fixes the crash issue. It removes the work aroung I proposed for non latin window's names: using the reasourse name provided by getClassHint. This one is causing the problem. So, we need to fix this first.
To XMonad core team: I don't know if this patch must be applied: probably it can be used by Tabbed users till when getClassHint is fixed. I don't know... you see!
Ciao Andrea who's going to have some breackfast now
Thu Jul 12 07:47:52 CEST 2007 Andrea Rossato
* NamedWindows: removed getClassHint that is the cause of some crashing My work around for non latin string in WindowNames requires getClassHint that is, so far, buggy. For the time being we will not have non latin names in tabs. But at least the Tabbed layout is not going to crash XMonad.
We've decided not to apply this patch, because getClassHint has been fixed. Spencer Janssen

Andrea Rossato on 2007-07-12 07:55:40 +0200:
this patch soft of fixes the crash issue. It removes the work aroung I proposed for non latin window's names: using the reasourse name provided by getClassHint. This one is causing the problem. So, we need to fix this first.
That fixes the issue I reported, or at least keeps xmonad from crashing.
participants (4)
-
Alec Berryman
-
Andrea Rossato
-
Spencer Janssen
-
Stefan O'Rear