[haiku] Re: Deskbar won't "Close All"; who to blame :)

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sun, 25 Oct 2009 10:51:38 +0800

On 2009-10-25 at 10:36:40 [+0800], Caitlin Shaw <rogueeve@xxxxxxxxxxxxx> 
wrote:
> 
> I've been investigating an issue I discovered yesterday; which is that
> on several of my programs the Deskbar "Close All" option (under the
> window list menu) results in... nothing happening.
> 
> Tracking it down, I discovered at the bottom of ShowHideMenuItem.cpp in
> the Deskbar app the code for "Close All". The Deskbar constructs a
> BMessenger off of the team ID of the application, and then attempts to
> send the app a B_QUIT_REQUESTED message through that messenger. The
> problem is that the BMessenger instantiation is failing with B_BAD_TYPE.
> And the reason for that, is that that is what a BMesssenger does if the
> application has B_ARGV_ONLY set in the application flags resource. The
> applications in question don't make use of any of the special
> application flags, so I didn't provide a flags resource. And it seems
> that if you don't provide the flags, the system returns some default
> ones when asked for them, and those defaults include B_ARGV_ONLY.
> 
> So, know that I now how to fix it, I'm wondering whether this is a
> series of sensible behaviors that together culminate in an unfortunate
> error, or is it by design and I was very very bad not to include an
> application flags resource in my program. I know you are supposed to
> specify a signature, but I had always assumed that the other resources
> such as icons and flags were optional, especially since the FileTypes
> applet includes a checkbox for turning the use of app flags on and off.
> 
> It seems that perhaps the system could include the B_ARGV_ONLY flag
> based on the app signature being missing instead of the flags being
> missing; if the signature is missing it is obviously a unix or terminal
> app like "ls", etc so the flag is appropriate. Alternatively, the
> Deskbar could check for that condition and in that case try to quit the
> app some other way, such as sending messages to all of it's open
> windows, or sending a posix SIGTERM.

The issue was brought up very recently on one of the mailing lists. The 
B_ARGV_ONLY behavior is indeed correct -- constructing a messenger is 
supposed to fail -- but it must not be a default flag (it is not under 
BeOS). Unless I'm mistaken no Trac ticket has been filed yet.

CU, Ingo

Other related posts: