[haiku-development] Re: BWindow fShowLevel vs window_info.show_hide_level

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 12 Aug 2012 15:30:34 -0400

On Sun, Aug 12, 2012 at 2:53 PM, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
>
> According to git Axel implemented it initially [1] and changed it later on
> [2]. The API is private, but was apparently used by Be applications
> (OpenTracker). Depending on whether binary compatibility is desired in this
> case you'd have check how it works on BeOS.

I decided to do just that, and had fun retyping those private structs
and function prototypes since my VirtualBox BeOS VM has no internet ;)

On BeOS it turns out that indeed the show_hide_level is 0 or less for
showing windows, and 1 or more for hidden. Further if a window is
minimized it has a show_hide_level of 1 and is_mini of true. If the
window is just hidden (such as Tracker Settings after having opened
and closed it) it has show_hide_level of 1 and is_mini of false. If
you then click the Hide All function in Deskbar, the hidden window now
has a show_hide_level of 2 and is_mini is still false.

But then I think there is a bug in BeOS: if you then use another
Tracker window to open the settings, it comes back as minimized (even
though it isn't really a minimizeable window.) Then clicking it in the
window list of Tracker will show it. So maybe BeOS isn't worth
emulating ;)

Nonetheless I think there are a several things we are doing wrong, as
far as BeOS compatibility:

1. fShowLevel in our BWindow is probably opposite of BeOS.
2. My new code which syncs up fShowLevel with app_server should be
called for every call of Show() and Hide(), not just when the window
is actually shown or hidden. At least to match BeOS.
3. We are setting the minimized flag for hidden windows when we should
not. That is what was causing #4127 as indicated in the comments
before my last changes.

Though I feel like we should not mimic the BeOS bug. Of course I just
tested with my latest changes and right now we do ;)

So even though it is implemented differently right now we mimic BeOS
pretty well. But I may still change things a bit to match BeOS a bit
more.

-- 
Regards,
Ryan

Other related posts: