summaryrefslogtreecommitdiff
path: root/openbox/dispatch.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-21 09:41:01 +0000
committerDana Jansens <danakj@orodu.net>2003-03-21 09:41:01 +0000
commitc2cbef62bb5d7e0c3f8c00e95bc885dc1f9ab1da (patch)
tree2f368262765ec89d58ea6d63de3898aac2751bb8 /openbox/dispatch.c
parent1c7c94614dd64490063f768b71a5b9cf192ce1db (diff)
add a dispatched event for interactively moving a window.
move window snapping/resistance out of the kernel. make the action_move dispatch the new event.
Diffstat (limited to 'openbox/dispatch.c')
-rw-r--r--openbox/dispatch.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/openbox/dispatch.c b/openbox/dispatch.c
index 059f163b..d6f91a2f 100644
--- a/openbox/dispatch.c
+++ b/openbox/dispatch.c
@@ -212,3 +212,30 @@ void dispatch_signal(int signal)
f->h(&obe, f->data);
}
}
+
+void dispatch_move(Client *c, int *x, int *y)
+{
+ guint i;
+ EventType e = Event_Client_Moving;
+ GSList *it;
+ ObEvent obe;
+
+ obe.type = e;
+ obe.data.c.client = c;
+ obe.data.c.num[0] = *x;
+ obe.data.c.num[1] = *y;
+
+ i = 0;
+ while (e > 1) {
+ e >>= 1;
+ ++i;
+ }
+
+ for (it = funcs[i]; it != NULL; it = it->next) {
+ Func *f = it->data;
+ f->h(&obe, f->data);
+ }
+
+ *x = obe.data.c.num[0];
+ *y = obe.data.c.num[1];
+}