mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 03:20:46 -05:00
MetaPlugin: simplify the modal API
Remove grab window and cursor from the API, and just grab always on the stage window with no cursor. This is mainly to remove the X11 usage in the public API, in preparation for implementing this in wayland. https://bugzilla.gnome.org/show_bug.cgi?id=705917
This commit is contained in:
parent
d26f248b0f
commit
75f3ae14b5
@ -66,8 +66,6 @@ void meta_switch_workspace_completed (MetaScreen *screen);
|
|||||||
|
|
||||||
gboolean meta_begin_modal_for_plugin (MetaScreen *screen,
|
gboolean meta_begin_modal_for_plugin (MetaScreen *screen,
|
||||||
MetaPlugin *plugin,
|
MetaPlugin *plugin,
|
||||||
Window grab_window,
|
|
||||||
Cursor cursor,
|
|
||||||
MetaModalOptions options,
|
MetaModalOptions options,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
void meta_end_modal_for_plugin (MetaScreen *screen,
|
void meta_end_modal_for_plugin (MetaScreen *screen,
|
||||||
|
@ -423,8 +423,6 @@ meta_stage_is_focused (MetaScreen *screen)
|
|||||||
gboolean
|
gboolean
|
||||||
meta_begin_modal_for_plugin (MetaScreen *screen,
|
meta_begin_modal_for_plugin (MetaScreen *screen,
|
||||||
MetaPlugin *plugin,
|
MetaPlugin *plugin,
|
||||||
Window grab_window,
|
|
||||||
Cursor cursor,
|
|
||||||
MetaModalOptions options,
|
MetaModalOptions options,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
@ -435,10 +433,19 @@ meta_begin_modal_for_plugin (MetaScreen *screen,
|
|||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
Display *xdpy = meta_display_get_xdisplay (display);
|
Display *xdpy = meta_display_get_xdisplay (display);
|
||||||
MetaCompositor *compositor = display->compositor;
|
MetaCompositor *compositor = display->compositor;
|
||||||
|
ClutterStage *stage;
|
||||||
|
Window grab_window;
|
||||||
|
Cursor cursor = None;
|
||||||
gboolean pointer_grabbed = FALSE;
|
gboolean pointer_grabbed = FALSE;
|
||||||
gboolean keyboard_grabbed = FALSE;
|
gboolean keyboard_grabbed = FALSE;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
|
||||||
|
if (!stage)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
grab_window = clutter_x11_get_stage_window (stage);
|
||||||
|
|
||||||
if (compositor->modal_plugin != NULL || display->grab_op != META_GRAB_OP_NONE)
|
if (compositor->modal_plugin != NULL || display->grab_op != META_GRAB_OP_NONE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -266,10 +266,6 @@ meta_plugin_destroy_completed (MetaPlugin *plugin,
|
|||||||
/**
|
/**
|
||||||
* meta_plugin_begin_modal:
|
* meta_plugin_begin_modal:
|
||||||
* @plugin: a #MetaPlugin
|
* @plugin: a #MetaPlugin
|
||||||
* @grab_window: the X window to grab the keyboard and mouse on
|
|
||||||
* @cursor: the cursor to use for the pointer grab, or None,
|
|
||||||
* to use the normal cursor for the grab window and
|
|
||||||
* its descendants.
|
|
||||||
* @options: flags that modify the behavior of the modal grab
|
* @options: flags that modify the behavior of the modal grab
|
||||||
* @timestamp: the timestamp used for establishing grabs
|
* @timestamp: the timestamp used for establishing grabs
|
||||||
*
|
*
|
||||||
@ -290,15 +286,13 @@ meta_plugin_destroy_completed (MetaPlugin *plugin,
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
meta_plugin_begin_modal (MetaPlugin *plugin,
|
meta_plugin_begin_modal (MetaPlugin *plugin,
|
||||||
Window grab_window,
|
|
||||||
Cursor cursor,
|
|
||||||
MetaModalOptions options,
|
MetaModalOptions options,
|
||||||
guint32 timestamp)
|
guint32 timestamp)
|
||||||
{
|
{
|
||||||
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||||
|
|
||||||
return meta_begin_modal_for_plugin (priv->screen, plugin,
|
return meta_begin_modal_for_plugin (priv->screen, plugin,
|
||||||
grab_window, cursor, options, timestamp);
|
options, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -376,8 +376,6 @@ typedef enum {
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_plugin_begin_modal (MetaPlugin *plugin,
|
meta_plugin_begin_modal (MetaPlugin *plugin,
|
||||||
Window grab_window,
|
|
||||||
Cursor cursor,
|
|
||||||
MetaModalOptions options,
|
MetaModalOptions options,
|
||||||
guint32 timestamp);
|
guint32 timestamp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user