[Xcb] RANDR + xcb_screen_t root, the fields (width_in_pixels/height_in_pixels) are not changed

Alan Coopersmith alan.coopersmith at oracle.com
Mon Sep 6 16:41:42 UTC 2021

On 9/3/21 11:22 PM, Andrey Af wrote:
> Hi,
> After changing the screen size via utility xrandr -s 1 or the  RANDR
> API, why does the size information in screen root
> width_in_pixels/height_in_pixels not change?
> But if I make a new connection, then the information is correct.
> How do I update the information in the current connection correctly?

xcb_get_setup returns pointers to the information provided at connection
time - there is no way to update that information on an existing connection.
(The X11 core protocol did not expect that information to ever change -
  and it couldn't until the RANDR extension came along decades later.)

You'll need to keep track of resize events from the RANDR extension instead
and store the screen sizes in your own structure instead.

	-Alan Coopersmith-               alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - https://blogs.oracle.com/alanc

More information about the Xcb mailing list