clutter: Remove main loop helper

It's expected to always use meta_*() or your own main loop.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
This commit is contained in:
Jonas Ådahl 2020-07-09 21:45:41 +02:00
parent 961a1376cd
commit e848414f89
2 changed files with 0 additions and 81 deletions

View File

@ -90,9 +90,6 @@ static guint clutter_default_fps = 60;
static ClutterTextDirection clutter_text_direction = CLUTTER_TEXT_DIRECTION_LTR; static ClutterTextDirection clutter_text_direction = CLUTTER_TEXT_DIRECTION_LTR;
static guint clutter_main_loop_level = 0;
static GSList *main_loops = NULL;
/* debug flags */ /* debug flags */
guint clutter_debug_flags = 0; guint clutter_debug_flags = 0;
guint clutter_paint_debug_flags = 0; guint clutter_paint_debug_flags = 0;
@ -443,76 +440,6 @@ clutter_get_text_direction (void)
return dir; return dir;
} }
/**
* clutter_main_quit:
*
* Terminates the Clutter mainloop.
*/
void
clutter_main_quit (void)
{
if (main_loops == NULL)
{
g_critical ("Calling clutter_main_quit() without calling clutter_main() "
"is not allowed. If you are using another main loop, use the "
"appropriate API to terminate it.");
return;
}
CLUTTER_NOTE (MISC, "Terminating main loop level %d", clutter_main_loop_level);
g_main_loop_quit (main_loops->data);
}
/**
* clutter_main_level:
*
* Retrieves the depth of the Clutter mainloop.
*
* Return value: The level of the mainloop.
*/
gint
clutter_main_level (void)
{
return clutter_main_loop_level;
}
/**
* clutter_main:
*
* Starts the Clutter mainloop.
*/
void
clutter_main (void)
{
GMainLoop *loop;
if (!_clutter_context_is_initialized ())
{
g_warning ("Called clutter_main() but Clutter wasn't initialised. "
"You must call clutter_init() first.");
return;
}
clutter_main_loop_level++;
CLUTTER_NOTE (MISC, "Entering main loop level %d", clutter_main_loop_level);
loop = g_main_loop_new (NULL, TRUE);
main_loops = g_slist_prepend (main_loops, loop);
if (g_main_loop_is_running (main_loops->data))
g_main_loop_run (loop);
main_loops = g_slist_remove (main_loops, loop);
g_main_loop_unref (loop);
CLUTTER_NOTE (MISC, "Leaving main loop level %d", clutter_main_loop_level);
clutter_main_loop_level--;
}
gboolean gboolean
_clutter_threads_dispatch (gpointer data) _clutter_threads_dispatch (gpointer data)
{ {

View File

@ -136,14 +136,6 @@ GOptionGroup * clutter_get_option_group (void);
CLUTTER_EXPORT CLUTTER_EXPORT
GOptionGroup * clutter_get_option_group_without_init (void); GOptionGroup * clutter_get_option_group_without_init (void);
/* Mainloop */
CLUTTER_EXPORT
void clutter_main (void);
CLUTTER_EXPORT
void clutter_main_quit (void);
CLUTTER_EXPORT
gint clutter_main_level (void);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_do_event (ClutterEvent *event); void clutter_do_event (ClutterEvent *event);