Xlib voodoo XWidthOfScreen, etc

Jamey Sharp jamey at minilop.net
Mon May 23 10:04:47 PDT 2011


On Mon, May 23, 2011 at 12:30:03AM -0700, Jeremy Huddleston wrote:
> I'm having some trouble understanding some of Xlib...
> 
> After changing resolution with RandR, all the following seem to report the new resolution properly:
> 
> $ xdpyinfo
> $ xwininfo -root
> $ xrandr
> XineramaQueryScreens() called within my WM
> 
> however, XWidthOfScreen() and XHeightOfScreen() called from within my
> WM still report the old resolution.
> 
> I was under the impression that the internals of Display and Screen
> were updated "automagically" within Xlib.  Do I need to do something
> to force the internals to update?

The connection setup data, which includes per-screen widths and heights,
is sent only when the connection is set up. Applications that need to
know about changes to those values need to get RandR events.

There could be magic in libXrandr to fiddle with the contents of the
Display, but I'd be surprised... Especially since you'd still need to
have called into that library to get the magic hooked up.

Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110523/f354a057/attachment.pgp>


More information about the xorg-devel mailing list