def enable(self, _exaile): """ Enables the on screen display plugin """ do_assert(self.__window is None) # Note: Moving windows will not work on Wayland by design, because Wayland does not know # absolute window positioning. Gtk.Window.move() does not work there. # See https://blog.gtk.org/2016/07/15/future-of-relative-window-positioning/ # and https://lists.freedesktop.org/archives/wayland-devel/2015-September/024464.html if guiutil.platform_is_wayland(): raise EnvironmentError( "This plugin does not work on Wayland backend.") # Cached option values self.__options = { 'background': None, 'display_duration': None, 'border_radius': None, 'use_alpha': False, } self.__css_provider = Gtk.CssProvider() if sys.platform.startswith("win32"): # Setting opacity on Windows crashes with segfault, # see https://bugzilla.gnome.org/show_bug.cgi?id=674449 self.__options['use_alpha'] = False LOGGER.warn( "OSD: Disabling alpha channel because it is not supported on Windows." ) else: self.__options['use_alpha'] = True
def is_supported(): """ On some platforms (e.g. Linux+Wayland) tray icons are not supported. """ supported = not guiutil.platform_is_wayland() if not supported: logger.debug("No tray icon support on this platform") return supported