Ejemplo n.º 1
0
 def verify_capture(self, ss):
     #verify capture works:
     log("verify_capture(%s)", ss)
     try:
         capture = GTKImageCapture(self.root)
         bdata = capture.take_screenshot()[-1]
         nid = XPRA_DISPLAY_NOTIFICATION_ID
         title = body = ""
         if any(b != 0 for b in bdata):
             log("verify_capture(%s) succeeded", ss)
             if is_Wayland():
                 title = "Wayland Session Warning"
                 body = "Wayland sessions are not supported,\n"+\
                         "the screen capture is likely to be empty"
         else:
             log.warn("Warning: shadow screen capture is blank")
             body = "The shadow display capture is blank"
             if get_loaded_kernel_modules("vboxguest", "vboxvideo"):
                 body += "\nthis may be caused by the VirtualBox video driver."
             title = "Shadow Capture Failure"
         log("verify_capture: title=%r, body=%r", ss, title, body)
         if title and body:
             ss.may_notify(nid, title, body, icon_name="server")
     except Exception as e:
         ss.may_notify(nid,
                       "Shadow Error",
                       "Error shadowing the display:\n%s" % e,
                       icon_name="bugs")
Ejemplo n.º 2
0
 def do_make_screenshot_packet(self):
     capture = GTKImageCapture(self.root)
     w, h, encoding, rowstride, data = capture.take_screenshot()
     assert encoding == "png"  #use fixed encoding for now
     from xpra.net.compression import Compressed
     return [
         "screenshot", w, h, encoding, rowstride,
         Compressed(encoding, data)
     ]