Пример #1
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     self.keycodes = {}
     self.cursor_handle = None
     self.cursor_data = None
     if GetSystemMetrics(win32con.SM_SAMEDISPLAYFORMAT) == 0:
         raise InitException(
             "all the monitors must use the same display format")
     el = get_win32_event_listener()
     from xpra.net.bytestreams import set_continue_wait
     #on win32, we want to wait just a little while,
     #to prevent servers spinning wildly on non-blocking sockets:
     set_continue_wait(5)
     #TODO: deal with those messages?
     el.add_event_callback(win32con.WM_POWERBROADCAST,
                           self.power_broadcast_event)
     #el.add_event_callback(WM_WTSSESSION_CHANGE,         self.session_change_event)
     #these are bound to callbacks in the client,
     #but on the server we just ignore them:
     el.ignore_events.update({
         win32con.WM_ACTIVATEAPP: "WM_ACTIVATEAPP",
         win32con.WM_MOVE: "WM_MOVE",
         win32con.WM_INPUTLANGCHANGE: "WM_INPUTLANGCHANGE",
         win32con.WM_WININICHANGE: "WM_WININICHANGE",
     })
     #non-blocking server sockets (TCP and named pipes):
     from xpra.net.bytestreams import CONTINUE_ERRNO
     import errno
     CONTINUE_ERRNO[
         errno.WSAEWOULDBLOCK] = "WSAEWOULDBLOCK"  #@UndefinedVariable
Пример #2
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     self.keycodes = {}
     from xpra.net.bytestreams import set_continue_wait
     #on win32, we want to wait just a little while,
     #to prevent servers spinning wildly on non-blocking sockets:
     set_continue_wait(5)
Пример #3
0
 def start_refresh(self):
     #don't use the timer, get damage notifications:
     if self.refresh_registered:
         log.warn("Warning: screen refresh callback already registered!")
         return
     err = CG.CGRegisterScreenRefreshCallback(self.screen_refresh_callback, None)
     log("CGRegisterScreenRefreshCallback(%s)=%s", self.screen_refresh_callback, err)
     if err!=0:
         log.warn("Warning: CGRegisterScreenRefreshCallback failed with error %i", err)
         log.warn(" using fallback timer method")
         GTKShadowServerBase.start_refresh(self)
     else:
         self.refresh_registered = True
Пример #4
0
 def start_refresh(self):
     #don't use the timer, get damage notifications:
     if self.refresh_registered:
         log.warn("Warning: screen refresh callback already registered!")
         return
     err = CG.CGRegisterScreenRefreshCallback(self.screen_refresh_callback, None)
     log("CGRegisterScreenRefreshCallback(%s)=%s", self.screen_refresh_callback, err)
     if err!=0:
         log.warn("Warning: CGRegisterScreenRefreshCallback failed with error %i", err)
         log.warn(" using fallback timer method")
         GTKShadowServerBase.start_refresh(self)
     else:
         self.refresh_registered = True
Пример #5
0
 def stop_refresh(self):
     log("stop_refresh() mapped=%s, timer=%s", self.mapped, self.timer)
     if self.refresh_registered:
         try:
             err = CG.CGUnregisterScreenRefreshCallback(self.screen_refresh_callback, None)
             log("CGUnregisterScreenRefreshCallback(%s)=%s", self.screen_refresh_callback, err)
             if err:
                 log.warn(" unregistering the existing one returned %s", {0 : "OK"}.get(err, err))
         except ValueError as e:
             log.warn("Error unregistering screen refresh callback:")
             log.warn(" %s", e)
         self.refresh_registered = False
     #may stop the timer fallback:
     GTKShadowServerBase.stop_refresh(self)
Пример #6
0
 def __init__(self):
     #sanity check:
     image = CG.CGWindowListCreateImage(CG.CGRectInfinite,
                 CG.kCGWindowListOptionOnScreenOnly,
                 CG.kCGNullWindowID,
                 CG.kCGWindowImageDefault)
     if image is None:
         from xpra.scripts.config import InitExit
         log("cannot grab test screenshot - maybe you need to run this command whilst logged in via the UI")
         raise InitExit(1, "cannot grab pixels from the screen, make sure this command is launched from a GUI session")
     self.refresh_count = 0
     self.refresh_rectangle_count = 0
     self.refresh_registered = False
     GTKShadowServerBase.__init__(self)
