Exemple #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()
 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
    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
Exemple #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
Exemple #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
Exemple #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
Exemple #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)
Exemple #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
 def init(self, opts):
     XpraClientBase.init(self, opts)
     self.install_signal_handlers()
     self.glib_init()
     self.gobject_init()
 def __init__(self):
     gobject.GObject.__init__(self)
     XpraClientBase.__init__(self)
Exemple #11
0
 def run(self):
     XpraClientBase.run(self)
     self.glib_mainloop = glib.MainLoop()
     self.glib_mainloop.run()
     return  self.exit_code
Exemple #12
0
 def run(self):
     #override so we can use a GTK main loop instead
     XpraClientBase.run(self)
     Gtk.main()
     return self.exit_code
Exemple #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
Exemple #14
0
 def signal_cleanup(self):
     log("UIXpraClient.signal_cleanup()")
     XpraClientBase.signal_cleanup(self)
     reaper_cleanup()
     log("UIXpraClient.signal_cleanup() done")
Exemple #15
0
 def init(self, opts):
     XpraClientBase.init(self, opts)
     self.glib_init()
Exemple #16
0
 def run(self):
     XpraClientBase.run(self)
Exemple #17
0
 def run(self):
     XpraClientBase.run(self)
Exemple #18
0
 def run(self):
     XpraClientBase.run(self)
     self.run_loop()
     return self.exit_code
 def run(self):
     XpraClientBase.run(self)
     self.gobject_mainloop = gobject.MainLoop()
     self.gobject_mainloop.run()
     return  self.exit_code
 def make_hello(self):
     capabilities = XpraClientBase.make_hello(self)
     capabilities["keyboard"] = False
     return capabilities
Exemple #21
0
 def process_packet(self, proto, packet):
     self.check_server_echo(0)
     XpraClientBase.process_packet(self, proto, packet)
 def init(self, opts):
     XpraClientBase.init(self, opts)
     self.install_signal_handlers()
     self.glib_init()
     self.gobject_init()
 def run(self):
     XpraClientBase.run(self)
     self.gobject_mainloop = gobject.MainLoop()
     self.gobject_mainloop.run()
     return self.exit_code
Exemple #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)
Exemple #25
0
 def setup_connection(self, conn):
     XpraClientBase.setup_connection(self, conn)
     MmapClient.setup_connection(self, conn)
 def __init__(self):
     gobject.GObject.__init__(self)
     XpraClientBase.__init__(self)
Exemple #27
0
 def make_hello(self, challenge_response=None):
     capabilities = XpraClientBase.make_hello(self, challenge_response)
     capabilities["keyboard"] = False
     return capabilities
Exemple #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()
Exemple #29
0
 def run(self):
     XpraClientBase.run(self)
     self.glib_mainloop = glib.MainLoop()
     self.glib_mainloop.run()
     return self.exit_code
 def make_hello(self):
     capabilities = XpraClientBase.make_hello(self)
     capabilities["keyboard"] = False
     return capabilities
 def make_hello(self, challenge_response=None):
     capabilities = XpraClientBase.make_hello(self, challenge_response)
     capabilities["keyboard"] = False
     return capabilities