Closed Bug 264164 Opened 21 years ago Closed 20 years ago

Radio and check indicator w/ Classic theme remains hover state look

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ginnchen+exoracle, Assigned: ginnchen+exoracle)

References

Details

(Keywords: fixed1.8.1, regression)

Attachments

(6 files, 3 obsolete files)

I'm using trunk GTK2 build/20041008 on JDS2. Radio and check indicator w/ Classic theme sometimes has a trail, when mouse move over it. It looks as hover state after mouse pointer leaves. See attached ScreenShot. I don't have this problem with Mozilla 1.7.
Attached image ScreenShot
Flags: blocking1.8a6?
Sarah, can you take a look at this and see if it's reproduceable?
Ginn, it's not clear to me what the problem is from looking at the screenshot. testing this with today's gtk2 nightly build, after I click a radiobutton or checkbox, when I move the mouse off of the widget, the hover "highlighting" effect goes away for me. what remains is the the dotted focus ring --but I'd think that's expected since that's where focus was last (ie, where I last *clicked* the mouse).
fwiw, I also see the same thing in comment 3 using a gtk1 nightly from 2005-01-02-trunk.
(In reply to comment #3) > Ginn, it's not clear to me what the problem is from looking at the screenshot. > All the checkboxes and radios except 'Home page' is in hover state (blue). Does checkbox/radio changes color with your gnome-theme? If so, you can just move mouse over them without click, this bug will be reproduced. With some gnome themes, this bug is not obvious. I only tested GTK2 build on Linux/Solaris.
Attached image screenshot using default gnome-theme (obsolete) —
I realized that providing a screenshot of what I see might be helpful. :) Ginn, I'm using the default RedHat gnome-theme, called Bluecurve. (well, default for fedora core 2.)
Comment on attachment 170312 [details] screenshot using default gnome-theme oh, wait a sec --let me get an image showing the focus...
Attachment #170312 - Attachment is obsolete: true
when taking this screenshot, I clicked on the "home page" radiobutton which displays both the dotted focus ring and the paler-grey hover style. when I moved my mouse away from this radiobutton, the focus ring persisted (till I clicked elsewhere), but the paler-grey hover style went away (which seems expected).
(In reply to comment #8) > Created an attachment (id=170313) [edit] > screenshot showing focus > The problem is with bluecurve theme, the radio/checkbox doesn't change when you hover it. Try "Ocean Dream" theme. The radio/checkbox will be lighter when you hover it. Although it's still not very obvious. I can reproduce this bug with RH9, 20050104 nightly GTK2 build. I think it's a regression, I can't reproduce it with 20040720 mozilla 1.8a3.
Please notice that in this screenshot "Search" "Print" checkboxes and "Home page" "Last page visited" radios are all in hover state. Only the exact checkbox/radio under mouse cursor should be in hover state.
a regression caused by Bug 241070 patch by npeninguy@gmail.com (Nicolas PENINGUY), r=bryner sr=blizzard Refactor nsNativeThemeGTK backing out this patch does solve this problem.
Depends on: 241070
Keywords: regression
mozilla/ gfx/ src/ gtk/ nsNativeThemeGTK.cpp 252 // For XUL checkboxes and radio buttons, the state of the parent 253 // determines our state. 254 if (aWidgetType == NS_THEME_CHECKBOX || aWidgetType == NS_THEME_RADIO || 255 aWidgetType == NS_THEME_CHECKBOX_LABEL || 256 aWidgetType == NS_THEME_RADIO_LABEL) { 257 if (aWidgetFlags) { 258 nsIAtom* atom = nsnull; 259 260 if (aFrame) { 261 nsIContent* content = aFrame->GetContent(); 262 if (content->IsContentOfType(nsIContent::eXUL)) { 263 aFrame = aFrame->GetParent(); mozilla/ gfx/ src/ shared/ nsNativeTheme.cpp 182 if (content->IsContentOfType(nsIContent::eXUL)) { 183 // For a XUL checkbox or radio button, the state of the parent determines 184 // the checked state 185 aFrame = aFrame->GetParent(); duplicates, I don't know which one should be removed. Seems we need add #ifdef in mozilla/ gfx/ src/ shared/ nsNativeTheme.cpp, or we need another refactoring.
The GTK1 hover effects work fine in my standard RH7.3 installation.
Flags: blocking1.8b?
Flags: blocking1.8a6?
Flags: blocking1.8a6-
Hmm, sorry for that... I can reproduce it using the "Ocean Dream" theme. nsNativeThemeGTK::GetGtkWidgetAndState() is quite complicated, and I'm afraid of breaking something else. :( Simple patch restoring the old behaviour is coming...
Attached patch Simple fixSplinter Review
Attachment #172213 - Flags: review?(bryner)
Flags: blocking1.8b?
Flags: blocking1.8b-
Flags: blocking1.8a6-
The patch looks good to me. I really want it get fixed before 1.8b. It is horrible to Java Desktop System users.
Flags: blocking1.8b2?
Comment on attachment 172213 [details] [diff] [review] Simple fix I don't want to refork this method from the shared base class. Can you figure out how/why nsNativeTheme::GetContentState gives a different result from the one we're expecting?
Attachment #172213 - Flags: review?(bryner) → review-
(In reply to comment #17) > (From update of attachment 172213 [details] [diff] [review] [edit]) > I don't want to refork this method from the shared base class. Can you figure > out how/why nsNativeTheme::GetContentState gives a different result from the > one we're expecting? > In nsNativeTheme.cpp, there is aFrame = aFrame->GetParent(); for radio/checkbox in XUL. But the nsNativeThemeGTK::GetContentState doesn't have it. For this situation, the GetParent() method is used in nsNativeThemeGTK before calling GetContentState(), and may have other uses there.
Flags: blocking-aviary1.1?
Flags: blocking-aviary1.1? → blocking-aviary1.1-
Blocks: 287523
Flags: blocking1.8b2? → blocking1.8b2-
Attached patch another approach for this bug (obsolete) — Splinter Review
Move aFrame = aFrame->GetParent(); out of nsNativeThemeGTK. Please review it, this bug is very obvious on JDS or debian.
Attachment #190682 - Flags: review?(bryner)
my patch is not working on trunk now...
Attachment #190682 - Attachment is obsolete: true
Attachment #190682 - Flags: review?(bryner)
Attached patch another approach for this bug (obsolete) — Splinter Review
My last patch was wrong. This patch works fine, but I'm wondering whether we should check XULCheckboxRadio and do GetParent() in both GetGtkWidgetAndState() and GetContentState(). But this bug is really bad to me.
Attachment #194285 - Flags: review?(bryner)
*** Bug 289767 has been marked as a duplicate of this bug. ***
*** Bug 301976 has been marked as a duplicate of this bug. ***
This bug is also obvious in GNOME Industrial.
*** Bug 281228 has been marked as a duplicate of this bug. ***
Pulling blocking requests from bug 281228 over to this bug.
Flags: blocking1.9a1?
Flags: blocking1.8.1?
Pull over the CC'd list from bug 281228 to maybe help get this bug fixed (a patch is waiting to be reviewed).
Comment on attachment 194285 [details] [diff] [review] another approach for this bug Ok, I understand now. I don't really like this patch either, because it assumes (in cross-platform code) that the checkbox-with-spacing binding is being used. It seems like there's a pretty simple solution though: 1. Adjust aFrame for CHECKBOX_LABEL/RADIO_LABEL 2. Call GetContentState 3. All of the other processing before we start setting aState, but take out the frame adjustment for CHECKBOX_LABEL/RADIO_LABEL
*** Bug 317217 has been marked as a duplicate of this bug. ***
Attached patch proposed fixSplinter Review
This fixes it for me. It adjusts aFrame only for the label case, since GetContentState knows how to do it for the non-label case. I also reduced the over-wide scope of the |if (aWidgetFlags)| check, since we want to do this regardless of whether aWidgetFlags is true (so we can set aState).
Attachment #203863 - Flags: review?(roc)
(In reply to comment #30) > Created an attachment (id=203863) [edit] > proposed fix > > This fixes it for me. It adjusts aFrame only for the label case, since > GetContentState knows how to do it for the non-label case. I also reduced the > over-wide scope of the |if (aWidgetFlags)| check, since we want to do this > regardless of whether aWidgetFlags is true (so we can set aState). > This patch is not correct. I applied it to a last month's build. Every checkbox rendered as unchecked state no matter it is checked or not.
*** Bug 317851 has been marked as a duplicate of this bug. ***
*** Bug 320216 has been marked as a duplicate of this bug. ***
I think bryner had made some mistakes in his patch. stateFrame is assigned but never used after in his patch. This patch worked for me now.
Assignee: blizzard → ginn.chen
Attachment #203863 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #206382 - Flags: review?(roc)
Attachment #203863 - Flags: review?(roc)
Attachment #203863 - Attachment is obsolete: false
Attachment #203863 - Flags: review-
Comment on attachment 206382 [details] [diff] [review] make bryner's patch work ok, great. sorry about the delay.
Attachment #206382 - Flags: superreview+
Attachment #206382 - Flags: review?(roc)
Attachment #206382 - Flags: review+
Fixed on trunk
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Attachment #194285 - Attachment is obsolete: true
Attachment #194285 - Flags: review?(bryner)
Comment on attachment 206382 [details] [diff] [review] make bryner's patch work important for gtk/gtk2 users, affect Firefox on a lot of Linux/Unix distributions
Attachment #206382 - Flags: approval1.8.1?
Attachment #206382 - Flags: approval1.8.1? → branch-1.8.1?(roc)
Attachment #206382 - Flags: approval-branch-1.8.1?(roc) → approval-branch-1.8.1+
Checking in gfx/src/gtk/nsNativeThemeGTK.cpp; /cvsroot/mozilla/gfx/src/gtk/Attic/nsNativeThemeGTK.cpp,v <-- nsNativeThemeGTK.cpp new revision: 1.64.8.4; previous revision: 1.64.8.3 done
Keywords: fixed1.8.1
*** Bug 326147 has been marked as a duplicate of this bug. ***
Flags: blocking1.9a1?
Flags: blocking1.8.1?
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: