emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mouse information in xterm.


From: Ergus
Subject: Re: Mouse information in xterm.
Date: Mon, 14 Sep 2020 18:27:10 +0200

On Mon, Sep 14, 2020 at 06:23:25PM +0300, Eli Zaretskii wrote:
Date: Mon, 14 Sep 2020 13:38:16 +0200
From: Ergus <spacibba@aol.com>

I have been playing with x-popup-menu today and I noticed that in
terminal, when we pass t as the first parameter the popup appears in
position (0, 0) which is wrong.

I debugged the C code and it seems that this position is expected to be
computed in x_popup_menu_1 calling:

mouse_position_hook which is a pointer to term_mouse_position and the
vales are taken there from last_mouse_x and last_mouse_y.

The issue is that those values are updated only in term_mouse_movement
which is called in handle_one_term_event but that function never
triggers my gdb.

Is this somehow intended and a limitation of the terminal interface??

It's hard to answer your questions, because you didn't describe what
you tried to do.  For starters, did you invoke and navigate the menus
with a mouse or with a keyboard?

Hi Eli:

The menu part is just how I observed the issue. The problem is somewhere
else; handle_one_term_event is never called (at least for me) either
when moving the cursor, or the mouse or clicking here and there. So the
variables last_mouse_x and last_mouse_y are not updated.

So far I observe that handle_one_term_event is called in a single place
in the code, but the condition to enter the "if" around is never true at
least for me.

I tried to create the x-dialog from the scratch buffer. The code works
as expected in gui, but in xterm I see this problem.

I just tried this in xterm:

(x-popup-dialog t '("Dialog" "Value1" "Value"))

And the dialog appears either in (0,0) or in the center of the screen,
but not related with the mouse or cursor positions.

There is another function that updated last_mouse_x and last_mouse_y,
but all it's code is commented.

Best,
Ergus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]