~ubuntu-branches/ubuntu/precise/file-browser-applet/precise

« back to all changes in this revision

Viewing changes to src/context-menu.c

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2008-11-04 13:34:36 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081104133436-7kgxv6psv6mjnxh0
Tags: 0.6.0-0ubuntu1
* New upstream release.
 - Added context menu with a few actions (open-with, new folder here, 
   delete file/folder, create/extract archive, create CD/DVD from 
   file/folder, compile a tex file).
 - Added configuration option to make text vertical/horizontal when 
   the panel is vertical.
 - Added tooltips to configuration dialog.
 - Fixed bugs #21, #30, #34, #37, #39.
 - Plugged some memory leaks (thanks Silvio Ricardo Cordeiro).
 - Lots of code cleanup. 
* debian/control:
 - Add suggests on file-roller, brasero, and rubber 
   for new features.
 - Add Vcs-Bzr field.
 - Add versionized Build-Depend on libgtk2.0-dev (>= 2.14)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 * Boston, MA 02110-1301, USA.
24
24
 */
25
25
 
 
26
#include <glade/glade-xml.h>
 
27
#include <panel-applet.h>
26
28
#include <glib/gprintf.h>
27
29
#include <glib.h>
28
30
 
29
31
#include "context-menu.h"
30
32
#include "vfs.h"
31
33
 
32
 
/******************************************************************************/
33
 
static void
34
 
context_menu_add_delete_item (const gchar *file_name,
35
 
                                                          GtkWidget *menu) {
36
 
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
37
 
                                                          
38
 
        GtkWidget *menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_DELETE, NULL);
39
 
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
40
 
        
41
 
        GtkWidget *item_label = GTK_BIN (menu_item)->child;
42
 
        gtk_label_set_text (GTK_LABEL (item_label), "Move to Trash");
43
 
        
44
 
        g_signal_connect_swapped (G_OBJECT (menu_item),
45
 
                                                          "activate",
46
 
                                                          G_CALLBACK (vfs_trash_file),
47
 
                                                          (gpointer) file_name);
48
 
}
49
 
/******************************************************************************/
50
 
static void
51
 
context_menu_add_fake_items (const gchar *file_name,
52
 
                                                         GtkWidget *menu) {
53
 
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
54
 
 
55
 
        GtkWidget *menu_item;
56
 
        
57
 
        menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ABOUT, NULL);
58
 
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
59
 
 
60
 
        menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ADD, NULL);
61
 
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
62
 
 
63
 
        menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_APPLY, NULL);
64
 
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
65
 
 
66
 
        menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_BOLD, NULL);
67
 
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
68
 
 
69
 
        menu_item = gtk_image_menu_item_new_from_stock (GTK_STOCK_CDROM, NULL);
70
 
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
71
 
}
72
 
/******************************************************************************/
73
 
 
74
 
static void
75
 
context_menu_populate (const gchar *file_name,
76
 
                                           GtkWidget *menu) {
77
 
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
78
 
 
79
 
        context_menu_add_delete_item (file_name, menu);
80
 
        context_menu_add_fake_items (file_name, menu);
81
 
}
82
 
/******************************************************************************/
83
 
static void
84
 
context_menu_clean_up (GtkMenuShell *menu,
85
 
                                           GtkWidget *browser) {
86
 
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
87
 
 
 
34
Garbage garbage = NULL;
 
35
 
 
36
/******************************************************************************/
 
37
static char *archive_mime_types[] = {
 
38
        "application/x-ar",
 
39
        "application/x-arj",
 
40
        "application/x-bzip",
 
41
        "application/x-bzip-compressed-tar",
 
42
        "application/x-compress",
 
43
        "application/x-compressed-tar",
 
44
        "application/x-deb",
 
45
        "application/x-gtar",
 
46
        "application/x-gzip",
 
47
        "application/x-lha",
 
48
        "application/x-lhz",
 
49
        "application/x-rar",
 
50
        "application/x-rar-compressed",
 
51
        "application/x-tar",
 
52
        "application/x-zip",
 
53
        "application/x-zip-compressed",
 
54
        "application/zip",
 
55
        "multipart/x-zip",
 
56
        "application/x-rpm",
 
57
        "application/x-jar",
 
58
        "application/x-java-archive",
 
59
        "application/x-lzop",
 
60
        "application/x-zoo",
 
61
        "application/x-cd-image",
 
62
        "application/x-7z-compressed",
 
63
        "application/x-gzpostscript",
 
64
        "application/x-ms-dos-executable",
 
65
        NULL
 
66
};
 
67
/******************************************************************************/
 
68
static void
 
69
tree_set_sensitive (GtkWidget *menu_item, gboolean sensitive) {
 
70
        /* walk up the menu browser tree from the menu item that causes the popup
 
71
         * menu and disable all the menu shells, stopping at the menu bar. Need to
 
72
         * do this to get around the focus bug. Would be nicer if we couls do this
 
73
         * w/o changing the appearance of the widgets  */
 
74
        GtkWidget *current = menu_item->parent;
 
75
        while (current) {
 
76
                gtk_widget_set_sensitive (current, sensitive);
 
77
 
 
78
                if (GTK_IS_MENU_BAR (current)) return;
 
79
 
 
80
                current = GTK_MENU_SHELL (current)->parent_menu_shell;
 
81
        }
 
82
}
 
83
/******************************************************************************/
 
84
static void
 
85
context_menu_clean_up (GtkMenuShell *menu) {
 
86
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
 
87
 
 
88
        g_return_if_fail (GTK_IS_MENU_SHELL (menu));
 
89
 
 
90
        /* re-enable the menu browser */
 
91
        GtkWidget *tree_menu_item = g_object_get_data (G_OBJECT (menu), "menu_item");
 
92
        if (tree_menu_item)
 
93
                tree_set_sensitive (tree_menu_item, TRUE);
 
94
 
 
95
        /* close the menu browser tree */
 
96
        GtkWidget *browser = g_object_get_data (G_OBJECT (menu), "menu_browser");
88
97
        GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (browser));
89
98
        gtk_menu_shell_deactivate (GTK_MENU_SHELL (parent));
90
 
        
91
 
/*      gtk_grab_remove (GTK_WIDGET (menu));*/
92
 
/*      gdk_pointer_ungrab (GDK_CURRENT_TIME);*/
93
 
        
 
99
 
 
100
        /* delete the popup menu and empty the garbage */
94
101
        gtk_widget_destroy (GTK_WIDGET (menu));
 
102
        garbage_empty (&garbage, FALSE);
 
103
}
 
104
/******************************************************************************/
 
105
/* originally wanted to use nautilus burn for this, but it doesn't seem
 
106
 * possible to programmatically add files to burn:/// */
 
107
/*
 
108
static void
 
109
context_menu_add_burn_callback (const gchar *file_name) {
 
110
        GFile *source = g_file_new_for_path (file_name);
 
111
        GFile *destination = g_file_new_for_uri ("burn:///");
 
112
 
 
113
        GError *error = NULL;
 
114
 
 
115
        g_file_copy (source,
 
116
                                 destination,
 
117
                                 G_FILE_COPY_OVERWRITE,
 
118
                                 NULL,
 
119
                                 NULL,
 
120
                                 NULL,
 
121
                                 &error);
 
122
 
 
123
        utils_gerror_ok (&error, TRUE);
 
124
}
 
125
*/
 
126
/******************************************************************************/
 
127
static void
 
128
context_menu_add_new_dir_callback (gchar *file_name) {
 
129
        GError *error = NULL;
 
130
 
 
131
        GladeXML* xml = glade_xml_new (GLADEUI_PATH, "new_dir_dialog", NULL);
 
132
        g_return_if_fail (xml != NULL);
 
133
 
 
134
        GtkWidget *new_dir_dialog = glade_xml_get_widget (xml, "new_dir_dialog");
 
135
        GtkWidget *new_dir_entry  = glade_xml_get_widget (xml, "new_dir_entry");
 
136
 
 
137
        if (gtk_dialog_run (GTK_DIALOG (new_dir_dialog)) == GTK_RESPONSE_ACCEPT) {
 
138
                const gchar *entry_text = gtk_entry_get_text (GTK_ENTRY (new_dir_entry));
 
139
                gchar *new_dir = g_strdup_printf ("%s/%s", file_name, entry_text);
 
140
 
 
141
                GFile *file = g_file_new_for_path (new_dir);
 
142
                g_file_make_directory (file, NULL, &error);
 
143
                g_object_unref (file);
 
144
 
 
145
                /* open the dir if we succeeded in creating it */
 
146
                if (utils_gerror_ok (&error, TRUE)) {
 
147
                        vfs_file_do_default_action (new_dir);
 
148
                }
 
149
        }
 
150
        gtk_widget_destroy (new_dir_dialog);
 
151
        g_free (file_name);
 
152
}
 
153
/******************************************************************************/
 
154
static void
 