Пример #7
0
 def stop_refresh(self, wid):
     log("stop_refresh(%i) mapped=%s, timer=%s", wid, self.mapped, self.refresh_timer)
     #may stop the timer fallback:
     GTKShadowServerBase.stop_refresh(self, wid)
     if self.refresh_registered and not self.mapped:
         try:
             err = CG.CGUnregisterScreenRefreshCallback(self.screen_refresh_callback, None)
             log("CGUnregisterScreenRefreshCallback(%s)=%s", self.screen_refresh_callback, err)
             if err:
                 log.warn(" unregistering the existing one returned %s", {0 : "OK"}.get(err, err))
         except ValueError as e:
             log.warn("Error unregistering screen refresh callback:")
             log.warn(" %s", e)
         self.refresh_registered = False
Пример #8
0
 def __init__(self):
     #sanity check:
     image = CG.CGWindowListCreateImage(CG.CGRectInfinite,
                 CG.kCGWindowListOptionOnScreenOnly,
                 CG.kCGNullWindowID,
                 CG.kCGWindowImageDefault)
     if image is None:
         from xpra.scripts.config import InitExit
         log("cannot grab test screenshot - maybe you need to run this command whilst logged in via the UI")
         raise InitExit(1, "cannot grab pixels from the screen, make sure this command is launched from a GUI session")
     patch_picture_encode()
     self.refresh_count = 0
     self.refresh_rectangle_count = 0
     self.refresh_registered = False
     GTKShadowServerBase.__init__(self)
Пример #9
0
 def refresh(self):
     v = GTKShadowServerBase.refresh(self)
     if v and SEAMLESS:
         for rwm in self._id_to_window.values():
             rwm.refresh_shape()
     log("refresh()=%s", v)
     return v
Пример #10
0
 def start_refresh(self, wid):
     #don't use the timer, get damage notifications:
     if wid not in self.mapped:
         self.mapped.append(wid)
     if self.refresh_registered:
         return
     if not USE_TIMER:
         err = CG.CGRegisterScreenRefreshCallback(self.screen_refresh_callback, None)
         log("CGRegisterScreenRefreshCallback(%s)=%s", self.screen_refresh_callback, err)
         if err==0:
             self.refresh_registered = True
             return
         else:
             log.warn("Warning: CGRegisterScreenRefreshCallback failed with error %i", err)
             log.warn(" using fallback timer method")
     GTKShadowServerBase.start_refresh(self, wid)
Пример #11
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     self.keycodes = {}
     el = get_win32_event_listener()
     from xpra.net.bytestreams import set_continue_wait
     #on win32, we want to wait just a little while,
     #to prevent servers spinning wildly on non-blocking sockets:
     set_continue_wait(5)
     #TODO: deal with those messages?
     #el.add_event_callback(win32con.WM_POWERBROADCAST,   self.power_broadcast_event)
     #el.add_event_callback(WM_WTSSESSION_CHANGE,         self.session_change_event)
     #these are bound to callbacks in the client,
     #but on the server we just ignore them:
     el.ignore_events.update({
         win32con.WM_ACTIVATEAPP: "WM_ACTIVATEAPP",
         win32con.WM_MOVE: "WM_MOVE",
         win32con.WM_INPUTLANGCHANGE: "WM_INPUTLANGCHANGE",
         win32con.WM_WININICHANGE: "WM_WININICHANGE",
     })
Пример #12
0
 def get_info(self, proto, *_args):
     info = GTKServerBase.get_info(self, proto)
     info.update(GTKShadowServerBase.get_info(self, proto))
     info.setdefault("features", {})["shadow"] = True
     info.setdefault("server", {
                                "pixel-depth": self.pixel_depth,
                                "type"       : "Python/gtk2/win32-shadow",
                                "tray"       : self.tray,
                                "tray-icon"  : self.tray_icon or ""
                                })
     return info
