Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crashes and mismatched tabs in TabView. #6

Merged
merged 1 commit into from Apr 19, 2018

Conversation

KapiX
Copy link
Contributor

@KapiX KapiX commented Apr 15, 2018

  • Default BTab uses view's name property as tab label, so
    SetLabel changes that value. However, view names are important
    for yab and this would cause inconsistencies in view lists yab
    stores for referencing them by name. Views attached to tabs would
    not be removed because there is no name "Tab1" in the index
    (there is "Test1", which is the view's original name).
    Later, when asking for view with the same name created later yab
    could get wrong view (if lucky) or crash (if unlucky).
    This commit fixes that by storing original name in YabView
    property, and using that for removing views from the hierarchy.
  • Fixes missing Tabview remove or tab remove #5.

Adding to that, I will be raising this issue on Haiku's development list, because that behavior is potential source of problems. Additionally, it's not possible to customize tab label rendering without introducing dependency on BControlLook which is problematic.

* Default BTab uses view's name property as tab label, so
  SetLabel changes that value. However, view names are important
  for yab and this would cause inconsistencies in view lists yab
  stores for referencing them by name. Views attached to tabs would
  not be removed because there is no name "Tab1" in the index
  (there is "Test1", which is the view's original name).
  Later, when asking for view with the same name created later yab
  could get wrong view (if lucky) or crash (if unlucky).
  This commit fixes that by storing original name in YabView
  property, and using that for removing views from the hierarchy.
* Fixes bbjimmy#5.
@KapiX
Copy link
Contributor Author

KapiX commented Apr 15, 2018

Also sorry for taking so long to fix this :(

@KapiX
Copy link
Contributor Author

KapiX commented Apr 15, 2018

Please hold on with merging this. The problem in Haiku has a larger scope than Yab (hey scripts might use view names and break on localized systems because of current BTab behavior) and I think I have a fix which won't break the ABI. TL;DR should be fixed in Haiku soon.

@bbjimmy
Copy link
Owner

bbjimmy commented Apr 16, 2018

Thanks for all the hard work! I'll wait for your input on how to proceed from here.

@KapiX
Copy link
Contributor Author

KapiX commented Apr 18, 2018

You can merge this PR as is. The described behavior turns out to be a "feature" of BeOS R5 API. BeBook explicitly states that tab's display name is target view's name. It can only be fixed for layout-enabled tab views, which Yab doesn't use.

@bbjimmy bbjimmy merged commit 44c8183 into bbjimmy:master Apr 19, 2018
@KapiX KapiX deleted the tabview-fix branch April 20, 2018 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing Tabview remove or tab remove
2 participants