Limit video output to a section of a display and leave the rest blank

The video projector I have to use this week projects an image too large for its screen
and spills over on every side.

Fixing the physical setup is not possible or at least unlikely for the moment: the only solution is to carefully resize and position windows so that they display in the visible part of the screen - using full-screen mode is out.

Is there a way around this via software, using xrandr for example?

# xrandr doesn't have a padding option...
xrandr --output VGA1 --mode 1360x768 --left-of LVDS1 --padding 200

Solution 1:

I have a broken screen, with only the upper left corner usable. I use Openbox as my window manager (through Crunchbang). I have this at the start of .config/openbox/autostart (but I suppose you can add it to anything that executes after X starts):

xrandr --newmode "1016x670_59.90"  54.87  1016 1064 1168 1320  670 671 674 694  -HSync +Vsync
xrandr --addmode LVDS1 1016x670_59.90
xrandr --output LVDS1 --fb 1016x670 --panning 1016x670 --mode 1016x670_59.90
xrandr --fb 1016x670 --output LVDS1 --mode 1280x800

This reduces my screen to using a 1016x670 box in the upper left corner. I have no idea why I have to create the new mode and switch out of it again, but this works for me.

I got the modeline from gtf:

 gtf 1016 670 59.9

In your case I think you're aiming for 1160x568 (200px padding all around).

Get the modeline:

gtf 1160 568 59.9
>> # 1160x568 @ 59.90 Hz (GTF) hsync: 35.22 kHz; pclk: 52.13 MHz
>> Modeline "1160x568_59.90"  52.13  1160 1200 1320 1480  568 569 572 588  -HSync +Vsync

Then

xrandr --newmode "1160x568_59.90"  52.13  1160 1200 1320 1480  568 569 572 588  -HSync +Vsync
xrandr --addmode VGA 1160x568_59.90
xrandr --output VGA --fb 1160x568 --panning 1160x568 --mode 1160x568_59.90
xrandr --fb 1160x568 --output VGA --mode 1280x800

Solution 2:

The best I could come up with was

  • use XMonad and a virtual machine: resize the VM window to fit the visible area of the display (no window decorations to get in the way) and then display the presentation full-screen in the VM

  • use xrandr's fb option to limit the total screen size to the visible area and the transform option to move it to the right place. Like this the other display is pretty useless.

    xrandr --fb 1000x600 --output VGA1 --mode 1360x768 --transform 1,0,-150,0,1,-80,0,0,1