From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
Date: Thu, 8 Feb 2024 00:41:40 -0600
Subject: fix: GetCursorScreenPoint() wrongly returns 0, 0

Fixes #41143. Discussion of the issue at
https://github.com/electron/electron/issues/41143#issuecomment-1933443163

This patch should be backported to e29, upstreamed to Chromium, and then
removed if it lands upstream.

diff --git a/ui/events/x/events_x_utils.cc b/ui/events/x/events_x_utils.cc
index c9cce0092930e54ec8b3c10e417e6a568db45bba..0b383018c24c242d47d4e9b239ca249d30ea59f5 100644
--- a/ui/events/x/events_x_utils.cc
+++ b/ui/events/x/events_x_utils.cc
@@ -598,6 +598,9 @@ gfx::Point EventLocationFromXEvent(const x11::Event& xev) {
 gfx::Point EventSystemLocationFromXEvent(const x11::Event& xev) {
   if (auto* crossing = xev.As<x11::CrossingEvent>())
     return gfx::Point(crossing->root_x, crossing->root_y);
+  if (auto* crossing = xev.As<x11::Input::CrossingEvent>())
+    return gfx::Point(Fp1616ToDouble(crossing->root_x),
+                      Fp1616ToDouble(crossing->root_y));
   if (auto* button = xev.As<x11::ButtonEvent>())
     return gfx::Point(button->root_x, button->root_y);
   if (auto* motion = xev.As<x11::MotionNotifyEvent>())