155
context_menu_add_new_dir (const gchar *file_name, GtkWidget *menu) {
 
156
 
 
157
        if (!vfs_file_is_directory (file_name)) return;
 
158
 
 
159
        GtkWidget *menu_item = gtk_image_menu_item_new_with_mnemonic ("_New Folder Here");
 
160
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item),
 
161
                                                                   gtk_image_new_from_stock (GTK_STOCK_NEW,
 
162
                                                                                                                         GTK_ICON_SIZE_MENU));
 
163
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
 
164
 
 
165
        g_signal_connect_swapped (G_OBJECT (menu_item),
 
166
                                                          "activate",
 
167
                                                          G_CALLBACK (context_menu_add_new_dir_callback),
 
168
                                                          (gpointer) g_strdup (file_name));     
 
169
}
 
170
/******************************************************************************/
 
171
static void
 
172
context_menu_add_burn (const gchar *file_name, GtkWidget *menu) {
 
173
        GtkWidget *menu_item = gtk_image_menu_item_new_with_mnemonic ("_Create CD/DVD");
 
174
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item),
 
175
                                                                   gtk_image_new_from_icon_name ("nautilus-cd-burner",
 
176
                                                                                                                                 GTK_ICON_SIZE_MENU));
 
177
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
 
178
 
 
179
        LaunchInfo *launch_info = g_new0 (LaunchInfo, 1);
 
180
        launch_info->command = g_strdup ("brasero");
 
181
        launch_info->file = g_strdup (file_name);
 
182
 
 
183
        g_signal_connect_swapped (G_OBJECT (menu_item),
 
184
                                                          "activate",
 
185
                                                          G_CALLBACK (vfs_launch_application),
 
186
                                                          (gpointer) launch_info);
 
187
 
 
188
        garbage_add_item (garbage, launch_info);
 
189
        garbage_add_item (garbage, launch_info->command);
 
190
        garbage_add_item (garbage, launch_info->file);
 
191
}
 
192
/******************************************************************************/
 
193
static void
 
194
context_menu_add_compile_tex (const gchar *file_name, GtkWidget *menu) {
 
195
 
 
196
        if (!g_str_has_suffix (file_name, "tex")) return;
 
197
 
 
198
        GtkWidget *menu_item = gtk_image_menu_item_new_with_mnemonic ("_Build Latex Document");
 
199
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item),
 
200
                                                                   gtk_image_new_from_icon_name ("build",
 
201
                                                                                                                                 GTK_ICON_SIZE_MENU));
 
202
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
 
203
        
 
204
        LaunchInfo *launch_info = g_new0 (LaunchInfo, 1);
 
205
        launch_info->command = g_strdup ("rubber -f --inplace -d");
 
206
        launch_info->file = g_strdup (file_name);
 
207
 
 
208
        g_signal_connect_swapped (G_OBJECT (menu_item),
 
209
                                                          "activate",
 
210
                                                          G_CALLBACK (vfs_launch_application),
 
211
                                                          (gpointer) launch_info);
 
212
 
 
213
        garbage_add_item (garbage, launch_info);
 
214
        garbage_add_item (garbage, launch_info->command);
 
215
        garbage_add_item (garbage, launch_info->file);
 
216
}
 
217
/******************************************************************************/
 
218
static gboolean
 
219
is_archive (const gchar *file_name) {
 
220
        gboolean ret = FALSE;
 
221
        GFile*     file = g_file_new_for_path (file_name);
 
222
        GFileInfo* file_info =  g_file_query_info (file,
 
223
                                                                                           G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
 
224
                                                                                           0,
 
225
                                                                                           NULL,                                                                                           
 
226
                                                                                           NULL);
 
227
 
 
228
        const gchar* content_type = g_file_info_get_content_type (file_info);
 
229
 
 
230
        int i;
 
231
        for (i = 0; archive_mime_types[i] != NULL; i++) {
 
232
                if (g_strcmp0 (content_type, archive_mime_types[i]) == 0) {
 
233
                        ret = TRUE;
 
234
                        break;
 
235
                }
 
236
        }
 
237
        g_object_unref (file_info);
 
238
        g_object_unref (file);
 
239
 
 
240
        return ret;
 
241
}
 
242
/******************************************************************************/
 
243
static void
 
244
context_menu_add_archive_action (const gchar *file_name, GtkWidget *menu) {
 
245
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
 
246
 
 
247
        gchar *archive_label = NULL;
 
248
        gchar *archive_action = NULL;
 
249
 
 
250
        if (is_archive (file_name)) {
 
251
                archive_label = "_Extract Here";
 
252
                archive_action = "file-roller -h";
 
253
        }
 
254
        else {
 
255
                archive_label = "Create _Archive";
 
256
                archive_action = "file-roller -d";
 
257
        }
 
258
 
 
259
        GtkWidget *menu_item = gtk_image_menu_item_new_with_mnemonic (archive_label);
 
260
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item),
 
