File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,12 @@ static void intent_method_call_handler(FlMethodChannel* channel,
4343
4444static bool ReadShowSystemTitlebar () {
4545 const char * home = getenv (" HOME" );
46- if (!home) return false ;
47-
48- std::string filepath = std::string (home) + " /.local/share/io.github.Predidit.Kazumi/showSystemTitlebar" ;
46+ const char * xdgdata = getenv (" XDG_DATA_HOME" );
47+ if (xdgdata){
48+ std::string filepath = std::string (xdgdata) + " /io.github.Predidit.Kazumi/showSystemTitlebar" ;
49+ } else if (home){
50+ std::string filepath = std::string (home) + " /.local/share/io.github.Predidit.Kazumi/showSystemTitlebar" ;
51+ } else return false ;
4952
5053 std::ifstream file (filepath);
5154 if (!file.is_open ()) return false ;
@@ -57,7 +60,7 @@ static bool ReadShowSystemTitlebar() {
5760 if (content == " true" ) return true ;
5861 if (content == " false" ) return false ;
5962
60- return false ; // 默认值
63+ return false ;
6164}
6265
6366// Implements GApplication::activate.
@@ -67,7 +70,7 @@ static void my_application_activate(GApplication* application) {
6770 GTK_WINDOW (gtk_application_window_new (GTK_APPLICATION (application)));
6871
6972
70- // 根据文件决定是否显示系统标题栏
73+ // showSystemTitlebar
7174 bool showSystemTitlebar = ReadShowSystemTitlebar ();
7275 if (!showSystemTitlebar) {
7376 GtkHeaderBar* header_bar = GTK_HEADER_BAR (gtk_header_bar_new ());
You can’t perform that action at this time.
0 commit comments