[gtk/mainloop-cleanup: 20/21] Drop gtk_get_main_thread
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/mainloop-cleanup: 20/21] Drop gtk_get_main_thread
- Date: Mon, 10 Feb 2020 04:17:39 +0000 (UTC)
commit a8db322be6e99e4407ecfb05d45ac16725668b96
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 9 22:37:18 2020 -0500
Drop gtk_get_main_thread
This is not a very useful api, and if you need it,
you can just as easily keep track yourself which thread
called gtk_init().
gtk/gtkmain.c | 16 ----------------
gtk/gtkmain.h | 3 ---
testsuite/gtk/main.c | 6 ------
3 files changed, 25 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 33fccd8a80..baa486593d 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -142,7 +142,6 @@ static GtkWindowGroup *gtk_main_get_window_group (GtkWidget *widget);
static gint pre_initialized = FALSE;
static gint gtk_initialized = FALSE;
static GList *current_events = NULL;
-static GThread *initialized_thread = NULL;
typedef struct {
GdkDisplay *display;
@@ -801,8 +800,6 @@ gtk_init_check (void)
do_pre_parse_initialization ();
do_post_parse_initialization ();
- initialized_thread = g_thread_self ();
-
ret = gdk_display_open_default () != NULL;
if (ret && (gtk_get_debug_flags () & GTK_DEBUG_INTERACTIVE))
@@ -927,19 +924,6 @@ gtk_is_initialized (void)
return gtk_initialized;
}
-/**
- * gtk_get_main_thread:
- *
- * Get the thread from which GTK was initialized.
- *
- * Returns: (transfer none): The #GThread initialized for GTK, must not be freed
- */
-GThread *
-gtk_get_main_thread (void)
-{
- return initialized_thread;
-}
-
/**
* gtk_get_locale_direction:
diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h
index dd5e547953..34bdfb5641 100644
--- a/gtk/gtkmain.h
+++ b/gtk/gtkmain.h
@@ -81,9 +81,6 @@ gboolean gtk_init_check (void);
GDK_AVAILABLE_IN_ALL
gboolean gtk_is_initialized (void);
-GDK_AVAILABLE_IN_ALL
-GThread * gtk_get_main_thread (void);
-
#ifdef G_OS_WIN32
/* Variants that are used to check for correct struct packing
diff --git a/testsuite/gtk/main.c b/testsuite/gtk/main.c
index cdfd4d058d..3487d3ed8b 100644
--- a/testsuite/gtk/main.c
+++ b/testsuite/gtk/main.c
@@ -4,15 +4,9 @@
static void
test_init (void)
{
- GThread *self = g_thread_self ();
-
g_assert (gtk_is_initialized () == FALSE);
- g_assert (gtk_get_main_thread () == NULL);
-
g_assert (gtk_init_check ());
g_assert (gtk_is_initialized () == TRUE);
-
- g_assert (gtk_get_main_thread () == self);
}
int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]