Skip to content

Commit

Permalink
build: Re-add handywindow linux code lines
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Aug 10, 2023
1 parent 28c3dfa commit dba1eda
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,25 @@ static void my_application_activate(GApplication* application) {
// If running on Wayland assume the header bar will work (may need changing
// if future cases occur).
gboolean use_header_bar = TRUE;
// Lines added to the template start
// Please re-add these lines after updating the linux build files
// If the user explicitly requests to disable the header bar, switch back to
// using a traditional title bar
const gchar* gtk_csd_env = g_getenv("GTK_CSD");
if (gtk_csd_env != nullptr && g_strcmp0(gtk_csd_env, "1") != 0)
use_header_bar = FALSE;
// Lines added to the template end
#ifdef GDK_WINDOWING_X11
GdkScreen* screen = gtk_window_get_screen(window);
if (GDK_IS_X11_SCREEN(screen)) {
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
use_header_bar = FALSE;
// Lines added to the template start
// Please re-add these lines after updating the linux build files
// Disable libhandy here, otherwise the close button disappears on KDE X11
g_setenv("GTK_CSD", "0", TRUE);
// Lines added to the template end
}
}
#endif
Expand Down

0 comments on commit dba1eda

Please sign in to comment.