display: Move devirtualize_modifiers into keybindings

It's mostly only used here.
This commit is contained in:
Jasper St. Pierre 2014-08-14 14:44:46 -04:00
parent 1e30db64d1
commit 9fa77acb8c
4 changed files with 33 additions and 33 deletions

View File

@ -400,10 +400,6 @@ gboolean meta_grab_op_is_mouse (MetaGrabOp op);
gboolean meta_grab_op_is_keyboard (MetaGrabOp op); gboolean meta_grab_op_is_keyboard (MetaGrabOp op);
gboolean meta_grab_op_should_block_wayland (MetaGrabOp op); gboolean meta_grab_op_should_block_wayland (MetaGrabOp op);
void meta_display_devirtualize_modifiers (MetaDisplay *display,
MetaVirtualModifier modifiers,
unsigned int *mask);
void meta_display_increment_focus_sentinel (MetaDisplay *display); void meta_display_increment_focus_sentinel (MetaDisplay *display);
void meta_display_decrement_focus_sentinel (MetaDisplay *display); void meta_display_decrement_focus_sentinel (MetaDisplay *display);
gboolean meta_display_focus_sentinel_clear (MetaDisplay *display); gboolean meta_display_focus_sentinel_clear (MetaDisplay *display);

View File

@ -2853,35 +2853,6 @@ meta_display_sort_windows_by_stacking (MetaDisplay *display,
return copy; return copy;
} }
void
meta_display_devirtualize_modifiers (MetaDisplay *display,
MetaVirtualModifier modifiers,
unsigned int *mask)
{
*mask = 0;
if (modifiers & META_VIRTUAL_SHIFT_MASK)
*mask |= ShiftMask;
if (modifiers & META_VIRTUAL_CONTROL_MASK)
*mask |= ControlMask;
if (modifiers & META_VIRTUAL_ALT_MASK)
*mask |= Mod1Mask;
if (modifiers & META_VIRTUAL_META_MASK)
*mask |= display->meta_mask;
if (modifiers & META_VIRTUAL_HYPER_MASK)
*mask |= display->hyper_mask;
if (modifiers & META_VIRTUAL_SUPER_MASK)
*mask |= display->super_mask;
if (modifiers & META_VIRTUAL_MOD2_MASK)
*mask |= Mod2Mask;
if (modifiers & META_VIRTUAL_MOD3_MASK)
*mask |= Mod3Mask;
if (modifiers & META_VIRTUAL_MOD4_MASK)
*mask |= Mod4Mask;
if (modifiers & META_VIRTUAL_MOD5_MASK)
*mask |= Mod5Mask;
}
static void static void
update_window_grab_modifiers (MetaDisplay *display) update_window_grab_modifiers (MetaDisplay *display)
{ {

View File

@ -117,4 +117,8 @@ GList *meta_prefs_get_keybindings (void);
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo); void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
const char *meta_prefs_get_iso_next_group_option (void); const char *meta_prefs_get_iso_next_group_option (void);
void meta_display_devirtualize_modifiers (MetaDisplay *display,
MetaVirtualModifier modifiers,
unsigned int *mask);
#endif #endif

View File

@ -527,6 +527,35 @@ reload_keycodes (MetaDisplay *display)
g_hash_table_foreach (display->key_bindings, binding_reload_keycode_foreach, display); g_hash_table_foreach (display->key_bindings, binding_reload_keycode_foreach, display);
} }
void
meta_display_devirtualize_modifiers (MetaDisplay *display,
MetaVirtualModifier modifiers,
unsigned int *mask)
{
*mask = 0;
if (modifiers & META_VIRTUAL_SHIFT_MASK)
*mask |= ShiftMask;
if (modifiers & META_VIRTUAL_CONTROL_MASK)
*mask |= ControlMask;
if (modifiers & META_VIRTUAL_ALT_MASK)
*mask |= Mod1Mask;
if (modifiers & META_VIRTUAL_META_MASK)
*mask |= display->meta_mask;
if (modifiers & META_VIRTUAL_HYPER_MASK)
*mask |= display->hyper_mask;
if (modifiers & META_VIRTUAL_SUPER_MASK)
*mask |= display->super_mask;
if (modifiers & META_VIRTUAL_MOD2_MASK)
*mask |= Mod2Mask;
if (modifiers & META_VIRTUAL_MOD3_MASK)
*mask |= Mod3Mask;
if (modifiers & META_VIRTUAL_MOD4_MASK)
*mask |= Mod4Mask;
if (modifiers & META_VIRTUAL_MOD5_MASK)
*mask |= Mod5Mask;
}
static void static void
binding_reload_modifiers_foreach (gpointer key, binding_reload_modifiers_foreach (gpointer key,
gpointer value, gpointer value,