GNOME Bugzilla – Bug 122065
Corner rounding depends on side widths
Last modified: 2005-07-14 21:00:44 UTC
If left_width or right_width is less than 3, then the top corners are not rounded. (I haven't checked the bottom corners.) This makes sense where rounding might clip the application window, but the height of the titlebar (and, presumably, the bottom) can allow rounding without clipping the app's window. Small, or maybe even absent, sides and bottoms would be nice for non-resizable windows.
(Yep, bottom corners do this, too.) The rounded corner comes in 5 pixels (from either edge) at the furthest point. So as long as your titlebar is at least 5 px tall, you don't need this restriction. (I think if your titlebar is < 5 px tall, you probably have bigger problems.) The restriction is in theme.c: look for "min_size_for_rounding = 3;". What it appears it's doing is checking to make sure (for the top-left corner) top_height and left_width are both greater than 3. That's sufficient, but it's not necessary. As long as either one of left_width or top_height is at least 5, it's safe. This allows themes to have left/right borders of width 1 or 2. (You can get even closer than that, if you want to be really picky; for example, if left_width = top_height = 2 it's still safe. But I don't think there's any demand for such a theme.)
Created attachment 31221 [details] [review] Use h+w>5 instead of h>3&&w>3 as criterion This is a more lenient threshold for drawing rounded corners. It handles every case the current code does, plus other cases with thinner sides or bottom that still have enough room for the rounded corners. I think there's at least one safe case it still doesn't handle (left_width = bottom_height = 2), but that's probably a pretty rare case (and it doesn't look very good to me, either).
This is pretty unobjectionable and it won't break existing themes.
Ken: We have branched; go ahead and commit (or let us know if you don't have cvs access so we can do it for you).
2005-07-14 Elijah Newren <newren@gmail.com> Patch from Ken Harris to provide a more lenient threshold for drawing rounded corners. Fixes #122065. * src/theme.c (meta_frame_layout_calc_geometry): use height + width > 5 instead of height > 3 && width > 3 as criterion