Created
August 21, 2019 20:14
-
-
Save glitsj16/3f6b33b0f1ce88e266181ac2639458a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These patches are intended to make Gnome-Pie use Xwayland by default. | |
This returns full functionality to the application when running a Wayland session. | |
--- a/src/utilities/bindingManager.vala | |
+++ b/src/utilities/bindingManager.vala | |
@@ -82,7 +82,8 @@ | |
/// Used to identify wayland sessions. | |
///////////////////////////////////////////////////////////////////// | |
- private bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; | |
+ //private bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; | |
+ private bool wayland = false; | |
///////////////////////////////////////////////////////////////////// | |
/// Helper class to store keybinding | |
--- a/src/daemon.vala | |
+++ b/src/daemon.vala | |
@@ -57,6 +57,10 @@ | |
public static int main(string[] args) { | |
version = "0.7.2"; | |
+ // Run on Xwayland by default | |
+ GLib.Environment.set_variable("CLUTTER_BACKEND", "x11", true); | |
+ GLib.Environment.set_variable("GDK_BACKEND", "x11", true); | |
+ | |
// disable overlay scrollbar --- hacky workaround for black / | |
// transparent background | |
GLib.Environment.set_variable("LIBOVERLAY_SCROLLBAR", "0", true); | |
--- a/src/pies/defaultConfig.vala | |
+++ b/src/pies/defaultConfig.vala | |
@@ -69,7 +69,8 @@ | |
window.add_action(new KeyAction(_("Restore"), "view-restore", "<Alt>F5")); | |
// add a pie with window list group | |
- if (GLib.Environment.get_variable("XDG_SESSION_TYPE") != "wayland") { | |
+ //if (GLib.Environment.get_variable("XDG_SESSION_TYPE") != "wayland") { | |
+ if (GLib.Environment.get_variable("CLUTTER_BACKEND") != "wayland") { | |
var alt_tab = PieManager.create_persistent_pie("Alt Tab", "preferences-system-windows", new Trigger.from_string("<Control><Alt>T")); | |
alt_tab.add_group(new WindowListGroup(alt_tab.id)); | |
} | |
--- a/src/actionGroups/groupRegistry.vala | |
+++ b/src/actionGroups/groupRegistry.vala | |
@@ -101,7 +101,8 @@ | |
///////////////////////////////////////////////////////////////////// | |
public static ActionGroup? create_group(string type_id, string parent_id) { | |
- bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; | |
+ //bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; | |
+ bool wayland = false; | |
switch (type_id) { | |
case "bookmarks": | |
--- a/src/gui/pieOptionsWindow.vala | |
+++ b/src/gui/pieOptionsWindow.vala | |
@@ -176,7 +176,8 @@ | |
public void show() { | |
this.window.show_all(); | |
- if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { | |
+ //if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { | |
+ if (GLib.Environment.get_variable("CLUTTER_BACKEND") == "wayland") { | |
this.optionsFrame.visible = false; | |
} | |
} | |
@@ -204,7 +205,8 @@ | |
this.trigger_button.set_trigger(trigger); | |
this.set_icon(pie.icon); | |
- if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { | |
+ //if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { | |
+ if (GLib.Environment.get_variable("CLUTTER_BACKEND") == "wayland") { | |
this.trigger_button.set_sensitive(false); | |
this.hint.set_line_wrap(true); | |
--- a/src/renderers/pieWindow.vala | |
+++ b/src/renderers/pieWindow.vala | |
@@ -111,7 +111,8 @@ | |
/// Used to identify wayland sessions. | |
///////////////////////////////////////////////////////////////////// | |
- private bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; | |
+ //private bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland"; | |
+ private bool wayland = false; | |
///////////////////////////////////////////////////////////////////// | |
/// C'tor, sets up the window. | |
--- a/src/actionGroups/windowListGroup.vala | |
+++ b/src/actionGroups/windowListGroup.vala | |
@@ -36,8 +36,13 @@ | |
///////////////////////////////////////////////////////////////////// | |
public static GroupRegistry.TypeDescription? register() { | |
- if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { | |
+ //if (GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland") { | |
+ if (GLib.Environment.get_variable("CLUTTER_BACKEND") == "wayland") { | |
warning("The WindowList slice group is not supported on Wayland."); | |
+ return null; | |
+ } | |
+ if (GLib.Environment.get_variable("CLUTTER_BACKEND") == "x11") { | |
+ message("Running on Xwayland."); | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment