Friday, August 6, 2010

Without cropping in Cygwin Xwin during switch monitors

I have a laptop with a LCD 1400x900 and a monitor with 1280x1024 connecting to the dock. When I dock and undock the laptop, my Cygwin Xwin always has something cropped. XWin doesn't change the resolution automatically, and I cannot use xrandr to change it too. For example, after starting xwin using LCD, and docking the laptop, xrandr still returns:

bash-3.2$ xrandr -q
Screen 0: minimum 1440 x 900, current 1440 x 900, maximum 1440 x 900
default connected 1440x900+0+0 0mm x 0mm
1440x900 0.0*

and the following command will fail because the size can only be 1440x900.

bash-3.2$ xrandr -fb 1280x1024

This is annoying because I have to restart xwin after switching the monitor. Finally I found this thread solved my problem.

add the following options into /usr/bin/startx

serverargs="-screen 0 1440x1024x32 -multiwindow -clipboard"

Basically it creates a screen large enough to cover any monitor.

No comments:

Post a Comment