don't grab the pointer during interactive events. this allows you to alt-tab during a dnd.

This commit is contained in:
Dana Jansens 2007-04-22 15:22:25 +00:00
parent 4c672be2e1
commit 27773e1cb7
5 changed files with 24 additions and 8 deletions

View file

@ -507,6 +507,8 @@ void client_unmanage(ObClient *self)
g_assert(self != NULL); g_assert(self != NULL);
frame_hide(self->frame); frame_hide(self->frame);
/* sync to send the hide to the server quickly, and to get back the enter
events */
XSync(ob_display, FALSE); XSync(ob_display, FALSE);
if (focus_client == self) { if (focus_client == self) {

View file

@ -590,9 +590,10 @@ static void event_process(const XEvent *ec, gpointer data)
NULL, g_direct_equal, NULL); NULL, g_direct_equal, NULL);
if (e->type == ButtonPress || e->type == ButtonRelease || if (e->type == ButtonPress || e->type == ButtonRelease ||
e->type == MotionNotify) e->type == MotionNotify) {
if (!keyboard_interactively_grabbed())
mouse_event(client, e); mouse_event(client, e);
else if (e->type == KeyPress) { } else if (e->type == KeyPress) {
keyboard_event((focus_cycle_target ? focus_cycle_target : keyboard_event((focus_cycle_target ? focus_cycle_target :
(focus_hilite ? focus_hilite : client)), (focus_hilite ? focus_hilite : client)),
e); e);
@ -762,6 +763,8 @@ static void event_handle_client(ObClient *client, XEvent *e)
frame_adjust_state(client->frame); frame_adjust_state(client->frame);
break; break;
case OB_FRAME_CONTEXT_FRAME: case OB_FRAME_CONTEXT_FRAME:
if (keyboard_interactively_grabbed())
break;
if (config_focus_follow && config_focus_delay) if (config_focus_follow && config_focus_delay)
ob_main_loop_timeout_remove_data(ob_main_loop, ob_main_loop_timeout_remove_data(ob_main_loop,
focus_delay_func, focus_delay_func,
@ -803,6 +806,8 @@ static void event_handle_client(ObClient *client, XEvent *e)
frame_adjust_state(client->frame); frame_adjust_state(client->frame);
break; break;
case OB_FRAME_CONTEXT_FRAME: case OB_FRAME_CONTEXT_FRAME:
if (keyboard_interactively_grabbed())
break;
if (e->xcrossing.mode == NotifyGrab || if (e->xcrossing.mode == NotifyGrab ||
e->xcrossing.mode == NotifyUngrab) e->xcrossing.mode == NotifyUngrab)
{ {

View file

@ -328,10 +328,16 @@ static void popup_cycle(ObClient *c, gboolean show)
void focus_cycle_draw_indicator() void focus_cycle_draw_indicator()
{ {
if (!focus_cycle_target) { if (!focus_cycle_target) {
XEvent e;
XUnmapWindow(ob_display, focus_indicator.top.win); XUnmapWindow(ob_display, focus_indicator.top.win);
XUnmapWindow(ob_display, focus_indicator.left.win); XUnmapWindow(ob_display, focus_indicator.left.win);
XUnmapWindow(ob_display, focus_indicator.right.win); XUnmapWindow(ob_display, focus_indicator.right.win);
XUnmapWindow(ob_display, focus_indicator.bottom.win); XUnmapWindow(ob_display, focus_indicator.bottom.win);
/* kill enter events cause by this unmapping */
XSync(ob_display, FALSE);
while (XCheckTypedEvent(ob_display, EnterNotify, &e));
} else { } else {
/* /*
if (focus_cycle_target) if (focus_cycle_target)

View file

@ -164,10 +164,8 @@ gboolean keyboard_interactive_grab(guint state, ObClient *client,
g_assert(action->data.any.interactive); g_assert(action->data.any.interactive);
if (!interactive_states) { if (!interactive_states) {
if (!grab_keyboard(TRUE)) if (!grab_keyboard(TRUE)) {
return FALSE; ob_debug("grab KEYBOARD failed\n");
if (!grab_pointer(TRUE, FALSE, OB_CURSOR_NONE)) {
grab_keyboard(FALSE);
return FALSE; return FALSE;
} }
} }
@ -195,7 +193,6 @@ void keyboard_interactive_end(ObInteractiveState *s,
if (!interactive_states) { if (!interactive_states) {
grab_keyboard(FALSE); grab_keyboard(FALSE);
grab_pointer(FALSE, FALSE, OB_CURSOR_NONE);
keyboard_reset_chains(); keyboard_reset_chains();
} }
} }

View file

@ -213,8 +213,14 @@ void popup_show(ObPopup *self, gchar *text)
void popup_hide(ObPopup *self) void popup_hide(ObPopup *self)
{ {
if (self->mapped) { if (self->mapped) {
XEvent e;
XUnmapWindow(ob_display, self->bg); XUnmapWindow(ob_display, self->bg);
self->mapped = FALSE; self->mapped = FALSE;
/* kill enter events cause by this unmapping */
XSync(ob_display, FALSE);
while (XCheckTypedEvent(ob_display, EnterNotify, &e));
} }
} }