]> Dogcows Code - chaz/openbox/commitdiff
really fix focus_last?
authorMikael Magnusson <mikachu@comhem.se>
Fri, 4 Aug 2006 19:56:42 +0000 (19:56 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Fri, 4 Aug 2006 19:56:42 +0000 (19:56 +0000)
openbox/action.c
openbox/client.c
openbox/focus.c
openbox/focus.h

index e98677b9ad44ef8fe0cf4a199d091642745f3b1c..05a9e640ae1eb682871165c2d5ae985d4d9740ad 100644 (file)
@@ -1071,7 +1071,8 @@ void action_focus(union ActionData *data)
 
 void action_unfocus (union ActionData *data)
 {
-    client_unfocus(data->client.any.c);
+    if (data->client.any.c == focus_client);
+        focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING);
 }
 
 void action_iconify(union ActionData *data)
index fdc8c108ce53d655fbb579e50b3e10f3d52ccde8..d4759bb9495d5118def64d29d899b50cfcc300f8 100644 (file)
@@ -2833,13 +2833,15 @@ gboolean client_focus(ObClient *self)
     return TRUE;
 }
 
+/* Used when the current client is closed, focus_last will then prevent
+ * focus from going to the mouse pointer */
 void client_unfocus(ObClient *self)
 {
     if (focus_client == self) {
 #ifdef DEBUG_FOCUS
         ob_debug("client_unfocus for %lx\n", self->window);
 #endif
-        focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING);
+        focus_fallback(OB_FOCUS_FALLBACK_CLOSED);
     }
 }
 
index 07df3a5624b8436c63d9bd5563053b37c4ac045b..6a56c2f819bccd72ca767e866e1fe6ee64a94bc4 100644 (file)
@@ -249,7 +249,8 @@ ObClient* focus_fallback_target(ObFocusFallbackType type)
 
     old = focus_client;
 
-    if (type == OB_FOCUS_FALLBACK_UNFOCUSING && old) {
+    if ((type == OB_FOCUS_FALLBACK_UNFOCUSING
+         || type == OB_FOCUS_FALLBACK_CLOSED) && old) {
         if (old->transient_for) {
             gboolean trans = FALSE;
 
index 345685c0f52f08bb06744cdbdc0e88ace3cf01db..014350f9901c8d2c208aa593cea35e3756b57bc0 100644 (file)
@@ -48,6 +48,7 @@ void focus_set_client(struct _ObClient *client);
 typedef enum {
     OB_FOCUS_FALLBACK_UNFOCUSING, /*!< forcefully remove focus from the
                                     current window */
+    OB_FOCUS_FALLBACK_CLOSED,     /*!< closed the window with focus */
     OB_FOCUS_FALLBACK_NOFOCUS     /*!< nothing has focus for some reason */
 } ObFocusFallbackType;
 
This page took 0.032272 seconds and 4 git commands to generate.