Closed Bug 1167239 Opened 9 years ago Closed 9 years ago

GTK3: TEST-UNEXPECTED-FAIL | dom/events/test/test_bug426082.html | Moving the mouse down from the label should have unpressed the button.

Categories

(Core :: Widget: Gtk, defect)

Unspecified
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: acomminos, Assigned: acomminos, Mentored)

References

Details

Attachments

(1 file, 2 obsolete files)

Running mochitest dom/events/test/test_bug426082.html on GTK3 builds fails.

TEST-UNEXPECTED-FAIL | dom/events/test/test_bug426082.html | Moving the mouse down from the label should have unpressed the button.
QA Contact: acomminos
Assignee: nobody → acomminos
QA Contact: acomminos
Attached patch Fix button focus state flags on GTK3 (obsolete) (deleted) — Splinter Review
This patch makes GTK3's GtkStateFlags more consistent with what is currently done on GTK2 (requiring hover for the button active state), fixing the test in this bug.

Thanks!
Attachment #8608914 - Flags: review?(karlt)
Comment on attachment 8608914 [details] [diff] [review]
Fix button focus state flags on GTK3

I doubt this is the right fix.
I suspect there are some widgets that should be active even when there is no hover.
It shouldn't be the drawing code applying a restriction that the widget is not active when not hovered.  That should be determined by the particular widget implementation.

Is it depressed or active that is set on the button when not expected?

The GTK2 code is quite different because the widget can have only one state.  With GTK3 there are different flags, and so different combinations are possible.
Attachment #8608914 - Flags: review?(karlt) → review-
'active' is being set on buttons that are not currently being hovered over, which violates the expectation of dom/events/test/test_bug426082.html.

I agree though, moving the activity decision out of the drawing code makes a lot of sense. What are your thoughts on putting the check in nsNativeThemeGtk::GetGtkWidgetAndState?

Cocoa does something similar in nsNativeThemeCocoa.cpp when dealing with buttons:

> [cell setHighlighted:isActive &&
>                      inState.HasAllStates(NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_HOVER)];
Attached patch Make GTK button activity require hover. (obsolete) (deleted) — Splinter Review
This patch moves the button activity decision based on hover state to nsNativeThemeGTK::GetGtkWidgetAndState. Thanks!
Attachment #8608914 - Attachment is obsolete: true
Attachment #8622475 - Flags: review?(karlt)
Comment on attachment 8622475 [details] [diff] [review]
Make GTK button activity require hover.

>       }
> 
>+      if (aWidgetType == NS_THEME_BUTTON) {
>+        aState->active &= aState->inHover;
>+      }

Please make this "else if".

I think this is fine, but some other button widgets should also behave similarly.
Attachment #8622475 - Flags: review?(karlt) → review+
Updated to cover more button types.

Try (GTK2): https://treeherder.mozilla.org/#/jobs?repo=try&revision=074645cc5482
Attachment #8622475 - Attachment is obsolete: true
Attachment #8623070 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/709775ec03a2
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: