3

I can start the xvfb instance just fine

Xvfb :1 -screen 0 800x600x24

I can then launch firefox and have it load correctly but the window is always smaller than the resolution I set during the xvfb command.

firefox http://www.ebay.com --display=:1

enter image description here

You can see the black bar, that's the full resolution. It appears it's sizing to what the page wants but it will never fill it out completely.

2
  • What is your goal?
    – ish
    Jun 26, 2012 at 14:53
  • I want to get an accurate screenshot at different resolutions. Since this is not the exact resolution it messes up my tests. Jun 26, 2012 at 15:01

2 Answers 2

3

Here is a solution, not pretty but works. Uses xdotool to set size after Firefox is running.

First:

xdotool search --onlyvisible firefox

This will display a single window ID, windowid. Then:

xdotool windowmove windowid 0 0
xdotool windowsize windowid 1280 720

You must first do the windowmove and follow it by the windowsize.

In some cases once I did this, the size and position were correct forever more, in other cases had to run again each time I ran Firefox.

1

Assume the border is there and compensate accordingly in your capture. If you need 1024x768, then set the screen size to 1034x778 and capture 1024x768

Xvfb :1 -screen 0 1034x778x24 > /dev/null &
ffmpeg -t 1 -s 1024x768 -f x11grab -i :1.0+10,10 -f mjpeg screenshot.png

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .