[gnome-system-monitor] Use traditional titlebars on !GNOME DE's
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Use traditional titlebars on !GNOME DE's
- Date: Thu, 4 Dec 2014 10:59:38 +0000 (UTC)
commit a486e06d8ff45cc99508a2b82da96fc5225d3e80
Author: Tim Lunn <tim feathertop org>
Date: Wed Dec 3 07:42:51 2014 +1100
Use traditional titlebars on !GNOME DE's
https://bugzilla.gnome.org/show_bug.cgi?id=741044
src/interface.cpp | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/interface.cpp b/src/interface.cpp
index a9410b3..b40676e 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -626,6 +626,8 @@ create_main_window (GsmApplication *app)
GtkWidget *process_menu_button;
GMenuModel *process_menu_model;
+ const char* session;
+
int width, height, xpos, ypos;
GtkBuilder *builder = gtk_builder_new();
@@ -637,6 +639,18 @@ create_main_window (GsmApplication *app)
gtk_widget_set_name (main_window, "gnome-system-monitor");
app->main_window = main_window;
+ session = g_getenv ("XDG_CURRENT_DESKTOP");
+ if (session && !strstr (session, "GNOME")){
+ GtkWidget *mainbox;
+ GtkWidget *headerbar;
+
+ mainbox = GTK_WIDGET (gtk_builder_get_object (builder, "main_box"));
+ headerbar = GTK_WIDGET (gtk_builder_get_object (builder, "header_bar"));
+ gtk_window_set_titlebar (GTK_WINDOW (main_window), NULL);
+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), FALSE);
+ gtk_box_pack_start (GTK_BOX(mainbox), headerbar, FALSE, FALSE, 0);
+ }
+
g_settings_get (app->settings, GSM_SETTING_WINDOW_STATE, "(iiii)",
&width, &height, &xpos, &ypos);
width = CLAMP (width, 50, gdk_screen_width ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]