dont queue up interative end actions

This commit is contained in:
Dana Jansens 2003-10-02 04:06:40 +00:00
parent 4ea5a21fe1
commit 9bd60fd92b
4 changed files with 37 additions and 13 deletions

View file

@ -949,7 +949,11 @@ void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
keyboard_interactive_grab(state, a->data.any.c, a); keyboard_interactive_grab(state, a->data.any.c, a);
} }
ob_main_loop_queue_action(ob_main_loop, a); /* closing interactive actions are not queued */
if (!done)
ob_main_loop_queue_action(ob_main_loop, a);
else
a->func(&a->data);
} }
} }
} }

View file

@ -393,21 +393,21 @@ static void event_process(const XEvent *ec, gpointer data)
/* deal with it in the kernel */ /* deal with it in the kernel */
if (group) if (group)
event_handle_group(group, e); event_handle_group(group, e);
else if (client) else if (client)
event_handle_client(client, e); event_handle_client(client, e);
else if (dockapp) else if (dockapp)
event_handle_dockapp(dockapp, e); event_handle_dockapp(dockapp, e);
else if (dock) else if (dock)
event_handle_dock(dock, e); event_handle_dock(dock, e);
else if (window == RootWindow(ob_display, ob_screen)) else if (window == RootWindow(ob_display, ob_screen))
event_handle_root(e); event_handle_root(e);
else if (e->type == MapRequest) else if (e->type == MapRequest)
client_manage(window); client_manage(window);
else if (e->type == ConfigureRequest) { else if (e->type == ConfigureRequest) {
/* unhandled configure requests must be used to configure the /* unhandled configure requests must be used to configure the
window directly */ window directly */
XWindowChanges xwc; XWindowChanges xwc;
xwc.x = e->xconfigurerequest.x; xwc.x = e->xconfigurerequest.x;
xwc.y = e->xconfigurerequest.y; xwc.y = e->xconfigurerequest.y;
@ -531,6 +531,7 @@ void event_enter_client(ObClient *client)
config_focus_delay, config_focus_delay,
focus_delay_func, focus_delay_func,
client, NULL); client, NULL);
ob_debug("added focus timeout\n");
} else } else
focus_delay_func(client); focus_delay_func(client);
} }
@ -679,10 +680,11 @@ static void event_handle_client(ObClient *client, XEvent *e)
} else { } else {
#ifdef DEBUG_FOCUS #ifdef DEBUG_FOCUS
ob_debug("%sNotify mode %d detail %d on %lx, " ob_debug("%sNotify mode %d detail %d on %lx, "
"focusing window\n", "focusing window: %d\n",
(e->type == EnterNotify ? "Enter" : "Leave"), (e->type == EnterNotify ? "Enter" : "Leave"),
e->xcrossing.mode, e->xcrossing.mode,
e->xcrossing.detail, client?client->window:0); e->xcrossing.detail, (client?client->window:0),
!nofocus);
#endif #endif
if (!nofocus && config_focus_follow) if (!nofocus && config_focus_follow)
event_enter_client(client); event_enter_client(client);
@ -1175,6 +1177,7 @@ static gboolean focus_delay_func(gpointer data)
{ {
ObClient *c = data; ObClient *c = data;
ob_debug("focus timeout %d\n", focus_client != c);
if (focus_client != c) { if (focus_client != c) {
client_focus(c); client_focus(c);
if (config_focus_raise) if (config_focus_raise)
@ -1195,12 +1198,23 @@ void event_ignore_queued_enters()
XSync(ob_display, FALSE); XSync(ob_display, FALSE);
ob_debug("Trying to ignore\n");
/* count the events */ /* count the events */
while (TRUE) { while (TRUE) {
e = g_new(XEvent, 1); e = g_new(XEvent, 1);
if (XCheckTypedEvent(ob_display, EnterNotify, e)) { if (XCheckTypedEvent(ob_display, EnterNotify, e)) {
ObWindow *win;
win = g_hash_table_lookup(window_map, &e->xany.window);
if (win && WINDOW_IS_CLIENT(win)) {
ob_debug("skipping enter event on 0x%lx\n", e->xany.window);
++ignore_enter_focus;
} else
ob_debug("NOT skipping enter event on 0x%lx\n",
e->xany.window);
saved = g_slist_append(saved, e); saved = g_slist_append(saved, e);
++ignore_enter_focus;
} else { } else {
g_free(e); g_free(e);
break; break;

View file

@ -77,6 +77,7 @@ gboolean grab_pointer(gboolean grab, ObCursor cur)
False, GRAB_PTR_MASK, GrabModeAsync, False, GRAB_PTR_MASK, GrabModeAsync,
GrabModeAsync, FALSE, GrabModeAsync, FALSE,
ob_cursor(cur), event_lasttime) == Success; ob_cursor(cur), event_lasttime) == Success;
ob_debug("GRABBING\n");
if (!ret) if (!ret)
--pgrabs; --pgrabs;
} else } else
@ -84,6 +85,9 @@ gboolean grab_pointer(gboolean grab, ObCursor cur)
} else if (pgrabs > 0) { } else if (pgrabs > 0) {
if (--pgrabs == 0) { if (--pgrabs == 0) {
XUngrabPointer(ob_display, event_lasttime); XUngrabPointer(ob_display, event_lasttime);
ob_debug("UNGRABBING\n");
event_ignore_queued_enters();
} }
ret = TRUE; ret = TRUE;
} }

View file

@ -100,6 +100,8 @@ int main(int argc, char **argv)
textdomain(PACKAGE_NAME); textdomain(PACKAGE_NAME);
g_set_prgname(argv[0]); g_set_prgname(argv[0]);
chdir(g_get_home_dir());
parse_paths_startup(); parse_paths_startup();