Added support for wayland with gnome-shell.
This commit is contained in:
parent
f2fd9167b4
commit
435f93865d
|
@ -246,7 +246,9 @@ class SystemTray {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("gnome".equalsIgnoreCase(GDM)) {
|
if ("gnome".equalsIgnoreCase(GDM)) {
|
||||||
|
// install the Gnome extension
|
||||||
Tray.usingGnome = true;
|
Tray.usingGnome = true;
|
||||||
|
Extension.install();
|
||||||
|
|
||||||
// are we fedora? If so, what version?
|
// are we fedora? If so, what version?
|
||||||
// now, what VERSION of fedora? 23/24/25/? don't have AppIndicator installed, so we have to use GtkStatusIcon
|
// now, what VERSION of fedora? 23/24/25/? don't have AppIndicator installed, so we have to use GtkStatusIcon
|
||||||
|
@ -274,7 +276,10 @@ class SystemTray {
|
||||||
return selectTypeQuietly(TrayType.GtkStatusIcon);
|
return selectTypeQuietly(TrayType.GtkStatusIcon);
|
||||||
}
|
}
|
||||||
else if ("default".equalsIgnoreCase(GDM)) {
|
else if ("default".equalsIgnoreCase(GDM)) {
|
||||||
|
// install the Gnome extension
|
||||||
Tray.usingGnome = true;
|
Tray.usingGnome = true;
|
||||||
|
Extension.install();
|
||||||
|
|
||||||
// this can be gnome3 on debian/kali
|
// this can be gnome3 on debian/kali
|
||||||
|
|
||||||
if (OSUtil.Linux.isKali()) {
|
if (OSUtil.Linux.isKali()) {
|
||||||
|
@ -300,11 +305,13 @@ class SystemTray {
|
||||||
return selectTypeQuietly(TrayType.GtkStatusIcon);
|
return selectTypeQuietly(TrayType.GtkStatusIcon);
|
||||||
}
|
}
|
||||||
else if ("ubuntu".equalsIgnoreCase(GDM)) {
|
else if ("ubuntu".equalsIgnoreCase(GDM)) {
|
||||||
// ubuntu 17.10 uses the NEW gnome DE, which screws up previous Ubuntu workarounds, since it's now proper Gnome
|
// ubuntu 17.10+ uses the NEW gnome DE, which screws up previous Ubuntu workarounds, since it's now proper Gnome
|
||||||
int[] version = OSUtil.Linux.getUbuntuVersion();
|
int[] version = OSUtil.Linux.getUbuntuVersion();
|
||||||
if (version[0] > 17 || (version[0] == 17 && version[1] == 10)) {
|
if (version[0] > 17 || (version[0] == 17 && version[1] == 10)) {
|
||||||
// this is gnome 3.26.1
|
// this is gnome 3.26.1
|
||||||
logger.debug("This Ubuntu 17.10 is not yet supported!");
|
// install the Gnome extension
|
||||||
|
Tray.usingGnome = true;
|
||||||
|
Extension.install();
|
||||||
}
|
}
|
||||||
|
|
||||||
return selectTypeQuietly(TrayType.AppIndicator);
|
return selectTypeQuietly(TrayType.AppIndicator);
|
||||||
|
@ -328,7 +335,7 @@ class SystemTray {
|
||||||
return selectTypeQuietly(TrayType.AppIndicator);
|
return selectTypeQuietly(TrayType.AppIndicator);
|
||||||
}
|
}
|
||||||
case Unity7: {
|
case Unity7: {
|
||||||
// Ubuntu Unity7 (17.04+, which has MIR) is a weird combination. It's "Gnome", but it's not "Gnome Shell".
|
// Ubuntu Unity7 (17.04, which has MIR) is a weird combination. It's "Gnome", but it's not "Gnome Shell".
|
||||||
return selectTypeQuietly(TrayType.AppIndicator);
|
return selectTypeQuietly(TrayType.AppIndicator);
|
||||||
}
|
}
|
||||||
case XFCE: {
|
case XFCE: {
|
||||||
|
|
|
@ -169,9 +169,22 @@ class Extension {
|
||||||
|
|
||||||
private static
|
private static
|
||||||
void restartShell() {
|
void restartShell() {
|
||||||
|
if (OSUtil.DesktopEnv.isWayland()) {
|
||||||
|
// you can no longer restart the shell in wayland. You must logout-login for shell modifications to apply
|
||||||
|
// https://mail.gnome.org/archives/commits-list/2015-March/msg01019.html
|
||||||
|
|
||||||
|
// HOWEVER, with wayland, shell-extensions that DO NO MODIFY THE GUI (we don't, we just add icons to it)
|
||||||
|
// are enabled without a shell restart.
|
||||||
|
|
||||||
|
// if there are still difficulties, you can use the following
|
||||||
|
// gnome-shell-extension-tool -e SystemTray@Dorkbox
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ENABLE_SHELL_RESTART) {
|
if (ENABLE_SHELL_RESTART) {
|
||||||
if (SystemTray.DEBUG) {
|
if (SystemTray.DEBUG) {
|
||||||
logger.debug("DEBUG mode enabled. You need to log-in/out or manually restart the shell via '{}' to apply the changes.",
|
logger.debug("DEBUG mode enabled. You need to log-out/in or manually restart the shell via '{}' to apply the changes.",
|
||||||
SHELL_RESTART_COMMAND);
|
SHELL_RESTART_COMMAND);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,11 +222,6 @@ class _GtkStatusIconNativeTray extends Tray {
|
||||||
});
|
});
|
||||||
|
|
||||||
bind(gtkMenu, null, systemTray);
|
bind(gtkMenu, null, systemTray);
|
||||||
|
|
||||||
// install the Gnome extension
|
|
||||||
if (Tray.usingGnome) {
|
|
||||||
Extension.install();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user