check if the window is focused before unfocusing it
authorDana Jansens <danakj@orodu.net>
Fri, 14 Feb 2003 18:31:52 +0000 (18:31 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 14 Feb 2003 18:31:52 +0000 (18:31 +0000)
src/screen.cc

index 17a8c22..3f507af 100644 (file)
@@ -669,7 +669,7 @@ void Screen::unmanageWindow(Client *client)
   client->_modal = false;
   
   // unfocus the client (calls the focus callbacks)
-  client->unfocus();
+  if (client->focused()) client->unfocus();
 
 #ifdef DEBUG
   printf("Unmanaged window 0x%lx frame 0x%lx\n", client->window(), framewin);