I think it's better not to delete focusLastWindow() from setState. There
is a pair manager->lockFocus() and manager->unlockFocus(), that is widly
used in the source code to isolate setState from moving input focus. So,
the better solution is to use it. New patch attached
--- a/src/wmcontainer.cc 2010-08-06 18:23:51.000000000 +0400
+++ b/src/wmcontainer.cc 2010-08-06 18:23:22.000000000 +0400
@@ -183,10 +183,12 @@
void YClientContainer::handleMapRequest(const XMapRequestEvent &mapRequest) {
if (mapRequest.window == getFrame()->client()->handle()) {
+ manager->lockFocus();
getFrame()->setState(WinStateMinimized |
WinStateHidden |
WinStateRollup,
0);
+ manager->unlockFocus();
bool doActivate = true;
getFrame()->updateFocusOnMap(doActivate);
if (doActivate) {