开发者

Resizing an Xvfb display

开发者 https://www.devze.com 2023-03-12 22:23 出处:网络
Simple Question: Is there a way to resize a Xvfb disp开发者_高级运维lay? I tried with RandR but it seems that the RandR extension is not supported by Xvfb. Are there other ways to resize the screen?

Simple Question: Is there a way to resize a Xvfb disp开发者_高级运维lay?

I tried with RandR but it seems that the RandR extension is not supported by Xvfb. Are there other ways to resize the screen?

Thanks for your help!


You can use the server-args command line argument to specify a custom resolution for the virtual frame buffer being created, but this does not change the resolution of an existing virtual frame buffer:

xvfb-run --server-args="-screen 0, 1024x768x24" ...


Most distributions now ship a version of Xvfb with randr support. The code was committed in late 2015 vfb: add randr support (v2).

To resize you will first need to define a new mode (you can use tools like gtf to get the modeline definition values), add it to the virtual output, and then you can switch to it.

ie for 1280x1024:

xrandr --newmode "1280x1024"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode screen 1280x1024
xrandr -s 1280x1024
0

精彩评论

暂无评论...
验证码 换一张
取 消