mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 04:22:05 +00:00
backend-x11: Take the touch grab on the stage window
So we don't get assert fails when touching the screen on mutter nested.
This commit is contained in:
parent
c5abf5ddbb
commit
3b85e4b2b9
@ -50,6 +50,7 @@ struct _MetaBackendClass
|
|||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
|
|
||||||
void (* post_init) (MetaBackend *backend);
|
void (* post_init) (MetaBackend *backend);
|
||||||
|
void (* compositor_created) (MetaBackend *backend);
|
||||||
|
|
||||||
MetaIdleMonitor * (* create_idle_monitor) (MetaBackend *backend,
|
MetaIdleMonitor * (* create_idle_monitor) (MetaBackend *backend,
|
||||||
int device_id);
|
int device_id);
|
||||||
|
@ -79,6 +79,11 @@ meta_backend_real_post_init (MetaBackend *backend)
|
|||||||
priv->cursor_renderer = META_BACKEND_GET_CLASS (backend)->create_cursor_renderer (backend);
|
priv->cursor_renderer = META_BACKEND_GET_CLASS (backend)->create_cursor_renderer (backend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_backend_real_compositor_created (MetaBackend *backend)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static MetaCursorRenderer *
|
static MetaCursorRenderer *
|
||||||
meta_backend_real_create_cursor_renderer (MetaBackend *backend)
|
meta_backend_real_create_cursor_renderer (MetaBackend *backend)
|
||||||
{
|
{
|
||||||
@ -114,6 +119,7 @@ meta_backend_class_init (MetaBackendClass *klass)
|
|||||||
klass->create_cursor_renderer = meta_backend_real_create_cursor_renderer;
|
klass->create_cursor_renderer = meta_backend_real_create_cursor_renderer;
|
||||||
klass->grab_device = meta_backend_real_grab_device;
|
klass->grab_device = meta_backend_real_grab_device;
|
||||||
klass->ungrab_device = meta_backend_real_ungrab_device;
|
klass->ungrab_device = meta_backend_real_ungrab_device;
|
||||||
|
klass->compositor_created = meta_backend_real_compositor_created;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -145,6 +151,12 @@ meta_backend_post_init (MetaBackend *backend)
|
|||||||
META_BACKEND_GET_CLASS (backend)->post_init (backend);
|
META_BACKEND_GET_CLASS (backend)->post_init (backend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_backend_compositor_created (MetaBackend *backend)
|
||||||
|
{
|
||||||
|
META_BACKEND_GET_CLASS (backend)->compositor_created (backend);
|
||||||
|
}
|
||||||
|
|
||||||
MetaIdleMonitor *
|
MetaIdleMonitor *
|
||||||
meta_backend_get_idle_monitor (MetaBackend *backend,
|
meta_backend_get_idle_monitor (MetaBackend *backend,
|
||||||
int device_id)
|
int device_id)
|
||||||
|
@ -38,6 +38,8 @@ GType meta_backend_get_type (void);
|
|||||||
|
|
||||||
MetaBackend * meta_get_backend (void);
|
MetaBackend * meta_get_backend (void);
|
||||||
|
|
||||||
|
void meta_backend_compositor_created (MetaBackend *backend);
|
||||||
|
|
||||||
MetaIdleMonitor * meta_backend_get_idle_monitor (MetaBackend *backend,
|
MetaIdleMonitor * meta_backend_get_idle_monitor (MetaBackend *backend,
|
||||||
int device_id);
|
int device_id);
|
||||||
MetaMonitorManager * meta_backend_get_monitor_manager (MetaBackend *backend);
|
MetaMonitorManager * meta_backend_get_monitor_manager (MetaBackend *backend);
|
||||||
|
@ -266,7 +266,7 @@ take_touch_grab (MetaBackend *backend)
|
|||||||
XISetMask (mask.mask, XI_TouchEnd);
|
XISetMask (mask.mask, XI_TouchEnd);
|
||||||
|
|
||||||
XIGrabTouchBegin (priv->xdisplay, META_VIRTUAL_CORE_POINTER_ID,
|
XIGrabTouchBegin (priv->xdisplay, META_VIRTUAL_CORE_POINTER_ID,
|
||||||
DefaultRootWindow (priv->xdisplay),
|
meta_backend_x11_get_xwindow (x11),
|
||||||
False, &mask, 1, &mods);
|
False, &mask, 1, &mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,11 +307,15 @@ meta_backend_x11_post_init (MetaBackend *backend)
|
|||||||
meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
|
meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
take_touch_grab (backend);
|
|
||||||
|
|
||||||
META_BACKEND_CLASS (meta_backend_x11_parent_class)->post_init (backend);
|
META_BACKEND_CLASS (meta_backend_x11_parent_class)->post_init (backend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_backend_x11_compositor_created (MetaBackend *backend)
|
||||||
|
{
|
||||||
|
take_touch_grab (backend);
|
||||||
|
}
|
||||||
|
|
||||||
static MetaIdleMonitor *
|
static MetaIdleMonitor *
|
||||||
meta_backend_x11_create_idle_monitor (MetaBackend *backend,
|
meta_backend_x11_create_idle_monitor (MetaBackend *backend,
|
||||||
int device_id)
|
int device_id)
|
||||||
@ -408,6 +412,7 @@ meta_backend_x11_class_init (MetaBackendX11Class *klass)
|
|||||||
MetaBackendClass *backend_class = META_BACKEND_CLASS (klass);
|
MetaBackendClass *backend_class = META_BACKEND_CLASS (klass);
|
||||||
|
|
||||||
backend_class->post_init = meta_backend_x11_post_init;
|
backend_class->post_init = meta_backend_x11_post_init;
|
||||||
|
backend_class->compositor_created = meta_backend_x11_compositor_created;
|
||||||
backend_class->create_idle_monitor = meta_backend_x11_create_idle_monitor;
|
backend_class->create_idle_monitor = meta_backend_x11_create_idle_monitor;
|
||||||
backend_class->create_monitor_manager = meta_backend_x11_create_monitor_manager;
|
backend_class->create_monitor_manager = meta_backend_x11_create_monitor_manager;
|
||||||
backend_class->create_cursor_renderer = meta_backend_x11_create_cursor_renderer;
|
backend_class->create_cursor_renderer = meta_backend_x11_create_cursor_renderer;
|
||||||
|
@ -822,6 +822,8 @@ meta_display_open (void)
|
|||||||
|
|
||||||
enable_compositor (display);
|
enable_compositor (display);
|
||||||
|
|
||||||
|
meta_backend_compositor_created (meta_get_backend ());
|
||||||
|
|
||||||
meta_screen_create_guard_window (screen);
|
meta_screen_create_guard_window (screen);
|
||||||
|
|
||||||
/* Set up touch support */
|
/* Set up touch support */
|
||||||
|
Loading…
Reference in New Issue
Block a user