]> Dogcows Code - chaz/openbox/commitdiff
don't validate inside client_focus. instead, validate before you call it!
authorDana Jansens <danakj@orodu.net>
Mon, 12 Mar 2007 06:04:00 +0000 (06:04 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 12 Mar 2007 06:04:00 +0000 (06:04 +0000)
openbox/action.c
openbox/client.c
openbox/client.h
openbox/event.c
openbox/screen.c

index 097eaf8d165db736d3acea1b3a146c7c8cc5a85d..73eadf8dc4bc969908a93d6b30ab2165266e414b 100644 (file)
@@ -1164,7 +1164,8 @@ void action_focus(union ActionData *data)
            moving on us */
         event_halt_focus_delay();
 
-        client_focus(data->client.any.c);
+        if (client_validate(data->client.any.c))
+            client_focus(data->client.any.c);
     }
 }
 
index 7e93603601954e01c52e9b91d389de5217d27333..be61a806e06e8eef98b2ea1801f37c8040dc9ced 100644 (file)
@@ -2937,8 +2937,10 @@ gboolean client_focus(ObClient *self)
     /* choose the correct target */
     self = client_focus_target(self);
 
+#if 0
     if (!client_validate(self))
         return FALSE;
+#endif
 
     if (!client_can_focus(self)) {
         if (!self->frame->visible) {
index ff460153092eb3067d4d9854afb43b22feebf6a9..845d9ad213bff72fef2573b98fbc034c30799f5e 100644 (file)
@@ -472,7 +472,9 @@ ObClient *client_focus_target(ObClient *self);
   without focusing it or modifying the focus order lists. */
 gboolean client_can_focus(ObClient *self);
 
-/*! Attempt to focus the client window */
+/*! Attempt to focus the client window
+  NOTE: You should validate the client before calling this !! (client_validate)
+*/
 gboolean client_focus(ObClient *self);
 
 /*! Remove focus from the client window */
index 5d19e897d581cdc68cf84398385e5af14082d1d6..16ec8e0a6ad851b253c632de5031b2d4395776fd 100644 (file)
@@ -433,7 +433,7 @@ static void event_process(const XEvent *ec, gpointer data)
             }
         }
 
-#if 0 /* focus debugging stuff */
+#if 1 /* focus debugging stuff */
     if (e->type == FocusIn || e->type == FocusOut) {
         gint mode = e->xfocus.mode;
         gint detail = e->xfocus.detail;
@@ -1287,9 +1287,11 @@ static gboolean focus_delay_func(gpointer data)
     ObClient *c = data;
 
     if (focus_client != c) {
-        client_focus(c);
-        if (config_focus_raise)
-            client_raise(c);
+        if (client_validate(c)) {
+            client_focus(c);
+            if (config_focus_raise)
+                client_raise(c);
+        }
     }
     return FALSE; /* no repeat */
 }
index 0a5bf2d17f44138d6a0fcc229ffef8d2e53aee96..f37c02e97704c12766dd6e31ba2c25643fa373df 100644 (file)
@@ -894,7 +894,7 @@ void screen_show_desktop(gboolean show)
         /* focus desktop */
         for (it = focus_order[screen_desktop]; it; it = g_list_next(it))
             if (((ObClient*)it->data)->type == OB_CLIENT_TYPE_DESKTOP &&
-                client_focus(it->data))
+                client_validate(it->data) && client_focus(it->data))
                 break;
     } else {
         focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
This page took 0.040442 seconds and 4 git commands to generate.