diff options
Diffstat (limited to 'managers/clutter/matchbox-window-manager-2-clutter.c')
-rw-r--r-- | managers/clutter/matchbox-window-manager-2-clutter.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/managers/clutter/matchbox-window-manager-2-clutter.c b/managers/clutter/matchbox-window-manager-2-clutter.c index ab3b227..68d0431 100644 --- a/managers/clutter/matchbox-window-manager-2-clutter.c +++ b/managers/clutter/matchbox-window-manager-2-clutter.c @@ -4,10 +4,6 @@ #include <matchbox/matchbox.h> #include <signal.h> -#if USE_GTK -#include <gdk/gdkx.h> -#endif - enum { KEY_ACTION_PAGE_NEXT, KEY_ACTION_PAGE_PREV, @@ -76,6 +72,15 @@ key_binding_func (MBWMManager *wm, } } +ClutterX11FilterReturn +forward_xevent (XEvent *xevent, + ClutterEvent *event, + void *user_data) +{ + mb_wm_manager_handle_xlib_event (wm, xevent); + return CLUTTER_X11_FILTER_CONTINUE; +} + int main(int argc, char **argv) { @@ -91,35 +96,22 @@ main(int argc, char **argv) mb_wm_object_init(); -#if USE_GTK - printf ("initializing gtk\n"); - - gtk_init (&argc, &argv); - dpy = GDK_DISPLAY(); -#endif - - /* - * If using clutter, we share the display connection, and hook - * our xevent handler into the clutter main loop. - * - * If we are also doing gtk integration, we need to make clutter to - * use the gtk display connection. + /* We share Clutter's display connection, and hook our xevent + * handler into the clutter main loop. */ if (dpy) clutter_x11_set_display (dpy); -#if USE_GTK - clutter_x11_disable_event_retrieval (); -#endif - clutter_init (&argc, &argv); if (!dpy) dpy = clutter_x11_get_default_display (); + clutter_x11_add_filter (forward_xevent, wm); + wm = mb_wm_manager_new_with_dpy (argc, argv, dpy); compositor = mb_wm_comp_mgr_clutter_new (wm); - mb_wm_manager_run_with_compositor (wm, compositor); + mb_wm_manager_start_with_compositor (wm, compositor); mb_wm_object_unref (MB_WM_OBJECT (compositor)); if (wm == NULL) @@ -143,7 +135,7 @@ main(int argc, char **argv) NULL, (void*)KEY_ACTION_PAGE_PREV); - mb_wm_manager_main_loop(wm); + clutter_main (); mb_wm_object_unref (MB_WM_OBJECT (wm)); |