This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [patch] cursor


Jehan,

>     - Last, WM_NCMOUSEMOVE calls the default winproc. This should fix
> the min/max/close button highlight problem on WinXP (Although I don't
> have XP so I can't test)

That's an excellent catch.  I went back and read the Platform SDK docs about
WM_NCMOUSEMOVE:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui
/windowsuserinterface/userinput/mouseinput/mouseinputreference/mouseinputmes
sages/wm_ncmousemove.asp

As I thought, the documentation for WM_NCMOUSEMOVE does say that you are
supposed to return 0 if you process that message.  However, they fail to
mention that things such as button highlighting are handled by
DefWindowProc, which you still need to call if you want to preserve that
default behavior.  This document gave me some indications that this was the
case:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui
/windowsuserinterface/userinput/mouseinput/aboutmouseinput.asp

One thing that is not entirely clear is whether we should call
DefWindowProc, then return 0, or if we should just 'break' after our
processing of the message and return whatever DefWindowProc returns.  I've
opted for the latter, for now.


>     - Moreover, the cursor state is global to the application, not to
> each window. So I made fCursor a global variable, which simplifies the
> code more (doesn't care about ScreenPrivLast anymore). Potentially, we
> could get rid of fCursor  altogether by using GetCursorInfo instead
> (don't know about performance issues though).

Making the cursor state a global variable is probably a good idea; or, we
could at least make it a static inside winWindowProc if it is not accessed
elsewhere.  This would take care of the cursor hiding/showing problems that
happen when we have multiple screens.  (e.g. XWin -screen 0 640 480 -screen
1 1024 768)

I'll go ahead and switch the cursor state variable to a global.


>     - It maybe just a matter of preferences but for me, I prefer if the
> windows cursor is hidden in the client area of X if it isn't active. I
> personnally find it ugly to have two mouse cursors on top of each other
> :p. It's then not necessary to show/hide the mouse upon (de)activation.
> This simplifies the code a bit.

This is really a matter of preference.  I originally coded it this way, but
I got enough complaints that I switched to the current system of not hiding
the cursor when we don't have the focus.  Maybe we can make this a
configuration option?  As it is it just reverts to previous functionality,
so I'll skip it for now.

Thanks,

Harold


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]