After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 122065 - Corner rounding depends on side widths
Corner rounding depends on side widths
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: themes
2.4.x
Other Linux
: Normal enhancement
: future
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks: 102547
 
 
Reported: 2003-09-11 23:17 UTC by Gregory Merchan
Modified: 2005-07-14 21:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use h+w>5 instead of h>3&&w>3 as criterion (1.71 KB, patch)
2004-09-02 22:19 UTC, Ken Harris
committed Details | Review

Description Gregory Merchan 2003-09-11 23:17:07 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.
Comment 1 Ken Harris 2004-09-02 02:13:34 UTC
(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.)
Comment 2 Ken Harris 2004-09-02 22:19:07 UTC
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).
Comment 3 Rob Adams 2005-05-26 20:39:34 UTC
This is pretty unobjectionable and it won't break existing themes.
Comment 4 Elijah Newren 2005-07-12 21:04:17 UTC
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).
Comment 5 Elijah Newren 2005-07-14 21:00:44 UTC
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