[gnote] Check DESKTOP_SESSION to contain environment name



commit c3ec90e739d9fc388a613b517b9d227a3b6b5b76
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Oct 11 18:34:48 2015 +0300

    Check DESKTOP_SESSION to contain environment name
    
    Will give more reliable results, i.e. gnome-wayland will be found when
    key just has gnome.

 src/mainwindow.cpp |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 22bec6e..d10e8a2 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -120,10 +120,12 @@ bool MainWindow::use_client_side_decorations()
       sharp::string_split(desktops, setting, ",");
       const char *current_desktop = std::getenv("DESKTOP_SESSION");
       if (current_desktop) {
+        Glib::ustring current_de = Glib::ustring(current_desktop).lowercase();
         FOREACH(std::string de, desktops) {
-         if(de == current_desktop) {
-           s_use_client_side_decorations = 1;
-         }
+          Glib::ustring denv = Glib::ustring(de).lowercase();
+          if(current_de.find(denv) != Glib::ustring::npos) {
+            s_use_client_side_decorations = 1;
+          }
         }
       }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]