if is_X11(): try: from xpra.x11.bindings.xi2_bindings import X11XI2Bindings as _X11XI2Bindings #@UnresolvedImport X11XI2 = _X11XI2Bindings() except Exception: log.error("no XI2 bindings", exc_info=True) return X11XI2 device_bell = None GTK_MENUS = envbool("XPRA_GTK_MENUS", False) RANDR_DPI = envbool("XPRA_RANDR_DPI", True) XSETTINGS_DPI = envbool("XPRA_XSETTINGS_DPI", True) USE_NATIVE_TRAY = envbool( "XPRA_USE_NATIVE_TRAY", is_unity() or (is_Ubuntu() and is_gnome()) or (is_gnome() and not is_Fedora()) or is_kde()) XINPUT_WHEEL_DIV = envint("XPRA_XINPUT_WHEEL_DIV", 15) DBUS_SCREENSAVER = envbool("XPRA_DBUS_SCREENSAVER", False) def gl_check(): if not is_X11() and is_Wayland(): return "disabled under wayland with GTK3 (buggy)" return None def get_native_system_tray_classes(): return []
def test_de(self): is_unity() is_gnome() is_kde()
X11WindowBindings = None X11XI2Bindings = None if is_X11(): try: from xpra.x11.bindings.window_bindings import X11WindowBindings #@UnresolvedImport from xpra.x11.bindings.xi2_bindings import X11XI2Bindings #@UnresolvedImport except Exception as e: log.error("no X11 bindings", exc_info=True) del e device_bell = None GTK_MENUS = envbool("XPRA_GTK_MENUS", False) RANDR_DPI = envbool("XPRA_RANDR_DPI", True) XSETTINGS_DPI = envbool("XPRA_XSETTINGS_DPI", True) USE_NATIVE_TRAY = envbool("XPRA_USE_NATIVE_TRAY", is_unity() or (is_gnome() and not is_Fedora()) or is_kde()) XINPUT_WHEEL_DIV = envint("XPRA_XINPUT_WHEEL_DIV", 15) DBUS_SCREENSAVER = envbool("XPRA_DBUS_SCREENSAVER", False) def gl_check(): if not is_X11() and is_Wayland(): return "disabled under wayland with GTK3 (buggy)" return None def get_native_system_tray_classes(): return [] def get_wm_name(): wm_name = os.environ.get("XDG_CURRENT_DESKTOP", "")
def find_pinentry_bin(): if is_gnome(): return which("pinentry-gnome3") if is_kde(): return which("pinentry-qt") return None
from gi.repository import Gdk, Gtk, Gio, GdkPixbuf from xpra.client.gtk_base.gtk_client_window_base import GTKClientWindowBase, HAS_X11_BINDINGS from xpra.client.gtk3.window_menu import WindowMenuHelper from xpra.gtk_common.gtk_util import scaled_image from xpra.scripts.config import TRUE_OPTIONS, FALSE_OPTIONS from xpra.util import envbool, typedict from xpra.os_util import bytestostr, is_gnome from xpra.log import Logger paintlog = Logger("paint") metalog = Logger("metadata") geomlog = Logger("geometry") WINDOW_ICON = envbool("XPRA_WINDOW_ICON", True) WINDOW_XPRA_MENU = envbool("XPRA_WINDOW_XPRA_MENU", is_gnome()) WINDOW_MENU = envbool("XPRA_WINDOW_MENU", True) """ GTK3 version of the ClientWindow class """ class GTK3ClientWindow(GTKClientWindowBase): def init_window(self, metadata): super().init_window(metadata) self.header_bar_image = None if self.can_use_header_bar(metadata): self.add_header_bar() def _icon_size(self): tb = self.get_titlebar()