allow moving workspace while moving window with modifier remove the

2008-03-11  Matthew Wilson  <msw@gimp.org>

        * src/core/keybindings.c (meta_display_process_key_event, process_event,
        find_handler, process_mouse_move_resize_grab): allow moving workspace
	while moving window with modifier
        * src/core/workspace.c (meta_workspace_activate_with_focus): remove the
	correct window on jumping workspace while moving


svn path=/trunk/; revision=3649
This commit is contained in:
Matthew Wilson 2008-03-11 03:37:54 +00:00 committed by Thomas James Alexander Thurman
parent 87cceaf992
commit 9836007f5e
3 changed files with 112 additions and 116 deletions

View File

@ -1,3 +1,11 @@
2008-03-11 Matthew Wilson <msw@gimp.org>
* src/core/keybindings.c (meta_display_process_key_event, process_event,
find_handler, process_mouse_move_resize_grab): allow moving workspace
while moving window with modifier
* src/core/workspace.c (meta_workspace_activate_with_focus): remove the
correct window on jumping workspace while moving
2008-03-10 Josh Lee <jleedev@gmail.com>
* src/core/compositor.c (window_has_shadow): Don't shadow

View File

@ -1583,7 +1583,7 @@ find_handler (const MetaKeyHandler *handlers,
return NULL;
}
static void
static gboolean
process_event (MetaKeyBinding *bindings,
int n_bindings,
const MetaKeyHandler *handlers,
@ -1597,13 +1597,13 @@ process_event (MetaKeyBinding *bindings,
/* we used to have release-based bindings but no longer. */
if (event->type == KeyRelease)
return;
return FALSE;
i = 0;
while (i < n_bindings)
{
if (bindings[i].keycode == event->xkey.keycode &&
((event->xkey.state & ~(display->ignored_modifier_mask)) ==
((event->xkey.state & 0xff & ~(display->ignored_modifier_mask)) ==
bindings[i].mask) &&
event->type == KeyPress)
{
@ -1637,7 +1637,7 @@ process_event (MetaKeyBinding *bindings,
(* handler->func) (display, screen, window, event,
&bindings[i]);
return;
return TRUE;
}
++i;
@ -1645,6 +1645,7 @@ process_event (MetaKeyBinding *bindings,
meta_topic (META_DEBUG_KEYBINDINGS,
"No handler found for this event in this binding table\n");
return FALSE;
}
/* Handle a key event. May be called recursively: some key events cause
@ -1665,6 +1666,7 @@ meta_display_process_key_event (MetaDisplay *display,
{
KeySym keysym;
gboolean handled;
gboolean keep_grab;
gboolean all_keys_grabbed;
const char *str;
MetaScreen *screen;
@ -1703,34 +1705,16 @@ meta_display_process_key_event (MetaDisplay *display,
str ? str : "none", event->xkey.state,
window ? window->desc : "(no window)");
keep_grab = TRUE;
all_keys_grabbed = window ? window->all_keys_grabbed : screen->all_keys_grabbed;
if (!all_keys_grabbed)
if (all_keys_grabbed)
{
/* Do the normal keybindings */
process_event (display->screen_bindings,
display->n_screen_bindings,
screen_handlers,
display, screen, NULL, event, keysym);
if (window)
process_event (display->window_bindings,
display->n_window_bindings,
window_handlers,
display, screen, window, event, keysym);
return;
}
if (display->grab_op == META_GRAB_OP_NONE)
return;
/* If we get here we have a global grab, because
* we're in some special keyboard mode such as window move
* mode.
*/
handled = FALSE;
if (window ? (window == display->grab_window) :
(screen == display->grab_screen))
{
@ -1748,7 +1732,7 @@ meta_display_process_key_event (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for mouse-only move/resize\n");
g_assert (window != NULL);
handled = process_mouse_move_resize_grab (display, screen,
keep_grab = process_mouse_move_resize_grab (display, screen,
window, event, keysym);
break;
@ -1756,7 +1740,7 @@ meta_display_process_key_event (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard move\n");
g_assert (window != NULL);
handled = process_keyboard_move_grab (display, screen,
keep_grab = process_keyboard_move_grab (display, screen,
window, event, keysym);
break;
@ -1772,7 +1756,7 @@ meta_display_process_key_event (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard resize\n");
g_assert (window != NULL);
handled = process_keyboard_resize_grab (display, screen,
keep_grab = process_keyboard_resize_grab (display, screen,
window, event, keysym);
break;
@ -1784,34 +1768,39 @@ meta_display_process_key_event (MetaDisplay *display,
case META_GRAB_OP_KEYBOARD_ESCAPING_GROUP:
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard tabbing/cycling\n");
handled = process_tab_grab (display, screen, event, keysym);
keep_grab = process_tab_grab (display, screen, event, keysym);
break;
case META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING:
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard workspace switching\n");
handled = process_workspace_switch_grab (display, screen, event, keysym);
keep_grab = process_workspace_switch_grab (display, screen, event, keysym);
break;
default:
break;
}
}
/* end grab if a key that isn't used gets pressed */
if (!handled)
if (!keep_grab)
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Ending grab op %u on key event sym %s\n",
display->grab_op, XKeysymToString (keysym));
meta_display_end_grab_op (display, event->xkey.time);
g_assert (display->grab_op == META_GRAB_OP_NONE);
/* and go round again: #112560 */
meta_display_process_key_event (display, window, event);
return;
}
}
/* Do the normal keybindings */
handled = process_event (display->screen_bindings,
display->n_screen_bindings,
screen_handlers,
display, screen, NULL, event, keysym);
if (!all_keys_grabbed && !handled && window)
handled = process_event (display->window_bindings,
display->n_window_bindings,
window_handlers,
display, screen, window, event, keysym);
}
static gboolean
@ -1848,13 +1837,10 @@ process_mouse_move_resize_grab (MetaDisplay *display,
else
display->grab_was_cancelled = TRUE;
/* End grab, since this was an "unhandled" keypress */
/* End grab */
return FALSE;
}
/* The keypress really isn't handled but we just want to ignore it, so
* treat it as handled.
*/
return TRUE;
}

View File

@ -315,10 +315,12 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
* then remove from old workspace, so the window
* never gets unmapped and we maintain the button grab
* on it.
*
* \bug This comment appears to be the reverse of what happens
*/
if (move_window && (move_window->workspace != workspace))
{
meta_workspace_remove_window (workspace, move_window);
meta_workspace_remove_window (old, move_window);
meta_workspace_add_window (workspace, move_window);
}
}