Skip to content

Commit

Permalink
add a generic XGetWindowAttributes function for debugging
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@26447 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 22, 2020
1 parent f2e87a7 commit 60ad714
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/xpra/x11/bindings/window_bindings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,41 @@ cdef class X11WindowBindingsInstance(X11CoreBindingsInstance):
XUnmapWindow(self.display, xwindow)
return serial


def getWindowAttributes(self, Window xwindow):
self.context_check()
cdef XWindowAttributes attrs
cdef Status status = XGetWindowAttributes(self.display, xwindow, &attrs)
if status==0:
return None
return {
"geometry" : (attrs.x, attrs.y, attrs.width, attrs.height, attrs.border_width),
"depth" : attrs.depth,
"visual" : {
"visual-id" : attrs.visual.visualid,
#"class" : attrs.visual.c_class,
"red-mask" : attrs.visual.red_mask,
"green-mask" : attrs.visual.green_mask,
"blue-mask" : attrs.visual.blue_mask,
"bits-per-rgb" : attrs.visual.bits_per_rgb,
"map_entries" : attrs.visual.map_entries,
},
"bit-gravity" : attrs.bit_gravity,
"win-gravity" : attrs.win_gravity,
"backing-store" : attrs.backing_store,
"backing-planes" : attrs.backing_planes,
"backing-pixel" : attrs.backing_pixel,
"save-under" : bool(attrs.save_under),
#"colormap" : 0,
"map-installed" : attrs.map_installed,
"map-state" : attrs.map_state,
"all-events-mask" : attrs.all_event_masks,
"your_event_mask" : attrs.your_event_mask,
"do-not-propagate-mask" : attrs.do_not_propagate_mask,
"override-redirect" : attrs.override_redirect,
}


# Mapped status
def is_mapped(self, Window xwindow):
self.context_check()
Expand Down

0 comments on commit 60ad714

Please sign in to comment.