Skip to content

Instantly share code, notes, and snippets.

@shellexy
Created October 26, 2011 13:53
Show Gist options
  • Save shellexy/1316417 to your computer and use it in GitHub Desktop.
Save shellexy/1316417 to your computer and use it in GitHub Desktop.
让 nautilus 在桌面没有使用 appmenu 时不要显示多余的屏幕顶部菜单栏
diff --git a/nautilus-3.2.0/src/nautilus-desktop-window.c b/nautilus-3.2.0/src/nautilus-desktop-window.c
--- a/nautilus-3.2.0/src/nautilus-desktop-window.c
+++ b/nautilus-3.2.0/src/nautilus-desktop-window.c
@@ -246,6 +246,11 @@ nautilus_desktop_window_constructed (GOb
g_signal_connect_swapped (nautilus_preferences, "changed::" NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR,
G_CALLBACK (nautilus_desktop_window_update_directory),
window);
+
+ GtkWidget * menubar_parent = gtk_widget_get_parent (NAUTILUS_WINDOW (window)->details->menubar);
+ GtkWidget * menubar_viewport = gtk_viewport_new (NULL, NULL);
+ gtk_widget_reparent (NAUTILUS_WINDOW (window)->details->menubar, menubar_viewport);
+ gtk_table_attach (GTK_TABLE (menubar_parent), menubar_viewport, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
}
static void
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment