Add a modifier key preference for the Alt+click stuff. Can be set to

2002-10-07  Havoc Pennington  <hp@redhat.com>

        Add a modifier key preference for the Alt+click stuff.
	Can be set to "disabled" as well.

	* src/run-metacity.sh: load .Xmodmap in the Xnest if it exists

	* src/display.c (meta_display_ungrab_window_buttons): ungrab
	AnyModifier in case the modifier changed since we grabbed
	(meta_display_open): rearrange code to use meta_display_close() to
	mop up when we can't find any screens, avoiding the need to
	keep the bail-out code in sync with meta_display_close.

	* src/keybindings.c (devirtualize_modifiers): move this function
	to a public place in display.c

	* src/metacity.schemas.in: add setting for the modifier key
	to use for Alt+left/middle/right click.

	* src/prefs.c (update_binding): add a missing newline to a warning
	(meta_prefs_get_mouse_button_mods): new function

	* src/ui.c (meta_ui_parse_modifier): new function
This commit is contained in:
Havoc Pennington
2002-10-07 23:14:40 +00:00
committed by Havoc Pennington
parent 372dc090fd
commit f08337d939
11 changed files with 348 additions and 108 deletions

View File

@@ -668,6 +668,51 @@ meta_ui_parse_accelerator (const char *accel,
return TRUE;
}
gboolean
meta_ui_parse_modifier (const char *accel,
MetaVirtualModifier *mask)
{
EggVirtualModifierType gdk_mask = 0;
guint gdk_sym = 0;
*mask = 0;
if (strcmp (accel, "disabled") == 0)
return TRUE;
if (!egg_accelerator_parse_virtual (accel, &gdk_sym, &gdk_mask))
return FALSE;
if (gdk_sym != None)
return FALSE;
if (gdk_mask & EGG_VIRTUAL_RELEASE_MASK) /* we don't allow this */
return FALSE;
if (gdk_mask & EGG_VIRTUAL_SHIFT_MASK)
*mask |= META_VIRTUAL_SHIFT_MASK;
if (gdk_mask & EGG_VIRTUAL_CONTROL_MASK)
*mask |= META_VIRTUAL_CONTROL_MASK;
if (gdk_mask & EGG_VIRTUAL_ALT_MASK)
*mask |= META_VIRTUAL_ALT_MASK;
if (gdk_mask & EGG_VIRTUAL_MOD2_MASK)
*mask |= META_VIRTUAL_MOD2_MASK;
if (gdk_mask & EGG_VIRTUAL_MOD3_MASK)
*mask |= META_VIRTUAL_MOD3_MASK;
if (gdk_mask & EGG_VIRTUAL_MOD4_MASK)
*mask |= META_VIRTUAL_MOD4_MASK;
if (gdk_mask & EGG_VIRTUAL_MOD5_MASK)
*mask |= META_VIRTUAL_MOD5_MASK;
if (gdk_mask & EGG_VIRTUAL_SUPER_MASK)
*mask |= META_VIRTUAL_SUPER_MASK;
if (gdk_mask & EGG_VIRTUAL_HYPER_MASK)
*mask |= META_VIRTUAL_HYPER_MASK;
if (gdk_mask & EGG_VIRTUAL_META_MASK)
*mask |= META_VIRTUAL_META_MASK;
return TRUE;
}
gboolean
meta_ui_window_is_widget (MetaUI *ui,
Window xwindow)