~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to debian/patches/020_immodules-files-d.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: gtk+2.0-2.10.10/gtk/gtkimmodule.c
 
2
===================================================================
 
3
--- gtk+2.0-2.10.10.orig/gtk/gtkimmodule.c      2007-03-12 14:51:28.000000000 +0100
 
4
+++ gtk+2.0-2.10.10/gtk/gtkimmodule.c   2007-03-13 14:10:33.000000000 +0100
 
5
@@ -59,6 +59,9 @@
 
6
 #define GTK_IM_MODULE(im_module)    (G_TYPE_CHECK_INSTANCE_CAST ((im_module), GTK_TYPE_IM_MODULE, GtkIMModule))
 
7
 #define GTK_IS_IM_MODULE(im_module) (G_TYPE_CHECK_INSTANCE_TYPE ((im_module), GTK_TYPE_IM_MODULE))
 
8
 
 
9
+#define IMMODULEFILEEXT ".immodules"
 
10
+#define IMMODULEFILEEXT_LEN ((int) strlen (IMMODULEFILEEXT))
 
11
+
 
12
 struct _GtkIMModule
 
13
 {
 
14
   GTypeModule parent_instance;
 
15
@@ -261,31 +264,15 @@
 
16
 
 
17
 
 
18
 static void
 
19
-gtk_im_module_initialize (void)
 
20
+process_module_file (const gchar *filename, FILE *file)
 
21
 {
 
22
   GString *line_buf = g_string_new (NULL);
 
23
   GString *tmp_buf = g_string_new (NULL);
 
24
-  gchar *filename = gtk_rc_get_im_module_file();
 
25
-  FILE *file;
 
26
   gboolean have_error = FALSE;
 
27
 
 
28
   GtkIMModule *module = NULL;
 
29
   GSList *infos = NULL;
 
30
 
 
31
-  contexts_hash = g_hash_table_new (g_str_hash, g_str_equal);
 
32
-
 
33
-  file = g_fopen (filename, "r");
 
34
-  if (!file)
 
35
-    {
 
36
-      /* In case someone wants only the default input method,
 
37
-       * we allow no file at all.
 
38
-       */
 
39
-      g_string_free (line_buf, TRUE);
 
40
-      g_string_free (tmp_buf, TRUE);
 
41
-      g_free (filename);
 
42
-      return;
 
43
-    }
 
44
-
 
45
   while (!have_error && pango_read_line (file, line_buf))
 
46
     {
 
47
       const char *p;
 
48
@@ -383,10 +370,76 @@
 
49
   else if (module)
 
50
     add_module (module, infos);
 
51
 
 
52
-  fclose (file);
 
53
   g_string_free (line_buf, TRUE);
 
54
   g_string_free (tmp_buf, TRUE);
 
55
-  g_free (filename);
 
56
+}
 
57
+
 
58
+static void
 
59
+gtk_im_module_initialize (void)
 
60
+{
 
61
+  gchar *im_module_file_str = gtk_rc_get_im_module_file();
 
62
+  gchar *im_module_files_d_str = g_build_filename (GTK_LIBDIR,
 
63
+                                                  "gtk-2.0",
 
64
+                                                  GTK_BINARY_VERSION,
 
65
+                                                  "immodule-files.d",
 
66
+                                                  NULL);
 
67
+  FILE *file;
 
68
+  gchar *list_str;
 
69
+  char **files;
 
70
+  int n;
 
71
+
 
72
+  list_str = g_strjoin (G_SEARCHPATH_SEPARATOR_S,
 
73
+                       im_module_file_str,
 
74
+                       im_module_files_d_str,
 
75
+                       NULL);
 
76
+
 
77
+  files = pango_split_file_list (list_str);
 
78
+
 
79
+  contexts_hash = g_hash_table_new (g_str_hash, g_str_equal);
 
80
+
 
81
+  n = 0;
 
82
+  while (files[n])
 
83
+    n++;
 
84
+
 
85
+  while (n-- > 0)
 
86
+    {
 
87
+      GDir *dir = g_dir_open (files[n], 0, NULL);
 
88
+      if (dir)
 
89
+       {
 
90
+         const char *dent;
 
91
+
 
92
+         while ((dent = g_dir_read_name (dir)))
 
93
+           {
 
94
+             int len = strlen (dent);
 
95
+             if (len > IMMODULEFILEEXT_LEN && strcmp (dent + len - IMMODULEFILEEXT_LEN, IMMODULEFILEEXT) == 0)
 
96
+               {
 
97
+                 gchar *pathname = g_build_filename (files[n], dent, NULL);
 
98
+                 file = g_fopen (pathname, "r");
 
99
+                 if (file)
 
100
+                   {
 
101
+                     process_module_file(pathname, file);
 
102
+                     fclose(file);
 
103
+                   }
 
104
+                 g_free (pathname);
 
105
+               }
 
106
+           }
 
107
+         g_dir_close (dir);
 
108
+       }
 
109
+      else
 
110
+       {
 
111
+         file = g_fopen (files[n], "r");
 
112
+         if (file)
 
113
+           {
 
114
+             process_module_file(files[n], file);
 
115
+             fclose (file);
 
116
+           }
 
117
+       }
 
118
+    }
 
119
+
 
120
+  g_strfreev (files);
 
121
+  g_free (list_str);
 
122
+  g_free (im_module_files_d_str);
 
123
+  g_free (im_module_file_str);
 
124
 }
 
125
 
 
126
 static gint