Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1674 closed bug (fixed)

Change leaf menu settings Deskbar Crashes

Reported by: cebif Owned by: axeld
Priority: normal Milestone: R1/alpha1
Component: Kits/Interface Kit Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Deskbar crashed when I tried to change settings of the leaf menu. I ticked the box for 7 recent folders. I then closed the deskbar leaf menu settings window and Deskbar crashed. It crashes when changing any of the settings in the Deskbar Leaf Menu and always consistent. To reproduce: 1) Poimt the mouse to Deskbar settins and click on Configure Be Menu. 2) Change any settings eg, 7 recent folders. 3) Click in the box on the left to activate the settings. 4) Close the leaf menu window. When you do this Deskbar crashes. I was using haikuimage.23146 on its own partition.

Attachments (2)

gdb and backtrace (4.2 KB ) - added by cebif 16 years ago.
patch-bug#1674.diff (414 bytes ) - added by cl21 16 years ago.

Download all attachments as: .zip

Change History (11)

by cebif, 16 years ago

Attachment: gdb and backtrace added

comment:1 by cebif, 16 years ago

I made a spelling mistake the title should be: Change leaf menu settings Deskbar Crashes

comment:2 by nielx, 16 years ago

Summary: Change lef menu settings Deskbar CrashesChange leaf menu settings Deskbar Crashes

by cl21, 16 years ago

Attachment: patch-bug#1674.diff added

in reply to:  description comment:3 by cl21, 16 years ago

When the TFavoritesConfigWindow is destroyed, all its child views are detached one by one. When the internal _BTextInput_ control of a BTextView is detached, and the BTextView still has the focus, then MakeFocus(false) is called on the BTextView to make sure that it won't need its _BTextInput_ control anymore. MakeFocus calls _Deactivate on the BTextView, which in turn uses GetMouse to set the cursor back to B_CURSOR_SYSTEM_DEFAULT in case it is still over the BTextView. GetMouse is called with the last argument being true (default), which means that it causes pending update events to be processed. With some of the children of the window already being detached and having no owner, processing these events causes trouble.

The attached patch sets the last argument of GetMouse to false, i.e. gets the position without processing pending updates. Just the current mouse position is used to decide whether the cursor is still on the BTextView and needs to be reset to its normal shape.

Regarding BTextView, I am not sure using _Deactivate in MakeFocus is a good idea because this means that the cursor changes back to normal while being over the BTextView even if the BTextView just loses the focus without being truly "deactivated".

comment:4 by jackburton, 16 years ago

Calling _Deactivate() is okay, since it de-highlights the selection and does other stuff. Maybe we should just avoid resetting the cursor... I can't remember what beos does here. BTW I think this problem showed up because of my hrev23062, which fixed bug #613 but causes other problems. Maybe we should review how activation works in beos, and remove message processing from UpdateIfNeeded() (except _UPDATE_ messages). Your patch is certainly correct, but GetMouse() should be more robust and don't crash even if you call it with the third parameter = true.

comment:5 by axeld, 16 years ago

Agreed. I would be all for reverting hrev23062 and reopen bug #613 then.

comment:6 by axeld, 16 years ago

Component: - Applications/DeskbarKits/Interface Kit
Milestone: R1R1/alpha

Should be fixed with hrev23196, please confirm.

in reply to:  6 ; comment:7 by cl21, 16 years ago

It seems to work now. Maybe removing the whole SetViewCursor(B_CURSOR_SYSTEM_DEFAULT) part from BTextView::_Deactivate() is not a bad idea. That way, changing focus won't disturb the cursor.

in reply to:  7 comment:8 by jackburton, 16 years ago

Resolution: fixed
Status: newclosed

Replying to cl21:

It seems to work now. Maybe removing the whole SetViewCursor(B_CURSOR_SYSTEM_DEFAULT) part from BTextView::_Deactivate() is not a bad idea. That way, changing focus won't disturb the cursor.

I agree. I did that with hrev20203.

comment:9 by axeld, 16 years ago

You obviously mean hrev23203.

Note: See TracTickets for help on using tickets.