diff options
author | monsta <[email protected]> | 2016-11-02 15:38:24 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-11-02 15:38:24 +0300 |
commit | b90041cb958032b3307eb19e0fd37831d54c5d9a (patch) | |
tree | bb5c034f7cab7e19d3947bf67ed7fc9cad090b82 | |
parent | 7ec8dfe386585a28257a443bcc5c47d937c741fb (diff) | |
download | mate-control-center-b90041cb958032b3307eb19e0fd37831d54c5d9a.tar.bz2 mate-control-center-b90041cb958032b3307eb19e0fd37831d54c5d9a.tar.xz |
build: require XCursor unconditionally
and drop bundled cursor files (.pcf) - they are not used at all
when XCursor library is in use
-rw-r--r-- | capplets/appearance/appearance-style.c | 12 | ||||
-rw-r--r-- | capplets/appearance/appearance-themes.c | 5 | ||||
-rw-r--r-- | capplets/appearance/data/Makefile.am | 6 | ||||
-rw-r--r-- | capplets/appearance/data/appearance.ui | 36 | ||||
-rw-r--r-- | capplets/appearance/data/cursor-large-white.pcf | bin | 18636 -> 0 bytes | |||
-rw-r--r-- | capplets/appearance/data/cursor-large.pcf | bin | 17432 -> 0 bytes | |||
-rw-r--r-- | capplets/appearance/data/cursor-white.pcf | bin | 13848 -> 0 bytes | |||
-rw-r--r-- | capplets/appearance/theme-save.c | 4 | ||||
-rw-r--r-- | capplets/common/mate-theme-apply.c | 9 | ||||
-rw-r--r-- | capplets/common/mate-theme-info.c | 127 | ||||
-rw-r--r-- | configure.ac | 29 |
11 files changed, 5 insertions, 223 deletions
diff --git a/capplets/appearance/appearance-style.c b/capplets/appearance/appearance-style.c index fbc090ed..a5ad6730 100644 --- a/capplets/appearance/appearance-style.c +++ b/capplets/appearance/appearance-style.c @@ -509,7 +509,6 @@ icon_theme_changed (GSettings *settings, gchar *key, AppearanceData *data) theme_is_writable (theme)); } -#ifdef HAVE_XCURSOR static void cursor_size_changed_cb (int size, AppearanceData *data) { @@ -536,13 +535,11 @@ cursor_size_scale_value_changed_cb (GtkRange *range, AppearanceData *data) cursor_size_changed_cb (size, data); } } -#endif static void update_cursor_size_scale (MateThemeCursorInfo *theme, AppearanceData *data) { -#ifdef HAVE_XCURSOR GtkWidget *cursor_size_scale; GtkWidget *cursor_size_label; GtkWidget *cursor_size_small_label; @@ -610,7 +607,6 @@ update_cursor_size_scale (MateThemeCursorInfo *theme, if (size != gsettings_size) cursor_size_changed_cb (size, data); -#endif } static void @@ -1090,7 +1086,6 @@ style_init (AppearanceData *data) settings = gtk_settings_get_default (); g_signal_connect (settings, "notify::gtk-color-scheme", (GCallback) color_scheme_changed, data); -#ifdef HAVE_XCURSOR w = appearance_capplet_get_widget (data, "cursor_size_scale"); g_signal_connect (w, "value-changed", (GCallback) cursor_size_scale_value_changed_cb, data); @@ -1103,13 +1098,6 @@ style_init (AppearanceData *data) label = g_strdup_printf ("<small><i>%s</i></small>", gtk_label_get_text (GTK_LABEL (w))); gtk_label_set_markup (GTK_LABEL (w), label); g_free (label); -#else - w = appearance_capplet_get_widget (data, "cursor_size_hbox"); - gtk_widget_set_no_show_all (w, TRUE); - gtk_widget_hide (w); - gtk_widget_show (appearance_capplet_get_widget (data, "cursor_message_hbox")); - gtk_box_set_spacing (GTK_BOX (appearance_capplet_get_widget (data, "cursor_vbox")), 12); -#endif /* connect signals */ /* color buttons */ diff --git a/capplets/appearance/appearance-themes.c b/capplets/appearance/appearance-themes.c index 9f8d35be..6669e822 100644 --- a/capplets/appearance/appearance-themes.c +++ b/capplets/appearance/appearance-themes.c @@ -234,9 +234,8 @@ theme_load_from_gsettings (AppearanceData *data) theme->notification_theme_name = NULL; theme->cursor_theme_name = g_settings_get_string (data->mouse_settings, CURSOR_THEME_KEY); -#ifdef HAVE_XCURSOR theme->cursor_size = g_settings_get_int (data->mouse_settings, CURSOR_SIZE_KEY); -#endif + if (theme->cursor_theme_name == NULL) theme->cursor_theme_name = g_strdup ("default"); @@ -1138,9 +1137,7 @@ void themes_init(AppearanceData* data) /* listen to gsettings changes, too */ g_signal_connect (data->marco_settings, "changed::" MARCO_THEME_KEY, G_CALLBACK (theme_gsettings_changed), data); g_signal_connect (data->mouse_settings, "changed::" CURSOR_THEME_KEY, G_CALLBACK (theme_gsettings_changed), data); -#ifdef HAVE_XCURSOR g_signal_connect (data->mouse_settings, "changed::" CURSOR_SIZE_KEY, G_CALLBACK (theme_gsettings_changed), data); -#endif g_signal_connect (data->wp_settings, "changed::" WP_FILE_KEY, G_CALLBACK (background_or_font_changed), data); g_signal_connect (data->interface_settings, "changed::" GTK_FONT_KEY, G_CALLBACK (background_or_font_changed), data); g_signal_connect (data->interface_settings, "changed::" DOCUMENT_FONT_KEY, G_CALLBACK (background_or_font_changed), data); diff --git a/capplets/appearance/data/Makefile.am b/capplets/appearance/data/Makefile.am index 72ace798..ff85ab63 100644 --- a/capplets/appearance/data/Makefile.am +++ b/capplets/appearance/data/Makefile.am @@ -17,12 +17,6 @@ dist_pixmap_DATA = \ mouse-cursor-white.png \ mouse-cursor-white-large.png -cursorfontdir = $(datadir)/mate/cursor-fonts -dist_cursorfont_DATA = \ - cursor-large.pcf \ - cursor-white.pcf \ - cursor-large-white.pcf - @INTLTOOL_DESKTOP_RULE@ desktopdir = $(datadir)/applications diff --git a/capplets/appearance/data/appearance.ui b/capplets/appearance/data/appearance.ui index 91619bb1..bec649ea 100644 --- a/capplets/appearance/data/appearance.ui +++ b/capplets/appearance/data/appearance.ui @@ -2587,42 +2587,6 @@ <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <object class="GtkHBox" id="cursor_message_hbox"> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="no_show_all">True</property> - <property name="spacing">6</property> - <child> - <object class="GtkImage" id="image3"> - <property name="visible">True</property> - <property name="stock">gtk-dialog-info</property> - <property name="icon-size">5</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label5"> - <property name="width_request">280</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Changing your cursor theme takes effect the next time you log in.</property> - <property name="wrap">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> <object class="GtkScrolledWindow" id="scrolledwindow8"> <property name="height_request">200</property> <property name="visible">True</property> diff --git a/capplets/appearance/data/cursor-large-white.pcf b/capplets/appearance/data/cursor-large-white.pcf Binary files differdeleted file mode 100644 index e1d7b631..00000000 --- a/capplets/appearance/data/cursor-large-white.pcf +++ /dev/null diff --git a/capplets/appearance/data/cursor-large.pcf b/capplets/appearance/data/cursor-large.pcf Binary files differdeleted file mode 100644 index 6580b33d..00000000 --- a/capplets/appearance/data/cursor-large.pcf +++ /dev/null diff --git a/capplets/appearance/data/cursor-white.pcf b/capplets/appearance/data/cursor-white.pcf Binary files differdeleted file mode 100644 index bc9932c3..00000000 --- a/capplets/appearance/data/cursor-white.pcf +++ /dev/null diff --git a/capplets/appearance/theme-save.c b/capplets/appearance/theme-save.c index 20904496..cbfccdb3 100644 --- a/capplets/appearance/theme-save.c +++ b/capplets/appearance/theme-save.c @@ -226,14 +226,10 @@ write_theme_to_disk (MateThemeMetaInfo *theme_info, } if (theme_info->cursor_theme_name) { -#ifdef HAVE_XCURSOR str = g_strdup_printf ("CursorTheme=%s\n" "CursorSize=%i\n", theme_info->cursor_theme_name, theme_info->cursor_size); -#else - str = g_strdup_printf ("CursorFont=%s\n", theme_info->cursor_theme_name); -#endif g_output_stream_write (output, str, strlen (str), NULL, NULL); g_free (str); } diff --git a/capplets/common/mate-theme-apply.c b/capplets/common/mate-theme-apply.c index df5a8953..6f0cc09e 100644 --- a/capplets/common/mate-theme-apply.c +++ b/capplets/common/mate-theme-apply.c @@ -37,7 +37,6 @@ #define MARCO_THEME_KEY "theme" #define MOUSE_SCHEMA "org.mate.peripherals-mouse" -#define CURSOR_FONT_KEY "cursor-font" #define CURSOR_THEME_KEY "cursor-theme" #define CURSOR_SIZE_KEY "cursor-size" @@ -123,7 +122,6 @@ mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info) } /* Set the cursor theme key */ -#ifdef HAVE_XCURSOR old_key = g_settings_get_string (mouse_settings, CURSOR_THEME_KEY); if (compare (old_key, meta_theme_info->cursor_theme_name)) { @@ -135,13 +133,6 @@ mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info) { g_settings_set_int (mouse_settings, CURSOR_SIZE_KEY, meta_theme_info->cursor_size); } -#else - old_key = g_settings_get_string (mouse_settings, CURSOR_FONT_KEY); - if (compare (old_key, meta_theme_info->cursor_theme_name)) - { - g_settings_set_string (mouse_settings, CURSOR_FONT_KEY, meta_theme_info->cursor_theme_name); - } -#endif g_free (old_key); g_object_unref (interface_settings); diff --git a/capplets/common/mate-theme-info.c b/capplets/common/mate-theme-info.c index 964d45c0..38f2c741 100644 --- a/capplets/common/mate-theme-info.c +++ b/capplets/common/mate-theme-info.c @@ -39,9 +39,7 @@ #include "mate-theme-info.h" #include "gtkrc-utils.h" -#ifdef HAVE_XCURSOR - #include <X11/Xcursor/Xcursor.h> -#endif +#include <X11/Xcursor/Xcursor.h> #define THEME_NAME "X-GNOME-Metatheme/Name" #define THEME_COMMENT "X-GNOME-Metatheme/Comment" @@ -485,7 +483,6 @@ read_icon_theme (GFile *icon_theme_uri) return icon_theme_info; } -#ifdef HAVE_XCURSOR static void add_default_cursor_theme () { @@ -628,117 +625,6 @@ read_cursor_theme (GFile *cursor_theme_uri) return cursor_theme_info; } -#else /* !HAVE_XCURSOR */ - -static gchar * -read_current_cursor_font (void) -{ - DIR *dir; - gchar *dir_name; - struct dirent *file_dirent; - - dir_name = g_build_filename(g_get_user_config_dir(), "mate", "share", "cursor-fonts", NULL); - - if (! g_file_test (dir_name, G_FILE_TEST_EXISTS)) { - g_free (dir_name); - return NULL; - } - - dir = opendir (dir_name); - - while ((file_dirent = readdir (dir)) != NULL) { - struct stat st; - gchar *link_name; - - link_name = g_build_filename (dir_name, file_dirent->d_name, NULL); - if (lstat (link_name, &st)) { - g_free (link_name); - continue; - } - - if (S_ISLNK (st.st_mode)) { - gint length; - gchar target[256]; - - length = readlink (link_name, target, 255); - if (length > 0) { - gchar *retval; - target[length] = '\0'; - retval = g_strdup (target); - g_free (link_name); - closedir (dir); - return retval; - } - - } - g_free (link_name); - } - g_free (dir_name); - closedir (dir); - return NULL; -} - -static void -read_cursor_fonts (void) -{ - gchar *cursor_font; - gint i; - - const gchar *builtins[][4] = { - { - "mate/cursor-fonts/cursor-normal.pcf", - N_("Default Pointer"), - N_("Default Pointer - Current"), - "mouse-cursor-normal.png" - }, { - "mate/cursor-fonts/cursor-white.pcf", - N_("White Pointer"), - N_("White Pointer - Current"), - "mouse-cursor-white.png" - }, { - "mate/cursor-fonts/cursor-large.pcf", - N_("Large Pointer"), - N_("Large Pointer - Current"), - "mouse-cursor-normal-large.png" - }, { - "mate/cursor-fonts/cursor-large-white.pcf", - N_("Large White Pointer - Current"), - N_("Large White Pointer"), - "mouse-cursor-white-large.png" - } - }; - - cursor_font = read_current_cursor_font(); - - if (!cursor_font) - cursor_font = g_strdup (builtins[0][0]); - - for (i = 0; i < G_N_ELEMENTS (builtins); i++) { - MateThemeCursorInfo *theme_info; - gchar *filename; - - theme_info = mate_theme_cursor_info_new (); - - filename = g_build_filename (MATECC_DATA_DIR, "pixmaps", builtins[i][3], NULL); - theme_info->thumbnail = gdk_pixbuf_new_from_file (filename, NULL); - g_free (filename); - - theme_info->path = g_build_filename (MATECC_DATA_DIR, builtins[i][0], NULL); - theme_info->name = g_strdup (theme_info->path); - - if (!strcmp (theme_info->path, cursor_font)) - theme_info->readable_name = g_strdup (_(builtins[i][2])); - else - theme_info->readable_name = g_strdup (_(builtins[i][1])); - - g_hash_table_insert (cursor_theme_hash_by_uri, theme_info->path, theme_info); - add_theme_to_hash_by_name (cursor_theme_hash_by_name, theme_info); - } - - g_free (cursor_font); -} -#endif /* HAVE_XCURSOR */ - static void handle_change_signal (gpointer data, MateThemeChangeType change_type, @@ -934,12 +820,10 @@ update_common_theme_dir_index (GFile *theme_index_uri, } } -#ifdef HAVE_XCURSOR /* cursor themes don't necessarily have an index file, so try those in any case */ else { theme_info = (MateThemeCommonInfo *) read_cursor_theme (theme_index_uri); } -#endif if (theme_info) { theme_info->priority = priority; @@ -1004,9 +888,7 @@ static void update_cursor_theme_index (GFile *cursor_theme_index_uri, gint priority) { -#ifdef HAVE_XCURSOR update_common_theme_dir_index (cursor_theme_index_uri, MATE_THEME_TYPE_CURSOR, priority); -#endif } static void @@ -1979,7 +1861,6 @@ mate_theme_init () } g_strfreev (search_path); -#ifdef XCURSOR_ICONDIR /* if there's a separate xcursors dir, add that as well */ if (strcmp (XCURSOR_ICONDIR, top_theme_dir_string) && strcmp (XCURSOR_ICONDIR, "/usr/share/icons")) { @@ -1987,16 +1868,10 @@ mate_theme_init () add_top_icon_theme_dir_monitor (top_theme_dir, 1, NULL); g_object_unref (top_theme_dir); } -#endif -#ifdef HAVE_XCURSOR /* make sure we have the default theme */ if (!mate_theme_cursor_info_find ("default")) add_default_cursor_theme (); -#else - /* If we don't have Xcursor, use the built-in cursor fonts instead */ - read_cursor_fonts (); -#endif /* done */ initted = TRUE; diff --git a/configure.ac b/configure.ac index 61a38245..e9f95e94 100644 --- a/configure.ac +++ b/configure.ac @@ -212,31 +212,9 @@ DISPLAY_CAPPLET_LIBS="$DISPLAY_CAPPLET_LIBS" CAPPLET_LIBS="$CAPPLET_LIBS $x_libs" MATECC_LIBS="$MATECC_LIBS $x_libs" -dnl -dnl Check for XCursor support. If it exists, then we compile the -dnl mouse capplet with support for it turned on -dnl -have_xcursor=no -PKG_CHECK_MODULES(XCURSOR, [ - xcursor - ], - have_xcursor=yes - AC_DEFINE(HAVE_XCURSOR, 1, [Define if the Xcursor extension is available]), - have_xcursor=no) -AM_CONDITIONAL(HAVE_XCURSOR, [test $have_xcursor=yes]) -AC_SUBST(XCURSOR_CFLAGS) -AC_SUBST(XCURSOR_LIBS) - -if test x$have_xcursor = xyes; then - AC_MSG_CHECKING([for XCURSOR cursor location]) - XCURSOR_ICONDIR=$($PKG_CONFIG --variable=icondir xcursor) - if test "x$XCURSOR_ICONDIR" != x; then - AC_DEFINE_UNQUOTED(XCURSOR_ICONDIR, "${XCURSOR_ICONDIR}", [Define to the xcursor icon path]) - else - XCURSOR_ICONDIR=none - fi - AC_MSG_RESULT([${XCURSOR_ICONDIR}]) -fi +PKG_CHECK_MODULES(XCURSOR, xcursor) +XCURSOR_ICONDIR=$($PKG_CONFIG --variable=icondir xcursor) +AC_DEFINE_UNQUOTED(XCURSOR_ICONDIR, "${XCURSOR_ICONDIR}", [Define to the xcursor icon path]) CAPPLET_LIBS="$CAPPLET_LIBS $XCURSOR_LIBS" @@ -367,5 +345,4 @@ echo " GTK+ API version: ${GTK_API_VERSION} Appindicator: ${enable_appindicator} Libmate-slab: ${have_libmateslab} - XCursor support: ${have_xcursor} " |