unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* wrong cursor position reported when window margins are wide
@ 2017-02-28 14:01 Joost Kremers
  2017-02-28 16:19 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Joost Kremers @ 2017-02-28 14:01 UTC (permalink / raw)
  To: emacs-devel@gnu.org

Hi all,

I recently had a bug report for a package[1] I maintain, which 
seems to be a bug in Emacs itself. The user that reported the bug 
uses Fcitx[2], an X-Window based input framework for Chinese 
(probably other Asian languages as well, but I have no expertise 
in that area). Another user reported the same problem for another 
such input framework, ibus[3].

Basically, these input methods consist of a small box (GUI window) 
that follows the text cursor. They rely on the underlying program 
(i.e., in this case Emacs) to report the cursor position in order 
to position the input box correctly.

It seems that when the window margins of an Emacs window are 
non-nil, the cursor position is reported incorrectly, resulting in 
the input box being displayed in the wrong place.

The original bug report is here:

<https://github.com/joostkremers/visual-fill-column/issues/25#issuecomment-281844388>

There are screen shots that illustrate the problem. (Scroll down a 
bit for screen shots with `emacs -Q'.)

The problem exists with Emacs v. 25.1.1, GTK+ for Linux. Emacs for 
Windows does not display a similar problem. (Which is the main 
reason why I think this is an Emacs bug rather than a bug in my 
package. Basically, all my package does is set the window margins 
to a non-nil value.)

Since I don't use ibus, Fcitx or any similar package, I cannot 
confirm the problem myself. Therefore, I figured it would be best 
to post here first before filing a bug report. I'm hoping that 
someone here can confirm the bug and perhaps tell me what exactly 
to put in the bug report to make it concise and to the point.

TIA

Joost





[1] https://github.com/joostkremers/visual-fill-column

[2] https://fcitx-im.org/wiki/Fcitx

[3] https://github.com/ibus/ibus/wiki

-- 
Joost Kremers
Life has its moments



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: wrong cursor position reported when window margins are wide
  2017-02-28 14:01 wrong cursor position reported when window margins are wide Joost Kremers
@ 2017-02-28 16:19 ` Eli Zaretskii
  2017-02-28 20:41   ` Joost Kremers
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-02-28 16:19 UTC (permalink / raw)
  To: Joost Kremers; +Cc: emacs-devel

> From: Joost Kremers <joostkremers@fastmail.fm>
> Date: Tue, 28 Feb 2017 15:01:22 +0100
> 
> I recently had a bug report for a package[1] I maintain, which 
> seems to be a bug in Emacs itself. The user that reported the bug 
> uses Fcitx[2], an X-Window based input framework for Chinese 
> (probably other Asian languages as well, but I have no expertise 
> in that area). Another user reported the same problem for another 
> such input framework, ibus[3].
> 
> Basically, these input methods consist of a small box (GUI window) 
> that follows the text cursor. They rely on the underlying program 
> (i.e., in this case Emacs) to report the cursor position in order 
> to position the input box correctly.
> 
> It seems that when the window margins of an Emacs window are 
> non-nil, the cursor position is reported incorrectly, resulting in 
> the input box being displayed in the wrong place.
> 
> The original bug report is here:
> 
> <https://github.com/joostkremers/visual-fill-column/issues/25#issuecomment-281844388>
> 
> There are screen shots that illustrate the problem. (Scroll down a 
> bit for screen shots with `emacs -Q'.)

Sorry, I couldn't understand what is meant by "cursor position
reporting".  Could you clarify, and perhaps show an example of how
that reported position changes when a window has display margins?

Thanks.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: wrong cursor position reported when window margins are wide
  2017-02-28 16:19 ` Eli Zaretskii
@ 2017-02-28 20:41   ` Joost Kremers
  2017-03-01  3:40     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Joost Kremers @ 2017-02-28 20:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


On Tue, Feb 28 2017, Eli Zaretskii wrote:
>> From: Joost Kremers <joostkremers@fastmail.fm>
>> Date: Tue, 28 Feb 2017 15:01:22 +0100
>> It seems that when the window margins of an Emacs window are 
>> non-nil, the cursor position is reported incorrectly, resulting 
>> in 
>> the input box being displayed in the wrong place.
>> 
>> The original bug report is here:
>> 
>> <https://github.com/joostkremers/visual-fill-column/issues/25#issuecomment-281844388>
>> 
>> There are screen shots that illustrate the problem. (Scroll 
>> down a 
>> bit for screen shots with `emacs -Q'.)
>
> Sorry, I couldn't understand what is meant by "cursor position
> reporting".  Could you clarify, 

Honestly, I'm in way over my head here, so I'm mainly going by 
this FAQ on the Fcitx site:

https://fcitx-im.org/wiki/FAQ#Cursor_Following_problem

which admittedly doesn't provide much info, either. Basically, 
from what I gather, Fcitx and ibus and similar input methods pop 
up an input box that follows the text cursor as you type. In order 
to do so, they need to know the absolute position of the text 
cursor on the screen. And in order to be able to determine 
(calculate?) this position, they need some info from the windowing 
system, which in turn receives this info from the active 
application.

I'm sorry I can't be more specific, but I know nothing about the 
internals of the X Window System, nor am I well-versed enough in C 
to go through the Fcitx source and figure out what information it 
is exactly that Fcitx requires from X. I was kinda hoping that 
someone here has more clue than I do and could help out.

> and perhaps show an example of how
> that reported position changes when a window has display 
> margins?

Apparently, judging by the screen shots posted in the Github 
thread, the reported position does *not* change, even though it 
should.


-- 
Joost Kremers
Life has its moments



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: wrong cursor position reported when window margins are wide
  2017-02-28 20:41   ` Joost Kremers
@ 2017-03-01  3:40     ` Eli Zaretskii
  2017-03-01  8:00       ` Joost Kremers
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-03-01  3:40 UTC (permalink / raw)
  To: Joost Kremers; +Cc: emacs-devel

> From: Joost Kremers <joostkremers@fastmail.fm>
> Cc: emacs-devel@gnu.org
> Date: Tue, 28 Feb 2017 21:41:13 +0100
> 
> 
> On Tue, Feb 28 2017, Eli Zaretskii wrote:
> >> From: Joost Kremers <joostkremers@fastmail.fm>
> >> Date: Tue, 28 Feb 2017 15:01:22 +0100
> >> It seems that when the window margins of an Emacs window are 
> >> non-nil, the cursor position is reported incorrectly, resulting 
> >> in 
> >> the input box being displayed in the wrong place.
> >> 
> >> The original bug report is here:
> >> 
> >> <https://github.com/joostkremers/visual-fill-column/issues/25#issuecomment-281844388>
> >> 
> >> There are screen shots that illustrate the problem. (Scroll 
> >> down a 
> >> bit for screen shots with `emacs -Q'.)
> >
> > Sorry, I couldn't understand what is meant by "cursor position
> > reporting".  Could you clarify, 
> 
> Honestly, I'm in way over my head here, so I'm mainly going by 
> this FAQ on the Fcitx site:
> 
> https://fcitx-im.org/wiki/FAQ#Cursor_Following_problem
> 
> which admittedly doesn't provide much info, either. Basically, 
> from what I gather, Fcitx and ibus and similar input methods pop 
> up an input box that follows the text cursor as you type. In order 
> to do so, they need to know the absolute position of the text 
> cursor on the screen. And in order to be able to determine 
> (calculate?) this position, they need some info from the windowing 
> system, which in turn receives this info from the active 
> application.

But we must know at least what Emacs features are used to get the
cursor position info.  Otherwise, I don't see how we can investigate
this issue, nor even that it's Emacs's fault.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: wrong cursor position reported when window margins are wide
  2017-03-01  3:40     ` Eli Zaretskii
@ 2017-03-01  8:00       ` Joost Kremers
  2017-03-01 16:14         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Joost Kremers @ 2017-03-01  8:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


On Wed, Mar 01 2017, Eli Zaretskii wrote:
> But we must know at least what Emacs features are used to get 
> the
> cursor position info.  Otherwise, I don't see how we can 
> investigate
> this issue, nor even that it's Emacs's fault.

Yes, I realise that. Which is why I posted here instead of filing 
a bug report, hoping that someone here would know and understand 
these things better than I do.

I'll try and contact the Fcitx and/or ibus maintainers to see if 
they can help explain what features exactly Emacs should report. 
Will post here if I learn anything.



-- 
Joost Kremers
Life has its moments



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: wrong cursor position reported when window margins are wide
  2017-03-01  8:00       ` Joost Kremers
@ 2017-03-01 16:14         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2017-03-01 16:14 UTC (permalink / raw)
  To: Joost Kremers; +Cc: emacs-devel

> From: Joost Kremers <joostkremers@fastmail.fm>
> Cc: emacs-devel@gnu.org
> Date: Wed, 01 Mar 2017 09:00:55 +0100
> 
> I'll try and contact the Fcitx and/or ibus maintainers to see if 
> they can help explain what features exactly Emacs should report. 
> Will post here if I learn anything.

Thank you.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-01 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-28 14:01 wrong cursor position reported when window margins are wide Joost Kremers
2017-02-28 16:19 ` Eli Zaretskii
2017-02-28 20:41   ` Joost Kremers
2017-03-01  3:40     ` Eli Zaretskii
2017-03-01  8:00       ` Joost Kremers
2017-03-01 16:14         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).