From c6fd3bcc28d050378179789b9890cfa001280417 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 25 Apr 2008 03:58:12 +0000 Subject: [PATCH] 2.13.0 --- .cvsignore | 2 +- filechooser-iconsize.patch | 21 --- foreign-cmap.patch | 29 --- gtk2.spec | 2 +- im-setting.patch | 357 ------------------------------------- implicit-g_fopen.patch | 10 -- libbeagle.patch | 65 ------- lpoptions.patch | 228 ----------------------- sources | 2 +- tab-drag-crash.patch | 11 -- 10 files changed, 3 insertions(+), 724 deletions(-) delete mode 100644 filechooser-iconsize.patch delete mode 100644 foreign-cmap.patch delete mode 100644 im-setting.patch delete mode 100644 implicit-g_fopen.patch delete mode 100644 libbeagle.patch delete mode 100644 lpoptions.patch delete mode 100644 tab-drag-crash.patch diff --git a/.cvsignore b/.cvsignore index 15f76ca..f6dde24 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gtk+-2.12.9.tar.bz2 +gtk+-2.13.0.tar.bz2 diff --git a/filechooser-iconsize.patch b/filechooser-iconsize.patch deleted file mode 100644 index 5bf567a..0000000 --- a/filechooser-iconsize.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up gtk+-2.12.9/gtk/gtkfilesystem.c.iconsize gtk+-2.12.9/gtk/gtkfilesystem.c ---- gtk+-2.12.9/gtk/gtkfilesystem.c.iconsize 2008-04-09 12:32:53.000000000 -0400 -+++ gtk+-2.12.9/gtk/gtkfilesystem.c 2008-04-09 12:34:15.000000000 -0400 -@@ -306,7 +306,7 @@ gtk_file_info_render_icon (const GtkFile - pixbuf = gtk_widget_render_icon (widget, - gtk_file_info_get_is_folder (info) - ? GTK_STOCK_DIRECTORY : GTK_STOCK_FILE, -- GTK_ICON_SIZE_SMALL_TOOLBAR, -+ GTK_ICON_SIZE_MENU, - NULL); - if (!pixbuf && error) - g_set_error (error, -@@ -670,7 +670,7 @@ gtk_file_system_volume_render_icon (GtkF - if (!pixbuf) - pixbuf = gtk_widget_render_icon (widget, - GTK_STOCK_HARDDISK, -- GTK_ICON_SIZE_SMALL_TOOLBAR, -+ GTK_ICON_SIZE_MENU, - NULL); - - return pixbuf; diff --git a/foreign-cmap.patch b/foreign-cmap.patch deleted file mode 100644 index 7023e8d..0000000 --- a/foreign-cmap.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -rup gtk+-2.12.8.orig/gdk/x11/gdkcolor-x11.c gtk+-2.12.8.new/gdk/x11/gdkcolor-x11.c ---- gtk+-2.12.8.orig/gdk/x11/gdkcolor-x11.c 2008-02-12 12:57:43.000000000 -0500 -+++ gtk+-2.12.8.new/gdk/x11/gdkcolor-x11.c 2008-04-02 22:02:07.000000000 -0400 -@@ -46,7 +46,7 @@ struct _GdkColormapPrivateX11 - GdkColorInfo *info; - time_t last_sync_time; - -- guint foreign : 1; -+ gboolean foreign; - }; - - #define GDK_COLORMAP_PRIVATE_DATA(cmap) ((GdkColormapPrivateX11 *) GDK_COLORMAP (cmap)->windowing_data) -@@ -107,7 +107,7 @@ gdk_colormap_finalize (GObject *object) - - gdk_colormap_remove (colormap); - -- if (!private->screen->closed) -+ if (!private->screen->closed && !private->foreign) - XFreeColormap (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap); - - if (private->hash) -@@ -1292,6 +1292,7 @@ gdk_x11_colormap_foreign_new (GdkVisual - private->screen = screen; - private->xcolormap = xcolormap; - private->private_val = FALSE; -+ private->foreign = TRUE; - - colormap->size = visual->colormap_size; - diff --git a/gtk2.spec b/gtk2.spec index fcbbe08..29633c6 100644 --- a/gtk2.spec +++ b/gtk2.spec @@ -19,7 +19,7 @@ Version: %{base_version} Release: 1%{?dist} License: LGPLv2+ Group: System Environment/Libraries -Source: http://download.gnome.org/sources/gtk+/2.12/gtk+-%{version}.tar.bz2 +Source: http://download.gnome.org/sources/gtk+/2.13/gtk+-%{version}.tar.bz2 Source1: update-gdk-pixbuf-loaders Source2: update-gtk-immodules diff --git a/im-setting.patch b/im-setting.patch deleted file mode 100644 index def2a93..0000000 --- a/im-setting.patch +++ /dev/null @@ -1,357 +0,0 @@ -diff -up gtk+-2.12.3/gtk/gtkimmulticontext.h.im-setting gtk+-2.12.3/gtk/gtkimmulticontext.h ---- gtk+-2.12.3/gtk/gtkimmulticontext.h.im-setting 2007-12-17 23:50:52.000000000 -0500 -+++ gtk+-2.12.3/gtk/gtkimmulticontext.h 2007-12-17 23:51:31.000000000 -0500 -@@ -45,7 +45,7 @@ struct _GtkIMMulticontext - - GtkIMMulticontextPrivate *priv; - -- const gchar *context_id; -+ gchar *context_id; - }; - - struct _GtkIMMulticontextClass -diff -up gtk+-2.12.3/gtk/gtksettings.c.im-setting gtk+-2.12.3/gtk/gtksettings.c ---- gtk+-2.12.3/gtk/gtksettings.c.im-setting 2007-12-17 23:51:11.000000000 -0500 -+++ gtk+-2.12.3/gtk/gtksettings.c 2007-12-17 23:51:31.000000000 -0500 -@@ -106,7 +106,8 @@ enum { - PROP_PRINT_PREVIEW_COMMAND, - PROP_ENABLE_MNEMONICS, - PROP_ENABLE_ACCELS, -- PROP_RECENT_FILES_LIMIT -+ PROP_RECENT_FILES_LIMIT, -+ PROP_IM_MODULE - }; - - -@@ -805,6 +806,20 @@ gtk_settings_class_init (GtkSettingsClas - GTK_PARAM_READWRITE), - NULL); - g_assert (result == PROP_RECENT_FILES_LIMIT); -+ -+ /** -+ * GtkSettings:gtk-im-module: -+ * -+ * Which IM module should be used by default. -+ */ -+ result = settings_install_property_parser (class, -+ g_param_spec_string ("gtk-im-module", -+ P_("Default IM module"), -+ P_("Which IM module should be used by default"), -+ NULL, -+ GTK_PARAM_READWRITE), -+ NULL); -+ g_assert (result == PROP_IM_MODULE); - } - - static void -diff -up gtk+-2.12.3/gtk/gtkimmodule.c.im-setting gtk+-2.12.3/gtk/gtkimmodule.c ---- gtk+-2.12.3/gtk/gtkimmodule.c.im-setting 2007-12-17 23:50:34.000000000 -0500 -+++ gtk+-2.12.3/gtk/gtkimmodule.c 2007-12-17 23:51:31.000000000 -0500 -@@ -37,6 +37,8 @@ - #include - #include "gtkimmodule.h" - #include "gtkimcontextsimple.h" -+#include "gtksettings.h" -+#include "gtkmain.h" - #include "gtkrc.h" - #include "gtkintl.h" - #include "gtkalias.h" -@@ -418,7 +420,7 @@ _gtk_im_module_list (const GtkIMContextI - #endif - GtkIMContextInfo simple_context_info = { - SIMPLE_ID, -- N_("Default"), -+ N_("Simple"), - GETTEXT_PACKAGE, - #ifdef GTK_LOCALEDIR - GTK_LOCALEDIR, -@@ -546,17 +548,15 @@ match_locale (const gchar *locale, - - /** - * _gtk_im_module_get_default_context_id: -- * @locale: a locale id in the form 'en_US' -+ * @client_window: a window - * -- * Return the context_id of the best IM context type -- * for the given locale ID. -+ * Return the context_id of the best IM context type -+ * for the given window. - * - * Return value: the context ID (will never be %NULL) -- * the value is newly allocated and must be freed -- * with g_free(). - **/ - const gchar * --_gtk_im_module_get_default_context_id (const gchar *locale) -+_gtk_im_module_get_default_context_id (GdkWindow *client_window) - { - GSList *tmp_list; - const gchar *context_id = NULL; -@@ -564,6 +564,8 @@ _gtk_im_module_get_default_context_id (c - gint i; - gchar *tmp_locale, *tmp; - const gchar *envvar; -+ GdkScreen *screen; -+ GtkSettings *settings; - - if (!contexts_hash) - gtk_im_module_initialize (); -@@ -571,12 +573,41 @@ _gtk_im_module_get_default_context_id (c - envvar = g_getenv ("GTK_IM_MODULE"); - if (envvar && - (strcmp (envvar, SIMPLE_ID) == 0 || -- g_hash_table_lookup (contexts_hash, envvar))) -- return g_strdup (envvar); -+ g_hash_table_lookup (contexts_hash, envvar))) -+ return envvar; -+ -+ /* Check if the certain immodule is set in XSETTINGS. -+ */ -+ if (client_window != NULL && GDK_IS_DRAWABLE (client_window)) -+ { -+ screen = gdk_drawable_get_screen (GDK_DRAWABLE (client_window)); -+ if (screen) -+ settings = gtk_settings_get_for_screen (screen); -+ else -+ settings = gtk_settings_get_default (); -+ -+ g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL); -+ if (tmp) -+ { -+ if (strcmp (tmp, SIMPLE_ID) == 0) -+ context_id = SIMPLE_ID; -+ else -+ { -+ GtkIMModule *module; -+ module = g_hash_table_lookup (contexts_hash, tmp); -+ if (module) -+ context_id = module->contexts[0]->context_id; -+ } -+ g_free (tmp); -+ -+ if (context_id) -+ return context_id; -+ } -+ } - - /* Strip the locale code down to the essentials - */ -- tmp_locale = g_strdup (locale); -+ tmp_locale = _gtk_get_lc_ctype (); - tmp = strchr (tmp_locale, '.'); - if (tmp) - *tmp = '\0'; -@@ -589,7 +620,7 @@ _gtk_im_module_get_default_context_id (c - { - GtkIMModule *module = tmp_list->data; - -- for (i=0; in_contexts; i++) -+ for (i = 0; i < module->n_contexts; i++) - { - const gchar *p = module->contexts[i]->default_locales; - while (p) -@@ -612,5 +643,5 @@ _gtk_im_module_get_default_context_id (c - - g_free (tmp_locale); - -- return g_strdup (context_id ? context_id : SIMPLE_ID); -+ return context_id ? context_id : SIMPLE_ID; - } -diff -up gtk+-2.12.3/gtk/gtkimmodule.h.im-setting gtk+-2.12.3/gtk/gtkimmodule.h ---- gtk+-2.12.3/gtk/gtkimmodule.h.im-setting 2007-12-17 23:50:41.000000000 -0500 -+++ gtk+-2.12.3/gtk/gtkimmodule.h 2007-12-17 23:51:31.000000000 -0500 -@@ -38,10 +38,10 @@ struct _GtkIMContextInfo - - /* Functions for use within GTK+ - */ --void _gtk_im_module_list (const GtkIMContextInfo ***contexts, -- guint *n_contexts); --GtkIMContext *_gtk_im_module_create (const gchar *context_id); --const gchar * _gtk_im_module_get_default_context_id (const gchar *lang); -+void _gtk_im_module_list (const GtkIMContextInfo ***contexts, -+ guint *n_contexts); -+GtkIMContext * _gtk_im_module_create (const gchar *context_id); -+const gchar * _gtk_im_module_get_default_context_id (GdkWindow *client_window); - - /* The following entry points are exported by each input method module - */ -diff -up gtk+-2.12.3/gtk/gtkimmulticontext.c.im-setting gtk+-2.12.3/gtk/gtkimmulticontext.c ---- gtk+-2.12.3/gtk/gtkimmulticontext.c.im-setting 2007-12-17 23:51:01.000000000 -0500 -+++ gtk+-2.12.3/gtk/gtkimmulticontext.c 2007-12-17 23:51:31.000000000 -0500 -@@ -85,6 +85,7 @@ static gboolean gtk_im_multicontext_dele - gint n_chars, - GtkIMMulticontext *multicontext); - -+static const gchar *user_context_id = NULL; - static const gchar *global_context_id = NULL; - - G_DEFINE_TYPE (GtkIMMulticontext, gtk_im_multicontext, GTK_TYPE_IM_CONTEXT) -@@ -141,6 +142,7 @@ gtk_im_multicontext_finalize (GObject *o - GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (object); - - gtk_im_multicontext_set_slave (multicontext, NULL, TRUE); -+ g_free (multicontext->context_id); - - G_OBJECT_CLASS (gtk_im_multicontext_parent_class)->finalize (object); - } -@@ -224,35 +226,68 @@ gtk_im_multicontext_get_slave (GtkIMMult - { - GtkIMContext *slave; - -- if (!global_context_id) -- { -- gchar *locale = _gtk_get_lc_ctype (); -- global_context_id = _gtk_im_module_get_default_context_id (locale); -- g_free (locale); -- } -- -+ if (!global_context_id) -+ { -+ if (user_context_id) -+ global_context_id = user_context_id; -+ else -+ global_context_id = _gtk_im_module_get_default_context_id (multicontext->priv->client_window); -+ } - slave = _gtk_im_module_create (global_context_id); - gtk_im_multicontext_set_slave (multicontext, slave, FALSE); - g_object_unref (slave); - -- multicontext->context_id = global_context_id; -+ multicontext->context_id = g_strdup (global_context_id); - } - - return multicontext->slave; - } - - static void -+im_module_setting_changed (GtkSettings *settings, -+ gpointer data) -+{ -+ global_context_id = NULL; -+} -+ -+ -+static void - gtk_im_multicontext_set_client_window (GtkIMContext *context, - GdkWindow *window) - { - GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context); -- -- GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext); -+ GtkIMContext *slave; -+ GdkScreen *screen; -+ GtkSettings *settings; -+ gboolean connected; - - multicontext->priv->client_window = window; -- -+ -+ slave = gtk_im_multicontext_get_slave (multicontext); -+ - if (slave) - gtk_im_context_set_client_window (slave, window); -+ -+ if (window == NULL) -+ return; -+ -+ screen = gdk_drawable_get_screen (GDK_DRAWABLE (window)); -+ if (screen) -+ settings = gtk_settings_get_for_screen (screen); -+ else -+ settings = gtk_settings_get_default (); -+ -+ connected = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (settings), -+ "gtk-im-module-connected")); -+ if (!connected) -+ { -+ g_signal_connect (settings, "notify::gtk-im-module", -+ G_CALLBACK (im_module_setting_changed), NULL); -+ g_object_set_data (G_OBJECT (settings), "gtk-im-module-connected", -+ GINT_TO_POINTER (TRUE)); -+ -+ global_context_id = NULL; -+ } - } - - static void -@@ -298,7 +333,8 @@ gtk_im_multicontext_focus_in (GtkIMConte - * using before, get rid of the old slave and create a new one - * for the new global context type. - */ -- if (!multicontext->context_id || -+ if (multicontext->context_id == NULL || -+ global_context_id == NULL || - strcmp (global_context_id, multicontext->context_id) != 0) - gtk_im_multicontext_set_slave (multicontext, NULL, FALSE); - -@@ -459,7 +495,8 @@ activate_cb (GtkWidget *menuitem - - gtk_im_context_reset (GTK_IM_CONTEXT (context)); - -- global_context_id = id; -+ user_context_id = id; -+ global_context_id = NULL; - gtk_im_multicontext_set_slave (context, NULL, FALSE); - } - } -@@ -500,12 +537,22 @@ gtk_im_multicontext_append_menuitems (Gt - const GtkIMContextInfo **contexts; - guint n_contexts, i; - GSList *group = NULL; -+ GtkWidget *menuitem; - -+ menuitem = gtk_radio_menu_item_new_with_label (group, Q_("input method menu|System")); -+ if (!user_context_id) -+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE); -+ group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); -+ g_object_set_data (G_OBJECT (menuitem), I_("gtk-context-id"), NULL); -+ g_signal_connect (menuitem, "activate", G_CALLBACK (activate_cb), context); -+ -+ gtk_widget_show (menuitem); -+ gtk_menu_shell_append (menushell, menuitem); -+ - _gtk_im_module_list (&contexts, &n_contexts); - -- for (i=0; i < n_contexts; i++) -+ for (i = 0; i < n_contexts; i++) - { -- GtkWidget *menuitem; - const gchar *translated_name; - #ifdef ENABLE_NLS - if (contexts[i]->domain && contexts[i]->domain[0]) -@@ -562,11 +609,9 @@ gtk_im_multicontext_append_menuitems (Gt - menuitem = gtk_radio_menu_item_new_with_label (group, - translated_name); - -- if ((global_context_id == NULL && group == NULL) || -- (global_context_id && -- strcmp (contexts[i]->context_id, global_context_id) == 0)) -- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), -- TRUE); -+ if ((user_context_id && -+ strcmp (contexts[i]->context_id, user_context_id) == 0)) -+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE); - - group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); - -diff -up gtk+-2.12.3/gdk/x11/gdksettings.c.im-setting gtk+-2.12.3/gdk/x11/gdksettings.c ---- gtk+-2.12.3/gdk/x11/gdksettings.c.im-setting 2007-12-17 23:49:43.000000000 -0500 -+++ gtk+-2.12.3/gdk/x11/gdksettings.c 2007-12-17 23:54:19.000000000 -0500 -@@ -65,7 +65,8 @@ static const char gdk_settings_names[] = - "Xft/RGBA\0" "gtk-xft-rgba\0" - "Xft/DPI\0" "gtk-xft-dpi\0" - "Net/FallbackIconTheme\0" "gtk-fallback-icon-theme\0" -- "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0"; -+ "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0" -+ "Gtk/IMModule\0" "gtk-im-module\0"; - - static const struct - { -@@ -107,5 +108,6 @@ static const struct - { 1197, 1206 }, - { 1219, 1227 }, - { 1239, 1261 }, -- { 1285, 1305 } -+ { 1285, 1305 }, -+ { 1326, 1339 } - }; diff --git a/implicit-g_fopen.patch b/implicit-g_fopen.patch deleted file mode 100644 index b043bb8..0000000 --- a/implicit-g_fopen.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- gtk+-2.12.9/modules/printbackends/cups/gtkprintbackendcups.c 2008-03-12 05:17:03.000000000 +0100 -+++ gtk+-2.12.9/modules/printbackends/cups/gtkprintbackendcups.c 2008-04-07 19:06:13.000000000 +0200 -@@ -35,6 +35,7 @@ - #include - #include - -+#include - #include - #include - diff --git a/libbeagle.patch b/libbeagle.patch deleted file mode 100644 index ef1f6e3..0000000 --- a/libbeagle.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -up gtk+-2.12.8/gtk/gtksearchenginebeagle.c.libbeagle gtk+-2.12.8/gtk/gtksearchenginebeagle.c ---- gtk+-2.12.8/gtk/gtksearchenginebeagle.c.libbeagle 2008-02-26 01:17:35.000000000 -0500 -+++ gtk+-2.12.8/gtk/gtksearchenginebeagle.c 2008-02-26 01:18:04.000000000 -0500 -@@ -69,8 +69,6 @@ static GSList *(*beagle_hits_subtracted_ - static BeagleQuery *(*beagle_query_new) (void) = NULL; - static void (*beagle_query_add_text) (BeagleQuery *query, - const char *str) = NULL; --static void (*beagle_query_add_hit_type) (BeagleQuery *query, -- const char *hit_type) = NULL; - static void (*beagle_query_set_max_hits) (BeagleQuery *query, - gint max_hits) = NULL; - static BeagleQueryPartProperty *(*beagle_query_part_property_new) (void) = NULL; -@@ -102,7 +100,6 @@ static struct BeagleDlMapping - MAP (beagle_hits_subtracted_response_get_uris), - MAP (beagle_query_new), - MAP (beagle_query_add_text), -- MAP (beagle_query_add_hit_type), - MAP (beagle_query_set_max_hits), - MAP (beagle_query_part_property_new), - MAP (beagle_query_part_set_logic), -@@ -129,7 +126,10 @@ open_libbeagle (void) - - done = TRUE; - -- beagle = g_module_open ("libbeagle.so.0", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); -+ beagle = g_module_open ("libbeagle.so.1", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); -+ if (!beagle) -+ beagle = g_module_open ("libbeagle.so.0", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); -+ - if (!beagle) - return; - -@@ -274,6 +274,7 @@ gtk_search_engine_beagle_start (GtkSearc - GtkSearchEngineBeagle *beagle; - GError *error; - gchar *text; -+ gchar *query; - - error = NULL; - beagle = GTK_SEARCH_ENGINE_BEAGLE (engine); -@@ -295,11 +296,13 @@ gtk_search_engine_beagle_start (GtkSearc - "error", G_CALLBACK (beagle_error), engine); - - /* We only want files */ -- beagle_query_add_hit_type (beagle->priv->current_query, "File"); -- beagle_query_set_max_hits (beagle->priv->current_query, 1000); - -+ - text = _gtk_query_get_text (beagle->priv->query); -- beagle_query_add_text (beagle->priv->current_query, text); -+ query = g_strconcat (text, " type:File", NULL); -+ -+ beagle_query_set_max_hits (beagle->priv->current_query, 1000); -+ beagle_query_add_text (beagle->priv->current_query, query); - - beagle->priv->current_query_uri_prefix = _gtk_query_get_location (beagle->priv->query); - -@@ -312,6 +315,7 @@ gtk_search_engine_beagle_start (GtkSearc - - /* These must live during the lifetime of the query */ - g_free (text); -+ g_free (query); - } - - static void diff --git a/lpoptions.patch b/lpoptions.patch deleted file mode 100644 index 0bc15a0..0000000 --- a/lpoptions.patch +++ /dev/null @@ -1,228 +0,0 @@ -diff -up gtk+-2.12.8/modules/printbackends/cups/gtkprintbackendcups.c.lpoptions gtk+-2.12.8/modules/printbackends/cups/gtkprintbackendcups.c ---- gtk+-2.12.8/modules/printbackends/cups/gtkprintbackendcups.c.lpoptions 2008-03-04 22:52:25.000000000 -0500 -+++ gtk+-2.12.8/modules/printbackends/cups/gtkprintbackendcups.c 2008-03-04 22:52:50.000000000 -0500 -@@ -20,6 +20,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -1403,6 +1404,158 @@ cups_request_ppd (GtkPrinter *printer) - (GDestroyNotify)get_ppd_data_free); - } - -+/* Ordering matters for default preference */ -+static const char *lpoptions_locations[] = { -+ "/etc/cups/lpoptions", -+ ".lpoptions", -+ ".cups/lpoptions" -+}; -+ -+static void -+cups_parse_user_default_printer (const char *filename, -+ char **printer_name) -+{ -+ FILE *fp; -+ char line[1024], *lineptr, *defname = NULL; -+ -+ if ((fp = g_fopen (filename, "r")) == NULL) -+ return; -+ -+ while (fgets (line, sizeof (line), fp) != NULL) -+ { -+ if (strncasecmp (line, "default", 7) != 0 || !isspace (line[7])) -+ continue; -+ -+ lineptr = line + 8; -+ while (isspace (*lineptr)) -+ lineptr++; -+ -+ if (!*lineptr) -+ continue; -+ -+ defname = lineptr; -+ while (!isspace (*lineptr) && *lineptr && *lineptr != '/') -+ lineptr++; -+ -+ *lineptr = '\0'; -+ -+ if (*printer_name != NULL) -+ g_free (*printer_name); -+ -+ *printer_name = g_strdup (defname); -+ } -+ -+ fclose (fp); -+} -+ -+static void -+cups_get_user_default_printer (char **printer_name) -+{ -+ int i; -+ -+ for (i = 0; i < G_N_ELEMENTS (lpoptions_locations); i++) -+ { -+ if (g_path_is_absolute (lpoptions_locations[i])) -+ { -+ cups_parse_user_default_printer (lpoptions_locations[i], -+ printer_name); -+ } -+ else -+ { -+ char *filename; -+ -+ filename = g_build_filename (g_get_home_dir (), -+ lpoptions_locations[i], NULL); -+ cups_parse_user_default_printer (filename, printer_name); -+ g_free (filename); -+ } -+ } -+} -+ -+static int -+cups_parse_user_options (const char *filename, -+ const char *printer_name, -+ int num_options, -+ cups_option_t **options) -+{ -+ FILE *fp; -+ gchar line[1024], *lineptr, *name; -+ -+ if ((fp = g_fopen (filename, "r")) == NULL) -+ return num_options; -+ -+ while (fgets (line, sizeof (line), fp) != NULL) -+ { -+ if (strncasecmp (line, "dest", 4) == 0 && isspace (line[4])) -+ lineptr = line + 4; -+ else if (strncasecmp (line, "default", 7) == 0 && isspace (line[7])) -+ lineptr = line + 7; -+ else -+ continue; -+ -+ /* Skip leading whitespace */ -+ while (isspace (*lineptr)) -+ lineptr++; -+ -+ if (!*lineptr) -+ continue; -+ -+ /* NUL-terminate the name, stripping the instance name */ -+ name = lineptr; -+ while (!isspace (*lineptr) && *lineptr) -+ { -+ if (*lineptr == '/') -+ *lineptr = '\0'; -+ lineptr++; -+ } -+ -+ if (!*lineptr) -+ continue; -+ -+ *lineptr++ = '\0'; -+ -+ if (strncasecmp (name, printer_name, strlen (printer_name)) != 0) -+ continue; -+ -+ /* We found our printer, parse the options */ -+ num_options = cupsParseOptions (lineptr, num_options, options); -+ } -+ -+ fclose (fp); -+ -+ return num_options; -+} -+ -+static int -+cups_get_user_options (const char *printer_name, -+ int num_options, -+ cups_option_t **options) -+{ -+ int i; -+ -+ for (i = 0; i < sizeof (lpoptions_locations); i++) -+ { -+ if (g_path_is_absolute (lpoptions_locations[i])) -+ { -+ num_options = cups_parse_user_options (lpoptions_locations[i], -+ printer_name, -+ num_options, -+ options); -+ } -+ else -+ { -+ char *filename; -+ -+ filename = g_build_filename (g_get_home_dir (), -+ lpoptions_locations[i], NULL); -+ num_options = cups_parse_user_options (filename, printer_name, -+ num_options, options); -+ g_free (filename); -+ } -+ } -+ -+ return num_options; -+} - - static void - cups_request_default_printer_cb (GtkPrintBackendCups *print_backend, -@@ -1431,6 +1584,7 @@ cups_request_default_printer (GtkPrintBa - { - GtkCupsRequest *request; - const char *str; -+ char *name = NULL; - - if ((str = g_getenv ("LPDEST")) != NULL) - { -@@ -1446,6 +1600,15 @@ cups_request_default_printer (GtkPrintBa - return; - } - -+ /* Figure out user setting for default printer */ -+ cups_get_user_default_printer (&name); -+ if (name != NULL) -+ { -+ print_backend->default_printer = name; -+ print_backend->got_default_printer = TRUE; -+ return; -+ } -+ - request = gtk_cups_request_new (NULL, - GTK_CUPS_POST, - CUPS_GET_DEFAULT, -@@ -2214,6 +2377,9 @@ cups_printer_get_options (GtkPrinter - char *prio_display[] = {N_("Urgent"), N_("High"), N_("Medium"), N_("Low") }; - char *cover[] = {"none", "classified", "confidential", "secret", "standard", "topsecret", "unclassified" }; - char *cover_display[] = {N_("None"), N_("Classified"), N_("Confidential"), N_("Secret"), N_("Standard"), N_("Top Secret"), N_("Unclassified"),}; -+ char *name; -+ int num_opts; -+ cups_option_t *opts = NULL; - - - set = gtk_printer_option_set_new (); -@@ -2310,6 +2476,23 @@ cups_printer_get_options (GtkPrinter - handle_group (set, ppd_file, &ppd_file->groups[i], &ppd_file->groups[i], settings); - } - -+ /* Now honor the user set defaults for this printer */ -+ num_opts = cups_get_user_options (gtk_printer_get_name (printer), 0, &opts); -+ -+ for (i = 0; i < num_opts; i++) -+ { -+ if (STRING_IN_TABLE (opts->name, cups_option_blacklist)) -+ continue; -+ -+ name = get_option_name (opts[i].name); -+ option = gtk_printer_option_set_lookup (set, name); -+ if (option) -+ gtk_printer_option_set (option, opts[i].value); -+ g_free (name); -+ } -+ -+ cupsFreeOptions (num_opts, opts); -+ - return set; - } - diff --git a/sources b/sources index 8973980..6ea92a8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -33499772fdc3bea569c6d5673e5831b4 gtk+-2.12.9.tar.bz2 +6c07effe4cb8055aeb93702b08d68b1e gtk+-2.13.0.tar.bz2 diff --git a/tab-drag-crash.patch b/tab-drag-crash.patch deleted file mode 100644 index 296cfad..0000000 --- a/tab-drag-crash.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up gtk+-2.12.9/gtk/gtknotebook.c.tab-drag-crash gtk+-2.12.9/gtk/gtknotebook.c ---- gtk+-2.12.9/gtk/gtknotebook.c.tab-drag-crash 2008-04-09 21:50:07.000000000 -0400 -+++ gtk+-2.12.9/gtk/gtknotebook.c 2008-04-09 21:50:12.000000000 -0400 -@@ -2729,7 +2729,6 @@ hide_drag_window (GtkNotebook *no - else - gtk_widget_unparent (page->tab_label); - -- gtk_widget_set_parent_window (page->tab_label, widget->window); - gtk_widget_set_parent (page->tab_label, widget); - g_object_unref (page->tab_label); - }