Summary: | TimeLeft widget listens to too many signals | ||
---|---|---|---|
Product: | [Applications] juk | Reporter: | Thomas Zander <zander> |
Component: | general | Assignee: | Scott Wheeler <wheeler> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Fix |
Description
Thomas Zander
2004-01-18 21:46:59 UTC
Subject: Re: New: TimeLeft widget listens to too many signals On Sunday 18 January 2004 21:47, zander@kde.org wrote: > So if I do a mouse-down, move mouse around, and then mouse release I could > have triggered 10 or more state changes between the time-left and > played-time states. This is certainly not intuitive... Huh? It only toggles on pressing the left mouse button. Line 164 in statuslabel.cpp: if(mouseEvent && mouseEvent->state() == LeftButton) { [...] -Scott Looking at the docs you might see that button() will return NoButton on mouse move events. So you did not filter out mouse move or mouse down events, you listen to ALL events generated by the left mouse button. Please try to 'drag' over the label to see my point, or simply insert a kdDebug() after the if you mentioned. I'll attach a patch that fixes this for me. Created attachment 4231 [details]
Fix
Subject: Re: TimeLeft widget listens to too many signals On Sunday 18 January 2004 22:51, zander@kde.org wrote: > Please try to 'drag' over the label to see my point, or simply insert a > kdDebug() after the if you mentioned. Ah, got it. Had never done that on accident before. :-) - -Scott -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQFACwSRQu0ByfY5QTkRAslCAJ4uhdYTjnKumjQ2nvHCWaBzDHhy2gCeN+8S 3KzJ96H1b45sAYEF5Q/66lw= =Udb4 -----END PGP SIGNATURE----- Subject: kdemultimedia/juk CVS commit by wheeler: Only toggle the time played / remaining on mouse release. Thanks to Thomas Zander for the patch. (I'll backport this after 3.2.0 is out.) CCMAIL:72906-done@bugs.kde.org M +4 -1 statuslabel.cpp 1.19 --- kdemultimedia/juk/statuslabel.cpp #1.18:1.19 @@ -162,5 +162,8 @@ bool StatusLabel::eventFilter(QObject *o QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent *>(e); - if(mouseEvent && mouseEvent->state() == LeftButton) { + if(mouseEvent && + mouseEvent->state() == LeftButton && + mouseEvent->button() == LeftButton) + { if(o == m_itemTimeLabel) { |