[gnome-mines] Use XDG_CURRENT_DESKTOP to decide whether to use a header bar
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mines] Use XDG_CURRENT_DESKTOP to decide whether to use a header bar
- Date: Sun, 28 Sep 2014 15:15:23 +0000 (UTC)
commit 60cbfdd5c24ce9282e27272c4c142f5df9b90954
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 a1c5ac9..7b645e3 100644
--- a/src/gnome-mines.vala
+++ b/src/gnome-mines.vala
@@ -161,16 +161,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]