mirror of
https://github.com/brl/mutter.git
synced 2024-12-01 04:10:43 -05:00
MetaScreen::keyboard-grabbed property
gboolean read-only property that tracks the all_keys_grabbed flag of MetaScreen.
This commit is contained in:
parent
1d5117a607
commit
2a8c160569
@ -940,7 +940,10 @@ meta_screen_grab_all_keys (MetaScreen *screen, guint32 timestamp)
|
|||||||
"Grabbing all keys on RootWindow\n");
|
"Grabbing all keys on RootWindow\n");
|
||||||
retval = grab_keyboard (screen->display, screen->xroot, timestamp);
|
retval = grab_keyboard (screen->display, screen->xroot, timestamp);
|
||||||
if (retval)
|
if (retval)
|
||||||
|
{
|
||||||
screen->all_keys_grabbed = TRUE;
|
screen->all_keys_grabbed = TRUE;
|
||||||
|
g_object_notify (G_OBJECT (screen), "keyboard-grabbed");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
meta_screen_grab_keys (screen);
|
meta_screen_grab_keys (screen);
|
||||||
|
|
||||||
@ -959,6 +962,7 @@ meta_screen_ungrab_all_keys (MetaScreen *screen, guint32 timestamp)
|
|||||||
|
|
||||||
/* Re-establish our standard bindings */
|
/* Re-establish our standard bindings */
|
||||||
meta_screen_grab_keys (screen);
|
meta_screen_grab_keys (screen);
|
||||||
|
g_object_notify (G_OBJECT (screen), "keyboard-grabbed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,8 @@ static void meta_screen_sn_event (SnMonitorEvent *event,
|
|||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_N_WORKSPACES = 1
|
PROP_N_WORKSPACES = 1,
|
||||||
|
PROP_KEYBOARD_GRABBED,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -118,6 +119,9 @@ meta_screen_get_property (GObject *object,
|
|||||||
case PROP_N_WORKSPACES:
|
case PROP_N_WORKSPACES:
|
||||||
g_value_set_int (value, meta_screen_get_n_workspaces (screen));
|
g_value_set_int (value, meta_screen_get_n_workspaces (screen));
|
||||||
break;
|
break;
|
||||||
|
case PROP_KEYBOARD_GRABBED:
|
||||||
|
g_value_set_boolean (value, screen->all_keys_grabbed ? TRUE : FALSE);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -167,6 +171,16 @@ meta_screen_class_init (MetaScreenClass *klass)
|
|||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_N_WORKSPACES,
|
PROP_N_WORKSPACES,
|
||||||
pspec);
|
pspec);
|
||||||
|
|
||||||
|
pspec = g_param_spec_boolean ("keyboard-grabbed",
|
||||||
|
"Keyboard grabbed",
|
||||||
|
"Whether the keyboard is grabbed",
|
||||||
|
FALSE,
|
||||||
|
G_PARAM_READABLE);
|
||||||
|
|
||||||
|
g_object_class_install_property (object_class,
|
||||||
|
PROP_KEYBOARD_GRABBED,
|
||||||
|
pspec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user