--- 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) {