Пример #13
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     self.keycodes = {}
     self.cursor_handle = None
     self.cursor_data = None
     self.cursor_errors = [0, 0]
     if GetSystemMetrics(win32con.SM_SAMEDISPLAYFORMAT) == 0:
         raise InitException(
             "all the monitors must use the same display format")
     el = get_win32_event_listener()
     #TODO: deal with those messages?
     el.add_event_callback(win32con.WM_POWERBROADCAST,
                           self.power_broadcast_event)
     #el.add_event_callback(WM_WTSSESSION_CHANGE,         self.session_change_event)
     #these are bound to callbacks in the client,
     #but on the server we just ignore them:
     el.ignore_events.update({
         win32con.WM_ACTIVATEAPP: "WM_ACTIVATEAPP",
         win32con.WM_MOVE: "WM_MOVE",
         win32con.WM_INPUTLANGCHANGE: "WM_INPUTLANGCHANGE",
         win32con.WM_WININICHANGE: "WM_WININICHANGE",
     })
Пример #14
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     X11ServerCore.__init__(self)
     self.session_type = "shadow"
     self.cursor_poll_timer = None
Пример #15
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     self.keycodes = {}
Пример #16
0
 def last_client_exited(self):
     GTKShadowServerBase.last_client_exited(self)
     X11ServerCore.last_client_exited(self)
Пример #17
0
 def make_hello(self, source):
     capabilities = X11ServerCore.make_hello(self, source)
     capabilities.update(GTKShadowServerBase.make_hello(self, source))
     capabilities["server_type"] = "Python/gtk2/x11-shadow"
     return capabilities
Пример #18
0
 def init(self, opts):
     GTKShadowServerBase.init(self, opts)
     X11ServerCore.do_init(self, opts)
Пример #19
0
 def cleanup(self):
     GTKShadowServerBase.cleanup(self)
     X11ServerCore.cleanup(self)
Пример #20
0
 def stop_refresh(self):
     GTKShadowServerBase.stop_refresh(self)
     self.stop_poll_cursor()
Пример #21
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     X11ServerCore.__init__(self)
     self.session_type = "shadow"
Пример #22
0
 def refresh(self):
     v = GTKShadowServerBase.refresh(self)
     if v and SEAMLESS:
         self.root_window_model.refresh_shape()
     log("refresh()=%s", v)
     return v
Пример #23
0
 def init(self, opts):
     self.pixel_depth = int(opts.pixel_depth) or 32
     if self.pixel_depth not in (24, 30, 32):
         raise InitException("unsupported pixel depth: %s" %
                             self.pixel_depth)
     GTKShadowServerBase.init(self, opts)
Пример #24
0
 def refresh(self):
     v = GTKShadowServerBase.refresh(self)
     if v and SEAMLESS:
         self.root_window_model.refresh_shape()
     log("refresh()=%s", v)
     return v
Пример #25
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     X11ServerBase.__init__(self, False)
Пример #26
0
 def last_client_exited(self):
     GTKShadowServerBase.last_client_exited(self)
     X11ServerBase.last_client_exited(self)
Пример #27
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     X11ServerCore.__init__(self)
     self.cursor_poll_timer = None
Пример #28
0
 def init(self, opts):
     GTKShadowServerBase.init(self, opts)
     self.keycodes = {}
     #printing fails silently on OSX
     self.printing = False
Пример #29
0
 def init(self, opts):
     GTKShadowServerBase.init(self, opts)
     self.keycodes = {}
     #printing fails silently on OSX
     self.printing = False
Пример #30
0
 def init(self, opts):
     GTKShadowServerBase.init(self, opts)
     #don't call init on X11ServerCore,
     #this would call up to GTKServerBase.init(opts) again:
     X11ServerCore.do_init(self, opts)
Пример #31
0
 def make_hello(self, source):
     capabilities = X11ServerBase.make_hello(self, source)
     capabilities.update(GTKShadowServerBase.make_hello(self, source))
     capabilities["server_type"] = "Python/gtk2/x11-shadow"
     return capabilities
Пример #32
0
 def cleanup(self):
     GTKShadowServerBase.cleanup(self)
     X11ServerCore.cleanup(self)  #@UndefinedVariable
Пример #33
0
 def init(self, opts):
     GTKShadowServerBase.init(self, opts)
     X11ServerBase.init(self, opts)
Пример #34
0
 def __init__(self):
     GTKShadowServerBase.__init__(self)
     X11ServerBase.__init__(self)