From ce269c79bfccee61d3136ba0ca5bb04690f2dba5 Mon Sep 17 00:00:00 2001 From: Jim Nelson Date: Fri, 4 Apr 2014 14:56:38 -0700 Subject: [PATCH] --enable-unity flag to deal with GtkHeaderBar issues: Refs bgo#727624 Unity doesn't deal well with pure GtkHeaderBar apps, so this allows for the GtkHeaderBar to be treated like a toolbar and the window retain its chrome. --- configure | 6 ++++++ debian/rules | 2 +- src/CMakeLists.txt | 10 ++++++++++ src/client/components/main-window.vala | 9 +++++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 89fb4c74..4eb7e9d9 100755 --- a/configure +++ b/configure @@ -24,6 +24,8 @@ configure_help() { --disable-fatal-warnings Disable Vala fatal warnings when compiling. + --enable-unity + Enable Unity interface changes. --enable-ref-tracking Enable reference tracking which is dumped to stdout when the program exits. --disable-schemas-compile @@ -90,6 +92,10 @@ do CMDLINE="${CMDLINE} -DREF_TRACKING=ON" ;; + --enable-unity) + CMDLINE="${CMDLINE} -DENABLE_UNITY=ON" + ;; + --disable-schemas-compile) CMDLINE="${CMDLINE} -DGSETTINGS_COMPILE=OFF" CMDLINE="${CMDLINE} -DGSETTINGS_COMPILE_IN_PLACE=OFF" diff --git a/debian/rules b/debian/rules index 5a411ae5..3800f341 100755 --- a/debian/rules +++ b/debian/rules @@ -13,7 +13,7 @@ dh $@ --parallel override_dh_auto_configure: - ./configure --prefix=/usr + ./configure --prefix=/usr --enable-unity override_dh_strip: dh_strip --dbg-package=geary-dbg diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 54ab64a6..d28385bb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -579,6 +579,16 @@ else () message(STATUS "Reference tracking: OFF") endif () +if (ENABLE_UNITY) + message(STATUS "Unity interface changes: ON") + set(EXTRA_VALA_OPTIONS + ${EXTRA_VALA_OPTIONS} + --define=ENABLE_UNITY + ) +else () + message(STATUS "Unity interface changes: OFF") +endif () + set(LIB_PATHS ${DEPS_LIBRARY_DIRS}) link_directories(${LIB_PATHS}) add_definitions(${CFLAGS}) diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala index 0a013ce0..cd50bce6 100644 --- a/src/client/components/main-window.vala +++ b/src/client/components/main-window.vala @@ -73,12 +73,14 @@ public class MainWindow : Gtk.ApplicationWindow { Geary.Engine.instance.account_available.connect(on_account_available); Geary.Engine.instance.account_unavailable.connect(on_account_unavailable); - create_layout(); - // Toolbar. main_toolbar = new MainToolbar(); +#if !ENABLE_UNITY main_toolbar.show_close_button = true; set_titlebar(main_toolbar); +#endif + + create_layout(); } public override void show_all() { @@ -171,6 +173,9 @@ public class MainWindow : Gtk.ApplicationWindow { folder_paned.pack1(status_bar_box, false, false); folder_paned.pack2(conversations_paned, true, false); +#if ENABLE_UNITY + main_layout.pack_start(main_toolbar, false, true, 0); +#endif main_layout.pack_end(folder_paned, true, true, 0); add(main_layout);