]> Dogcows Code - chaz/openbox/blobdiff - openbox/action.c
a) remove focus_hilite, it is not needed and complicated things
[chaz/openbox] / openbox / action.c
index 9022333a1857faed249000b0961967254460c6f3..db49f56cd8f09e01727f25142caaa57f043daaff 100644 (file)
@@ -41,7 +41,7 @@ inline void client_action_start(union ActionData *data)
 {
     if (config_focus_follow)
         if (data->any.context != OB_FRAME_CONTEXT_CLIENT && !data->any.button)
-            grab_pointer(TRUE, OB_CURSOR_NONE);
+            grab_pointer(TRUE, FALSE, OB_CURSOR_NONE);
 }
 
 inline void client_action_end(union ActionData *data)
@@ -49,7 +49,7 @@ inline void client_action_end(union ActionData *data)
     if (config_focus_follow)
         if (data->any.context != OB_FRAME_CONTEXT_CLIENT) {
             if (!data->any.button) {
-                grab_pointer(FALSE, OB_CURSOR_NONE);
+                grab_pointer(FALSE, FALSE, OB_CURSOR_NONE);
             } else {
                 ObClient *c;
 
@@ -434,6 +434,11 @@ void setup_action_showmenu(ObAction **a, ObUserAction uact)
     }
 }
 
+void setup_action_focus(ObAction **a, ObUserAction uact)
+{
+    (*a)->data.any.client_action = OB_CLIENT_ACTION_OPTIONAL;
+}
+
 void setup_client_action(ObAction **a, ObUserAction uact)
 {
     (*a)->data.any.client_action = OB_CLIENT_ACTION_ALWAYS;
@@ -494,7 +499,7 @@ ActionString actionstrings[] =
     {
         "focus",
         action_focus,
-        setup_client_action
+        setup_action_focus
     },
     {
         "unfocus",
@@ -1042,7 +1047,7 @@ void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
            it won't work right unless we XUngrabKeyboard first,
            even though we grabbed the key/button Asychronously.
            e.g. "gnome-panel-control --main-menu" */
-        XUngrabKeyboard(ob_display, event_curtime);
+        grab_keyboard(FALSE);
     }
 
     for (it = acts; it; it = g_slist_next(it)) {
@@ -1122,6 +1127,7 @@ void action_execute(union ActionData *data)
                     g_error_free(e);
                     sn_spawn_cancel();
                 }
+                unsetenv("DESKTOP_STARTUP_ID");
                 g_free(program);
                 g_strfreev(argv);
             } else {
@@ -1158,15 +1164,22 @@ void action_activate(union ActionData *data)
 
 void action_focus(union ActionData *data)
 {
-    /* similar to the openbox dock for dockapps, don't let user actions give
-       focus to 3rd-party docks (panels) either (unless they ask for it
-       themselves). */
-    if (data->client.any.c->type != OB_CLIENT_TYPE_DOCK) {
-        /* if using focus_delay, stop the timer now so that focus doesn't go
-           moving on us */
-        event_halt_focus_delay();
+    if (data->client.any.c) {
+        /* similar to the openbox dock for dockapps, don't let user actions
+           give focus to 3rd-party docks (panels) either (unless they ask for
+           it themselves). */
+        if (data->client.any.c->type != OB_CLIENT_TYPE_DOCK) {
+            /* if using focus_delay, stop the timer now so that focus doesn't
+               go moving on us */
+            event_halt_focus_delay();
 
-        client_focus(data->client.any.c);
+            client_focus(data->client.any.c);
+        }
+    } else {
+        /* focus action on something other than a client, make keybindings
+           work for this openbox instance, but don't focus any specific client
+        */
+        focus_nothing();
     }
 }
 
This page took 0.025254 seconds and 4 git commands to generate.