Raise/Map and Focus a window: BadMatch error

Peter Harris peter.harris at hummingbird.com
Tue Dec 18 14:16:36 PST 2007


Andrew Troschinetz wrote:
> After trying to use XPeekIfEvent() I had the same problem as before I  
> moved to XWindowEvent().
> 
> Bool map_notify_for_window(Display *display, XEvent *e, XPointer  
> user_data) {
> 	Window window = *reinterpret_cast<Window*> (user_data);

I'm not all that familiar with C++, but it looks like you're
dereferencing a user_data (which is a Window, not a pointer to a Window).

> 		XPeekIfEvent (display, &e, map_notify_for_window,
> 			reinterpret_cast<XPointer> (window));

Did you leave out a try/catch around this? I expect your
map_notify_for_window to cause a core dump.

Peter Harris
-- 
     Hummingbird Connectivity - A Division of Open Text
Peter Harris                    http://connectivity.hummingbird.com
Research and Development        Phone: +1 905 762 6001
peter.harris at hummingbird.com    Toll Free: 1 877 359 4866



More information about the xorg mailing list