Skip to content

Commit

Permalink
#1658: check for wayland's partial randr support and disabled the ran…
Browse files Browse the repository at this point in the history
…dr flag when detected

git-svn-id: https://xpra.org/svn/Xpra/trunk@19613 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 11, 2018
1 parent bde0f10 commit f9e21af
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/xpra/x11/bindings/randr_bindings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ cdef class _RandRBindings(_X11CoreBindings):
cdef object _added_modes

def __init__(self):
self._has_randr = self.check_randr()
self._has_randr = self.check_randr() and self.check_randr_sizes()
self._added_modes = OrderedDict()

def __repr__(self):
Expand All @@ -155,6 +155,21 @@ cdef class _RandRBindings(_X11CoreBindings):
return True
return False

def check_randr_sizes(self):
#check for wayland, which has no sizes:
#(and we wouldn't be able to set screen resolutions)
cdef Window window
window = XDefaultRootWindow(self.display)
cdef XRRScreenConfiguration *config = NULL #@DuplicatedSignature
config = XRRGetScreenInfo(self.display, window)
if config==NULL:
log("check_randr_sizes: failed to get randr screen info")
return False
cdef int num_sizes = 0 #@DuplicatedSignature
xrrs = XRRConfigSizes(config, &num_sizes)
log("found %i config sizes", num_sizes)
return num_sizes>0

def has_randr(self):
return bool(self._has_randr)

Expand Down

0 comments on commit f9e21af

Please sign in to comment.