def main(): try: from xpra.x11.gtk_x11.gdk_display_source import init_display_source init_display_source() except: pass from xpra.platform.gui import main main()
def main(): #use gtk as display source: from xpra.x11.gtk_x11.gdk_display_source import init_display_source init_display_source() from xpra.util import print_nested_dict from xpra.platform import program_context with program_context("GTK-Keyboard", "GTK Keyboard"): x = GTKKeyboardHelper(None, True, "") x.query_xkbmap() print_nested_dict(x.get_keymap_properties())
def _send_client_message(window, message_type, *values): try: from xpra.x11.gtk_x11.gdk_display_source import init_display_source init_display_source() from xpra.x11.bindings.window_bindings import constants #@UnresolvedImport X11Window = X11WindowBindings() root_xid = X11Window.getDefaultRootWindow() if window: xid = get_xid(window) else: xid = root_xid SubstructureNotifyMask = constants["SubstructureNotifyMask"] SubstructureRedirectMask = constants["SubstructureRedirectMask"] event_mask = SubstructureNotifyMask | SubstructureRedirectMask X11Window.sendClientMessage(root_xid, xid, False, event_mask, message_type, *values) except Exception as e: log.warn("failed to send client message '%s' with values=%s: %s", message_type, values, e)
def main(): from xpra.platform import program_context from xpra.platform.gui import init as gui_init from xpra.os_util import POSIX from xpra.util import print_nested_dict from xpra.log import enable_color with program_context("OpenGL-Check"): gui_init() enable_color() verbose = "-v" in sys.argv or "--verbose" in sys.argv if verbose: log.enable_debug() if POSIX: from xpra.x11.gtk_x11.gdk_display_source import init_display_source init_display_source() force_enable = "-f" in sys.argv or "--force" in sys.argv from xpra.platform.gl_context import GLContext log("testing %s", GLContext) gl_context = GLContext() log("GLContext=%s", gl_context) #replace ImportError with a log message: global gl_check_error errors = [] def log_error(msg): log.error("ERROR: %s", msg) errors.append(msg) gl_check_error = log_error try: props = gl_context.check_support(force_enable) except Exception as e: props = {} log("check_support", exc_info=True) errors.append(e) log.info("") if len(errors) > 0: log.info("OpenGL errors:") for e in errors: log.info(" %s", e) if props: log.info("") log.info("OpenGL properties:") print_nested_dict(props) return len(errors)
# This file is part of Xpra. # Copyright (C) 2011-2017 Antoine Martin <*****@*****.**> # Xpra is released under the terms of the GNU GPL v2, or, at your option, any # later version. See the file COPYING for details. import os import re #ensure that we use gtk as display source: from xpra.x11.gtk_x11.gdk_display_source import init_display_source init_display_source() from xpra.util import std, csv from xpra.keyboard.layouts import parse_xkbmap_query from xpra.gtk_common.error import xsync from xpra.x11.bindings.keyboard_bindings import X11KeyboardBindings #@UnresolvedImport X11Keyboard = X11KeyboardBindings() from xpra.log import Logger log = Logger("x11", "keyboard") DEBUG_KEYSYMS = [ x for x in os.environ.get("XPRA_DEBUG_KEYSYMS", "").split(",") if len(x) > 0 ] #keys we choose not to map if the free space in the keymap is too limited #this list was generated using: