@@ -20,24 +20,9 @@ static void my_application_activate(GApplication* application) {
2020 GtkWindow* window =
2121 GTK_WINDOW (gtk_application_window_new (GTK_APPLICATION (application)));
2222
23- // Use a header bar when running in GNOME as this is the common style used
24- // by applications and is the setup most users will be using (e.g. Ubuntu
25- // desktop).
26- // If running on X and not using GNOME then just use a traditional title bar
27- // in case the window manager does more exotic layout, e.g. tiling.
28- // If running on Wayland assume the header bar will work (may need changing
29- // if future cases occur).
30- gboolean use_header_bar = TRUE ;
31- #ifdef GDK_WINDOWING_X11
32- GdkScreen* screen = gtk_window_get_screen (window);
33- if (GDK_IS_X11_SCREEN (screen)) {
34- const gchar* wm_name = gdk_x11_screen_get_window_manager_name (screen);
35- if (g_strcmp0 (wm_name, " GNOME Shell" ) != 0 ) {
36- use_header_bar = FALSE ;
37- }
38- }
39- #endif
40- if (use_header_bar) {
23+ const char * GTK_CSD = getenv (" GTK_CSD" );
24+
25+ if (GTK_CSD && strcmp (GTK_CSD, " 1" ) == 0 ) {
4126 GtkHeaderBar* header_bar = GTK_HEADER_BAR (gtk_header_bar_new ());
4227 gtk_widget_show (GTK_WIDGET (header_bar));
4328 gtk_header_bar_set_title (header_bar, " jhentai" );
@@ -97,6 +82,7 @@ static void my_application_class_init(MyApplicationClass* klass) {
9782static void my_application_init (MyApplication* self) {}
9883
9984MyApplication* my_application_new () {
85+ g_set_prgname (APPLICATION_ID);
10086 return MY_APPLICATION (g_object_new (my_application_get_type (),
10187 " application-id" , APPLICATION_ID,
10288 " flags" , G_APPLICATION_NON_UNIQUE,
0 commit comments