add a highlight action
authorDana Jansens <danakj@orodu.net>
Tue, 26 Jun 2007 12:54:19 +0000 (12:54 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 26 Jun 2007 12:54:19 +0000 (12:54 +0000)
openbox/actions/all.c
openbox/actions/all.h
openbox/actions/focus.c
openbox/actions/highlight.c [new file with mode: 0644]

index 51996de..e034fea 100644 (file)
@@ -41,4 +41,5 @@ void action_all_startup()
     action_movetofromedge_startup();
     action_growtoedge_startup();
     action_if_startup();
     action_movetofromedge_startup();
     action_growtoedge_startup();
     action_if_startup();
+    action_highlight_startup();
 }
 }
index fd71e4b..fc01df9 100644 (file)
@@ -42,5 +42,6 @@ void action_layer_startup();
 void action_movetofromedge_startup();
 void action_growtoedge_startup();
 void action_if_startup();
 void action_movetofromedge_startup();
 void action_growtoedge_startup();
 void action_if_startup();
+void action_highlight_startup();
 
 #endif
 
 #endif
index afa5f8f..de2bd6d 100644 (file)
@@ -45,10 +45,13 @@ static gboolean run_func(ObActionsData *data, gpointer options)
     Options *o = options;
 
     if (data->client) {
     Options *o = options;
 
     if (data->client) {
+/*
         ob_debug("button %d focusable %d context %d %d %d\n",
                  data->button, client_mouse_focusable(data->client),
                  data->context, 
                  OB_FRAME_CONTEXT_CLIENT, OB_FRAME_CONTEXT_FRAME);
         ob_debug("button %d focusable %d context %d %d %d\n",
                  data->button, client_mouse_focusable(data->client),
                  data->context, 
                  OB_FRAME_CONTEXT_CLIENT, OB_FRAME_CONTEXT_FRAME);
+*/
+
         if (data->button == 0 || client_mouse_focusable(data->client) ||
             (data->context != OB_FRAME_CONTEXT_CLIENT &&
              data->context != OB_FRAME_CONTEXT_FRAME))
         if (data->button == 0 || client_mouse_focusable(data->client) ||
             (data->context != OB_FRAME_CONTEXT_CLIENT &&
              data->context != OB_FRAME_CONTEXT_FRAME))
diff --git a/openbox/actions/highlight.c b/openbox/actions/highlight.c
new file mode 100644 (file)
index 0000000..95ba772
--- /dev/null
@@ -0,0 +1,21 @@
+#include "openbox/actions.h"
+#include "openbox/client.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_highlight_startup()
+{
+    actions_register("Highlight",
+                     NULL, NULL,
+                     run_func,
+                     NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+    if (data->client)
+        client_hilite(data->client, TRUE);
+
+    return FALSE;
+}