summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-06-22 05:02:25 +0000
committerDana Jansens <danakj@orodu.net>2007-06-22 05:02:25 +0000
commitbb0fd965c50289c02619113f113927294fa5be23 (patch)
tree9a15f1a6eaa28f16a557cacba547fba0bf75d50e
parent29c4cf4a15bc5fa97ba746b03a5e334f989c645e (diff)
add breakchroot action
-rw-r--r--Makefile.am1
-rw-r--r--openbox/action.c42
-rw-r--r--openbox/actions/activate.c4
-rw-r--r--openbox/actions/all.c1
-rw-r--r--openbox/actions/all.h1
-rw-r--r--openbox/actions/breakchroot.c21
6 files changed, 24 insertions, 46 deletions
diff --git a/Makefile.am b/Makefile.am
index 1276a7a7..bddea964 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -157,6 +157,7 @@ openbox_openbox_SOURCES = \
openbox/actions/all.c \
openbox/actions/all.h \
openbox/actions/activate.c \
+ openbox/actions/breakchroot.c \
openbox/actions/cyclewindows.c \
openbox/actions/debug.c \
openbox/actions/execute.c \
diff --git a/openbox/action.c b/openbox/action.c
index de2bcdcc..2288dcb9 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -446,11 +446,6 @@ void setup_action_addremove_desktop_last(ObAction **a, ObUserAction uact)
(*a)->data.addremovedesktop.current = FALSE;
}
-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;
@@ -499,11 +494,6 @@ ActionString actionstrings[] =
setup_action_directional_focus_northwest
},
{
- "focus",
- action_focus,
- setup_action_focus
- },
- {
"unfocus",
action_unfocus,
setup_client_action
@@ -839,11 +829,6 @@ ActionString actionstrings[] =
setup_action_growtoedge_east
},
{
- "breakchroot",
- action_break_chroot,
- NULL
- },
- {
"adddesktoplast",
action_add_desktop,
setup_action_addremove_desktop_last
@@ -1110,27 +1095,6 @@ void action_run_string(const gchar *name, struct _ObClient *c, Time time)
action_run(l, c, 0, time);
}
-void action_focus(union ActionData *data)
-{
- if (data->client.any.c) {
- if (!data->any.button || client_mouse_focusable(data->client.any.c) ||
- (data->any.context != OB_FRAME_CONTEXT_CLIENT &&
- data->any.context != OB_FRAME_CONTEXT_FRAME))
- {
- /* 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);
- }
- } 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();
- }
-}
-
void action_unfocus (union ActionData *data)
{
if (data->client.any.c == focus_client)
@@ -1762,12 +1726,6 @@ void action_toggle_dockautohide(union ActionData *data)
dock_configure();
}
-void action_break_chroot(union ActionData *data)
-{
- /* break out of one chroot */
- keyboard_reset_chains(1);
-}
-
void action_add_desktop(union ActionData *data)
{
client_action_start(data);
diff --git a/openbox/actions/activate.c b/openbox/actions/activate.c
index 66923622..a431bafd 100644
--- a/openbox/actions/activate.c
+++ b/openbox/actions/activate.c
@@ -62,10 +62,6 @@ static gboolean run_func(ObActionsData *data, gpointer options)
data->context != OB_FRAME_CONTEXT_CLIENT ||
data->context != OB_FRAME_CONTEXT_FRAME)
{
- /* if using focus_delay, stop the timer now so that focus doesn't
- go moving on us */
- event_halt_focus_delay();
-
client_activate(data->client, o->here, o->raise, o->unshade, TRUE);
}
} else {
diff --git a/openbox/actions/all.c b/openbox/actions/all.c
index a8cf305f..e3ad2b15 100644
--- a/openbox/actions/all.c
+++ b/openbox/actions/all.c
@@ -11,4 +11,5 @@ void action_all_startup()
action_restart_startup();
action_cyclewindows_startup();
action_activate_startup();
+ action_breakchroot_startup();
}
diff --git a/openbox/actions/all.h b/openbox/actions/all.h
index 1f9a7f38..5db2e55d 100644
--- a/openbox/actions/all.h
+++ b/openbox/actions/all.h
@@ -12,5 +12,6 @@ void action_exit_startup();
void action_restart_startup();
void action_cyclewindows_startup();
void action_activate_startup();
+void action_breakchroot_startup();
#endif
diff --git a/openbox/actions/breakchroot.c b/openbox/actions/breakchroot.c
new file mode 100644
index 00000000..bfdbf16c
--- /dev/null
+++ b/openbox/actions/breakchroot.c
@@ -0,0 +1,21 @@
+#include "openbox/actions.h"
+#include "openbox/keyboard.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_breakchroot_startup()
+{
+ actions_register("BreakChroot",
+ NULL, NULL,
+ run_func,
+ NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+ /* break out of one chroot */
+ keyboard_reset_chains(1);
+
+ return FALSE;
+}