Closed Bug 581771 Opened 14 years ago Closed 14 years ago

tooltips use COLOR_ALPHA layers unnecessarily

Categories

(Core :: Widget: Gtk, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b4

People

(Reporter: karlt, Assigned: karlt)

Details

Attachments

(1 file)

      No description provided.
GTK uses gtk_tooltip_paint_window() to respond to expose events for tooltips
and this uses only gtk_paint_flat_box() to paint the tooltip widget, and, in
the default theme, gtk_default_draw_flat_box() draws a background to fill the
box.

Similarly, moz_gtk_tooltip_paint() uses gtk_paint_flat_box().

It's possible that some themes may rely on the GdkWindow background getting
painted in gdk_window_begin_paint_region() (used for double buffering), while
Gecko doesn't use gdk_window_begin_paint_region().  However, I don't know of
any reported problems with our tooltips not getting painted.  If it turns out
that some themes do not completely paint the rectangle with
gtk_paint_flat_box(), then moz_gtk_tooltip_paint() should first draw a default
background.
Attachment #460112 - Flags: review?(roc)
Comment on attachment 460112 [details] [diff] [review]
report GTK themed tooltips as opaque

Simple (small) performance improvement.
Also avoids potential corruption like in attachment 420017 [details].
Attachment #460112 - Flags: approval2.0?
Attachment #460112 - Flags: approval2.0? → approval2.0+
http://hg.mozilla.org/mozilla-central/rev/5fb2e6f217c8
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b4
I've noticed that native tooltips are rounded and have a transparent background. Firefox appears to be the only app violating this. Shouldn't we fix this and wouldn't the patch here be wrong then?
(In reply to comment #4)
> I've noticed that native tooltips are rounded and have a transparent
> background. Firefox appears to be the only app violating this. Shouldn't we fix
> this and wouldn't the patch here be wrong then?

I'm guessing most themes with rounded tooltips would be doing this by setting a shape mask on style-set, rather than by drawing a transparent background (which we don't support yet).  Using a shape mask, or perhaps even native tooltips would be the best way to fix that, I'm guessing.

Some themes are starting to take advantage of ARGB widget colormaps and would be able to actually "draw" something transparent.
Currently we override such colormaps.  When we support these colormaps, GetWidgetTransparency should probably usually return eUnknownTransparency for ARGB default colormaps.  For those themes that can draw to these colormaps, using COLOR_ALPHA layers won't be as inefficient as for traditional RGB-only themes.
I am not entirely sure, but I think the rounded tooltips are a fedora specific GTK+ patch. (http://blogs.fedoraproject.org/wp/mclasen/2009/10/26/5-little-things/)
I'm on ubuntu.
There is a Fedora specific patch,
http://cvs.fedoraproject.org/viewvc/rpms/gtk2/F-13/fresh-tooltips.patch?revision=1.3&view=markup

Ubuntu are adopting it
https://bugs.launchpad.net/hundredpapercuts/+bug/487208
(I don't know whether or not this is what Dão sees.)

The Fedora patch uses a combination of shape masks and rgba colormaps where available.
The drawing code is custom and doesn't really use the theme much.
It's not really public, so we'd have to peek at expose event handlers to use it.
Using native tooltips would be easier/better if suitable.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: