GNOME Bugzilla – Bug 113798
Support aspect ratio hints
Last modified: 2004-12-22 21:47:04 UTC
The code to support aspect ratio hints in constraints.c is currently #if 0'd. We should figure out why and maybe even fix whatever's wrong with the code.
Need to fix this before stable release. I'm not sure it's disabled for a reason, I may have just been wanting to test the other code without this code interfering. So a first step may be to just try enabling it.
played around with this a bit. The aspect ratio code is completely hosed, especially the center resizing. Sometimes the whole window will move around with screen in screwy ways when center resizing. Sometimes it won't let you center resize at all. Corner resizing mostly works but it's possible to get it to do weird things also. I've retrofitted metacity-window-demo to add an aspect ratio hint-o-matic. I'm attaching a patch. If you press the new open button, it'll set the text widget to a 16:9 aspect ratio. Then you can play around with it easily if you want to. But for now I think I'm going to bed :-)
Created attachment 17038 [details] [review] add aspect ratio playing support to metacity-window-demo and un-#if 0 aspect ratio code
Adding PATCH keyword...
It's not really a patch. It's a pretend patch.
*** Bug 112324 has been marked as a duplicate of this bug. ***
Created attachment 18650 [details] [review] support aspect ratio
Attached patch works well for mouse resizing -- I essentially just disabled center resizing for aspect-constrained windows because it was causing undesirable side effects, and fixing them would have been more effort than I was willing to put into fixing this very rarely used feature.
Can you explain the patch more? Are you saying just disabling center fixes the other cases? It looks like there's code there related to center though?
The code related to center just prevents you from resizing the window out of aspect ratio at all, whereas you can resize the window at a corner (that is, you can still center resize, but not on aspect-ratio constrained windows). The problem with center resizing is that weird multi-dimensional side effects would pop up causing the window to move around in very odd ways. I immediately couldn't come up with a good way of fixing that, so I just disabled it.
OK, sounds reasonable and I'm not going to take the time to unpack the math, so I'll just trust you. ;-) Thanks
committed. We may end up revisiting this at a later date though.