summaryrefslogtreecommitdiff
path: root/src/core/keybindings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/keybindings.c')
-rw-r--r--src/core/keybindings.c376
1 files changed, 188 insertions, 188 deletions
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 29df5a66..63e33059 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1,12 +1,12 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* Marco Keybindings */
-/*
+/* Marco Keybindings */
+/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat Inc.
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
@@ -16,7 +16,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -142,7 +142,7 @@ reload_keymap (MetaDisplay *display)
display->min_keycode,
display->max_keycode -
display->min_keycode + 1,
- &display->keysyms_per_keycode);
+ &display->keysyms_per_keycode);
}
static void
@@ -151,7 +151,7 @@ reload_modmap (MetaDisplay *display)
XModifierKeymap *modmap;
int map_size;
int i;
-
+
if (display->modmap)
XFreeModifiermap (display->modmap);
@@ -166,7 +166,7 @@ reload_modmap (MetaDisplay *display)
display->meta_mask = 0;
display->hyper_mask = 0;
display->super_mask = 0;
-
+
/* there are 8 modifiers, and the first 3 are shift, shift lock,
* and control
*/
@@ -178,7 +178,7 @@ reload_modmap (MetaDisplay *display)
* see if its keysym is one we're interested in
*/
int keycode = modmap->modifiermap[i];
-
+
if (keycode >= display->min_keycode &&
keycode <= display->max_keycode)
{
@@ -191,21 +191,21 @@ reload_modmap (MetaDisplay *display)
if (syms[j] != 0)
{
const char *str;
-
+
str = XKeysymToString (syms[j]);
meta_topic (META_DEBUG_KEYBINDINGS,
"Keysym %s bound to modifier 0x%x\n",
str ? str : "none",
(1 << ( i / modmap->max_keypermod)));
}
-
+
if (syms[j] == XK_Num_Lock)
{
/* Mod1Mask is 1 << 3 for example, i.e. the
* fourth modifier, i / keyspermod is the modifier
* index
*/
-
+
display->num_lock_mask |= (1 << ( i / modmap->max_keypermod));
}
else if (syms[j] == XK_Scroll_Lock)
@@ -221,17 +221,17 @@ reload_modmap (MetaDisplay *display)
syms[j] == XK_Hyper_R)
{
display->hyper_mask |= (1 << ( i / modmap->max_keypermod));
- }
+ }
else if (syms[j] == XK_Meta_L ||
syms[j] == XK_Meta_R)
{
display->meta_mask |= (1 << ( i / modmap->max_keypermod));
}
-
+
++j;
}
}
-
+
++i;
}
@@ -258,14 +258,14 @@ reload_keycodes (MetaDisplay *display)
if (display->key_bindings)
{
int i;
-
+
i = 0;
while (i < display->n_key_bindings)
{
if (display->key_bindings[i].keycode == 0)
display->key_bindings[i].keycode = XKeysymToKeycode (
display->xdisplay, display->key_bindings[i].keysym);
-
+
++i;
}
}
@@ -276,11 +276,11 @@ reload_modifiers (MetaDisplay *display)
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Reloading keycodes for binding tables\n");
-
+
if (display->key_bindings)
{
int i;
-
+
i = 0;
while (i < display->n_key_bindings)
{
@@ -292,8 +292,8 @@ reload_modifiers (MetaDisplay *display)
" Devirtualized mods 0x%x -> 0x%x (%s)\n",
display->key_bindings[i].modifiers,
display->key_bindings[i].mask,
- display->key_bindings[i].name);
-
+ display->key_bindings[i].name);
+
++i;
}
}
@@ -328,7 +328,7 @@ count_bindings (const MetaKeyPref *prefs,
tmp = tmp->next;
}
-
+
++i;
}
@@ -363,7 +363,7 @@ rebuild_binding_table (MetaDisplay *display,
{
int n_bindings;
int src, dest;
-
+
n_bindings = count_bindings (prefs, n_prefs);
g_free (*bindings_p);
*bindings_p = g_new0 (MetaKeyBinding, n_bindings);
@@ -388,7 +388,7 @@ rebuild_binding_table (MetaDisplay *display,
(*bindings_p)[dest].keycode = combo->keycode;
(*bindings_p)[dest].modifiers = combo->modifiers;
(*bindings_p)[dest].mask = 0;
-
+
++dest;
if (prefs[src].add_shift &&
@@ -397,7 +397,7 @@ rebuild_binding_table (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Binding %s also needs Shift grabbed\n",
prefs[src].name);
-
+
(*bindings_p)[dest].name = prefs[src].name;
(*bindings_p)[dest].handler = handler;
(*bindings_p)[dest].keysym = combo->keysym;
@@ -405,19 +405,19 @@ rebuild_binding_table (MetaDisplay *display,
(*bindings_p)[dest].modifiers = combo->modifiers |
META_VIRTUAL_SHIFT_MASK;
(*bindings_p)[dest].mask = 0;
-
+
++dest;
}
}
-
+
tmp = tmp->next;
}
-
+
++src;
}
g_assert (dest == n_bindings);
-
+
*n_bindings_p = dest;
meta_topic (META_DEBUG_KEYBINDINGS,
@@ -430,10 +430,10 @@ rebuild_key_binding_table (MetaDisplay *display)
{
const MetaKeyPref *prefs;
int n_prefs;
-
+
meta_topic (META_DEBUG_KEYBINDINGS,
"Rebuilding key binding table from preferences\n");
-
+
meta_prefs_get_key_bindings (&prefs, &n_prefs);
rebuild_binding_table (display,
&display->key_bindings,
@@ -448,7 +448,7 @@ regrab_key_bindings (MetaDisplay *display)
GSList *windows;
meta_error_trap_push (display); /* for efficiency push outer trap */
-
+
tmp = display->screens;
while (tmp != NULL)
{
@@ -465,10 +465,10 @@ regrab_key_bindings (MetaDisplay *display)
while (tmp != NULL)
{
MetaWindow *w = tmp->data;
-
+
meta_window_ungrab_keys (w);
meta_window_grab_keys (w);
-
+
tmp = tmp->next;
}
meta_error_trap_pop (display, FALSE);
@@ -493,7 +493,7 @@ display_get_keybinding_action (MetaDisplay *display,
{
return meta_prefs_get_keybinding_action (display->key_bindings[i].name);
}
-
+
--i;
}
@@ -503,7 +503,7 @@ display_get_keybinding_action (MetaDisplay *display,
void
meta_display_process_mapping_event (MetaDisplay *display,
XEvent *event)
-{
+{
if (event->xmapping.request == MappingModifier)
{
meta_topic (META_DEBUG_KEYBINDINGS,
@@ -512,7 +512,7 @@ meta_display_process_mapping_event (MetaDisplay *display,
reload_modmap (display);
reload_modifiers (display);
-
+
regrab_key_bindings (display);
}
else if (event->xmapping.request == MappingKeyboard)
@@ -522,7 +522,7 @@ meta_display_process_mapping_event (MetaDisplay *display,
reload_keymap (display);
reload_modmap (display);
-
+
reload_keycodes (display);
regrab_key_bindings (display);
@@ -536,7 +536,7 @@ bindings_changed_callback (MetaPreference pref,
MetaDisplay *display;
display = data;
-
+
switch (pref)
{
case META_PREF_KEYBINDINGS:
@@ -585,9 +585,9 @@ meta_display_init_keys (MetaDisplay *display)
reload_keycodes (display);
reload_modifiers (display);
-
+
/* Keys are actually grabbed in meta_screen_grab_keys() */
-
+
meta_prefs_add_listener (bindings_changed_callback, display);
}
@@ -595,12 +595,12 @@ void
meta_display_shutdown_keys (MetaDisplay *display)
{
/* Note that display->xdisplay is invalid in this function */
-
+
meta_prefs_remove_listener (bindings_changed_callback, display);
if (display->keymap)
meta_XFree (display->keymap);
-
+
if (display->modmap)
XFreeModifiermap (display->modmap);
g_free (display->key_bindings);
@@ -610,7 +610,7 @@ static const char*
keysym_name (int keysym)
{
const char *name;
-
+
name = XKeysymToString (keysym);
if (name == NULL)
name = "(unknown)";
@@ -642,7 +642,7 @@ meta_change_keygrab (MetaDisplay *display,
/* efficiency, avoid so many XSync() */
meta_error_trap_push (display);
-
+
ignored_mask = 0;
while (ignored_mask <= display->ignored_modifier_mask)
{
@@ -671,11 +671,11 @@ meta_change_keygrab (MetaDisplay *display,
if (meta_is_debugging ())
{
int result;
-
+
result = meta_error_trap_pop_with_return (display, FALSE);
-
+
if (grab && result != Success)
- {
+ {
if (result == BadAccess)
meta_warning (_("Some other program is already using the key %s with modifiers %x as a binding\n"), keysym_name (keysym), modmask | ignored_mask);
else
@@ -713,7 +713,7 @@ grab_keys (MetaKeyBinding *bindings,
g_assert (n_bindings == 0 || bindings != NULL);
meta_error_trap_push (display);
-
+
i = 0;
while (i < n_bindings)
{
@@ -726,7 +726,7 @@ grab_keys (MetaKeyBinding *bindings,
bindings[i].keycode,
bindings[i].mask);
}
-
+
++i;
}
@@ -748,10 +748,10 @@ ungrab_all_keys (MetaDisplay *display,
if (meta_is_debugging ())
{
int result;
-
+
result = meta_error_trap_pop_with_return (display, FALSE);
-
- if (result != Success)
+
+ if (result != Success)
meta_topic (META_DEBUG_KEYBINDINGS,
"Ungrabbing all keys on 0x%lx failed\n", xwindow);
}
@@ -799,7 +799,7 @@ meta_window_grab_keys (MetaWindow *window)
window->keys_grabbed = FALSE;
return;
}
-
+
if (window->keys_grabbed)
{
if (window->frame && !window->grab_on_frame)
@@ -810,7 +810,7 @@ meta_window_grab_keys (MetaWindow *window)
else
return; /* already all good */
}
-
+
grab_keys (window->display->key_bindings,
window->display->n_key_bindings,
window->display,
@@ -867,7 +867,7 @@ grab_keyboard (MetaDisplay *display,
{
int result;
int grab_status;
-
+
/* Grab the keyboard, so we get key releases and all key
* presses
*/
@@ -877,7 +877,7 @@ grab_keyboard (MetaDisplay *display,
xwindow, True,
GrabModeAsync, GrabModeAsync,
timestamp);
-
+
if (grab_status != GrabSuccess)
{
meta_error_trap_pop_with_return (display, TRUE);
@@ -897,9 +897,9 @@ grab_keyboard (MetaDisplay *display,
return FALSE;
}
}
-
+
meta_topic (META_DEBUG_KEYBINDINGS, "Grabbed all keys\n");
-
+
return TRUE;
}
@@ -922,7 +922,7 @@ meta_screen_grab_all_keys (MetaScreen *screen, guint32 timestamp)
if (screen->all_keys_grabbed)
return FALSE;
-
+
if (screen->keys_grabbed)
meta_screen_ungrab_keys (screen);
@@ -958,10 +958,10 @@ meta_window_grab_all_keys (MetaWindow *window,
{
Window grabwindow;
gboolean retval;
-
+
if (window->all_keys_grabbed)
return FALSE;
-
+
if (window->keys_grabbed)
meta_window_ungrab_keys (window);
@@ -972,7 +972,7 @@ meta_window_grab_all_keys (MetaWindow *window,
"Focusing %s because we're grabbing all its keys\n",
window->desc);
meta_window_focus (window, timestamp);
-
+
grabwindow = window->frame ? window->frame->xwindow : window->xwindow;
meta_topic (META_DEBUG_KEYBINDINGS,
@@ -1004,16 +1004,16 @@ meta_window_ungrab_all_keys (MetaWindow *window, guint32 timestamp)
}
}
-static gboolean
+static gboolean
is_modifier (MetaDisplay *display,
unsigned int keycode)
{
int i;
int map_size;
- gboolean retval = FALSE;
+ gboolean retval = FALSE;
g_assert (display->modmap);
-
+
map_size = 8 * display->modmap->max_keypermod;
i = 0;
while (i < map_size)
@@ -1025,7 +1025,7 @@ is_modifier (MetaDisplay *display,
}
++i;
}
-
+
return retval;
}
@@ -1040,7 +1040,7 @@ is_modifier (MetaDisplay *display,
* mod5 = 7
*/
-static gboolean
+static gboolean
is_specific_modifier (MetaDisplay *display,
unsigned int keycode,
unsigned int mask)
@@ -1049,13 +1049,13 @@ is_specific_modifier (MetaDisplay *display,
int end;
gboolean retval = FALSE;
int mod_index;
-
+
g_assert (display->modmap);
meta_topic (META_DEBUG_KEYBINDINGS,
"Checking whether code 0x%x is bound to modifier 0x%x\n",
keycode, mask);
-
+
mod_index = 0;
mask = mask >> 1;
while (mask != 0)
@@ -1066,7 +1066,7 @@ is_specific_modifier (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Modifier has index %d\n", mod_index);
-
+
end = (mod_index + 1) * display->modmap->max_keypermod;
i = mod_index * display->modmap->max_keypermod;
while (i < end)
@@ -1078,7 +1078,7 @@ is_specific_modifier (MetaDisplay *display,
}
++i;
}
-
+
return retval;
}
@@ -1097,7 +1097,7 @@ get_primary_modifier (MetaDisplay *display,
ShiftMask, LockMask };
int i;
-
+
i = 0;
while (i < (int) G_N_ELEMENTS (masks))
{
@@ -1119,7 +1119,7 @@ keycode_is_primary_modifier (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Checking whether code 0x%x is the primary modifier of mask 0x%x\n",
keycode, entire_binding_mask);
-
+
primary_modifier = get_primary_modifier (display, entire_binding_mask);
if (primary_modifier != 0)
return is_specific_modifier (display, keycode, primary_modifier);
@@ -1137,9 +1137,9 @@ primary_modifier_still_pressed (MetaDisplay *display,
guint mask;
MetaScreen *random_screen;
Window random_xwindow;
-
+
primary_modifier = get_primary_modifier (display, entire_binding_mask);
-
+
random_screen = display->screens->data;
random_xwindow = random_screen->no_focus_window;
XQueryPointer (display->xdisplay,
@@ -1152,7 +1152,7 @@ primary_modifier_still_pressed (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Primary modifier 0x%x full grab mask 0x%x current state 0x%x\n",
primary_modifier, entire_binding_mask, mask);
-
+
if ((mask & primary_modifier) == 0)
return FALSE;
else
@@ -1190,7 +1190,7 @@ process_event (MetaKeyBinding *bindings,
((event->xkey.state & 0xff & ~(display->ignored_modifier_mask)) !=
bindings[i].mask))
continue;
-
+
/*
* window must be non-NULL for on_window to be true,
* and so also window must be non-NULL if we get here and
@@ -1208,7 +1208,7 @@ process_event (MetaKeyBinding *bindings,
meta_topic (META_DEBUG_KEYBINDINGS,
"Running handler for %s\n",
bindings[i].name);
-
+
/* Global keybindings count as a let-the-terminal-lose-focus
* due to new window mapping until the user starts
* interacting with the terminal again.
@@ -1254,10 +1254,10 @@ meta_display_process_key_event (MetaDisplay *display,
event->xkey.time);
if (all_bindings_disabled)
return;
-
+
/* if key event was on root window, we have a shortcut */
screen = meta_display_screen_for_root (display, event->xkey.window);
-
+
/* else round-trip to server */
if (screen == NULL)
screen = meta_display_screen_for_xwindow (display,
@@ -1265,18 +1265,18 @@ meta_display_process_key_event (MetaDisplay *display,
if (screen == NULL)
return; /* event window is destroyed */
-
+
/* ignore key events on popup menus and such. */
if (window == NULL &&
meta_ui_window_is_widget (screen->ui, event->xany.window))
return;
-
+
/* window may be NULL */
-
+
keysym = XKeycodeToKeysym (display->xdisplay, event->xkey.keycode, 0);
str = XKeysymToString (keysym);
-
+
/* was topic */
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing key %s event, keysym: %s state: 0x%x window: %s\n",
@@ -1301,8 +1301,8 @@ meta_display_process_key_event (MetaDisplay *display,
{
case META_GRAB_OP_MOVING:
case META_GRAB_OP_RESIZING_SE:
- case META_GRAB_OP_RESIZING_S:
- case META_GRAB_OP_RESIZING_SW:
+ case META_GRAB_OP_RESIZING_S:
+ case META_GRAB_OP_RESIZING_SW:
case META_GRAB_OP_RESIZING_N:
case META_GRAB_OP_RESIZING_NE:
case META_GRAB_OP_RESIZING_NW:
@@ -1314,7 +1314,7 @@ meta_display_process_key_event (MetaDisplay *display,
keep_grab = process_mouse_move_resize_grab (display, screen,
window, event, keysym);
break;
-
+
case META_GRAB_OP_KEYBOARD_MOVING:
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard move\n");
@@ -1322,7 +1322,7 @@ meta_display_process_key_event (MetaDisplay *display,
keep_grab = process_keyboard_move_grab (display, screen,
window, event, keysym);
break;
-
+
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
case META_GRAB_OP_KEYBOARD_RESIZING_S:
case META_GRAB_OP_KEYBOARD_RESIZING_N:
@@ -1331,14 +1331,14 @@ meta_display_process_key_event (MetaDisplay *display,
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
- case META_GRAB_OP_KEYBOARD_RESIZING_NW:
+ case META_GRAB_OP_KEYBOARD_RESIZING_NW:
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard resize\n");
g_assert (window != NULL);
keep_grab = process_keyboard_resize_grab (display, screen,
window, event, keysym);
break;
-
+
case META_GRAB_OP_KEYBOARD_TABBING_NORMAL:
case META_GRAB_OP_KEYBOARD_TABBING_NORMAL_ALL_WORKSPACES:
case META_GRAB_OP_KEYBOARD_TABBING_DOCK:
@@ -1351,13 +1351,13 @@ meta_display_process_key_event (MetaDisplay *display,
"Processing event for keyboard tabbing/cycling\n");
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");
keep_grab = process_workspace_switch_grab (display, screen, event, keysym);
break;
-
+
default:
break;
}
@@ -1430,7 +1430,7 @@ process_keyboard_move_grab (MetaDisplay *display,
int x, y;
int incr;
gboolean smart_snap;
-
+
handled = FALSE;
/* don't care about releases, but eat them, don't end grab */
@@ -1452,7 +1452,7 @@ process_keyboard_move_grab (MetaDisplay *display,
}
smart_snap = (event->xkey.state & ShiftMask) != 0;
-
+
#define SMALL_INCREMENT 1
#define NORMAL_INCREMENT 10
@@ -1486,7 +1486,7 @@ process_keyboard_move_grab (MetaDisplay *display,
else
display->grab_was_cancelled = TRUE;
}
-
+
/* When moving by increments, we still snap to edges if the move
* to the edge is smaller than the increment. This is because
* Shift + arrow to snap is sort of a hidden feature. This way
@@ -1509,7 +1509,7 @@ process_keyboard_move_grab (MetaDisplay *display,
handled = TRUE;
break;
}
-
+
switch (keysym)
{
case XK_KP_Home:
@@ -1540,7 +1540,7 @@ process_keyboard_move_grab (MetaDisplay *display,
else
meta_window_get_client_root_coords (window, &old_rect);
- meta_window_edge_resistance_for_move (window,
+ meta_window_edge_resistance_for_move (window,
old_rect.x,
old_rect.y,
&x,
@@ -1559,7 +1559,7 @@ process_keyboard_move_grab (MetaDisplay *display,
{
meta_window_move (window, TRUE, x, y);
}
-
+
meta_window_update_keyboard_move (window);
}
@@ -1583,7 +1583,7 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
{
case XK_Up:
case XK_KP_Up:
- display->grab_op = META_GRAB_OP_KEYBOARD_RESIZING_N;
+ display->grab_op = META_GRAB_OP_KEYBOARD_RESIZING_N;
handled = TRUE;
break;
case XK_Down:
@@ -1603,7 +1603,7 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
break;
}
break;
-
+
case META_GRAB_OP_KEYBOARD_RESIZING_S:
switch (keysym)
{
@@ -1635,13 +1635,13 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
break;
}
break;
-
+
case META_GRAB_OP_KEYBOARD_RESIZING_W:
switch (keysym)
{
case XK_Up:
case XK_KP_Up:
- display->grab_op = META_GRAB_OP_KEYBOARD_RESIZING_N;
+ display->grab_op = META_GRAB_OP_KEYBOARD_RESIZING_N;
handled = TRUE;
break;
case XK_Down:
@@ -1657,7 +1657,7 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
{
case XK_Up:
case XK_KP_Up:
- display->grab_op = META_GRAB_OP_KEYBOARD_RESIZING_N;
+ display->grab_op = META_GRAB_OP_KEYBOARD_RESIZING_N;
handled = TRUE;
break;
case XK_Down:
@@ -1667,7 +1667,7 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
break;
}
break;
-
+
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
@@ -1682,7 +1682,7 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
if (handled)
{
meta_window_update_keyboard_resize (window, TRUE);
- return TRUE;
+ return TRUE;
}
return FALSE;
@@ -1701,7 +1701,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
int width, height;
gboolean smart_snap;
int gravity;
-
+
handled = FALSE;
/* don't care about releases, but eat them, don't end grab */
@@ -1733,7 +1733,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
return FALSE;
}
- if (process_keyboard_resize_grab_op_change (display, screen, window,
+ if (process_keyboard_resize_grab_op_change (display, screen, window,
event, keysym))
return TRUE;
@@ -1751,7 +1751,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
gravity = meta_resize_gravity_from_grab_op (display->grab_op);
smart_snap = (event->xkey.state & ShiftMask) != 0;
-
+
#define SMALL_INCREMENT 1
#define NORMAL_INCREMENT 10
@@ -1764,7 +1764,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
{
width_inc = SMALL_INCREMENT;
height_inc = SMALL_INCREMENT;
- }
+ }
else
{
width_inc = NORMAL_INCREMENT;
@@ -1778,7 +1778,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
width_inc = window->size_hints.width_inc;
if (window->size_hints.height_inc > 1)
height_inc = window->size_hints.height_inc;
-
+
switch (keysym)
{
case XK_Up:
@@ -1805,7 +1805,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
g_assert_not_reached ();
break;
}
-
+
handled = TRUE;
break;
@@ -1833,10 +1833,10 @@ process_keyboard_resize_grab (MetaDisplay *display,
g_assert_not_reached ();
break;
}
-
+
handled = TRUE;
break;
-
+
case XK_Left:
case XK_KP_Left:
switch (gravity)
@@ -1861,10 +1861,10 @@ process_keyboard_resize_grab (MetaDisplay *display,
g_assert_not_reached ();
break;
}
-
+
handled = TRUE;
break;
-
+
case XK_Right:
case XK_KP_Right:
switch (gravity)
@@ -1889,10 +1889,10 @@ process_keyboard_resize_grab (MetaDisplay *display,
g_assert_not_reached ();
break;
}
-
+
handled = TRUE;
break;
-
+
default:
break;
}
@@ -1902,7 +1902,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
height = 1;
if (width < 1)
width = 1;
-
+
if (handled)
{
MetaRectangle old_rect;
@@ -1910,7 +1910,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
"Computed new window size due to keypress: "
"%dx%d, gravity %s\n",
width, height, meta_gravity_to_string (gravity));
-
+
if (display->grab_wireframe_active)
old_rect = display->grab_wireframe_rect;
else
@@ -1930,15 +1930,15 @@ process_keyboard_resize_grab (MetaDisplay *display,
if (display->grab_wireframe_active)
{
MetaRectangle new_position;
- meta_rectangle_resize_with_gravity (&display->grab_wireframe_rect,
+ meta_rectangle_resize_with_gravity (&display->grab_wireframe_rect,
&new_position,
gravity,
width,
height);
- meta_window_update_wireframe (window,
+ meta_window_update_wireframe (window,
new_position.x,
new_position.y,
- new_position.width,
+ new_position.width,
new_position.height);
}
else
@@ -1947,7 +1947,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
* are actually different from what we had before.
*/
if (window->rect.width != width || window->rect.height != height)
- meta_window_resize_with_gravity (window,
+ meta_window_resize_with_gravity (window,
TRUE,
width,
height,
@@ -1968,9 +1968,9 @@ end_keyboard_grab (MetaDisplay *display,
{
unsigned int primary_modifier;
XkbStateRec state;
-
+
primary_modifier = get_primary_modifier (display, display->grab_mask);
-
+
XkbGetState (display->xdisplay, XkbUseCoreKbd, &state);
if (!(primary_modifier & state.mods))
@@ -2018,7 +2018,7 @@ process_tab_grab (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Ending tab operation, primary modifier released\n");
-
+
if (target_window)
{
target_window->tab_unminimized = FALSE;
@@ -2039,10 +2039,10 @@ process_tab_grab (MetaDisplay *display,
return TRUE; /* we already ended the grab */
}
-
+
return FALSE; /* end grab */
}
-
+
/* don't care about other releases, but eat them, don't end grab */
if (event->type == KeyRelease)
return TRUE;
@@ -2122,7 +2122,7 @@ process_tab_grab (MetaDisplay *display,
default:
return FALSE;
}
-
+
break;
default:
break;
@@ -2134,7 +2134,7 @@ process_tab_grab (MetaDisplay *display,
* of course).
* See _{SWITCH,CYCLE}_GROUP.@@@
*/
-
+
popup_not_showing = FALSE;
key_used = FALSE;
backward = FALSE;
@@ -2168,7 +2168,7 @@ process_tab_grab (MetaDisplay *display,
default:
break;
}
-
+
if (key_used)
{
meta_topic (META_DEBUG_KEYBINDINGS,
@@ -2181,7 +2181,7 @@ process_tab_grab (MetaDisplay *display,
meta_ui_tab_popup_backward (screen->tab_popup);
else
meta_ui_tab_popup_forward (screen->tab_popup);
-
+
if (popup_not_showing)
{
/* We can't actually change window focus, due to the grab.
@@ -2197,7 +2197,7 @@ process_tab_grab (MetaDisplay *display,
(Window) meta_ui_tab_popup_get_selected (screen->tab_popup);
target_window =
meta_display_lookup_x_window (display, target_xwindow);
-
+
if (prev_window && prev_window->tab_unminimized)
{
prev_window->tab_unminimized = FALSE;
@@ -2218,7 +2218,7 @@ process_tab_grab (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Ending tabbing/cycling, uninteresting key pressed\n");
- meta_topic (META_DEBUG_KEYBINDINGS,
+ meta_topic (META_DEBUG_KEYBINDINGS,
"Syncing to old stack positions.\n");
meta_stack_set_positions (screen->stack,
screen->display->grab_old_window_stacking);
@@ -2229,7 +2229,7 @@ process_tab_grab (MetaDisplay *display,
prev_window->tab_unminimized = FALSE;
}
}
-
+
return key_used;
}
@@ -2268,7 +2268,7 @@ handle_switch_to_workspace (MetaDisplay *display,
}
workspace = meta_screen_get_workspace_by_index (screen, which);
-
+
if (workspace)
{
meta_workspace_activate (workspace, event->xkey.time);
@@ -2287,14 +2287,14 @@ error_on_command (int command_index,
guint32 timestamp)
{
if (command_index < 0)
- meta_warning ("Error on terminal command \"%s\": %s\n", command, message);
+ meta_warning ("Error on terminal command \"%s\": %s\n", command, message);
else
meta_warning ("Error on command %d \"%s\": %s\n",
- command_index, command, message);
+ command_index, command, message);
/*
marco-dialog said:
-
+
FIXME offer to change the value of the command's mateconf key
*/
@@ -2341,7 +2341,7 @@ set_display_setup_func (void *data)
putenv (full);
/* do not free full, because putenv is lame */
-}
+}
static gboolean
meta_spawn_command_line_async_on_screen (const gchar *command_line,
@@ -2357,7 +2357,7 @@ meta_spawn_command_line_async_on_screen (const gchar *command_line,
NULL, &argv,
error))
return FALSE;
-
+
retval = g_spawn_async (NULL,
argv,
NULL,
@@ -2382,7 +2382,7 @@ handle_run_command (MetaDisplay *display,
gint which = binding->handler->data;
const char *command;
GError *err;
-
+
command = meta_prefs_get_command (which);
if (command == NULL)
@@ -2392,12 +2392,12 @@ handle_run_command (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"No command %d to run in response to keybinding press\n",
which);
-
+
s = g_strdup_printf (_("No command %d has been defined.\n"),
which + 1);
error_on_command (which, NULL, s, screen->number, event->xkey.time);
g_free (s);
-
+
return;
}
@@ -2405,7 +2405,7 @@ handle_run_command (MetaDisplay *display,
if (!meta_spawn_command_line_async_on_screen (command, screen, &err))
{
error_on_command (which, command, err->message, screen->number, event->xkey.time);
-
+
g_error_free (err);
}
}
@@ -2636,7 +2636,7 @@ process_workspace_switch_grab (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Focusing default window on target workspace\n");
- meta_workspace_focus_default_window (target_workspace,
+ meta_workspace_focus_default_window (target_workspace,
NULL,
event->xkey.time);
@@ -2645,10 +2645,10 @@ process_workspace_switch_grab (MetaDisplay *display,
/* Workspace switching should have already occurred on KeyPress */
meta_warning ("target_workspace != active_workspace. Some other event must have occurred.\n");
-
+
return FALSE; /* end grab */
}
-
+
/* don't care about other releases, but eat them, don't end grab */
if (event->type == KeyRelease)
return TRUE;
@@ -2660,7 +2660,7 @@ process_workspace_switch_grab (MetaDisplay *display,
/* select the next workspace in the tabpopup */
workspace =
(MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->tab_popup);
-
+
if (workspace)
{
MetaWorkspace *target_workspace;
@@ -2733,7 +2733,7 @@ handle_show_desktop (MetaDisplay *display,
if (screen->active_workspace->showing_desktop)
{
meta_screen_unshow_desktop (screen);
- meta_workspace_focus_default_window (screen->active_workspace,
+ meta_workspace_focus_default_window (screen->active_workspace,
NULL,
event->xkey.time);
}
@@ -2765,7 +2765,7 @@ handle_panel (MetaDisplay *display,
default:
return;
}
-
+
ev.type = ClientMessage;
ev.window = screen->xroot;
ev.message_type = display->atom__MATE_PANEL_ACTION;
@@ -2805,7 +2805,7 @@ handle_activate_window_menu (MetaDisplay *display,
meta_window_get_position (display->focus_window,
&x, &y);
-
+
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
x += display->focus_window->rect.width;
@@ -2832,7 +2832,7 @@ tab_op_from_tab_type (MetaTabList type)
}
g_assert_not_reached ();
-
+
return 0;
}
@@ -2852,7 +2852,7 @@ cycle_op_from_tab_type (MetaTabList type)
}
g_assert_not_reached ();
-
+
return 0;
}
@@ -2870,11 +2870,11 @@ do_choose_window (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Tab list = %u show_popup = %d\n", type, show_popup);
-
+
/* reverse direction if shift is down */
if (event->xkey.state & ShiftMask)
backward = !backward;
-
+
initial_selection = meta_display_get_tab_next (display,
type,
screen,
@@ -2887,10 +2887,10 @@ do_choose_window (MetaDisplay *display,
initial_selection = meta_display_get_tab_current (display,
type, screen,
screen->active_workspace);
-
+
meta_topic (META_DEBUG_KEYBINDINGS,
"Initially selecting window %s\n",
- initial_selection ? initial_selection->desc : "(none)");
+ initial_selection ? initial_selection->desc : "(none)");
if (initial_selection != NULL)
{
@@ -2927,7 +2927,7 @@ do_choose_window (MetaDisplay *display,
* before we establish the grab. must end grab
* prior to trying to focus a window.
*/
- meta_topic (META_DEBUG_FOCUS,
+ meta_topic (META_DEBUG_FOCUS,
"Ending grab, activating %s, and turning off "
"mouse_mode due to switch/cycle windows where "
"modifier was released prior to grab\n",
@@ -2941,14 +2941,14 @@ do_choose_window (MetaDisplay *display,
{
meta_ui_tab_popup_select (screen->tab_popup,
(MetaTabEntryKey) initial_selection->xwindow);
-
+
if (show_popup)
meta_ui_tab_popup_set_showing (screen->tab_popup,
TRUE);
else
{
meta_window_raise (initial_selection);
- initial_selection->tab_unminimized =
+ initial_selection->tab_unminimized =
initial_selection->minimized;
meta_window_unminimize (initial_selection);
}
@@ -3143,7 +3143,7 @@ handle_move_to_workspace (MetaDisplay *display,
gint which = binding->handler->data;
gboolean flip = (which < 0);
MetaWorkspace *workspace;
-
+
/* If which is zero or positive, it's a workspace number, and the window
* should move to the workspace with that number.
*
@@ -3154,10 +3154,10 @@ handle_move_to_workspace (MetaDisplay *display,
if (window->always_sticky)
return;
-
+
workspace = NULL;
if (flip)
- {
+ {
workspace = meta_workspace_get_neighbor (screen->active_workspace,
which);
}
@@ -3165,7 +3165,7 @@ handle_move_to_workspace (MetaDisplay *display,
{
workspace = meta_screen_get_workspace_by_index (screen, which);
}
-
+
if (workspace)
{
/* Activate second, so the window is never unmapped */
@@ -3184,10 +3184,10 @@ handle_move_to_workspace (MetaDisplay *display,
else
{
/* We could offer to create it I suppose */
- }
+ }
}
-static void
+static void
handle_raise_or_lower (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
@@ -3195,29 +3195,29 @@ handle_raise_or_lower (MetaDisplay *display,
MetaKeyBinding *binding)
{
/* Get window at pointer */
-
+
MetaWindow *above = NULL;
-
+
/* Check if top */
if (meta_stack_get_top (window->screen->stack) == window)
{
meta_window_lower (window);
return;
}
-
+
/* else check if windows in same layer are intersecting it */
-
- above = meta_stack_get_above (window->screen->stack, window, TRUE);
+
+ above = meta_stack_get_above (window->screen->stack, window, TRUE);
while (above)
{
MetaRectangle tmp, win_rect, above_rect;
-
+
if (above->mapped)
{
meta_window_get_outer_rect (window, &win_rect);
meta_window_get_outer_rect (above, &above_rect);
-
+
/* Check if obscured */
if (meta_rectangle_intersect (&win_rect, &above_rect, &tmp))
{
@@ -3225,8 +3225,8 @@ handle_raise_or_lower (MetaDisplay *display,
return;
}
}
-
- above = meta_stack_get_above (window->screen->stack, above, TRUE);
+
+ above = meta_stack_get_above (window->screen->stack, above, TRUE);
}
/* window is not obscured */
@@ -3262,15 +3262,15 @@ handle_workspace_switch (MetaDisplay *display,
{
gint motion = binding->handler->data;
unsigned int grab_mask;
-
- g_assert (motion < 0);
+
+ g_assert (motion < 0);
meta_topic (META_DEBUG_KEYBINDINGS,
"Starting tab between workspaces, showing popup\n");
/* FIXME should we use binding->mask ? */
grab_mask = event->xkey.state & ~(display->ignored_modifier_mask);
-
+
if (meta_display_begin_grab_op (display,
screen,
NULL,
@@ -3284,12 +3284,12 @@ handle_workspace_switch (MetaDisplay *display,
{
MetaWorkspace *next;
gboolean grabbed_before_release;
-
+
next = meta_workspace_get_neighbor (screen->active_workspace, motion);
- g_assert (next);
+ g_assert (next);
grabbed_before_release = primary_modifier_still_pressed (display, grab_mask);
-
+
meta_topic (META_DEBUG_KEYBINDINGS,
"Activating target workspace\n");
@@ -3302,13 +3302,13 @@ handle_workspace_switch (MetaDisplay *display,
*/
meta_display_end_grab_op (display, event->xkey.time);
}
-
+
meta_workspace_activate (next, event->xkey.time);
if (grabbed_before_release)
{
meta_ui_tab_popup_select (screen->tab_popup, (MetaTabEntryKey) next);
-
+
/* only after selecting proper space */
meta_ui_tab_popup_set_showing (screen->tab_popup, TRUE);
}
@@ -3342,7 +3342,7 @@ handle_run_terminal (MetaDisplay *display,
{
const char *command;
GError *err;
-
+
command = meta_prefs_get_terminal_command ();
if (command == NULL)
@@ -3352,11 +3352,11 @@ handle_run_terminal (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"No terminal command to run in response to "
"keybinding press\n");
-
+
s = g_strdup_printf (_("No terminal command has been defined.\n"));
error_on_command (-1, NULL, s, screen->number, event->xkey.time);
g_free (s);
-
+
return;
}
@@ -3365,7 +3365,7 @@ handle_run_terminal (MetaDisplay *display,
{
error_on_command (-1, command, err->message, screen->number,
event->xkey.time);
-
+
g_error_free (err);
}
}