static void event_handle_dockapp(ObDockApp *app, XEvent *e);
static void event_handle_client(ObClient *c, XEvent *e);
static void event_handle_group(ObGroup *g, XEvent *e);
+static void event_handle_user_input(ObClient *client, XEvent *e);
static void focus_delay_dest(gpointer data);
static gboolean focus_delay_cmp(gconstpointer d1, gconstpointer d2);
}
#endif
- /* user input (action-bound) events */
if (e->type == ButtonPress || e->type == ButtonRelease ||
e->type == MotionNotify || e->type == KeyPress ||
e->type == KeyRelease)
{
- gboolean useevent = TRUE;
-
- if (menu_frame_visible) {
- if (event_handle_menu(e))
- /* don't use the event if the menu used it, but if the menu
- didn't use it and it's a keypress that is bound, it will
- close the menu and be used */
- useevent = FALSE;
- }
-
- if (useevent) {
- /* if the keyboard interactive action uses the event then dont
- use it for bindings. likewise is moveresize uses the event. */
- if (!keyboard_process_interactive_grab(e, &client) &&
- !(moveresize_in_progress && moveresize_event(e)))
- {
- if (moveresize_in_progress)
- /* make further actions work on the client being
- moved/resized */
- client = moveresize_client;
-
-
- menu_can_hide = FALSE;
- ob_main_loop_timeout_add(ob_main_loop,
- config_menu_hide_delay * 1000,
- menu_hide_delay_func,
- NULL, g_direct_equal, NULL);
-
- if (e->type == ButtonPress || e->type == ButtonRelease ||
- e->type == MotionNotify) {
- mouse_event(client, e);
- } else if (e->type == KeyPress) {
- keyboard_event((focus_cycle_target ? focus_cycle_target :
- (client ? client : focus_client)), e);
- }
- }
- }
+ event_handle_user_input(client, e);
}
+
/* if something happens and it's not from an XEvent, then we don't know
the time */
event_curtime = CurrentTime;
screen_set_num_desktops(d);
} else if (msgtype == prop_atoms.net_showing_desktop) {
screen_show_desktop(e->xclient.data.l[0] != 0, TRUE);
- } else if (msgtype == prop_atoms.ob_control) {
+ } else if (msgtype == prop_atoms.openbox_control) {
if (e->xclient.data.l[0] == 1)
ob_reconfigure();
else if (e->xclient.data.l[0] == 2)
frame_adjust_state(client->frame);
break;
case OB_FRAME_CONTEXT_FRAME:
+ /* When the mouse leaves an animating window, don't use the
+ corresponding enter events. Pretend like the animating window
+ doesn't even exist..! */
+ if (frame_iconify_animating(client->frame))
+ event_ignore_queued_enters();
+
ob_debug_type(OB_DEBUG_FOCUS,
"%sNotify mode %d detail %d on %lx\n",
(e->type == EnterNotify ? "Enter" : "Leave"),
e->xconfigurerequest.detail = ce.xconfigurerequest.detail;
}
- /* if we are iconic (or shaded (fvwm does this)) ignore the event */
- if (client->iconic || client->shaded) return;
+ ob_debug("ConfigureRequest desktop %d wmstate %d vis %d\n",
+ screen_desktop, client->wmstate, client->frame->visible);
+
+ /* If the client is in IconicState then ignore the event.
+ This used to only ignore iconic or shaded windows, but windows on
+ other desktops are also in IconicState, so now those can't
+ send ConfigureRequests either..
+ This fixes the bug of KDE apps moving when they try to active them-
+ selves on another desktop.
+ It used to say "fvwm does this" but I'm not sure if fvwm does
+ this for windows on other desktops too. Probably, it makes sense.
+ */
+ if (client->wmstate == IconicState) return;
/* resize, then move, as specified in the EWMH section 7.7 */
if (e->xconfigurerequest.value_mask & (CWWidth | CWHeight |
else if (msgtype == prop_atoms.net_wm_icon) {
client_update_icons(client);
}
+ else if (msgtype == prop_atoms.net_wm_icon_geometry) {
+ client_update_icon_geometry(client);
+ }
else if (msgtype == prop_atoms.net_wm_user_time) {
client_update_user_time(client);
}
return ret;
}
+static void event_handle_user_input(ObClient *client, XEvent *e)
+{
+ g_assert(e->type == ButtonPress || e->type == ButtonRelease ||
+ e->type == MotionNotify || e->type == KeyPress ||
+ e->type == KeyRelease);
+
+ if (menu_frame_visible) {
+ if (event_handle_menu(e))
+ /* don't use the event if the menu used it, but if the menu
+ didn't use it and it's a keypress that is bound, it will
+ close the menu and be used */
+ return;
+ }
+
+ /* if the keyboard interactive action uses the event then dont
+ use it for bindings. likewise is moveresize uses the event. */
+ if (!keyboard_process_interactive_grab(e, &client) &&
+ !(moveresize_in_progress && moveresize_event(e)))
+ {
+ if (moveresize_in_progress)
+ /* make further actions work on the client being
+ moved/resized */
+ client = moveresize_client;
+
+ menu_can_hide = FALSE;
+ ob_main_loop_timeout_add(ob_main_loop,
+ config_menu_hide_delay * 1000,
+ menu_hide_delay_func,
+ NULL, g_direct_equal, NULL);
+
+ if (e->type == ButtonPress ||
+ e->type == ButtonRelease ||
+ e->type == MotionNotify)
+ {
+ /* the frame may not be "visible" but they can still click on it
+ in the case where it is animating before disappearing */
+ if (!client || !frame_iconify_animating(client->frame))
+ mouse_event(client, e);
+ } else if (e->type == KeyPress) {
+ keyboard_event((focus_cycle_target ? focus_cycle_target :
+ (client ? client : focus_client)), e);
+ }
+ }
+}
+
static gboolean menu_hide_delay_func(gpointer data)
{
menu_can_hide = TRUE;