261
                                                                   gtk_image_new_from_icon_name ("package",
 
262
                                                                                                                                 GTK_ICON_SIZE_MENU));
 
263
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
 
264
        
 
265
        LaunchInfo *launch_info = g_new0 (LaunchInfo, 1);
 
266
        launch_info->command = g_strdup (archive_action);
 
267
        launch_info->file = g_strdup (file_name);
 
268
 
 
269
        g_signal_connect_swapped (G_OBJECT (menu_item),
 
270
                                                          "activate",
 
271
                                                          G_CALLBACK (vfs_launch_application),
 
272
                                                          (gpointer) launch_info);
 
273
 
 
274
        garbage_add_item (garbage, launch_info);
 
275
        garbage_add_item (garbage, launch_info->command);
 
276
        garbage_add_item (garbage, launch_info->file);
 
277
}
 
278
/******************************************************************************/
 
279
static void
 
280
context_menu_add_open_with_item (const gchar *file_name, GtkWidget *menu) {
 
281
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
 
282
 
 
283
        GList *root = vfs_get_all_mime_applications (file_name);
 
284
        GList *apps = root;
 
285
        
 
286
        if (root == NULL) return;
 
287
 
 
288
        GtkWidget *menu_item = gtk_image_menu_item_new_with_mnemonic ("_Open With");
 
289
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item),
 
290
                                                                   gtk_image_new_from_stock (GTK_STOCK_OPEN,
 
291
                                                                                                                         GTK_ICON_SIZE_MENU));
 
292
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
 
293
 
 
294
        GtkWidget *sub_menu = gtk_menu_new ();
 
295
        /* sigh! The browser menu does not close properly if the popup menu is
 
296
         * cancelled from a submenu in the popup menu*/
 
297
        g_signal_connect_swapped (GTK_MENU_SHELL (sub_menu),
 
298
                                          "selection_done",
 
299
                                          G_CALLBACK (context_menu_clean_up),
 
300
                                          menu);
 
301
 
 
302
        gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item),
 
303
                                                           sub_menu);
 
304
 
 
305
        while (apps != NULL) {
 
306
                menu_item = gtk_image_menu_item_new_with_label (g_app_info_get_name (apps->data));
 
307
                gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item),
 
308
                                                                           gtk_image_new_from_gicon (g_app_info_get_icon (apps->data),
 
309
                                                                                                                                 GTK_ICON_SIZE_MENU));
 
310
 
 
311
                LaunchInfo *launch_info = g_new0 (LaunchInfo, 1);
 
312
                launch_info->command = g_strdup (g_app_info_get_executable (apps->data));
 
313
                launch_info->file = g_strdup (file_name);
 
314
 
 
315
                g_signal_connect_swapped (GTK_MENU_ITEM (menu_item),
 
316
                                                                  "activate",
 
317
                                                                  G_CALLBACK (vfs_launch_application),
 
318
                                                                  (gpointer) launch_info);
 
319
 
 
320
                gtk_menu_shell_append (GTK_MENU_SHELL (sub_menu), menu_item);
 
321
 
 
322
                garbage_add_item (garbage, launch_info);
 
323
                garbage_add_item (garbage, launch_info->command);
 
324
                garbage_add_item (garbage, launch_info->file);
 
325
 
 
326
                g_object_unref (apps->data);
 
327
                apps = apps->next;
 
328
        }
 
329
        g_list_free (root);
 
330
}
 
331
/******************************************************************************/
 
332
static void
 
333
context_menu_add_trash_item (const gchar *file_name, GtkWidget *menu) {
 
334
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
 
335
                                                  
 
336
        GtkWidget *menu_item = gtk_image_menu_item_new_with_mnemonic ("_Move to Trash");
 
337
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item),
 
338
                                                                                                                gtk_image_new_from_stock (GTK_STOCK_DELETE,
 
339
                                                                                                                                                                  GTK_ICON_SIZE_MENU));
 
340
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
 
341
        
 
342
        g_signal_connect_swapped (G_OBJECT (menu_item),
 
343
                                                          "activate",
 
344
                                                          G_CALLBACK (vfs_file_trash),
 
345
                                                          (gpointer) g_strdup (file_name));
 
346
}
 
347
/******************************************************************************/
 
348
/*
 
349
static void
 
350
context_menu_add_close_item (GtkWidget *menu) {
 
351
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
 
352
 
 
353
        gtk_menu_shell_append (GTK_MENU_SHELL (menu),
 
354
                                                   gtk_separator_menu_item_new());
 
355
 
 
356
        gtk_menu_shell_append (GTK_MENU_SHELL (menu),
 
357
                                                   gtk_image_menu_item_new_from_stock (GTK_STOCK_CLOSE, NULL));
 
358
}
 
359
*/
 
360
/******************************************************************************/
 
361
static void
 
362
context_menu_populate (const gchar *file_name, GtkWidget *menu) {
 
363
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
 
364
 
 
365
        context_menu_add_open_with_item (file_name, menu);
 
366
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_separator_menu_item_new());
 
367
        context_menu_add_new_dir                (file_name, menu);
 
368
        context_menu_add_trash_item             (file_name, menu);
 
369
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_separator_menu_item_new());
 
370
        context_menu_add_archive_action (file_name, menu);
 
371
        context_menu_add_compile_tex    (file_name, menu);
 
372
        context_menu_add_burn                   (file_name, menu);
 
373
        /*context_menu_add_close_item           (menu);*/
 
374
 
 
375
        gtk_widget_show_all (menu);
95
376
}
96
377
/******************************************************************************/
97
378
gboolean
98
 
context_menu_display (const gchar *file_name,
99
 
                                          GtkWidget *menu_item) {
 
379
context_menu_display (const gchar *file_name, GtkWidget *menu_item) {
100
380
        if (DEBUG) g_printf ("In %s\n", __FUNCTION__);
101
381
 
102
382
        int event_button;
103
383
        int event_time;
104
384
 
105
 
        GdkEventButton *event = g_object_get_data (G_OBJECT (menu_item),
106
 
                                                                                           "button_event");
 
385
        GdkEventButton *event = g_object_get_data (G_OBJECT (menu_item), "button_event");
107
386
        if (event) {
108
387
                event_button = event->button;
109
388
                event_time = event->time;
113
392
                event_time = gtk_get_current_event_time();
114
393
        }
115
394
 
116
 
        GtkWidget *browser = g_object_get_data (G_OBJECT (menu_item),
117
 
                                                                                          "menu_browser");
118
 
 
119
 
/*
120
 
GtkWidget *panel_menu_bar = gtk_widget_get_parent (GTK_WIDGET (browser));
121
 
GtkWidget *parent_menu = gtk_widget_get_parent (GTK_WIDGET (menu_item));
122
 
GtkMenuShell *panel_menu_bar_shell = GTK_MENU_SHELL (panel_menu_bar);
123
 
GtkWidget *applet = gtk_widget_get_parent (GTK_WIDGET (panel_menu_bar));
124
 
GtkWidget *panel = gtk_widget_get_parent (GTK_WIDGET (applet));
125
 
*/
 
395
        garbage_init (&garbage);
126
396
 
127
397
        GtkWidget *menu = gtk_menu_new ();
128
398
 
 
399
        /* add some data to the popup menu so we can ge to it later */
 
400
        GtkWidget *menu_browser = g_object_get_data (G_OBJECT (menu_item), "menu_browser");
 
401
        g_object_set_data (G_OBJECT (menu), "menu_browser", menu_browser);
 
402
        g_object_set_data (G_OBJECT (menu), "menu_item", menu_item);
 
403
 
129
404
        g_signal_connect (GTK_MENU_SHELL (menu),
130
405
                                          "selection_done",
131
406
                                          G_CALLBACK (context_menu_clean_up),
132
 
                                          browser);
 
407
                                          NULL);
133
408
 
134
409
        context_menu_populate (file_name, menu);
135
410
 
136
 
        gtk_widget_show_all (menu);
 
411
        /* disable the menu browser to get around the focus bug */
 
412
        tree_set_sensitive (menu_item, FALSE);
137
413
 
138
414
        gtk_menu_popup (GTK_MENU (menu),
139
415
                                        NULL,
142
418
                                        NULL,
143
419
                                        event_button,
144
420
                                        event_time);
145
 
 
146
 
/*gtk_grab_add (GTK_WIDGET (menu));*/
147
 
/*gdk_pointer_grab (GTK_WIDGET (menu)->window,
148
 
                                  TRUE,
149
 
                                  0,
150
 
                                  NULL,
151
 
                                  NULL,
152
 
                                  GDK_CURRENT_TIME);*/
153
 
 
154
421
        return TRUE;
155
422
}
156
423
/******************************************************************************/