xpra icon
Bug tracker and wiki

Ticket #988: paint-root-overlay.patch

File paint-root-overlay.patch, 1.3 KB (added by Antoine Martin, 5 years ago)

PoC

  • xpra/x11/server.py

     
    859859            windowlog("cannot close window %s: it is already gone!", wid)
    860860
    861861
     862    def _damage(self, window, x, y, width, height, options=None):
     863        X11ServerBase._damage(self, window, x, y, width, height, options)
     864        if True:
     865            root = gtk.gdk.get_default_root_window()
     866            w = X11Window.XCompositeGetOverlayWindow(root.xid)
     867            log.warn("XCompositeGetOverlayWindow(%#x)=%#x", root.xid, w)
     868            from xpra.os_util import memoryview_to_bytes
     869            image = window.get_image(x, y, width, height)
     870            gc = root.new_gc()
     871            img_data = memoryview_to_bytes(image.get_pixels())
     872            rowstride = image.get_rowstride()
     873            gdkoverlaywin = gtk.gdk.window_foreign_new(w)
     874            #gdkoverlaywin.draw_rgb_image(gc, x, y, width, height, gtk.gdk.RGB_DITHER_NONE, img_data, rowstride)
     875            gdkoverlaywin.draw_rgb_32_image(gc, x, y, width, height, gtk.gdk.RGB_DITHER_NONE, img_data, rowstride)
     876            #X11Window.XCompositeReleaseOverlayWindow(w)
     877
     878
    862879    def make_screenshot_packet(self):
    863880        try:
    864881            return self.do_make_screenshot_packet()