summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagn@redhat.com>2013-08-16 15:03:03 +0200
committerGiovanni Campagna <gcampagn@redhat.com>2013-08-20 14:21:52 +0200
commit3f2dcf16983e44fb67df166428e1fb2427a015b7 (patch)
tree7f6b97eb1aefa86ba6cf6fb8f92cf53ab4757c4b
parent44097c1b371a721709c71ed375dc92de9e879efe (diff)
downloadmutter-3f2dcf16983e44fb67df166428e1fb2427a015b7.tar.gz
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
-rw-r--r--src/compositor/compositor-private.h2
-rw-r--r--src/compositor/compositor.c11
-rw-r--r--src/compositor/meta-plugin.c8
-rw-r--r--src/meta/meta-plugin.h2
4 files changed, 10 insertions, 13 deletions
diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h
index acb8d3c22..0ebf3a439 100644
--- a/src/compositor/compositor-private.h
+++ b/src/compositor/compositor-private.h
@@ -66,8 +66,6 @@ void meta_switch_workspace_completed (MetaScreen *screen);
gboolean meta_begin_modal_for_plugin (MetaScreen *screen,
MetaPlugin *plugin,
- Window grab_window,
- Cursor cursor,
MetaModalOptions options,
guint32 timestamp);
void meta_end_modal_for_plugin (MetaScreen *screen,
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 89235e641..9a864448e 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -412,8 +412,6 @@ meta_stage_is_focused (MetaScreen *screen)
gboolean
meta_begin_modal_for_plugin (MetaScreen *screen,
MetaPlugin *plugin,
- Window grab_window,
- Cursor cursor,
MetaModalOptions options,
guint32 timestamp)
{
@@ -424,10 +422,19 @@ meta_begin_modal_for_plugin (MetaScreen *screen,
MetaDisplay *display = meta_screen_get_display (screen);
Display *xdpy = meta_display_get_xdisplay (display);
MetaCompositor *compositor = display->compositor;
+ ClutterStage *stage;
+ Window grab_window;
+ Cursor cursor = None;
gboolean pointer_grabbed = FALSE;
gboolean keyboard_grabbed = FALSE;
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)
return FALSE;
diff --git a/src/compositor/meta-plugin.c b/src/compositor/meta-plugin.c
index daf582435..ba8b9cbd9 100644
--- a/src/compositor/meta-plugin.c
+++ b/src/compositor/meta-plugin.c
@@ -267,10 +267,6 @@ meta_plugin_destroy_completed (MetaPlugin *plugin,
/**
* meta_plugin_begin_modal:
* @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
* @timestamp: the timestamp used for establishing grabs
*
@@ -291,15 +287,13 @@ meta_plugin_destroy_completed (MetaPlugin *plugin,
*/
gboolean
meta_plugin_begin_modal (MetaPlugin *plugin,
- Window grab_window,
- Cursor cursor,
MetaModalOptions options,
guint32 timestamp)
{
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
return meta_begin_modal_for_plugin (priv->screen, plugin,
- grab_window, cursor, options, timestamp);
+ options, timestamp);
}
/**
diff --git a/src/meta/meta-plugin.h b/src/meta/meta-plugin.h
index d2643c2a9..0587551c8 100644
--- a/src/meta/meta-plugin.h
+++ b/src/meta/meta-plugin.h
@@ -396,8 +396,6 @@ typedef enum {
gboolean
meta_plugin_begin_modal (MetaPlugin *plugin,
- Window grab_window,
- Cursor cursor,
MetaModalOptions options,
guint32 timestamp);