From 7fc6c99987c11f0ea2a4fd14042b8997a6d160d1 Mon Sep 17 00:00:00 2001 From: Rob Adams Date: Sat, 17 May 2003 00:00:55 +0000 Subject: [PATCH] Flip the workspace when using up/down/left/right for move window to, but 2003-05-16 Rob Adams Flip the workspace when using up/down/left/right for move window to, but not when specifying a workspace explicitly as in move to workspace 4. Possible fix for #105492. * src/keybindings.c (do_handle_move_to_workspace): new function moves a window to a workspace with the option to flip to that workspace. (handle_move_to_workspace): Use new do_handle_move_to_workspace function without flipping (a keybinding) (handle_move_to_workspace_flip): Use new do_handle_move_to_workspace function with flipping (a keybinding) --- ChangeLog | 19 ++++++++++++---- src/keybindings.c | 58 +++++++++++++++++++++++++++++++++++++---------- 2 files changed, 60 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd8e0c3b7..df79879a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-05-16 Rob Adams + + * src/keybindings.c (do_handle_move_to_workspace): new function + moves a window to a workspace with the option to flip to that workspace. + (handle_move_to_workspace): Use new do_handle_move_to_workspace + function without flipping (a keybinding) + (handle_move_to_workspace_flip): Use new do_handle_move_to_workspace + function with flipping (a keybinding) + 2003-05-16 Havoc Pennington * src/frames.c (meta_frames_paint_to_drawable): fix for @@ -39,7 +48,7 @@ * configure.in: Added "cy" (Welsh) to ALL_LINGUAS. -2003-05-06 Danilo Šegan +2003-05-06 Danilo Å egan * configure.in: Added "sr" and "sr@Latn" to ALL_LINGUAS. @@ -3402,7 +3411,7 @@ Thu Nov 7 17:07:21 2002 Jonathan Blandford don't get focused automatically. Now how do we keep them out of the task list? -2002-06-04 Gustavo Giráldez +2002-06-04 Gustavo Giráldez * src/theme.c (draw_op_as_pixbuf): Use icon's instead of image's fill_type when type is META_DRAW_ICON. @@ -3748,7 +3757,7 @@ Mon Jun 3 15:12:11 2002 HideToshi Tajima 2002-05-21 Havoc Pennington * src/window.c (constrain_position): fix positioning in fullscreen - mode, patch from Gustavo Giráldez + mode, patch from Gustavo Giráldez 2002-05-20 Alessio Frusciante @@ -4091,7 +4100,7 @@ Mon Jun 3 15:12:11 2002 HideToshi Tajima 2002-04-30 Havoc Pennington * src/window.c (constrain_position): oops, fix - maximization. Pointed out by Gustavo Giráldez + maximization. Pointed out by Gustavo Giráldez Tue Apr 30 06:24:09 2002 Jonathan Blandford @@ -5515,7 +5524,7 @@ Tue Nov 20 18:49:16 2001 Owen Taylor it to current workspace, instead of moving user to the window's workspace. -2001-10-14 Héctor García Álvarez +2001-10-14 Héctor García Álvarez * configure.in: Added "es" to ALL_LINGUAS for Spanish translation. diff --git a/src/keybindings.c b/src/keybindings.c index 69bab7411..56ee41169 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -134,6 +134,11 @@ static void handle_move_to_workspace (MetaDisplay *display, MetaWindow *window, XEvent *event, MetaKeyBinding *binding); +static void handle_move_to_workspace_flip (MetaDisplay *display, + MetaScreen *screen, + MetaWindow *window, + XEvent *event, + MetaKeyBinding *binding); static void handle_workspace_switch (MetaDisplay *display, MetaScreen *screen, MetaWindow *window, @@ -381,13 +386,13 @@ static const MetaKeyHandler window_handlers[] = { GINT_TO_POINTER (10) }, { META_KEYBINDING_MOVE_WORKSPACE_12, handle_move_to_workspace, GINT_TO_POINTER (11) }, - { META_KEYBINDING_MOVE_WORKSPACE_LEFT, handle_move_to_workspace, + { META_KEYBINDING_MOVE_WORKSPACE_LEFT, handle_move_to_workspace_flip, GINT_TO_POINTER (META_MOTION_LEFT) }, - { META_KEYBINDING_MOVE_WORKSPACE_RIGHT, handle_move_to_workspace, + { META_KEYBINDING_MOVE_WORKSPACE_RIGHT, handle_move_to_workspace_flip, GINT_TO_POINTER (META_MOTION_RIGHT) }, - { META_KEYBINDING_MOVE_WORKSPACE_UP, handle_move_to_workspace, + { META_KEYBINDING_MOVE_WORKSPACE_UP, handle_move_to_workspace_flip, GINT_TO_POINTER (META_MOTION_UP) }, - { META_KEYBINDING_MOVE_WORKSPACE_DOWN, handle_move_to_workspace, + { META_KEYBINDING_MOVE_WORKSPACE_DOWN, handle_move_to_workspace_flip, GINT_TO_POINTER (META_MOTION_DOWN) }, { META_KEYBINDING_RAISE_OR_LOWER, handle_raise_or_lower, NULL}, { META_KEYBINDING_RAISE, handle_raise, NULL}, @@ -2986,11 +2991,12 @@ handle_toggle_sticky (MetaDisplay *display, } static void -handle_move_to_workspace (MetaDisplay *display, - MetaScreen *screen, - MetaWindow *window, - XEvent *event, - MetaKeyBinding *binding) +do_handle_move_to_workspace (MetaDisplay *display, + MetaScreen *screen, + MetaWindow *window, + XEvent *event, + MetaKeyBinding *binding, + gboolean flip) { int which; MetaWorkspace *workspace; @@ -3015,9 +3021,8 @@ handle_move_to_workspace (MetaDisplay *display, { /* Activate second, so the window is never unmapped */ meta_window_change_workspace (window, workspace); -#if 0 - meta_workspace_activate (workspace); -#endif + if (flip) + meta_workspace_activate (workspace); } else { @@ -3025,6 +3030,35 @@ handle_move_to_workspace (MetaDisplay *display, } } +static void +handle_move_to_workspace (MetaDisplay *display, + MetaScreen *screen, + MetaWindow *window, + XEvent *event, + MetaKeyBinding *binding) +{ + do_handle_move_to_workspace (display, + screen, + window, + event, + binding, + FALSE); +} +static void +handle_move_to_workspace_flip (MetaDisplay *display, + MetaScreen *screen, + MetaWindow *window, + XEvent *event, + MetaKeyBinding *binding) +{ + do_handle_move_to_workspace (display, + screen, + window, + event, + binding, + TRUE); +} + static void handle_raise_or_lower (MetaDisplay *display, MetaScreen *screen,