GNOME Bugzilla – Bug 737258
Dynamically detect when running under Unity
Last modified: 2014-11-14 21:57:41 UTC
I think Geary tries to show the title bar instead of the header bar on Ubuntu, but on Ubuntu with GNOME Shell, it shows both.
Ubuntu's Unity doesn't do well with client-side decorated windows, so when Geary is configured with the --enable-unity flag, it will let the server decorate the windows, giving you both the title and header bars. If you'll only be using GNOME Shell, just configure geary without the --enable-unity flag. Note that the version in the PPA is configured with the --enable-unity flag, to ensure it works in all desktop environments. That all said, I'm not sure why this has to be a configure-time option. All it does is change how the HeaderBar is put into the windows. Can we make it into a run-time flag?
(In reply to comment #1) > That all said, I'm not sure why this has to be a configure-time option. All it > does is change how the HeaderBar is put into the windows. Can we make it into > a run-time flag? We could, but it's fuzzy to me how to check what desktop environment the user is running under. We can't look for a particular package, i.e. libunity, because it's possible (likely, under Ubuntu) that they would have that installed even though they're running GNOME Shell. I'll change this ticket's title to reflect this, since that seems like an improvement. The better solution would be for Ubuntu to improve their themes and support for CSD, but that's a separate issue.
While an automatic detection would be great, it seems to me that a run-time flag could also work. Then instead of recompiling Geary, Remco could just edit the .desktop file to remove "--enable-unity". Or we could ship two desktop files, one with and one without this flag. It wouldn't be as slick as automatic detection, but it would be less work. We may want to see how Ubuntu 14.10 behaves before we waste any time on this, though.
14.10 has this problem the last time I checked, and I doubt it will change before it's released. See https://lists.ubuntu.com/archives/ubuntu-desktop/2014-September/004539.html I don't want to ship two .desktop files. That means the user will see "Geary (Unity)" and "Geary (GNOME Shell)" in their application list. (Unless you see a way around this.)
I received an email from a user who suggested examining the "XDG_CURRENT_DESKTOP" environment variable. That might be the solution we're looking for.
See also bug #738899.
Pushed to master, commit cbb21b
*** Bug 731809 has been marked as a duplicate of this bug. ***