SFML community forums

Help => Window => Topic started by: slotdev on March 06, 2014, 12:41:21 pm

Title: WM_NCHITTEST / WM_SETCURSOR
Post by: slotdev on March 06, 2014, 12:41:21 pm
Hi

My app has 2 windows on 2 separate monitors. When I click a button on one screen, I have to click twice to get the button to function, and again twice on the other screen, etc. So it seems that the window (cursor?) doesn't have focus and my app is getting the mouse XY for the wrong screen, as I can click one part of a screen, and it actions the button on the other screen (in the same XY position).

I have another app, on an older version of SFML (2.0) which works fine.

I have produced log files of WM_ messages, and the difference is, on the app that works OK, I am seeing this very often (every frame, I think):

WM_NCHITTEST
WM_SETCURSOR

I see the MouseMoved code is very different from 2.0 to 2.1.....but I don't think this would be the problem.

Does anyone have any ideas?

Ed

Title: Re: WM_NCHITTEST / WM_SETCURSOR
Post by: Laurent on March 06, 2014, 01:00:19 pm
This is a known bug that has been fixed, you should try the latest development version.
Title: Re: WM_NCHITTEST / WM_SETCURSOR
Post by: slotdev on March 06, 2014, 01:21:48 pm
Thanks Laurent, I'll check it out now.

Any ideas why it worked OK on 2.0, but not on an older 2.1?
Title: Re: WM_NCHITTEST / WM_SETCURSOR
Post by: zsbzsb on March 06, 2014, 01:52:08 pm
When SFML 2.1 was released it included a "bug fix" for some win32 implementation stuff, however the fix actually caused more issues (like the one you described) and no one caught the bug before 2.1 was released.