This patch comes from sawfish-mmc. Without it, opening a menu in KDE deactivates the current window. --- sawfish/src/events.c +++ sawfish/src/events.c @@ -955,11 +955,15 @@ Lisp_Window *w = find_window_by_id (ev->xfocus.window); if (ev->xfocus.detail == NotifyPointer) return; + if (ev->xfocus.mode == NotifyGrab || ev->xfocus.mode == NotifyUngrab) + return; if (w != 0 && ev->xfocus.detail != NotifyInferior) { if (focus_window == w) { - focus_window = 0; + if (ev->xfocus.mode == NotifyNormal || ev->xfocus.mode == NotifyWhileGrabbed) + focus_window = 0; + report_focus_change (w); }