summaryrefslogtreecommitdiff
path: root/openbox/actions
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/actions')
-rw-r--r--openbox/actions/activate.c7
-rw-r--r--openbox/actions/all.c2
-rw-r--r--openbox/actions/all.h2
-rw-r--r--openbox/actions/move.c29
-rw-r--r--openbox/actions/showmenu.c9
5 files changed, 36 insertions, 13 deletions
diff --git a/openbox/actions/activate.c b/openbox/actions/activate.c
index a431bafd..c3f3f98e 100644
--- a/openbox/actions/activate.c
+++ b/openbox/actions/activate.c
@@ -53,12 +53,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
Options *o = options;
if (data->client) {
- gboolean mouse = (data->uact == OB_USER_ACTION_MOUSE_PRESS ||
- data->uact == OB_USER_ACTION_MOUSE_RELEASE ||
- data->uact == OB_USER_ACTION_MOUSE_CLICK ||
- data->uact == OB_USER_ACTION_MOUSE_DOUBLE_CLICK ||
- data->uact == OB_USER_ACTION_MOUSE_MOTION);
- if (!mouse || client_mouse_focusable(data->client) ||
+ 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/all.c b/openbox/actions/all.c
index e3ad2b15..a65d76b5 100644
--- a/openbox/actions/all.c
+++ b/openbox/actions/all.c
@@ -12,4 +12,6 @@ void action_all_startup()
action_cyclewindows_startup();
action_activate_startup();
action_breakchroot_startup();
+ action_close_startup();
+ action_move_startup();
}
diff --git a/openbox/actions/all.h b/openbox/actions/all.h
index 5db2e55d..fa252492 100644
--- a/openbox/actions/all.h
+++ b/openbox/actions/all.h
@@ -13,5 +13,7 @@ void action_restart_startup();
void action_cyclewindows_startup();
void action_activate_startup();
void action_breakchroot_startup();
+void action_close_startup();
+void action_move_startup();
#endif
diff --git a/openbox/actions/move.c b/openbox/actions/move.c
new file mode 100644
index 00000000..bf140c31
--- /dev/null
+++ b/openbox/actions/move.c
@@ -0,0 +1,29 @@
+#include "openbox/actions.h"
+#include "openbox/prop.h"
+#include "openbox/moveresize.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_move_startup()
+{
+ actions_register("Move",
+ NULL, NULL,
+ run_func,
+ NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+ if (data->client) {
+ guint32 corner;
+
+ corner = data->button != 0 ?
+ prop_atoms.net_wm_moveresize_move :
+ prop_atoms.net_wm_moveresize_move_keyboard;
+
+ moveresize_start(data->client, data->x, data->y, data->button, corner);
+ }
+
+ return FALSE;
+}
diff --git a/openbox/actions/showmenu.c b/openbox/actions/showmenu.c
index ec22de5b..4b12548f 100644
--- a/openbox/actions/showmenu.c
+++ b/openbox/actions/showmenu.c
@@ -1,4 +1,5 @@
#include "openbox/actions.h"
+#include "openbox/menu.h"
#include <glib.h>
typedef struct {
@@ -49,13 +50,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
if (data->uact == OB_USER_ACTION_MENU_SELECTION) return FALSE;
if (o->name) {
- gboolean mouse = (data->uact == OB_USER_ACTION_MOUSE_PRESS ||
- data->uact == OB_USER_ACTION_MOUSE_RELEASE ||
- data->uact == OB_USER_ACTION_MOUSE_CLICK ||
- data->uact == OB_USER_ACTION_MOUSE_DOUBLE_CLICK ||
- data->uact == OB_USER_ACTION_MOUSE_MOTION);
-
- menu_show(o->name, data->x, data->y, mouse, data->client);
+ menu_show(o->name, data->x, data->y, data->button != 0, data->client);
}
return FALSE;