Пример #1
0
def init_display_source():
    from xpra.gtk_common.gobject_compat import is_gtk3
    if is_gtk3():
        from xpra.x11.gtk3.gdk_display_source import init_gdk_display_source  #@UnresolvedImport @UnusedImport
    else:
        from xpra.x11.gtk2.gdk_display_source import init_gdk_display_source  #@UnresolvedImport @Reimport
    init_gdk_display_source()
Пример #2
0
def check_support():
    from xpra.os_util import PYTHON3
    ptr = get_display_ptr()
    if not ptr:
        if PYTHON3:
            from xpra.x11.gtk3.gdk_display_source import init_gdk_display_source  #@UnresolvedImport, @UnusedImport
        else:
            from xpra.x11.gtk2.gdk_display_source import init_gdk_display_source  #@UnresolvedImport, @Reimport
        init_gdk_display_source()

    return GLContext().check_support()
Пример #3
0
def main(*args):
    assert len(args) > 0
    if args[0].endswith(".png"):
        return snapshot(args[0])

    def cb(title, geom):
        s = AdHocStruct()
        s.title = title
        s.geometry = geom
        return s

    from xpra.x11.gtk3 import gdk_display_source  #pylint: disable=import-outside-toplevel, no-name-in-module
    gdk_display_source.init_gdk_display_source()
    for w in window_matches(args, cb):
        print("%s" % (w, ))
Пример #4
0
# This file is part of Xpra.
# Copyright (C) 2013-2019 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.

from xpra.os_util import is_X11
if is_X11():
    try:
        from xpra.x11.gtk3.gdk_display_source import init_gdk_display_source
        init_gdk_display_source()
    except ImportError:
        from xpra.log import Logger
        log = Logger("gtk", "client")
        log.warn("Warning: cannot import gtk3 x11 display source",
                 exc_info=True)