Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ineffective override of GDK_BACKEND envvar #1821

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Fix ineffective override of GDK_BACKEND envvar #1821

merged 1 commit into from
Mar 4, 2021

Conversation

bitscher
Copy link
Contributor

guake/guake/main.py

Lines 57 to 67 in 9c21327

def main():
"""Parses the command line parameters and decide if dbus methods
should be called or not. If there is already a guake instance
running it will be used and a True value will be returned,
otherwise, false will be returned.
"""
# Force to xterm-256 colors for compatibility with some old command line programs
os.environ["TERM"] = "xterm-256color"
# Force use X11 backend underwayland
os.environ["GDK_BACKEND"] = "x11"
does attempt to override the GDK_BACKEND environement variable at line 67 in main.py but it is already too late since Gdk is imported through earlier imports from guake.support and guake.utils

guake/guake/main.py

Lines 39 to 43 in 9c21327

from guake.globals import NAME
from guake.globals import bindtextdomain
from guake.support import print_support
from guake.utils import restore_preferences
from guake.utils import save_preferences

As a result, on a wayland session, the pointer position used to get window geometry is always (0,0) resulting in the wrong display being used for window placement and sizing.

See #1820

main() does attempt to override the `GDK_BACKEND` environement variable at line 67 in main.py but it is already too late since `Gdk` is imported through earlier imports from `guake.support` and `guake.utils`.
As a result, on a wayland session, the pointer position used to get window geometry is always (0,0) resulting in the wrong display being used for window placement and sizing.

Closes #1820
sem-ver: bugfix
@bitscher
Copy link
Contributor Author

Note that it could be the cause of other sizing/position-related issues that happen on Wayland.

@bitscher
Copy link
Contributor Author

Also worth noting that the following comment may be incorrect/misleading:

guake/guake/main.py

Lines 621 to 626 in 9c21327

# Load gi pretty late, to speed up as much as possible the parsing of the option for DBus
# comm through command line
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

zeusintuivo added a commit to zeusintuivo/guake that referenced this pull request Jan 9, 2021
@zeusintuivo
Copy link

After trying this. I think it does something funny. It seems it disappears the icon on "ALT TAB" and when using "Window List" gnome extension, the icon tab is gone. Which leads to the question, Is this how Guake is supposed to work?
Given that is guake is "a dropdown terminal." it seems that this change does fix some issues.
Which bring the question, could we make an option of adding a check mark to not hide the from "ALT TAB", and not hide form "Window List"
At least, I find it useful to have an icon listed and not hid, given that in Red Hat flavoured systems, the "SHOW=HIDE" key combination is not linking any combinations.

@eeshugerman
Copy link

eeshugerman commented Jan 27, 2021

It seems it disappears the icon on "ALT TAB" and when using "Window List" gnome extension, the icon tab is gone. Which leads to the question, Is this how Guake is supposed to work?

Yes, I believe so -- Guake should not appear in the app switcher, or GNOME overview, etc. That's how it works under X anyway. In fact, that's how I ended up here: I was about to submit a bug report for this.

Instead I guess I'll just watch this PR and in the meantime override my .desktop file to launch Guake with GDK_BACKEND=x11 😄

@gsemet gsemet merged commit ed8e561 into Guake:master Mar 4, 2021
@gsemet
Copy link
Member

gsemet commented Mar 4, 2021

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants