summaryrefslogtreecommitdiff
path: root/openbox/event.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2008-02-06 23:33:02 -0500
committerDana Jansens <danakj@orodu.net>2008-02-14 14:24:07 -0500
commita5005506a89ecffe13e04cbcda5c20a2fa6ba25d (patch)
tree07a221f9c4b2adde79abe528f7deefef186d8c59 /openbox/event.c
parent61b8f5243063622598ea21c26cccc220ea29a50c (diff)
make the prompt buttons respond to button presses. keyboard input code is there too but not working yet.
Diffstat (limited to 'openbox/event.c')
-rw-r--r--openbox/event.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/openbox/event.c b/openbox/event.c
index 0d7ff2a3..b2643916 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -89,6 +89,7 @@ static void event_process(const XEvent *e, gpointer data);
static void event_handle_root(XEvent *e);
static gboolean event_handle_menu_keyboard(XEvent *e);
static gboolean event_handle_menu(XEvent *e);
+static void event_handle_prompt(ObPrompt *p, XEvent *e);
static void event_handle_dock(ObDock *s, XEvent *e);
static void event_handle_dockapp(ObDockApp *app, XEvent *e);
static void event_handle_client(ObClient *c, XEvent *e);
@@ -704,7 +705,9 @@ static void event_process(const XEvent *ec, gpointer data)
}
#endif
- if (e->type == ButtonPress || e->type == ButtonRelease) {
+ if (prompt)
+ event_handle_prompt(prompt, e);
+ else if (e->type == ButtonPress || e->type == ButtonRelease) {
/* If the button press was on some non-root window, or was physically
on the root window, then process it */
if (window != RootWindow(ob_display, ob_screen) ||
@@ -1672,6 +1675,21 @@ static ObMenuFrame* find_active_or_last_menu(void)
return ret;
}
+static void event_handle_prompt(ObPrompt *p, XEvent *e)
+{
+ g_print("prompt event\n");
+ switch (e->type) {
+ case ButtonPress:
+ case ButtonRelease:
+ case MotionNotify:
+ prompt_mouse_event(p, e);
+ break;
+ case KeyPress:
+ prompt_key_event(p, e);
+ break;
+ }
+}
+
static gboolean event_handle_menu_keyboard(XEvent *ev)
{
guint keycode, state;