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

@ -1,3 +1,27 @@
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
2002-10-07 Havoc Pennington <hp@pobox.com> 2002-10-07 Havoc Pennington <hp@pobox.com>
* src/async-getprop.c: don't include unportable Xproto.h, fix from * src/async-getprop.c: don't include unportable Xproto.h, fix from

View File

@ -2,3 +2,4 @@
Focus windows on map: see http://bugzilla.gnome.org/show_bug.cgi?id=82921 Focus windows on map: see http://bugzilla.gnome.org/show_bug.cgi?id=82921
Keep panel always on top: http://bugzilla.gnome.org/show_bug.cgi?id=81551 Keep panel always on top: http://bugzilla.gnome.org/show_bug.cgi?id=81551
Edge flipping: http://bugzilla.gnome.org/show_bug.cgi?id=82917 Edge flipping: http://bugzilla.gnome.org/show_bug.cgi?id=82917
Opaque resize: http://bugzilla.gnome.org/show_bug.cgi?id=92618

View File

@ -79,6 +79,10 @@ static void process_selection_request (MetaDisplay *display,
static void process_selection_clear (MetaDisplay *display, static void process_selection_clear (MetaDisplay *display,
XEvent *event); XEvent *event);
static void update_window_grab_modifiers (MetaDisplay *display);
static void prefs_changed_callback (MetaPreference pref,
void *data);
static int static int
set_utf8_string_hint (MetaDisplay *display, set_utf8_string_hint (MetaDisplay *display,
@ -275,6 +279,10 @@ meta_display_open (const char *name)
meta_display_init_keys (display); meta_display_init_keys (display);
update_window_grab_modifiers (display);
meta_prefs_add_listener (prefs_changed_callback, display);
XInternAtoms (display->xdisplay, atom_names, G_N_ELEMENTS (atom_names), XInternAtoms (display->xdisplay, atom_names, G_N_ELEMENTS (atom_names),
False, atoms); False, atoms);
display->atom_net_wm_name = atoms[0]; display->atom_net_wm_name = atoms[0];
@ -365,45 +373,7 @@ meta_display_open (const char *name)
display->groups_by_leader = NULL; display->groups_by_leader = NULL;
screens = NULL; display->screens = NULL;
#ifdef HAVE_GTK_MULTIHEAD
i = 0;
while (i < ScreenCount (xdisplay))
{
MetaScreen *screen;
screen = meta_screen_new (display, i);
if (screen)
screens = g_slist_prepend (screens, screen);
++i;
}
#else
{
MetaScreen *screen;
screen = meta_screen_new (display, DefaultScreen (xdisplay));
if (screen)
screens = g_slist_prepend (screens, screen);
}
#endif
if (screens == NULL)
{
/* This would typically happen because all the screens already
* have window managers
*/
#ifndef USE_GDK_DISPLAY
XCloseDisplay (xdisplay);
#endif
all_displays = g_slist_remove (all_displays, display);
g_free (display->name);
g_free (display);
return FALSE;
}
display->screens = screens;
#ifdef USE_GDK_DISPLAY #ifdef USE_GDK_DISPLAY
display->events = NULL; display->events = NULL;
@ -442,6 +412,44 @@ meta_display_open (const char *name)
display->grab_screen = NULL; display->grab_screen = NULL;
display->grab_resize_popup = NULL; display->grab_resize_popup = NULL;
screens = NULL;
#ifdef HAVE_GTK_MULTIHEAD
i = 0;
while (i < ScreenCount (xdisplay))
{
MetaScreen *screen;
screen = meta_screen_new (display, i);
if (screen)
screens = g_slist_prepend (screens, screen);
++i;
}
#else
{
MetaScreen *screen;
screen = meta_screen_new (display, DefaultScreen (xdisplay));
if (screen)
screens = g_slist_prepend (screens, screen);
}
#endif
display->screens = screens;
if (screens == NULL)
{
/* This would typically happen because all the screens already
* have window managers.
*/
meta_display_close (display);
return FALSE;
}
/* display->leader_window was created as a side effect of
* initializing the screens
*/
set_utf8_string_hint (display, set_utf8_string_hint (display,
display->leader_window, display->leader_window,
display->atom_net_wm_name, display->atom_net_wm_name,
@ -469,6 +477,7 @@ meta_display_open (const char *name)
} }
meta_display_grab (display); meta_display_grab (display);
/* Now manage all existing windows */ /* Now manage all existing windows */
tmp = display->screens; tmp = display->screens;
while (tmp != NULL) while (tmp != NULL)
@ -580,6 +589,8 @@ meta_display_close (MetaDisplay *display)
display->closing += 1; display->closing += 1;
meta_prefs_remove_listener (prefs_changed_callback, display);
if (display->autoraise_timeout_id != 0) if (display->autoraise_timeout_id != 0)
{ {
g_source_remove (display->autoraise_timeout_id); g_source_remove (display->autoraise_timeout_id);
@ -1046,10 +1057,10 @@ event_callback (XEvent *event,
else if (window && display->grab_op == META_GRAB_OP_NONE) else if (window && display->grab_op == META_GRAB_OP_NONE)
{ {
gboolean begin_move = FALSE; gboolean begin_move = FALSE;
guint grab_mask; unsigned int grab_mask;
gboolean unmodified; gboolean unmodified;
grab_mask = Mod1Mask; grab_mask = display->window_grab_modifiers;
if (g_getenv ("METACITY_DEBUG_BUTTON_GRABS")) if (g_getenv ("METACITY_DEBUG_BUTTON_GRABS"))
grab_mask |= ControlMask; grab_mask |= ControlMask;
@ -2581,6 +2592,7 @@ meta_display_grab_window_buttons (MetaDisplay *display,
* XSync() * XSync()
*/ */
if (display->window_grab_modifiers != 0)
{ {
gboolean debug = g_getenv ("METACITY_DEBUG_BUTTON_GRABS") != NULL; gboolean debug = g_getenv ("METACITY_DEBUG_BUTTON_GRABS") != NULL;
int i = 1; int i = 1;
@ -2590,8 +2602,7 @@ meta_display_grab_window_buttons (MetaDisplay *display,
xwindow, xwindow,
TRUE, TRUE,
FALSE, FALSE,
i, Mod1Mask); i, display->window_grab_modifiers);
/* This is for debugging, since I end up moving the Xnest /* This is for debugging, since I end up moving the Xnest
* otherwise ;-) * otherwise ;-)
@ -2611,12 +2622,20 @@ void
meta_display_ungrab_window_buttons (MetaDisplay *display, meta_display_ungrab_window_buttons (MetaDisplay *display,
Window xwindow) Window xwindow)
{ {
gboolean debug = g_getenv ("METACITY_DEBUG_BUTTON_GRABS") != NULL; gboolean debug;
int i = 1; int i;
if (display->window_grab_modifiers == 0)
return;
debug = g_getenv ("METACITY_DEBUG_BUTTON_GRABS") != NULL;
i = 1;
while (i < 4) while (i < 4)
{ {
meta_change_button_grab (display, xwindow, meta_change_button_grab (display, xwindow,
FALSE, FALSE, i, Mod1Mask); FALSE, FALSE, i,
display->window_grab_modifiers);
if (debug) if (debug)
meta_change_button_grab (display, xwindow, meta_change_button_grab (display, xwindow,
FALSE, FALSE, i, ControlMask); FALSE, FALSE, i, ControlMask);
@ -3495,3 +3514,85 @@ meta_display_unmanage_windows_for_screen (MetaDisplay *display,
} }
g_slist_free (winlist); g_slist_free (winlist);
} }
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
update_window_grab_modifiers (MetaDisplay *display)
{
MetaVirtualModifier virtual_mods;
unsigned int mods;
virtual_mods = meta_prefs_get_mouse_button_mods ();
meta_display_devirtualize_modifiers (display, virtual_mods,
&mods);
display->window_grab_modifiers = mods;
}
static void
prefs_changed_callback (MetaPreference pref,
void *data)
{
if (pref == META_PREF_MOUSE_BUTTON_MODS)
{
MetaDisplay *display = data;
GSList *windows;
GSList *tmp;
windows = meta_display_list_windows (display);
/* Ungrab all */
tmp = windows;
while (tmp != NULL)
{
MetaWindow *w = tmp->data;
meta_display_ungrab_window_buttons (display, w->xwindow);
meta_display_ungrab_focus_window_button (display, w->xwindow);
tmp = tmp->next;
}
/* change our modifier */
update_window_grab_modifiers (display);
/* Grab all */
tmp = windows;
while (tmp != NULL)
{
MetaWindow *w = tmp->data;
meta_display_grab_focus_window_button (display, w->xwindow);
meta_display_grab_window_buttons (display, w->xwindow);
tmp = tmp->next;
}
g_slist_free (windows);
}
}

View File

@ -205,6 +205,9 @@ struct _MetaDisplay
/* Pending autoraise */ /* Pending autoraise */
guint autoraise_timeout_id; guint autoraise_timeout_id;
/* Alt+click button grabs */
unsigned int window_grab_modifiers;
/* current window operation */ /* current window operation */
MetaGrabOp grab_op; MetaGrabOp grab_op;
MetaScreen *grab_screen; MetaScreen *grab_screen;
@ -382,4 +385,8 @@ gboolean meta_rectangle_intersect (MetaRectangle *src1,
MetaRectangle *src2, MetaRectangle *src2,
MetaRectangle *dest); MetaRectangle *dest);
void meta_display_devirtualize_modifiers (MetaDisplay *display,
MetaVirtualModifier modifiers,
unsigned int *mask);
#endif #endif

View File

@ -439,35 +439,6 @@ reload_keycodes (MetaDisplay *display)
} }
} }
static void
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
reload_modifiers (MetaDisplay *display) reload_modifiers (MetaDisplay *display)
{ {
@ -481,7 +452,7 @@ reload_modifiers (MetaDisplay *display)
i = 0; i = 0;
while (display->screen_bindings[i].keysym != None) while (display->screen_bindings[i].keysym != None)
{ {
devirtualize_modifiers (display, meta_display_devirtualize_modifiers (display,
display->screen_bindings[i].modifiers, display->screen_bindings[i].modifiers,
&display->screen_bindings[i].mask); &display->screen_bindings[i].mask);
@ -496,7 +467,7 @@ reload_modifiers (MetaDisplay *display)
i = 0; i = 0;
while (display->window_bindings[i].keysym != None) while (display->window_bindings[i].keysym != None)
{ {
devirtualize_modifiers (display, meta_display_devirtualize_modifiers (display,
display->window_bindings[i].modifiers, display->window_bindings[i].modifiers,
&display->window_bindings[i].mask); &display->window_bindings[i].mask);

View File

@ -3,6 +3,24 @@
<!-- General preferences --> <!-- General preferences -->
<schema>
<key>/schemas/apps/metacity/general/mouse_button_modifier</key>
<applyto>/apps/metacity/general/mouse_button_modifier</applyto>
<owner>metacity</owner>
<type>string</type>
<default>&lt;Alt&gt;</default>
<locale name="C">
<short>Modifier to use for modified window click actions (Alt+left/middle/right click)</short>
<long>
Clicking a window while holding down this modifier key
will move the window (left click), resize the window
(middle click), or show the window menu (right click).
Modifier is expressed as "&lt;Alt&gt;" or "&lt;Super&gt;"
for example.
</long>
</locale>
</schema>
<schema> <schema>
<key>/schemas/apps/metacity/general/focus_mode</key> <key>/schemas/apps/metacity/general/focus_mode</key>
<applyto>/apps/metacity/general/focus_mode</applyto> <applyto>/apps/metacity/general/focus_mode</applyto>

View File

@ -30,6 +30,7 @@
/* If you add a key, it needs updating in init() and in the gconf /* If you add a key, it needs updating in init() and in the gconf
* notify listener and of course in the .schemas file * notify listener and of course in the .schemas file
*/ */
#define KEY_MOUSE_BUTTON_MODS "/apps/metacity/general/mouse_button_modifier"
#define KEY_FOCUS_MODE "/apps/metacity/general/focus_mode" #define KEY_FOCUS_MODE "/apps/metacity/general/focus_mode"
#define KEY_AUTO_RAISE "/apps/metacity/general/auto_raise" #define KEY_AUTO_RAISE "/apps/metacity/general/auto_raise"
#define KEY_AUTO_RAISE_DELAY "/apps/metacity/general/auto_raise_delay" #define KEY_AUTO_RAISE_DELAY "/apps/metacity/general/auto_raise_delay"
@ -50,6 +51,7 @@ static GList *changes = NULL;
static guint changed_idle; static guint changed_idle;
static gboolean use_system_font = TRUE; static gboolean use_system_font = TRUE;
static PangoFontDescription *titlebar_font = NULL; static PangoFontDescription *titlebar_font = NULL;
static MetaVirtualModifier mouse_button_mods = Mod1Mask;
static MetaFocusMode focus_mode = META_FOCUS_MODE_CLICK; static MetaFocusMode focus_mode = META_FOCUS_MODE_CLICK;
static char* current_theme = NULL; static char* current_theme = NULL;
static int num_workspaces = 4; static int num_workspaces = 4;
@ -63,6 +65,7 @@ static char *commands[NUM_COMMANDS] = { NULL, NULL, NULL, NULL, NULL, NULL,
static gboolean update_use_system_font (gboolean value); static gboolean update_use_system_font (gboolean value);
static gboolean update_titlebar_font (const char *value); static gboolean update_titlebar_font (const char *value);
static gboolean update_mouse_button_mods (const char *value);
static gboolean update_focus_mode (const char *value); static gboolean update_focus_mode (const char *value);
static gboolean update_theme (const char *value); static gboolean update_theme (const char *value);
static gboolean update_num_workspaces (int value); static gboolean update_num_workspaces (int value);
@ -236,6 +239,12 @@ meta_prefs_init (void)
&err); &err);
cleanup_error (&err); cleanup_error (&err);
str_val = gconf_client_get_string (default_client, KEY_MOUSE_BUTTON_MODS,
&err);
cleanup_error (&err);
update_mouse_button_mods (str_val);
g_free (str_val);
str_val = gconf_client_get_string (default_client, KEY_FOCUS_MODE, str_val = gconf_client_get_string (default_client, KEY_FOCUS_MODE,
&err); &err);
cleanup_error (&err); cleanup_error (&err);
@ -337,6 +346,22 @@ change_notify (GConfClient *client,
key = gconf_entry_get_key (entry); key = gconf_entry_get_key (entry);
value = gconf_entry_get_value (entry); value = gconf_entry_get_value (entry);
if (strcmp (key, KEY_MOUSE_BUTTON_MODS) == 0)
{
const char *str;
if (value && value->type != GCONF_VALUE_STRING)
{
meta_warning (_("GConf key \"%s\" is set to an invalid type\n"),
KEY_MOUSE_BUTTON_MODS);
goto out;
}
str = value ? gconf_value_get_string (value) : NULL;
if (update_mouse_button_mods (str))
queue_changed (META_PREF_MOUSE_BUTTON_MODS);
}
if (strcmp (key, KEY_FOCUS_MODE) == 0) if (strcmp (key, KEY_FOCUS_MODE) == 0)
{ {
const char *str; const char *str;
@ -545,6 +570,36 @@ change_notify (GConfClient *client,
return; /* AIX compiler wants something after a label like out: */ return; /* AIX compiler wants something after a label like out: */
} }
static gboolean
update_mouse_button_mods (const char *value)
{
MetaVirtualModifier old_mods = mouse_button_mods;
if (value != NULL)
{
MetaVirtualModifier mods;
meta_topic (META_DEBUG_KEYBINDINGS,
"Mouse button modifier has new gconf value \"%s\"\n",
value ? value : "none");
if (meta_ui_parse_modifier (value, &mods))
{
mouse_button_mods = mods;
}
else
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Failed to parse new gconf value\n");
meta_warning (_("\"%s\" found in configuration database is not a valid value for mouse button modifier\n"),
value);
}
}
return old_mods != mouse_button_mods;
}
static gboolean static gboolean
update_focus_mode (const char *value) update_focus_mode (const char *value)
{ {
@ -559,7 +614,7 @@ update_focus_mode (const char *value)
else if (g_ascii_strcasecmp (value, "mouse") == 0) else if (g_ascii_strcasecmp (value, "mouse") == 0)
focus_mode = META_FOCUS_MODE_MOUSE; focus_mode = META_FOCUS_MODE_MOUSE;
else else
meta_warning (_("GConf key '%s' is set to an invalid value"), meta_warning (_("GConf key '%s' is set to an invalid value\n"),
KEY_FOCUS_MODE); KEY_FOCUS_MODE);
} }
@ -598,6 +653,13 @@ update_theme (const char *value)
return changed; return changed;
} }
MetaVirtualModifier
meta_prefs_get_mouse_button_mods (void)
{
return mouse_button_mods;
}
MetaFocusMode MetaFocusMode
meta_prefs_get_focus_mode (void) meta_prefs_get_focus_mode (void)
{ {
@ -767,6 +829,9 @@ meta_preference_to_string (MetaPreference pref)
{ {
switch (pref) switch (pref)
{ {
case META_PREF_MOUSE_BUTTON_MODS:
return "MOUSE_BUTTON_MODS";
case META_PREF_FOCUS_MODE: case META_PREF_FOCUS_MODE:
return "FOCUS_MODE"; return "FOCUS_MODE";
@ -1004,7 +1069,7 @@ update_binding (MetaKeyPref *binding,
{ {
meta_topic (META_DEBUG_KEYBINDINGS, meta_topic (META_DEBUG_KEYBINDINGS,
"Failed to parse new gconf value\n"); "Failed to parse new gconf value\n");
meta_warning (_("\"%s\" found in configuration database is not a valid value for keybinding \"%s\""), meta_warning (_("\"%s\" found in configuration database is not a valid value for keybinding \"%s\"\n"),
value, binding->name); value, binding->name);
} }
} }

View File

@ -28,6 +28,7 @@
typedef enum typedef enum
{ {
META_PREF_MOUSE_BUTTON_MODS,
META_PREF_FOCUS_MODE, META_PREF_FOCUS_MODE,
META_PREF_AUTO_RAISE, META_PREF_AUTO_RAISE,
META_PREF_AUTO_RAISE_DELAY, META_PREF_AUTO_RAISE_DELAY,
@ -53,6 +54,7 @@ void meta_prefs_remove_listener (MetaPrefsChangedFunc func,
void meta_prefs_init (void); void meta_prefs_init (void);
const char* meta_preference_to_string (MetaPreference pref); const char* meta_preference_to_string (MetaPreference pref);
MetaVirtualModifier meta_prefs_get_mouse_button_mods (void);
MetaFocusMode meta_prefs_get_focus_mode (void); MetaFocusMode meta_prefs_get_focus_mode (void);
const char* meta_prefs_get_theme (void); const char* meta_prefs_get_theme (void);
/* returns NULL if GTK default should be used */ /* returns NULL if GTK default should be used */

View File

@ -73,6 +73,10 @@ if test -z "$ONLY_WM"; then
done done
fi fi
if test -e ~/.Xmodmap; then
DISPLAY=$CLIENT_DISPLAY xmodmap ~/.Xmodmap
fi
usleep 50000 usleep 50000
DISPLAY=$CLIENT_DISPLAY xsetroot -solid royalblue3 DISPLAY=$CLIENT_DISPLAY xsetroot -solid royalblue3

View File

@ -668,6 +668,51 @@ meta_ui_parse_accelerator (const char *accel,
return TRUE; 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 gboolean
meta_ui_window_is_widget (MetaUI *ui, meta_ui_window_is_widget (MetaUI *ui,
Window xwindow) Window xwindow)

View File

@ -156,6 +156,8 @@ gboolean meta_ui_have_a_theme (void);
gboolean meta_ui_parse_accelerator (const char *accel, gboolean meta_ui_parse_accelerator (const char *accel,
unsigned int *keysym, unsigned int *keysym,
MetaVirtualModifier *mask); MetaVirtualModifier *mask);
gboolean meta_ui_parse_modifier (const char *accel,
MetaVirtualModifier *mask);
gboolean meta_ui_window_is_widget (MetaUI *ui, gboolean meta_ui_window_is_widget (MetaUI *ui,
Window xwindow); Window xwindow);