[haiku-development] How to extend cursor outside application window

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Tue, 3 Jan 2017 11:31:27 -0800

Hi dev list,

Is it possible to set a custom cursor on an app e.g.
be_app->SetCursor(MyCustomCursor); and have that cursor stay even when
you move the mouse outside the app's window area while the mouse is
held down?

I've tried setting SetMouseEventMask(B_POINTER_EVENTS,
B_LOCK_WINDOW_FOCUS); in MouseDown() but that doesn't keep the mouse
cursor outside the window, only inside the window.

When the mouse moves outside the window the mouse cursor changes back
to the default hand cursor, then when I move the mouse back on top of
the window it changes back to my custom cursor.

I even tested on BeOS R5 and the behavior is the same so I'm guessing
the way it works is intentional.

I realize this is kind of an unusual thing to do but it would be nice
if there is a way to accomplish this feat.

If this feature is not possible, what would it take to add this
feature to App Server let's say by adding a new B_LOCK_CURSOR flag to
events param of SetMouseEventMask()?

For the curious, the application that I'm trying to do this in is
Deskbar. I'm setting the cursor while adjusting Deskbar's width in
vertical mode. It's not essential, but it would be nice to have.

Demonstration video:
https://insightfactory.tumblr.com/post/155037185951/the-mouse-cursor-changes-when-im-inside-the

Code: https://github.com/jscipione/haiku/tree/deskbar_width

Thanks for listening.

Other related posts: