X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=b0048e3725c158c4eac5296394f9083b735fbfef;hb=32390c6b6dceeb72e4e4ceb0e79ba4d8c8ede9a3;hp=f55950b527562b7a308fe90e73bfb00de63c19dc;hpb=a0691941e88ca8a8388fe17971be637e3aa3d835;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index f55950b5..b0048e37 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -21,6 +21,10 @@ #include #include +#ifdef USE_LIBSN +# include +#endif + #ifdef HAVE_SYS_SELECT_H # include #endif @@ -129,6 +133,10 @@ void event_loop() } XNextEvent(ob_display, &e); +#ifdef USE_LIBSN + sn_display_process_event(ob_sn_display, &e); +#endif + event_process(&e); had_event = TRUE; } @@ -538,30 +546,34 @@ static void event_handle_client(Client *client, XEvent *e) switch (e->type) { case ButtonPress: case ButtonRelease: - switch (frame_context(client, e->xbutton.window)) { - case Context_Maximize: - client->frame->max_press = (e->type == ButtonPress); - framerender_frame(client->frame); - break; - case Context_Close: - client->frame->close_press = (e->type == ButtonPress); - framerender_frame(client->frame); - break; - case Context_Iconify: - client->frame->iconify_press = (e->type == ButtonPress); - framerender_frame(client->frame); - break; - case Context_AllDesktops: - client->frame->desk_press = (e->type == ButtonPress); - framerender_frame(client->frame); - break; - case Context_Shade: - client->frame->shade_press = (e->type == ButtonPress); - framerender_frame(client->frame); - break; - default: - /* nothing changes with clicks for any other contexts */ - break; + /* Wheel buttons don't draw because they are an instant click, so it + is a waste of resources to go drawing it. */ + if (!(e->xbutton.button == 4 || e->xbutton.button == 5)) { + switch (frame_context(client, e->xbutton.window)) { + case Context_Maximize: + client->frame->max_press = (e->type == ButtonPress); + framerender_frame(client->frame); + break; + case Context_Close: + client->frame->close_press = (e->type == ButtonPress); + framerender_frame(client->frame); + break; + case Context_Iconify: + client->frame->iconify_press = (e->type == ButtonPress); + framerender_frame(client->frame); + break; + case Context_AllDesktops: + client->frame->desk_press = (e->type == ButtonPress); + framerender_frame(client->frame); + break; + case Context_Shade: + client->frame->shade_press = (e->type == ButtonPress); + framerender_frame(client->frame); + break; + default: + /* nothing changes with clicks for any other contexts */ + break; + } } break; case FocusIn: @@ -883,10 +895,9 @@ static void event_handle_client(Client *client, XEvent *e) } else if (msgtype == prop_atoms.net_wm_strut) client_update_strut(client); - else if (msgtype == prop_atoms.net_wm_icon) + else if (msgtype == prop_atoms.net_wm_icon || + msgtype == prop_atoms.kwm_win_icon) client_update_icons(client); - else if (msgtype == prop_atoms.kwm_win_icon) - client_update_kwm_icon(client); default: ; #ifdef SHAPE @@ -1007,7 +1018,6 @@ static void event_handle_dockapp(DockApp *app, XEvent *e) dock_app_drag(app, &e->xmotion); break; case UnmapNotify: - g_message("Unmap"); if (app->ignore_unmaps) { app->ignore_unmaps--; break; @@ -1015,7 +1025,6 @@ static void event_handle_dockapp(DockApp *app, XEvent *e) dock_remove(app, TRUE); break; case DestroyNotify: - g_message("Destroy"); dock_remove(app, FALSE); break; case ReparentNotify: