X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=9a351f73ceec24a0f4af0cb11c0ef1d078f8aad0;hb=4e88712158d5019e09907a5f3ff4b78174712daf;hp=39dfca5c51a65bc0f1f3a79dd3b347908f3fea4f;hpb=f26f23de50cb7941a7702198e3b4d1b2f9de062e;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index 39dfca5c..9a351f73 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1,4 +1,5 @@ #include "openbox.h" +#include "slit.h" #include "client.h" #include "xerror.h" #include "prop.h" @@ -23,6 +24,7 @@ static void event_process(XEvent *e); static void event_handle_root(XEvent *e); +static void event_handle_slitapp(SlitApp *app, XEvent *e); static void event_handle_client(Client *c, XEvent *e); static void event_handle_menu(Menu *menu, XEvent *e); @@ -114,7 +116,7 @@ void event_loop() XNextEvent(ob_display, &e); event_process(&e); - had_event = TRUE; + had_event = TRUE; } if (!had_event) { @@ -313,7 +315,8 @@ static gboolean event_ignore(XEvent *e, Client *client) #endif /* is the focused window getting a FocusOut/In back to itself? */ - if (fe.xfocus.window == e->xfocus.window) { + if (fe.xfocus.window == e->xfocus.window && + !event_ignore(&fe, client)) { #ifdef DEBUG_FOCUS g_message("focused window got an Out/In back to " "itself IGNORED both"); @@ -372,12 +375,15 @@ static gboolean event_ignore(XEvent *e, Client *client) static void event_process(XEvent *e) { Window window; - Client *client; + Client *client = NULL; + SlitApp *slitapp = NULL; Menu *menu = NULL; window = event_get_window(e); if (!(client = g_hash_table_lookup(client_map, &window))) - menu = g_hash_table_lookup(menu_map, &window); + if (!(slitapp = g_hash_table_lookup(slit_app_map, &window))) + menu = g_hash_table_lookup(menu_map, &window); + event_set_lasttime(e); event_hack_mods(e); if (event_ignore(e, client)) @@ -389,6 +395,8 @@ static void event_process(XEvent *e) return; } else if (client) event_handle_client(client, e); + else if (slitapp) + event_handle_slitapp(slitapp, e); else if (window == ob_root) event_handle_root(e); else if (e->type == MapRequest) @@ -731,18 +739,7 @@ static void event_handle_client(Client *client, XEvent *e) client_close(client); } else if (msgtype == prop_atoms.net_active_window) { g_message("net_active_window for 0x%lx", client->window); - if (screen_showing_desktop) - screen_show_desktop(FALSE); - if (client->iconic) - client_iconify(client, FALSE, TRUE); - else if (!client->frame->visible) - /* if its not visible for other reasons, then don't mess - with it */ - break; - if (client->shaded) - client_shade(client, FALSE); - client_focus(client); - stacking_raise(client); + client_activate(client); } else if (msgtype == prop_atoms.net_wm_moveresize) { g_message("net_wm_moveresize for 0x%lx", client->window); if ((Atom)e->xclient.data.l[2] == @@ -869,10 +866,12 @@ static void event_handle_menu(Menu *menu, XEvent *e) g_message("EVENT %d", e->type); switch (e->type) { case ButtonPress: + g_message("BUTTON PRESS"); if (e->xbutton.button == 3) menu_hide(menu); break; case ButtonRelease: + g_message("BUTTON RELEASED"); if (!menu->shown) break; /* grab_pointer_window(FALSE, None, menu->frame);*/ @@ -890,16 +889,43 @@ static void event_handle_menu(Menu *menu, XEvent *e) e->xbutton.y < (signed)(h+b)) { menu_entry_fire(entry); } - } + break; case EnterNotify: case LeaveNotify: g_message("enter/leave"); entry = menu_find_entry(menu, e->xcrossing.window); if (entry) { - entry->hilite = e->type == EnterNotify; + if (menu->mouseover) + menu->mouseover(entry, e->type == EnterNotify); + else + menu_control_mouseover(entry, e->type == EnterNotify); + menu_entry_render(entry); } break; + } + } +} + +static void event_handle_slitapp(SlitApp *app, XEvent *e) +{ + switch (e->type) { + case UnmapNotify: + if (app->ignore_unmaps) { + app->ignore_unmaps--; + break; + } + slit_remove(app, TRUE); + break; + case DestroyNotify: + slit_remove(app, FALSE); + break; + case ReparentNotify: + slit_remove(app, FALSE); + break; + case ConfigureNotify: + slit_app_configure(app, e->xconfigure.width, e->xconfigure.height); + break; } }