When using opencv compiled with QT support (trying to use the control panel), all my images (webcam captures) get expanded to fit the size of the window itself. Using CV_WINDOW_KEEP_RATIO does not seem to help. Initially, the images appear at the correct aspect ratio (that of my webcam) but once I mouse-over them they expand to fit the window. I've checked (with getWindowProperty) that CV_WINDOW_KEEP_RATIO does not somehow get set to FREE_RATIO.
I'm using Arch Linux, 64-bit, opencv 2.4.10, compiled it by myself as the distro version does not have qt support compiled in (probably to avoid the dependency). Using a tiling window manager as well which automatically resizes the windows into a grid layout.
For what it's worth, WINDOW_AUTOSIZE 'solves' the problem but as I'm using a lot of windows this just makes dealing with them unwieldy.