예제 #1
0
 def _process_startup_complete(self, packet):
     log("all the existing windows and system trays have been received")
     XpraClientBase._process_startup_complete(self, packet)
     gui_ready()
     if self.tray:
         self.tray.ready()
     self.send_info_request()
예제 #2
0
 def init_packet_handlers(self):
     XpraClientBase.init_packet_handlers(self)
     def noop(*args):
         log("ignoring packet: %s", args)
     #ignore the following packet types without error:
     for t in ["new-window", "new-override-redirect",
               "draw", "cursor", "bell",
               "notify_show", "notify_close",
               "ping", "ping_echo",
               "window-metadata", "configure-override-redirect",
               "lost-window"]:
         self._packet_handlers[t] = noop
예제 #3
0
    def init_packet_handlers(self):
        XpraClientBase.init_packet_handlers(self)

        def noop(*args):
            log("ignoring packet: %s", args)

        #ignore the following packet types without error:
        for t in [
                "new-window", "new-override-redirect", "draw", "cursor",
                "bell", "notify_show", "notify_close", "ping", "ping_echo",
                "window-metadata", "configure-override-redirect", "lost-window"
        ]:
            self._packet_handlers[t] = noop
예제 #4
0
 def init_packet_handlers(self):
     XpraClientBase.init_packet_handlers(self)
     def noop(*args):    # pragma: no cover
         log("ignoring packet: %s", args)
     #ignore the following packet types without error:
     #(newer servers should avoid sending us any of those)
     for t in (
         "new-window", "new-override-redirect",
         "draw", "cursor", "bell",
         "notify_show", "notify_close",
         "ping", "ping_echo",
         "window-metadata", "configure-override-redirect",
         "lost-window",
         ):
         self._packet_handlers[t] = noop
예제 #5
0
    def make_hello(self):
        caps = XpraClientBase.make_hello(self)
        caps["session-type"] = get_session_type()
        #don't try to find the server uuid if this platform cannot run servers..
        #(doing so causes lockups on win32 and startup errors on osx)
        if POSIX and not is_Wayland():
            #we may be running inside another server!
            try:
                from xpra.server.server_uuid import get_uuid
                caps["server_uuid"] = get_uuid() or ""
            except ImportError:
                pass
        for x in (  #generic feature flags:
                "wants_events",
                "setting-change",
                "xdg-menu-update",
        ):
            caps[x] = True
        caps.update({
            #generic server flags:
            "share": self.client_supports_sharing,
            "lock": self.client_lock,
        })
        caps.update({"mouse": True})
        caps.update(self.get_keyboard_caps())
        for c in CLIENT_BASES:
            caps.update(c.get_caps(self))

        def u(prefix, c):
            updict(caps, prefix, c, flatten_dicts=False)

        u("control_commands", self.get_control_commands_caps())
        u("platform", get_platform_info())
        u("opengl", self.opengl_props)
        return caps
예제 #6
0
    def make_hello(self):
        caps = XpraClientBase.make_hello(self)
        caps["session-type"] = get_session_type()
        #don't try to find the server uuid if this platform cannot run servers..
        #(doing so causes lockups on win32 and startup errors on osx)
        if MMAP_SUPPORTED:
            #we may be running inside another server!
            try:
                from xpra.server.server_uuid import get_uuid
                caps["server_uuid"] = get_uuid() or ""
            except:
                pass
        for x in (  #generic feature flags:
                "notify-startup-complete",
                "wants_events",
                "setting-change",
        ):
            caps[x] = True
        #FIXME: the messy bits without proper namespace:
        caps.update({
            #generic server flags:
            "share": self.client_supports_sharing,
            "lock": self.client_lock,
        })
        caps.update(self.get_keyboard_caps())
        for c in CLIENT_BASES:
            caps.update(c.get_caps(self))

        def u(prefix, c):
            updict(caps, prefix, c, flatten_dicts=False)

        u("control_commands", self.get_control_commands_caps())
        u("platform", get_platform_info())
        return caps
예제 #7
0
 def _process_startup_complete(self, packet):
     log("all the existing windows and system trays have been received")
     XpraClientBase._process_startup_complete(self, packet)
     gui_ready()
     if self.tray:
         self.tray.ready()
     self.send_info_request()
     msg = "running"
     try:
         windows = tuple(self._id_to_window.values())
     except AttributeError:
         pass
     else:
         trays = sum(1 for w in windows if w.is_tray())
         wins = sum(1 for w in windows if not w.is_tray())
         if wins:
             msg += ", %i window%s" % (wins, engs(wins))
         if trays:
             msg += ", %i tray%s" % (trays, engs(trays))
     log.info(msg)
예제 #8
0
    def make_hello(self):
        caps = XpraClientBase.make_hello(self)
        caps["session-type"] = get_session_type()

        #don't try to find the server uuid if this platform cannot run servers..
        #(doing so causes lockups on win32 and startup errors on osx)
        if MMAP_SUPPORTED:
            #we may be running inside another server!
            try:
                from xpra.server.server_uuid import get_uuid
                caps["server_uuid"] = get_uuid() or ""
            except:
                pass
        for x in (
                #generic feature flags:
                "notify-startup-complete",
                "wants_events",
                "setting-change",
        ):
            caps[x] = True
        #FIXME: the messy bits without proper namespace:
        caps.update({
            #generic server flags:
            "share": self.client_supports_sharing,
            "lock": self.client_lock,
        })
        #messy unprefixed:
        caps.update(WindowClient.get_caps(self))
        caps.update(DisplayClient.get_caps(self))
        caps.update(NetworkState.get_caps(self))
        caps.update(Encodings.get_caps(self))
        caps.update(ClipboardClient.get_caps(self))
        caps.update(self.get_keyboard_caps())

        #nicely prefixed:
        def u(prefix, c):
            updict(caps, prefix, c, flatten_dicts=False)

        u("sound", AudioClient.get_audio_capabilities(self))
        u("notifications", self.get_notifications_caps())
        u("control_commands", self.get_control_commands_caps())
        u("platform", get_platform_info())
        mmap_caps = MmapClient.get_caps(self)
        u("mmap", mmap_caps)
        #pre 2.3 servers only use underscore instead of "." prefix for mmap caps:
        for k, v in mmap_caps.items():
            caps["mmap_%s" % k] = v
        return caps
예제 #9
0
 def init(self, opts):
     XpraClientBase.init(self, opts)
     self.install_signal_handlers()
     self.glib_init()
     self.gobject_init()
예제 #10
0
 def __init__(self):
     gobject.GObject.__init__(self)
     XpraClientBase.__init__(self)
예제 #11
0
 def run(self):
     XpraClientBase.run(self)
     self.glib_mainloop = glib.MainLoop()
     self.glib_mainloop.run()
     return  self.exit_code
예제 #12
0
 def run(self):
     #override so we can use a GTK main loop instead
     XpraClientBase.run(self)
     Gtk.main()
     return self.exit_code
예제 #13
0
 def server_connection_established(self):
     if not XpraClientBase.server_connection_established(self):
         return False
     #process the rest from the UI thread:
     self.idle_add(self.process_ui_capabilities)
     return True
예제 #14
0
 def signal_cleanup(self):
     log("UIXpraClient.signal_cleanup()")
     XpraClientBase.signal_cleanup(self)
     reaper_cleanup()
     log("UIXpraClient.signal_cleanup() done")
예제 #15
0
 def init(self, opts):
     XpraClientBase.init(self, opts)
     self.glib_init()
예제 #16
0
 def run(self):
     XpraClientBase.run(self)
예제 #17
0
 def run(self):
     XpraClientBase.run(self)
예제 #18
0
 def run(self):
     XpraClientBase.run(self)
     self.run_loop()
     return self.exit_code
예제 #19
0
 def run(self):
     XpraClientBase.run(self)
     self.gobject_mainloop = gobject.MainLoop()
     self.gobject_mainloop.run()
     return  self.exit_code
예제 #20
0
 def make_hello(self):
     capabilities = XpraClientBase.make_hello(self)
     capabilities["keyboard"] = False
     return capabilities
예제 #21
0
 def process_packet(self, proto, packet):
     self.check_server_echo(0)
     XpraClientBase.process_packet(self, proto, packet)
예제 #22
0
 def init(self, opts):
     XpraClientBase.init(self, opts)
     self.install_signal_handlers()
     self.glib_init()
     self.gobject_init()
예제 #23
0
 def run(self):
     XpraClientBase.run(self)
     self.gobject_mainloop = gobject.MainLoop()
     self.gobject_mainloop.run()
     return self.exit_code
예제 #24
0
 def __init__(self):
     self.idle_add = glib.idle_add
     self.timeout_add = glib.timeout_add
     self.source_remove = glib.source_remove
     gobject.GObject.__init__(self)
     XpraClientBase.__init__(self)
예제 #25
0
 def setup_connection(self, conn):
     XpraClientBase.setup_connection(self, conn)
     MmapClient.setup_connection(self, conn)
예제 #26
0
 def __init__(self):
     gobject.GObject.__init__(self)
     XpraClientBase.__init__(self)
예제 #27
0
 def make_hello(self, challenge_response=None):
     capabilities = XpraClientBase.make_hello(self, challenge_response)
     capabilities["keyboard"] = False
     return capabilities
예제 #28
0
 def init(self, opts):
     XpraClientBase.init(self, opts)
     if self.INSTALL_SIGNAL_HANDLERS:
         self.install_signal_handlers()
     self.glib_init()
     self.gobject_init()
예제 #29
0
 def run(self):
     XpraClientBase.run(self)
     self.glib_mainloop = glib.MainLoop()
     self.glib_mainloop.run()
     return self.exit_code
예제 #30
0
 def make_hello(self):
     capabilities = XpraClientBase.make_hello(self)
     capabilities["keyboard"] = False
     return capabilities
예제 #31
0
 def make_hello(self, challenge_response=None):
     capabilities = XpraClientBase.make_hello(self, challenge_response)
     capabilities["keyboard"] = False
     return capabilities