/* ...or it if it was physically on an openbox
internal window... */
((w = window_find(e->xbutton.subwindow)) &&
- WINDOW_IS_INTERNAL(w)))
+ (WINDOW_IS_INTERNAL(w) || WINDOW_IS_DOCK(w))))
/* ...then process the event, otherwise ignore it */
{
used = event_handle_user_input(client, e);
static void event_handle_dock(ObDock *s, XEvent *e)
{
switch (e->type) {
- case ButtonPress:
- if (e->xbutton.button == 1)
- stacking_raise(DOCK_AS_WINDOW(s));
- else if (e->xbutton.button == 2)
- stacking_lower(DOCK_AS_WINDOW(s));
- break;
case EnterNotify:
dock_hide(FALSE);
break;
if (ev->type == ButtonRelease || ev->type == ButtonPress) {
ObMenuEntryFrame *e;
- if (menu_hide_delay_reached() &&
- (ev->xbutton.button < 4 || ev->xbutton.button > 5))
+ if ((ev->xbutton.button < 4 || ev->xbutton.button > 5) &&
+ ((ev->type == ButtonRelease && menu_hide_delay_reached()) ||
+ ev->type == ButtonPress))
{
if ((e = menu_entry_frame_under(ev->xbutton.x_root,
ev->xbutton.y_root)))
if (ev->type == ButtonRelease)
menu_entry_frame_execute(e, ev->xbutton.state);
}
- else if (ev->type == ButtonRelease)
+ else
menu_frame_hide_all();
}
ret = TRUE;
}
- else if (ev->type == MotionNotify) {
- ObMenuFrame *f;
- ObMenuEntryFrame *e;
-
- if ((e = menu_entry_frame_under(ev->xmotion.x_root,
- ev->xmotion.y_root)))
- if (!(f = find_active_menu()) ||
- f == e->frame ||
- f->parent == e->frame ||
- f->child == e->frame)
- menu_frame_select(e->frame, e, FALSE);
- }
else if (ev->type == KeyPress || ev->type == KeyRelease) {
guint mods;
ObMenuFrame *frame;
gboolean find_timestamp(XEvent *e, gpointer data)
{
const Time t = event_get_timestamp(e);
- if (t > event_curtime) {
+ if (t && t >= event_curtime) {
event_curtime = t;
return TRUE;
}
{
next_time();
}
+
+void event_update_user_time(void)
+{
+ event_last_user_time = event_time();
+}