GNOME Bugzilla – Bug 322070
Constraints don't always apply correctly for partial struts
Last modified: 2006-01-10 04:58:37 UTC
I can pretty easily get windows almost completely occluded by panels, up to and including leaving just one pixel width visible. Also, it doesn't seem to find the closest feasible region correctly. Consider the following screenshots (to be attached). In the first screenshot, a right panel and a bottom panel combine to leave just one row of pixel visible on the window. In the second screenshot I move the right panel down one pixel to completely occlude the window, which causes it to be moved up, rather then left which is a much better solution.
Created attachment 55048 [details] First screenshot -- not much window visible
Created attachment 55049 [details] second screenshot -- nonoptimal solution to constraints
maybe we should simply cull out any feasible rectangles which are either narrower or wider than some threshold? That would presumably fix the first issue, though not the second.
narrower or *shorter* than some threshold.
Yeah, the basic way the algorithm works is to first find those maximal/spanning rectangles that I was taking about. For the first issue you mention, one of the rectangles would be screen_width x 1 in size. The keep-partially-onscreen constraint is then defined in terms of extending the all maximal/spanning rectangles in each of the directions corresponding to how much it can be offscreen for that direction. It just turns out that your 1 pixel height was a case where the window was offscreen in both directions and since the window is allowed more than halfway off the screen in each direction it seemed perfectly fine to the algorithm. We could cut out small rectangles like you say or maybe require a certain percentage be on the screen. Either sounds fine. I wasn't able to duplicate the second issue; I tried making a setup like yours but the window always got shoved to the left. Could you specify the dimensions of each of the panel and the window and I'll see if maybe that helps me reproduce?
Created attachment 57061 [details] [review] Fix the allowed-to-only-have-on-pixel-thickness onscreen issue (I still can't duplicate the second issue and will need a verbose debugging log to do anything with it)
I don't have anything intelligent to say on this one, if you guys think it looks good then go for it.
Committed. Since the second issue was different, Rob, please open a separate bug if you can still duplicate and provide a verbose debugging log.