Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: activation in windows on non-primary screen fails assertion for scr #279

Open
Aeyk opened this issue Jan 2, 2024 · 1 comment
Open

Comments

@Aeyk
Copy link

Aeyk commented Jan 2, 2024

To reproduce: start warpd.exe, mouse over to non-primary screen, activate warpd

Microsoft Visual C++ Runtime Library
Assertion failed!
Program:
File: src\platform\windows\windows.c
Line: 345
Expression: scr
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts
(Press Retry to debug the application - JIT must be enabled)

#117 (comment)
#117 (comment)

Ill try to take a stab at it and update the issue with what I find in the likely case I am unsuccessful, maybe my notes will help another contributor.

@Aeyk
Copy link
Author

Aeyk commented Jan 2, 2024

Speculative: what it seems like is happening, is that GetCursorPos will return coordinates larger than the bounding box defined in wn_get_screen_at:

dprintf src/platform/windows/windows.c:343, "p.x: %ld, p.y: %ld\n",p.x,p.y

dprintf src/platform/windows/winscreen.c:174, "display %ld, top: %ld, left: %ld, bottom: %ld, right: %ld, x: %ld, y: %ld, w: %ld, h:%ld\n", nscreens, dim->top, dim->left, dim->bottom, dim->right, scr->x, scr->y, scr->w, scr->h

dprintf src/platform/windows/winscreen.c:229, "scr->x: %ld, scr->y: %ld, scr->w: %ld, scr->h: %ld\n", scr->x, scr->y, scr->w, scr->h
dprintf src/platform/windows/winscreen.c:278, "wn_get_screen_at reports in bounds: %s\n", (x >= screens[i].x && x <= screens[i].x + screens[i].w && y >= screens[i].y && y <= screens[i].y + screens[i].h) ? "true" : "false"

On primary monitor activate hints:

display 1, top: 0, left: 0, bottom: 1440, right: 2560, x: 0, y: 0, w: 2560, h:1440
display 1, top: 0, left: 0, bottom: 1440, right: 2560, x: 0, y: 0, w: 2560, h:1440
display 2, top: 0, left: 2560, bottom: 1440, right: 5120, x: 0, y: 2560, w: 2560, h:1440
display 2, top: 0, left: 2560, bottom: 1440, right: 5120, x: 0, y: 2560, w: 2560, h:1440
[New Thread 32224.0x5d10]
p.x: 285, p.y: 560
p.x: 285, p.y: 560
wn_get_screen_at reports in bounds: true
p.x: 285, p.y: 560
p.x: 285, p.y: 560
wn_get_screen_at reports in bounds: true
p.x: 285, p.y: 560
p.x: 285, p.y: 560
wn_get_screen_at reports in bounds: true
p.x: 285, p.y: 560
p.x: 285, p.y: 560
wn_get_screen_at reports in bounds: true
p.x: 101, p.y: 1350
p.x: 101, p.y: 1350
wn_get_screen_at reports in bounds: true

On secondary monitor activate hints:

p.x: 3564, p.y: 655
p.x: 3564, p.y: 655

then the failed assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant