Thursday, July 16, 2009

What 'OK' button?

Netbooks are great. I love the portability, and the fact that it's possible to make devices that small now-a-days, but they still have sufficient power for typical daily work. One of the trade-offs for that smaller size though, is a smaller screen size. Typical resolution for many of these newer netbooks is 1024x576.

Unfortunately, most developers aren't running at anything near that small anymore. The side effect of this is that devices that small often go forgotten, or untested at least. I saw a few of these recently when digging through the preferences dialogs in an application and found one that was not resizable, and pushed straight off the bottom of the screen. Fortunately, this isn't too hard to work around. If you ever run into this, simply hold down alt, and click in the windows somewhere to drag it around to a better position so that you can see the buttons. But more importantly - REPORT THE BUG! And if you're a developer, please think about things like this when designing user interfaces.

I'd like to focus on the test aspect of this for a moment though. I'm working on a testsuite for testing these sorts of things, but the way it works for now requires that you actually be running at the maximum resolution you support. Problem is, I don't have a netbook at the moment that defaults to 1024x576.

xrandr to the rescue
Here's a simple way to do this, and it's even working great on my UNR installation running under virtualbox. You'll need to have the VirtualBox guest extensions installed on the VM for this to work properly.

Use cvt to get the modeline
$ cvt 1024 576
Modeline "1024x576_60.00" 46.50 1024 1064 1160 1296 576 579 584 599 -hsync +vsync

Next use xrandr to add the new mode
$ xrandr --newmode "1024x576_60.00" 46.50 1024 1064 1160 1296 576 579 584 599 -hsync +vsync
$ xrandr --addmode VBOX1 "1024x576_60.00"
$ xrandr -s 1024x576_60.00

And that's it! At this point, you should see the screen resolution change. One thing to note, if you are not running under virtualbox, replace the VBOX1 with LVDS on the addmode line. If that still doesn't work, run xrandr by itself and look for the line that says "connected" to find the output name to use.

No comments: