Skip to content

Commit

Permalink
use decoration provided by environment
Browse files Browse the repository at this point in the history
  • Loading branch information
sun-jiao committed Mar 25, 2024
1 parent 583a6c7 commit a29e92a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ static void my_application_activate(GApplication* application) {
use_header_bar = FALSE;
}
}

const char * desktopEnv = std::getenv("XDG_CURRENT_DESKTOP");
if (desktopEnv) {
const char * lowercaseDesktopEnv = g_ascii_strdown(desktopEnv, -1);
if (strcmp(lowercaseDesktopEnv, "gnome") != 0) {
use_header_bar = FALSE;
}
}
#endif
if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
Expand Down

0 comments on commit a29e92a

Please sign in to comment.