aboutsummaryrefslogtreecommitdiffstats
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 @@
+0.9.7 use a new menu bar from gtk_ui_manager, so need a translation here to
+enable owl menu
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Index: pcmanfm-0.9.7/configure.ac
+===================================================================
+--- pcmanfm-0.9.7.orig/configure.ac 2010-07-27 10:28:12.000000000 +0800
++++ pcmanfm-0.9.7/configure.ac 2010-07-27 18:03:42.000000000 +0800
+@@ -70,6 +70,8 @@
+
+ gtk_modules="gtk+-2.0 >= 2.16.0"
+ PKG_CHECK_MODULES(GTK, [$gtk_modules])
++OWL_LIBS="-lowl"
++GTK_LIBS="$GTK_LIBS $OWL_LIBS"
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+
+Index: pcmanfm-0.9.7/src/main-win.c
+===================================================================
+--- pcmanfm-0.9.7.orig/src/main-win.c 2010-07-27 10:56:08.000000000 +0800
++++ pcmanfm-0.9.7/src/main-win.c 2010-07-27 17:28:59.000000000 +0800
+@@ -36,6 +36,8 @@
+ #include "main-win.h"
+ #include "pref.h"
+
++#include "libowl/owlwindowmenu.h"
++
+ static void fm_main_win_finalize (GObject *object);
+ G_DEFINE_TYPE(FmMainWin, fm_main_win, GTK_TYPE_WINDOW);
+
+@@ -466,9 +468,27 @@
+ fm_main_win_chdir(win, path);
+ }
+
++/* Transfer gtk_ui_manager menubar to gtk menubar */
++static GtkWidget * ui_menubar_to_menu(GtkWidget *menubar)
++{
++ GtkWidget *main_menu;
++ GList *iter;
++
++ main_menu = gtk_menu_new();
++
++ for ( iter = gtk_container_get_children(GTK_CONTAINER(menubar));
++ iter;
++ iter = g_list_next(iter) )
++ {
++ GtkWidget *menu = GTK_WIDGET(iter->data);
++ gtk_widget_reparent(menu, main_menu);
++ }
++ return main_menu;
++}
++
+ static void fm_main_win_init(FmMainWin *self)
+ {
+- GtkWidget *vbox, *menubar, *toolitem, *scroll;
++ GtkWidget *vbox, *menubar, *owl_menubar, *toolitem, *scroll;
+ GtkUIManager* ui;
+ GtkActionGroup* act_grp;
+ GtkAction* act;
+@@ -537,7 +557,6 @@
+
+ self->popup = gtk_ui_manager_get_widget(ui, "/popup");
+
+- gtk_box_pack_start( (GtkBox*)vbox, menubar, FALSE, TRUE, 0 );
+ gtk_box_pack_start( (GtkBox*)vbox, self->toolbar, FALSE, TRUE, 0 );
+
+ /* load bookmarks menu */
+@@ -586,6 +605,11 @@
+ gtk_container_add( (GtkContainer*)self, vbox );
+ gtk_widget_show_all(vbox);
+
++ owl_menubar = ui_menubar_to_menu(menubar);
++ gtk_widget_show_all (owl_menubar);
++ owl_set_window_menu (GTK_WINDOW(self),
++ GTK_MENU(owl_menubar));
++
+ /* create new tab */
+ fm_main_win_add_tab(self, fm_path_get_home());
+ gtk_widget_grab_focus(self->folder_view);