clutter/osx: add clutter_osx_disable_event_retrieval

https://bugzilla.gnome.org/show_bug.cgi?id=719962
This commit is contained in:
cee1 2013-12-04 10:43:56 +08:00 committed by Emmanuele Bassi
parent d005c6a880
commit 9efda7eac7
2 changed files with 21 additions and 2 deletions

View File

@ -42,6 +42,9 @@
G_DEFINE_TYPE (ClutterBackendOSX, clutter_backend_osx, CLUTTER_TYPE_BACKEND)
/* various flags corresponding to pre init setup calls */
static gboolean _no_event_retrieval = FALSE;
/*************************************************************************/
static gboolean
clutter_backend_osx_post_parse (ClutterBackend *backend,
@ -73,6 +76,19 @@ clutter_backend_osx_post_parse (ClutterBackend *backend,
return TRUE;
}
void
clutter_osx_disable_event_retrieval (void)
{
if (_clutter_context_is_initialized ())
{
g_warning ("clutter_osx_disable_event_retrieval() can only be "
"called before clutter_init()");
return;
}
_no_event_retrieval = TRUE;
}
static ClutterFeatureFlags
clutter_backend_osx_get_features (ClutterBackend *backend)
{
@ -95,7 +111,8 @@ _clutter_backend_osx_events_init (ClutterBackend *backend)
"backend", CLUTTER_BACKEND(backend_osx),
NULL);
_clutter_osx_event_loop_init ();
if (!_no_event_retrieval)
_clutter_osx_event_loop_init ();
}
static gboolean

View File

@ -24,7 +24,7 @@
#import <AppKit/AppKit.h>
#include <clutter/clutter-stage.h>
#include <clutter/clutter.h>
@class NSEvent;
@ -38,6 +38,8 @@ void _clutter_events_osx_uninit (void);
void _clutter_event_osx_put (NSEvent *nsevent, ClutterStage *wrapper);
void clutter_osx_disable_event_retrieval (void);
G_END_DECLS
#endif /* __CLUTTER_OSX_H__ */