mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-09 06:59:08 +02:00
[client] Guard cursor DIP conversion against an empty screen cache
This commit is contained in:
@@ -49,5 +49,11 @@ func getCursorPosition(app *application.App) (application.Point, bool) {
|
|||||||
if app == nil || app.Screen == nil {
|
if app == nil || app.Screen == nil {
|
||||||
return p, true
|
return p, true
|
||||||
}
|
}
|
||||||
|
// The wails GTK3 backend caches screens from the active window; a tray app
|
||||||
|
// has none at startup, so the cache is empty and PhysicalToDipPoint would
|
||||||
|
// dereference a nil nearest screen. Raw pixels are correct there anyway.
|
||||||
|
if app.Screen.ScreenNearestPhysicalPoint(p) == nil {
|
||||||
|
return p, true
|
||||||
|
}
|
||||||
return app.Screen.PhysicalToDipPoint(p), true
|
return app.Screen.PhysicalToDipPoint(p), true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user