[gnome-mines/gnome-3-14] Use XDG_CURRENT_DESKTOP to decide whether to use a header bar
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mines/gnome-3-14] Use XDG_CURRENT_DESKTOP to decide whether to use a header bar
- Date: Mon, 13 Oct 2014 19:06:44 +0000 (UTC)
commit cee47b72e4c9a3fb6b42b93a390beb9c12648994
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sat Sep 27 10:00:41 2014 -0500
Use XDG_CURRENT_DESKTOP to decide whether to use a header bar
In theory, this is a better approach. In practice, it will make no
difference, but this is what we'll do for the other games (that won't
get custom menu bars and therefore won't check shell-shows-menubar).
src/gnome-mines.vala | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gnome-mines.vala b/src/gnome-mines.vala
index ffe1e40..4f55426 100644
--- a/src/gnome-mines.vala
+++ b/src/gnome-mines.vala
@@ -144,16 +144,20 @@ public class Mines : Gtk.Application
window.maximize ();
add_window (window);
- bool shell_shows_menubar;
- Gtk.Settings.get_default ().get ("gtk-shell-shows-menubar", out shell_shows_menubar);
- if (!shell_shows_menubar)
+ var desktop = Environment.get_variable ("XDG_CURRENT_DESKTOP");
+ if (desktop == null || desktop != "Unity")
{
var headerbar = new Gtk.HeaderBar ();
headerbar.show_close_button = true;
headerbar.set_title (_("Mines"));
headerbar.show ();
window.set_titlebar (headerbar);
+ }
+ bool shell_shows_menubar;
+ Gtk.Settings.get_default ().get ("gtk-shell-shows-menubar", out shell_shows_menubar);
+ if (!shell_shows_menubar)
+ {
var menu = new Menu ();
app_main_menu = new Menu ();
menu.append_section (null, app_main_menu);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]