Lemmings Forums

Lix => Lix Main => Topic started by: Forestidia86 on April 02, 2021, 05:18:43 PM

Title: MacOS second monitor mouse bug (issue #419)
Post by: Forestidia86 on April 02, 2021, 05:18:43 PM
Since I don't want to create a github account, some suggestions here to the (probably Allegro) bug (#419) (https://github.com/SimonN/LixD/issues/419)

1) Filing an issue to Allegro, they should know best to find a fix if viable
2) Playing around with the values in the example, e.g. divide through 4, multiply with negative values etc.
3) Looking what values are shown if the cursor is within the window (maybe even create a video for that)
4) Using debug libraries to create log, which can be maybe helpful for issue at Allegro
5) Offering the workaround to switch off the mouse warping, maybe it's viable for Dominator
Title: Re: MacOS second monitor mouse bug (issue #419)
Post by: Forestidia86 on April 02, 2021, 05:40:12 PM
6) Trying having both monitors the same resolution. (Since Dominator found the readme remark (https://github.com/liballeg/allegro5/blob/master/README_macosx.txt#L32) about monitors with different resolutions.)

One of Dominators hunches seems to be that the cursor wants to jump to the promary monitor and only gets to the seam.

Possibly linked issues at Allegro (unsure):

al_get_monitor_info returns wrong values on Retina displays (https://github.com/liballeg/allegro5/issues/923) (earlier (closed) issues concerning resolution problems exist as well)
[5.0.7] al_get_window_position returns different values than expected (https://github.com/liballeg/allegro5/issues/396) (old, windows/probably not relevant)
Multi-Monitor Support (OSX) (https://github.com/liballeg/allegro5/issues/170) (closed,old)
ALLEGRO_MOUSE_STATE display property not set (https://github.com/liballeg/allegro5/issues/325) (closed,old)
Title: Re: MacOS second monitor mouse bug (issue #419)
Post by: Simon on April 02, 2021, 07:41:57 PM
Yep, linked between this LF thread and Dominator's Lix issue #419 on github.

Dominator has filed Allegro5 #1236: Issue with al_set_mouse_xy on secondary monitor (Mac) (https://github.com/liballeg/allegro5/issues/1236), I'll watch how things develop.

-- Simon
Title: Re: MacOS second monitor mouse bug (issue #419)
Post by: Forestidia86 on April 03, 2021, 08:41:24 PM
What I noticed in the source file qzmouse.m (https://github.com/liballeg/allegro5/blob/master/src/macosx/qzmouse.m#L316) is that it contains "CGDirectDisplayID (https://developer.apple.com/documentation/coregraphics/cgdirectdisplayid)", which seems to give each monitor an identifier. Maybe there goes sth. wrong, but I can't assess that as a nonprogrammer.

Title: Re: MacOS second monitor mouse bug (issue #419)
Post by: Forestidia86 on April 04, 2021, 10:40:55 PM
7) Positioning the screens above one another (in the displays-arrangement menu) and look if now it still jumps to the seam.
Title: Re: MacOS second monitor mouse bug (issue #419)
Post by: Forestidia86 on April 05, 2021, 10:35:12 PM
On this site (https://developer.apple.com/documentation/coregraphics/quartz_display_services#1655882) seems to be listed most of the commands concerning CGDisplay, which seem to be used in the Allegro code as well.

8) On primary monitor, what happens if you put the window in one lower corner (if it wasn't already tried)?
Title: Re: MacOS second monitor mouse bug (issue #419)
Post by: Forestidia86 on April 09, 2021, 06:51:22 AM
The documentation to CGMainDisplayID() (https://developer.apple.com/documentation/coregraphics/1455620-cgmaindisplayid) talks about global display coordinate space and that the main display is the display with its screen location at (0,0).

But don't know if there go calculations wrong or how it was considered.