]> Dogcows Code - chaz/openbox/blobdiff - openbox/keyboard.c
dont go changing the session file all the time, and so then dont need to unlink so...
[chaz/openbox] / openbox / keyboard.c
index 7a74b427c9e3fda3a63dfa57780912f201189c6a..05d40cd06b1801c8501c4e1a0818a0d1d4b5d90b 100644 (file)
@@ -155,22 +155,19 @@ gboolean keyboard_bind(GList *keylist, ObAction *action)
     return TRUE;
 }
 
-void keyboard_interactive_grab(guint state, ObClient *client,
-                               ObAction *action)
+gboolean keyboard_interactive_grab(guint state, ObClient *client,
+                                   ObAction *action)
 {
     ObInteractiveState *s;
 
     g_assert(action->data.any.interactive);
 
-    if (moveresize_in_progress)
-        moveresize_end(FALSE);
-
     if (!interactive_states) {
         if (!grab_keyboard(TRUE))
-            return;
+            return FALSE;
         if (!grab_pointer(TRUE, OB_CURSOR_NONE)) {
             grab_keyboard(FALSE);
-            return;
+            return FALSE;
         }
     }
 
@@ -181,6 +178,8 @@ void keyboard_interactive_grab(guint state, ObClient *client,
     s->actions = g_slist_append(NULL, action);
 
     interactive_states = g_slist_append(interactive_states, s);
+
+    return TRUE;
 }
 
 void keyboard_interactive_end(ObInteractiveState *s,
@@ -200,18 +199,17 @@ void keyboard_interactive_end(ObInteractiveState *s,
     }
 }
 
-void keyboard_interactive_end_client(gpointer data)
+void keyboard_interactive_end_client(ObClient *client, gpointer data)
 {
     GSList *it, *next;
-    ObClient *c = data;
 
     for (it = interactive_states; it; it = next) {
         ObInteractiveState *s = it->data;
 
         next = g_slist_next(it);
 
-        if (s->client == c)
-            keyboard_interactive_end(s, 0, FALSE);
+        if (s->client == client)
+            s->client = NULL;
     }
 }
 
@@ -294,7 +292,7 @@ void keyboard_startup(gboolean reconfig)
     grab_keys(TRUE);
 
     if (!reconfig)
-        client_add_destructor(keyboard_interactive_end_client);
+        client_add_destructor(keyboard_interactive_end_client, NULL);
 }
 
 void keyboard_shutdown(gboolean reconfig)
This page took 0.021851 seconds and 4 git commands to generate.