The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Window Hit test reports wrong x position
Zelif


Joined: 05 Jul 2015
Posts: 2
Location: Australia
SDL Version: SDL-2.0.4 build 9783
OS: Windows 10
Monitor 1: 1920 x 1080
Monitor 2: 2840 x 2160 (configured to the left)

While using SDL_SetWindowHitTest on a window to control dragging of a custom caption bar, the hit test functions correctly while the window is on my main monitor. When I drag the window and drop it on my second monitor it reports the x mouse position in the hit test as around 65500 for the top left of the application where it should be 0. Y position functions as it should set as 0 for the top left.

I'm not sure if this is a problem since I am using the latest build of SDL or not, or since I am using a 4k or windows 10.
Window Hit test reports wrong x position
Klong15@mail.greenrive...
Guest

What are you expecting for the x position? The left desktop is negative in windows.


https://msdn.microsoft.com/en-us/library/windows/desktop/dd145136(v=vs.85).aspx

From: SDL on behalf of Zelif
Sent: Sunday, July 5, 2015 4:34 PM
To:
Subject: [SDL] Window Hit test reports wrong x position

SDL Version: SDL-2.0.4 build 9783
OS: Windows 10
Monitor 1: 1920 x 1080
Monitor 2: 2840 x 2160 (configured to the left)

While using SDL_SetWindowHitTest on a window to control dragging of a custom caption bar, the hit test functions correctly while the window is on my main monitor. When I drag the window and drop it on my second monitor it reports the x mouse position in the hit test as around 65500 for the top left of the application where it should be 0. Y position functions as it should set as 0 for the top left.

I'm not sure if this is a problem since I am using the latest build of SDL or not, or since I am using a 4k or windows 10.
Re: Window Hit test reports wrong x position
Zelif


Joined: 05 Jul 2015
Posts: 2
Location: Australia
... wrote:
What are you expecting for the x position? The left desktop is negative in windows.


https://msdn.microsoft.com/en-us/library/windows/desktop/dd145136(v=vs.85).aspx

I'm not looking to get the window position, this is the internal starting position( I should have clarified that sorry)
On the main monitor top left of the application reports x = 0, y = 0, On my left monitor my top left of the application is x = 65500, y = 0
I have just tried it with 1920 x 1080 and it still reports the same problem with x.

If I place the monitor on the right it will behave as expected and give x = 0, y = 0 as my top left in the application.

I just tried it in other positions and have found that if i place it above or below the main monitor it will only give correct 0,0 if the 2nd monitor is equal to or greater than the X position of my main monitor, anything below will result in the top left of the application setting X to 65500

Example: http://puu.sh/iQx9q/10db29552b.png
In this my main monitor is Screen#2 and Screen#1 is my secondary. Any time I set the monitor below the original starting X position it will always report the X position as 65500 for the top left of my application.

Hopefully that explains it a little better.
Window Hit test reports wrong x position
Ryan C. Gordon
Guest

Quote:
I just tried it in other positions and have found that if i place it
above or below the main monitor it will only give correct 0,0 if the 2nd
monitor is equal to or greater than the X position of my main monitor,
anything below will result in the top left of the application setting X
to 65500

This is likely an SDL bug, hit testing is all new code still. Can you
stick this in Bugzilla so I don't forget to fix it?

Thanks,
--ryan.



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Window Hit test reports wrong x position
Klong15@mail.greenrive...
Guest

I don't have access to a second monitor at the moment, though I'm going to take a look and see if I notice anything... I'll update to the bug case as well...

Zelif, please pass along the issue/case # .

________________________________________
From: SDL on behalf of Ryan C. Gordon
Sent: Wednesday, July 8, 2015 7:58 PM
To:
Subject: Re: [SDL] Window Hit test reports wrong x position

Quote:
I just tried it in other positions and have found that if i place it
above or below the main monitor it will only give correct 0,0 if the 2nd
monitor is equal to or greater than the X position of my main monitor,
anything below will result in the top left of the application setting X
to 65500

This is likely an SDL bug, hit testing is all new code still. Can you
stick this in Bugzilla so I don't forget to fix it?

Thanks,
--ryan.



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org