[Spice-commits] client/x11

Hans de Goede jwrdegoede at kemper.freedesktop.org
Tue Nov 23 09:17:15 PST 2010


 client/x11/platform.cpp |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 32d94860910aabc7212e4059bf095d0bcd99cc1c
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Tue Nov 23 15:32:15 2010 +0100

    spicec-x11: Fix unhandled exception: no window proc crash (rhbz#655836)
    
    When XIM + ibus is in use XIM creates an invisible window for its own
    purposes, we sometimes get a _GTK_LOAD_ICONTHEMES ClientMessage event on
    this window. Since this window was not explicitly created by spicec, it
    does not have a Window Context (with the event handling function for the
    window in question) set. This would cause spicec to throw an unhandled
    exception and exit.
    
    This patch replaces the exception throwing with silently ignoring
    ClientMessage events on Windows without a Context and logging a warning
    for other event types.

diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 2009817..334a74f 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -295,7 +295,15 @@ void XEventHandler::on_event()
 	}
 
         if (XFindContext(&_x_display, event.xany.window, _win_proc_context, &proc_pointer)) {
-            THROW("no window proc");
+            /* When XIM + ibus is in use XIM creates an invisible window for
+               its own purposes, we sometimes get a _GTK_LOAD_ICONTHEMES
+               ClientMessage event on this window -> skip logging. */
+            if (event.type != ClientMessage) {
+                LOG_WARN(
+                    "Event on window without a win proc, type: %d, window: %u",
+                    event.type, (unsigned int)event.xany.window);
+            }
+            continue;
         }
         XUnlockDisplay(x_display);
         ((XPlatform::win_proc_t)proc_pointer)(event);


More information about the Spice-commits mailing list