[haiku-bugs] Re: [Haiku] #4592: Keyboard navigating alerts

  • From: "leavengood" <trac@xxxxxxxxxxxx>
  • Date: Sun, 05 Aug 2012 14:33:18 -0000

#4592: Keyboard navigating alerts
------------------------------+-----------------------
   Reporter:  humdinger       |      Owner:  humdinger
       Type:  enhancement     |     Status:  assigned
   Priority:  normal          |  Milestone:  R1
  Component:  User Interface  |    Version:  R1/alpha1
 Resolution:                  |   Keywords:
 Blocked By:                  |   Blocking:
Has a Patch:  1               |   Platform:  All
------------------------------+-----------------------

Comment (by leavengood):

 Well take note that I said you can support closing on escape by ADDING
 B_CLOSE_ON_ESCAPE to the Flags. In the patch you set the flags to that
 alone, which probably removes the other flags which BAlert sets
 (B_NOT_CLOSABLE | B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS). I haven't
 tested your patch so I can't be sure, but I strongly suspect that is the
 case. This is easy to fix though, probably even with a search and replace
 in your patch. Basically all instances of:

 {{{ alert->SetFlags(B_CLOSE_ON_ESCAPE); }}}

 need to become:

 {{{ alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); }}}

 That's how you add that flag without affecting the other ones. See:

 http://www.haiku-os.org/legacy-docs/bebook/BWindow.html#BWindow_SetFlags

 Though considering that BAlert already has the flag B_NOT_CLOSABLE, it
 could be argued that B_CLOSE_ON_ESCAPE sort of conflicts with that, at
 least in principle. It should still work technically, since the BWindow
 code which handles B_CLOSE_ON_ESCAPE doesn't look at B_NOT_CLOSABLE.

 But taking a quick look at your patch, it seems that adding this will be
 fine for all those alerts.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/4592#comment:8>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: