summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2018-07-30 16:05:33 +0200
committerGitHub <noreply@github.com>2018-07-30 16:05:33 +0200
commit22b6b89e7d03e479b6e81a7c5557e38c0a1d3107 (patch)
tree496fdd8fc05c87d36a944736fb6529e5c2c4938b
parent98394f10547645b007adb747102362ab8a78f908 (diff)
downloadmidori-git-22b6b89e7d03e479b6e81a7c5557e38c0a1d3107.tar.gz
Honor GTK_CSD=0 to disable CSD (#4)
Make the headerbar, which is also the tab strip, the first child within the window if CSD is disabled. ![screenshot from 2018-07-25 17-18-39](https://user-images.githubusercontent.com/1204189/43210809-59e5683a-9030-11e8-9933-a550a271a4d3.png)
-rw-r--r--core/browser.vala12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/browser.vala b/core/browser.vala
index ff51f2b2..7b147a4b 100644
--- a/core/browser.vala
+++ b/core/browser.vala
@@ -179,6 +179,18 @@ namespace Midori {
provider.load_from_resource ("/data/gtk3.css");
Gtk.StyleContext.add_provider_for_screen (get_screen (), provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+
+ // Make headerbar (titlebar) the topmost bar if CSD is disabled
+ if (Environment.get_variable ("GTK_CSD") == "0") {
+ var titlebar = (Gtk.HeaderBar)get_titlebar ();
+ titlebar.ref ();
+ set_titlebar (null);
+ titlebar.show_close_button = false;
+ var box = (navigationbar.parent as Gtk.Box);
+ box.add (titlebar);
+ box.reorder_child (titlebar, 0);
+ titlebar.unref ();
+ }
}
public Browser (App app) {