Subject: bug#36779: 25.1; mouse click not recognized for frames with large left position

From: martin rudalics <[email-masked]>
Date: Tue, 30 Jul 2019 09:01:13 +0200

>> Can you mark text with the mouse?
 > No, I cannot.

So the mouse down event is probably not recognized.

 >> Does the bug happen only when the
 >> entire frame is positioned to the right of 3840
 > Yes, that's the case.
 >
 >> or do you see it with
 >> a frame starting before 3840 but extending to the right of the display
 >> as well?
 > This situation does*not*  exhibit the bug.

Thanks for clarifying this.

 > Thanks!  I built both Emacs 25.1 and 26.2 (latest release) from the
 > sources, and confirmed that*both*  exhibits the same problem in my
 > environment.
 > I run gdb for the latter (Emacs 26.2)

Please continue using 26.2 for debugging.

 > and the values of *dpyinfo and
 > event->xbutton at that code point (line 8848) are:
 >
 > When the problem occurs:

These do not reveal any great differences, I suppose the
x_root values

 >    x_root = 4326, y_root = 281, state = 0, button = 1, same_screen = 1}

and

 >    x_root = 2467, y_root = 229, state = 0, button = 1, same_screen = 1}

are the expected ones, the first larger than 3840 the second smaller.

 > I haven't yet pursued further executions (I need to sit in front of the
 > second, 60-inch 4K display for this!), but will do (so, advice is welcome!).

The subsequent code is among the most convoluted ones Emacs has,
sprinkled with USE_GTK, USE_X_TOOLKIT and USE_TOOLKIT_SCROLL_BARS
defines, so you have all my sympathy.  But maybe stepping into
x_window_to_frame already exhibits that the latter is not able to find
a suitable frame ...

martin