Bug 273828 - oxygen-gtk: In Swing apps, inactive tabs all get the blue hover highlight even when not hovered
Summary: oxygen-gtk: In Swing apps, inactive tabs all get the blue hover highlight eve...
Status: CLOSED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: gtk2-engine (other bugs)
Version First Reported In: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-22 04:39 UTC by Kevin Kofler
Modified: 2011-07-29 23:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Kofler 2011-05-22 04:39:23 UTC
Version:           unspecified (using KDE 4.6.3) 
OS:                Linux

In Java Swing apps, using the com.sun.java.swing.plaf.gtk.GTKLookAndFeel (with oxygen-gtk as the GTK+ theme), all inactive tabs always get highlighted with the blue hover shadow even when they're not being hovered with the mouse.

Reproducible: Didn't try

Steps to Reproduce:
Try running a Java Swing apps which has tabs in it. Use these JVM switches:
-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
-Dswing.systemlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
to make sure it actually uses the GTKLookAndFeel (as opposed to the ugly Metal one, see also http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=729 ).

Actual Results:  
All inactive tabs falsely show as if they were being hovered.

Expected Results:  
Only actually hovered tabs should show up as hovered, or if this is not possible, then no hover highlight should be drawn at all.

This glitch is very annoying because the highlighting shadow misleadingly draws the attention away from the active tab.
Comment 1 Kevin Kofler 2011-05-22 04:41:22 UTC
Oops, actually this should read "Reproducible: Always", not "Didn't try". (I forgot to set the combobox.) I did try, it happens every single time.
Comment 2 Ruslan Kabatsayev 2011-05-22 17:06:16 UTC
It would be easy to fix (disable hover support) if we knew how to detect Swing usage. Just detecting java isn't enough since e.g. SWT works with tabs normally (because it's mostly normal GTK+ wrapper).
Any ideas on this?
Comment 3 Kevin Kofler 2011-05-22 18:21:29 UTC
I think we need to sanity-check the coordinates returned by gdk_window_get_pointer at:
https://projects.kde.org/projects/playground/artwork/oxygen-gtk/repository/revisions/master/entry/src/animations/oxygenhoverdata.cpp#L49

I think the solution to the mystery must be that there is a false intersect detected in that function.
Comment 4 Kevin Kofler 2011-05-22 18:23:38 UTC
(The coordinates in Swing's fake widgets must be nonsense which happens to always intersect.)
Comment 5 Hugo Pereira Da Costa 2011-05-22 18:36:42 UTC
yes, thats what it is. That's why we need to find a way to disable hover on tabs for this kind of widgets, (and this kind only).
Will investigate.
Comment 6 Hugo Pereira Da Costa 2011-05-22 19:52:44 UTC
Kevin,
2 newbie questions:
- Swing is swt, correct ? 
- can you point me to one or two (basic please) swt apps, for me to test patches ?

Thx,

Hugo
Comment 7 Ruslan Kabatsayev 2011-05-22 19:57:39 UTC
@Hugo
No, SWT and Swing are very different. SWT is a GTK wrapper on Linux, while Swing draws all the widgets on a single X window, using GTK only as a theme drawer. That's why SWT apps work OK with tab prelight, while Swing ones don't.
Comment 8 Ruslan Kabatsayev 2011-05-22 20:01:01 UTC
Here's a good tab test app using Swing:
http://download.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html
Comment 9 Hugo Pereira Da Costa 2011-05-23 19:12:54 UTC
Git commit abcceffd3eb38fef3d49499ce5a82caa5d1cd6c5 by Hugo Pereira Da Costa.
Committed on 23/05/2011 at 19:09.
Pushed by hpereiradacosta into branch 'master'.

Disable tab widgets hover in Java (non-swt) applications when an invalid window
is passed as argument to
draw_extension.
CCBUG: 273829

M  +4    -1    src/oxygenstylewrapper.cpp     

http://commits.kde.org/oxygen-gtk/abcceffd3eb38fef3d49499ce5a82caa5d1cd6c5