[haiku-development] Re: app_server flag fixes

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 4 Oct 2009 15:48:33 -0400

On Sun, Oct 4, 2009 at 3:04 PM, Caitlin Shaw <rogueeve@xxxxxxxxxxxxx> wrote:
> I was investigating why the Vulcan Death Grip no longer works to kill
> DeskBar tabs (actually it does, it's just it's now CTRL+WIN+SHIFT instead of
> CTRL+ALT+SHIFT).

Funny I noticed that wasn't working the other day too. I didn't know
the modifiers were changed...

> By default, the server will "eat" mouse-clicks made while CTRL+ALT is down,
> and treat the click as if it were a click on the window tab (i.e. you can
> move the window around while clicking within the window client area). The
> flag B_NO_SERVER_SIDE_WINDOW_MODIFIERS is said to disable this behavior, but
> doesn't seem to actually work.
>
> The problem seems to be in src/servers/app/Window.cpp(1849). The flag is not
> one of the ones listed in ValidWindowFlags(), and so is filtered out by the
> app_server. Adding the flag to ValidWindowFlags() got it working for me. I
> assume, but did not actually check, that two other flags which were missing,
> B_CLOSE_ON_ESCAPE and B_AUTO_UPDATE_SIZE_LIMITS, were also broken.
>
> It looks like someone added the flags into headers/os/interface/Window.h(61)
> but forgot to add them into ValidWindowFlags(). The simple patch is to add
> the flags to ValidWindowFlags(), however it seems it would help ensure this
> would not occur again if the flags did not have to match up in two separate
> source files. My initial idea was to define a new constant, e.g.
> B_VALID_WINDOW_FLAGS, within Window.h and have ValidWindowFlags() just
> return that constant. The constant would be placed right below the enum so
> it would be obvious to someone adding a flag to the enum that
> B_VALID_WINDOW_FLAGS was supposed to be updated as well. However, Window.h
> is not just an app_server file but the actual <Window.h> provided to all
> applications, so was hesitant to submit a patch changing it without asking
> the developers first.

I personally think that is fine, since one of my pet peeves is code
like this that needs to be updated in multiple places.

> Two other things:
>
> It seems to make sense that the CTRL+ALT trick to move the window should
> only "eat" the click if you pressed exactly CTRL+ALT, not e.g.
> "CTRL+ALT+SHIFT". This idea also seems to be mentioned in a comment by
> stippi to ticket 4230. I patched mine to do this; do folks approve of this
> change?

I would approve of it.

> It also occurred to me that if the window is not movable, and a CTRL+ALT
> click is done within it's contents using the primary mouse button, then the
> "server side window modifiers" are meaningless in that particular case
> anyway, so the click might want to be let through. What do you think, makes
> sense or inconsistent?

I suppose since it would otherwise be useless (since the window can't
be moved), it doesn't hurt to let it through.

-- 
Regards,
Ryan

Other related posts: