Stop using settings for modules

The Wayland backend was already not supporting this setting
since it is an XSetting that is not backed by a GSetting.

Drop this setting altogether, since we will stop supporting
general-purpose modules.
This commit is contained in:
Matthias Clasen 2018-02-18 08:31:31 -05:00
parent fef3dfc43e
commit a732ebf521
4 changed files with 0 additions and 98 deletions

View File

@ -35,7 +35,6 @@ static const struct {
{"Gtk/ColorPalette", "gtk-color-palette"},
{"Gtk/FontName", "gtk-font-name"},
{"Gtk/KeyThemeName", "gtk-key-theme-name"},
{"Gtk/Modules", "gtk-modules"},
{"Gtk/ButtonImages", "gtk-button-images"},
{"Gtk/MenuImages", "gtk-menu-images"},
{"Gtk/CursorThemeName", "gtk-cursor-theme-name"},

View File

@ -387,28 +387,6 @@ load_module (GSList *module_list,
return module_list;
}
static void
gtk_module_info_unref (GtkModuleInfo *info)
{
GSList *l;
info->ref_count--;
if (info->ref_count == 0)
{
GTK_NOTE (MODULES,
g_message ("Unloading module: %s", g_module_name (info->module)));
gtk_modules = g_slist_remove (gtk_modules, info);
g_module_close (info->module);
for (l = info->names; l; l = l->next)
g_free (l->data);
g_slist_free (info->names);
g_free (info);
}
}
static GSList *
load_modules (const char *module_str)
{
@ -469,9 +447,7 @@ static void
display_opened_cb (GdkDisplayManager *display_manager,
GdkDisplay *display)
{
GValue value = G_VALUE_INIT;
GSList *slist;
GtkSettings *settings;
for (slist = gtk_modules; slist; slist = slist->next)
{
@ -484,15 +460,6 @@ display_opened_cb (GdkDisplayManager *display_manager,
}
}
g_value_init (&value, G_TYPE_STRING);
if (gdk_display_get_setting (display, "gtk-modules", &value))
{
settings = gtk_settings_get_for_display (display);
_gtk_modules_settings_changed (settings, g_value_get_string (&value));
g_value_unset (&value);
}
/* Since closing display doesn't actually release the resources yet,
* we have to connect to the ::closed signal.
*/
@ -538,37 +505,6 @@ _gtk_modules_init (gint *argc,
}
}
static void
settings_destroy_notify (gpointer data)
{
GSList *iter, *modules = data;
for (iter = modules; iter; iter = iter->next)
{
GtkModuleInfo *info = iter->data;
gtk_module_info_unref (info);
}
g_slist_free (modules);
}
void
_gtk_modules_settings_changed (GtkSettings *settings,
const gchar *modules)
{
GSList *new_modules = NULL;
GTK_NOTE (MODULES, g_message ("gtk-modules setting changed to: %s", modules));
/* load/ref before unreffing existing */
if (modules && modules[0])
new_modules = load_modules (modules);
g_object_set_data_full (G_OBJECT (settings),
I_("gtk-modules"),
new_modules,
settings_destroy_notify);
}
/* Return TRUE if module_to_check causes version conflicts.
* If module_to_check is NULL, check the main module.
*/

View File

@ -36,8 +36,6 @@ gchar ** _gtk_get_module_path (const gchar *type);
void _gtk_modules_init (gint *argc,
gchar ***argv,
const gchar *gtk_modules_args);
void _gtk_modules_settings_changed (GtkSettings *settings,
const gchar *modules);
gboolean _gtk_module_has_mixed_deps (GModule *module);

View File

@ -22,8 +22,6 @@
#include "gtksettings.h"
#include "gtkmodules.h"
#include "gtkmodulesprivate.h"
#include "gtksettingsprivate.h"
#include "gtkintl.h"
#include "gtkwidget.h"
@ -154,7 +152,6 @@ enum {
PROP_KEY_THEME_NAME,
PROP_DND_DRAG_THRESHOLD,
PROP_FONT_NAME,
PROP_MODULES,
PROP_XFT_ANTIALIAS,
PROP_XFT_HINTING,
PROP_XFT_HINTSTYLE,
@ -212,7 +209,6 @@ static guint settings_install_property_parser (GtkSettingsClass *class,
GParamSpec *pspec,
GtkRcPropertyParser parser);
static void settings_update_double_click (GtkSettings *settings);
static void settings_update_modules (GtkSettings *settings);
static void settings_update_cursor_theme (GtkSettings *settings);
static void settings_update_font_options (GtkSettings *settings);
@ -455,15 +451,6 @@ gtk_settings_class_init (GtkSettingsClass *class)
NULL);
g_assert (result == PROP_FONT_NAME);
result = settings_install_property_parser (class,
g_param_spec_string ("gtk-modules",
P_("GTK Modules"),
P_("List of currently active GTK modules"),
NULL,
GTK_PARAM_READWRITE),
NULL);
g_assert (result == PROP_MODULES);
result = settings_install_property_parser (class,
g_param_spec_int ("gtk-xft-antialias",
P_("Xft Antialias"),
@ -1203,7 +1190,6 @@ gtk_settings_create_for_display (GdkDisplay *display)
settings_init_style (settings);
settings_update_xsettings (settings);
settings_update_modules (settings);
settings_update_double_click (settings);
settings_update_cursor_theme (settings);
settings_update_font_options (settings);
@ -1332,9 +1318,6 @@ gtk_settings_notify (GObject *object,
switch (property_id)
{
case PROP_MODULES:
settings_update_modules (settings);
break;
case PROP_DOUBLE_CLICK_TIME:
case PROP_DOUBLE_CLICK_DISTANCE:
settings_update_double_click (settings);
@ -2055,20 +2038,6 @@ settings_update_double_click (GtkSettings *settings)
gdk_display_set_double_click_distance (priv->display, double_click_distance);
}
static void
settings_update_modules (GtkSettings *settings)
{
gchar *modules;
g_object_get (settings,
"gtk-modules", &modules,
NULL);
_gtk_modules_settings_changed (settings, modules);
g_free (modules);
}
static void
settings_update_cursor_theme (GtkSettings *settings)
{