summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-11-23 15:32:15 +0100
committerHans de Goede <hdegoede@redhat.com>2010-11-25 11:26:22 +0100
commitc8a034f2858f247d6a00ec1ad47de491b7e99575 (patch)
treeef341016347ca65fbddbdbb48233ca2aa76349c3
parent0e7a79ae11a905cee128c2429a7738fe43e30586 (diff)
downloadspice-c8a034f2858f247d6a00ec1ad47de491b7e99575.tar.gz
spice-c8a034f2858f247d6a00ec1ad47de491b7e99575.tar.xz
spice-c8a034f2858f247d6a00ec1ad47de491b7e99575.zip
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.
-rw-r--r--client/x11/platform.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 20098176..334a74ff 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);