Skip to content
This repository has been archived by the owner on Jan 17, 2018. It is now read-only.

Wayland support #1

Open
GKFX opened this issue Aug 19, 2017 · 0 comments · Fixed by #8
Open

Wayland support #1

GKFX opened this issue Aug 19, 2017 · 0 comments · Fixed by #8
Assignees

Comments

@GKFX
Copy link
Owner

GKFX commented Aug 19, 2017

On GNOME with Wayland, as seen on Debian Buster, GdkX11.X11Window.foreign_new_for_display throws

TypeError: argument display: Expected GdkX11.X11Display, but got __gi__.GdkWaylandDisplay

so the title bar isn't hidden, because GdkX11.X11Display.get_default() returned a Wayland display, not an X11 display.

@GKFX GKFX self-assigned this Aug 19, 2017
lantw44 added a commit to lantw44/hide-ff-title-bar that referenced this issue Oct 11, 2017
Firefox doesn't support Wayland yet, but GDK prefers Wayland to X11
when both environments are available. To keep the extension usable on
Wayland environments, we have to force GDK to choose the X11 backend.

There is a function in C API of GDK called gdk_set_allowed_backends,
which can be used to modify the priority of GDK backends. It must be
called before opening a display. However, the usual way to import GDK
in python, 'from gi.repository import Gdk', runs override scripts which
automatically calls gdk_init_check.

Therefore, we use 'gi.module.get_introspection_module' instead of the
standard way to access gdk_set_allowed_backends. Calling it with 'x11'
makes sure that we always use the X11 backend, which is the only GDK
backend currently supported by Firefox.

This commit fixes GKFX#1.
@GKFX GKFX closed this as completed in #8 Oct 11, 2017
@GKFX GKFX reopened this Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant