summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato/pcmanfm/files/owl-window-menu.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-sato/pcmanfm/files/owl-window-menu.patch')
-rw-r--r--meta/recipes-sato/pcmanfm/files/owl-window-menu.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/meta/recipes-sato/pcmanfm/files/owl-window-menu.patch b/meta/recipes-sato/pcmanfm/files/owl-window-menu.patch
new file mode 100644
index 0000000000..f3d4e61a22
--- /dev/null
+++ b/meta/recipes-sato/pcmanfm/files/owl-window-menu.patch
@@ -0,0 +1,80 @@
10.9.7 use a new menu bar from gtk_ui_manager, so need a translation here to
2enable owl menu
3
4Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
5
6Index: pcmanfm-0.9.7/configure.ac
7===================================================================
8--- pcmanfm-0.9.7.orig/configure.ac 2010-07-27 10:28:12.000000000 +0800
9+++ pcmanfm-0.9.7/configure.ac 2010-07-27 18:03:42.000000000 +0800
10@@ -70,6 +70,8 @@
11
12 gtk_modules="gtk+-2.0 >= 2.16.0"
13 PKG_CHECK_MODULES(GTK, [$gtk_modules])
14+OWL_LIBS="-lowl"
15+GTK_LIBS="$GTK_LIBS $OWL_LIBS"
16 AC_SUBST(GTK_CFLAGS)
17 AC_SUBST(GTK_LIBS)
18
19Index: pcmanfm-0.9.7/src/main-win.c
20===================================================================
21--- pcmanfm-0.9.7.orig/src/main-win.c 2010-07-27 10:56:08.000000000 +0800
22+++ pcmanfm-0.9.7/src/main-win.c 2010-07-27 17:28:59.000000000 +0800
23@@ -36,6 +36,8 @@
24 #include "main-win.h"
25 #include "pref.h"
26
27+#include "libowl/owlwindowmenu.h"
28+
29 static void fm_main_win_finalize (GObject *object);
30 G_DEFINE_TYPE(FmMainWin, fm_main_win, GTK_TYPE_WINDOW);
31
32@@ -466,9 +468,27 @@
33 fm_main_win_chdir(win, path);
34 }
35
36+/* Transfer gtk_ui_manager menubar to gtk menubar */
37+static GtkWidget * ui_menubar_to_menu(GtkWidget *menubar)
38+{
39+ GtkWidget *main_menu;
40+ GList *iter;
41+
42+ main_menu = gtk_menu_new();
43+
44+ for ( iter = gtk_container_get_children(GTK_CONTAINER(menubar));
45+ iter;
46+ iter = g_list_next(iter) )
47+ {
48+ GtkWidget *menu = GTK_WIDGET(iter->data);
49+ gtk_widget_reparent(menu, main_menu);
50+ }
51+ return main_menu;
52+}
53+
54 static void fm_main_win_init(FmMainWin *self)
55 {
56- GtkWidget *vbox, *menubar, *toolitem, *scroll;
57+ GtkWidget *vbox, *menubar, *owl_menubar, *toolitem, *scroll;
58 GtkUIManager* ui;
59 GtkActionGroup* act_grp;
60 GtkAction* act;
61@@ -537,7 +557,6 @@
62
63 self->popup = gtk_ui_manager_get_widget(ui, "/popup");
64
65- gtk_box_pack_start( (GtkBox*)vbox, menubar, FALSE, TRUE, 0 );
66 gtk_box_pack_start( (GtkBox*)vbox, self->toolbar, FALSE, TRUE, 0 );
67
68 /* load bookmarks menu */
69@@ -586,6 +605,11 @@
70 gtk_container_add( (GtkContainer*)self, vbox );
71 gtk_widget_show_all(vbox);
72
73+ owl_menubar = ui_menubar_to_menu(menubar);
74+ gtk_widget_show_all (owl_menubar);
75+ owl_set_window_menu (GTK_WINDOW(self),
76+ GTK_MENU(owl_menubar));
77+
78 /* create new tab */
79 fm_main_win_add_tab(self, fm_path_get_home());
80 gtk_widget_grab_focus(self->folder_view);