Opened 6 years ago

Closed 6 years ago

#14264 closed bug (fixed)

regression: focus does not hold in Vision list view

Reported by: pulkomandy Owned by: jscipione
Priority: normal Milestone: Unscheduled
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc: closequarters
Blocked By: Blocking:
Platform: All

Description

Trying to select a channel in Vision, it will not stay focused in the list view, as a result it is not possible to see which channel is active.

Possibly a regression from hrev52069 ?

Change History (8)

comment:1 by waddlesplash, 6 years ago

Cc: closequarters added
Component: - GeneralKits/Interface Kit
Owner: changed from nobody to jscipione
Status: newassigned

comment:2 by closequarters, 6 years ago

I was concerned that I broke this in my fix for #9190, so I did some debugging here. The problem is that BListView::MouseDown sets the instance variable fTrack->item_index, and then MouseUp uses this instance variable to determine which item in the list to select/deselect. However, Vision completely overrides MouseDown in WindowList::MouseDown, and never calls the super class BListView::MouseDown method. The result is that the MouseDown of WindowList fires, followed by the MouseUp of BListView.

I'm not sure what the right solution is here because I don't have enough experience with Haiku applications, but I think it's possible we could classify this as a Vision bug, not a Haiku bug. If Vision were to override MouseUp and do nothing there, then behavior of focus on select would be restored. Thoughts?

comment:3 by jscipione, 6 years ago

Nice debugging closequarters: it does indeed sound like an app bug in Vision not calling the inherited classes MouseDown method which was exposed by your fix to #9190. It is definitely not a regression from hrev52069. :) I think the proper fix needs to be done in Vision.

The BeBook is a bit vague when it says under BListView::MouseDown: "you shouldn't override (or call) this [method]." Ok but if you do override it anyway, you should call the base method because it does a bunch of stuff (paraphrasing) "Responds to B_MOUSE_DOWN messages by selecting items, invoking items on double-click, and autoscrolling the list when the user drags with a mouse button down. This function also calls InitiateDrag() to give derived classes the opportunity to drag items."

Vision overriding MouseDown without calling its inherited BListView::MouseDown method certainly seems to be an app bug.

comment:4 by pulkomandy, 6 years ago

Fair enough, but I think the Vision code worked in BeOS so it is still a behavior incompatibility. I'm fine with patching Vision if it's the only app affected...

comment:5 by jscipione, 6 years ago

The question is not why doesn't Vision work now, the question is how the BListView work in Vision before? BeOS and Haiku until very recently was doing all this stuff in MouseDown which Vision never called. We've changed Haiku to do a lot of this stuff in MouseUp isntead and that cause this bug to show in Vision but how did selecting items work on BeOS if Vision never called BListView::MouseDown and at least according to the BeBook that's where R5 did the selecting of items? A mystery.

Version 1, edited 6 years ago by jscipione (previous) (next) (diff)

comment:6 by closequarters, 6 years ago

jscipione, Vison selection works because Select() is called explicitly in Vision WindowList::MouseDown. Essentially the authors of Vision completely replaced MouseDown with their own version. What is odd is that apparently BListView::MouseUp didn't do any selecting in BeOS, otherwise Vision would have been experiencing this issue prior most likely.

I like PulkoMandy's idea of testing some other apps to see if this selection problem is more widespread. So far in the built-in apps/prefs, I haven't been able to reproduce a selection failure as seen in Vision, so I'm feeling better about patching Vision instead of Haiku

comment:7 by closequarters, 6 years ago

This Vision bug is solved by patch posted to #9190 : https://review.haiku-os.org/#/c/haiku/+/343

comment:8 by waddlesplash, 6 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.