From 5130c1c28ac35fc62a10d8743eef2e9fa21efb20 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 6 Feb 2008 23:33:02 -0500 Subject: make the prompt buttons respond to button presses. keyboard input code is there too but not working yet. --- openbox/event.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'openbox/event.c') diff --git a/openbox/event.c b/openbox/event.c index 4591009e..85528076 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -86,6 +86,7 @@ static void event_process(const XEvent *e, gpointer data); static void event_handle_root(XEvent *e); static gboolean event_handle_menu_input(XEvent *e); static void event_handle_menu(ObMenuFrame *frame, 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); @@ -709,7 +710,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 != obt_root(ob_screen) || @@ -1677,6 +1680,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_input(XEvent *ev) { gboolean ret = FALSE; -- cgit v1.2.3