Opened 9 years ago

Closed 9 years ago

#11962 closed bug (fixed)

BToolBar's "flat" BButtons don't lose their "hover" state sometimes

Reported by: jackburton Owned by: waddlesplash
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

With Focus Follows Mouse enabled, there is a glitch in the Tracker Navigator icons mouseover. Move the mouse over a Navigator Icon, then move it slowly on another window placed near the tracker's one. The Icon will remain highlighted, like in the attached screenshot.

Attachments (1)

glitch.png (10.5 KB ) - added by jackburton 9 years ago.

Download all attachments as: .zip

Change History (10)

by jackburton, 9 years ago

Attachment: glitch.png added

comment:1 by diver, 9 years ago

Milestone: UnscheduledR1
Owner: changed from axeld to waddlesplash
Status: newassigned

I've seen it happening with without Focus Follows Mouse enabled.

comment:2 by Janus, 9 years ago

I can reproduce this with all the buttons in the system.

comment:3 by waddlesplash, 9 years ago

Component: Applications/TrackerKits/Interface Kit
Owner: changed from waddlesplash to nobody
Summary: Tracker Navigator icons mouseover glitchBToolBar's "flat" BButtons don't lose their "hover" state sometimes

My prior analysis of the situation is that because BToolBar's BButtons do not have B_FULL_POINTER_HISTORY enabled. This (in practice at least) means that some, but not all of the enter/leave events will reach the button. So if you slowly move the mouse off of the buttons, they will de-hover 100% of the time. But if you move the mouse quickly off of the buttons (easily reproducible by moving another window halfway overtop of one of the buttons, focusing that window, and then moving the mouse on the button and then off onto the other window), the button never is told the mouse isn't on it and so it keeps its "hovering" look.

I couldn't imagine this didn't affect every button in the system -- it's just that most buttons are not flat, and the color change on hover is not very dramatic, so it's not really noticeable. It appears Janus investigated that (above), and confirmed this.

As for how to fix this, I'm not sure. Just enabling B_FULL_POINTER_HISTORY is probably sufficient to fix this, but the question is "where?". I'm unsure of the performance implications of enabling it, and if it's more than a few hundred microseconds it's probably too much to enable it by default for every BButton. We could, however, have BButton enable/disable it when the "flat" state is toggled. Or perhaps this is really a bug somewhere "further up the chain" -- a bug in the event filtering system? I'm not really familiar with any of these things or their implications, so someone more knowledgeable than me will have to handle this one.

comment:4 by X512, 9 years ago

This bug is probably caused by wrong mouse message dispatching in Interface Kit or app_server. When cursor is moved to another window, previous window (and its views) is probably not notified correctly. B_ENTERED_VIEW/B_EXITED_VIEW message generation should be investigated.

in reply to:  3 comment:5 by jackburton, 9 years ago

Replying to waddlesplash:

My prior analysis of the situation is that because BToolBar's BButtons do not have B_FULL_POINTER_HISTORY enabled. This (in practice at least) means that some, but not all of the enter/leave events will reach the button. So if you slowly move the mouse off of the buttons, they will de-hover 100% of the time. But if you move the mouse quickly off of the buttons (easily reproducible by moving another window halfway overtop of one of the buttons, focusing that window, and then moving the mouse on the button and then off onto the other window), the button never is told the mouse isn't on it and so it keeps its "hovering" look.

I don't think this is the case, since B_ENTERED/B_EXITED_VIEW messages should always be dispatched, with or without the B_FULL_POINTER_HISTORY flag. I'd be more inclined to think this is a bug in interface kit or/and app_server, as X512 wrote.

comment:6 by X512, 9 years ago

I performed some tests and realized that this bug is not always reproduced. It is not reproduced in simple test application and WebPositive toolbar.

comment:7 by X512, 9 years ago

Bug is probably in BButton::MouseMoved function:

	bool inside = Bounds().Contains(where);
	if (_SetFlag(FLAG_INSIDE, inside))
		Invalidate();

Setting inside variable don't take B_ENTERED_VIEW/B_EXITED_VIEW in account. I didn't find any problems in app_server or core Interface Kit.

comment:8 by waddlesplash, 9 years ago

Owner: changed from nobody to waddlesplash

comment:9 by jackburton, 9 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev49183.

Note: See TracTickets for help on using tickets.