all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: joakim@verona.se
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725)
Date: Sat, 17 Jan 2015 12:19:28 +0200	[thread overview]
Message-ID: <83wq4lzp3j.fsf@gnu.org> (raw)
In-Reply-To: <m3twzqtohi.fsf@exodia.verona.se>

> From: joakim@verona.se
> Cc: monnier@iro.umontreal.ca,  emacs-devel@gnu.org
> Date: Fri, 16 Jan 2015 22:16:57 +0100
> 
> Here in the L2R case, I insert a button in the middle of the text. If I
> type more text, the buttone moves along with the text towards the right
> edge. This is the expected behaviour.
> (xwidget-demo "a-button"
>               (xwidget-insert (+ 15 (point-min)) 'Button  "button" 60  50)
>               (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic))
> 
> In the next case the button is also in the middle of the text at
> first. However, when the direction is changed to right-to-left, the text
> sticks to the right edge as expected, but the button jumps to the edge
> rather than staying within the text. If I type some text, the text move
> right to left, but the button just stays there at the right edge. 

That's indeed a sign of some problem.  The code that places the widget
on the screen on the Xlib level is something specific to your changes,
am I right?  I believe that's where the problem is: somehow that code
doesn't work correctly in right-to-left display lines (a.k.a. "glyph
rows").  Can you show the code which computes the coordinates where to
place the widget?

To make sure this code is indeed the problem, I suggest to look at the
glyph row generated by the device-independent part of the display
engine, and make sure the glyph row is correct.  Here's how:

 $ cd src
 $ gdb ./emacs
 (gdb) break Fredraw_display
 (gdb) r -Q

Now recreate the problem with button display in R2L line, make sure
the cursor is in that line, and type "M-x redraw-display RET".  This
will cause GDB to kick in.  Then do:

 (gdb) break set_cursor_from_row
 (gdb) continue

Usually, the first time the breakpoint in set_cursor_from_row is hit,
it's because Emacs redisplays the echo area, which is not where we
want to look.  Type "bt" to see if that's the case: if it is, you
should see display_echo_area in the backtrace, in which case type
"continue" and wait for the next time the breakpoint breaks.  This
time, "bt" should show something like this:

  14252     struct glyph *glyph = row->glyphs[TEXT_AREA];
  (gdb) bt 10
  #0  set_cursor_from_row (w=0x17e4918 <dumped_data+2497336>, row=0xfc46e8,
      matrix=0xfbd418, delta=0, delta_bytes=0, dy=0, dvpos=0) at xdisp.c:14252
  #1  0x010663b0 in display_line (it=0x82beb0) at xdisp.c:20828
  #2  0x0105720f in try_window (window=25053469, pos=..., flags=1)
      at xdisp.c:16928
  #3  0x01053f90 in redisplay_window (window=25053469, just_this_one_p=false)
      at xdisp.c:16401
  #4  0x0104c567 in redisplay_window_0 (window=25053469) at xdisp.c:14226

Now issue this command:

 (gdb) pgrow

and post the full output.

The command "pgrow" is defined by src/.gdbinit.  Latest versions of
GDB will refuse to read that file unless you tell GDB that it's "safe"
to read it.  If you didn't make such an arrangement, the easiest thing
to do is simply read the file manually:

 (gdb) source .gdbinit

You'll have to do that in case GDB says "pgrow" is not a known
command.

Finally, it could be that "pgrow" doesn't yet know how to display the
xwidget glyph, in which case you will have to modify the pgx function
in .gdbinit to do that.



  reply	other threads:[~2015-01-17 10:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20141226164113.11620.38682@vcs.savannah.gnu.org>
2014-12-27 15:22 ` [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725) Stefan Monnier
2014-12-27 15:48   ` joakim
2014-12-28 16:08     ` Eli Zaretskii
2014-12-29  9:48       ` joakim
2014-12-29 13:46         ` Ulrich Mueller
2014-12-29 16:10           ` Eli Zaretskii
2015-01-09 20:17           ` joakim
2014-12-29 16:03         ` Eli Zaretskii
2015-01-09 20:12           ` joakim
2015-01-09 20:35             ` Eli Zaretskii
2015-01-16 20:50               ` joakim
2015-01-16 20:59                 ` Eli Zaretskii
2015-01-16 21:16                   ` joakim
2015-01-17 10:19                     ` Eli Zaretskii [this message]
2015-01-17 15:21                       ` joakim
2015-01-17 17:40                         ` joakim
2015-01-17 18:04                           ` Eli Zaretskii
2015-01-17 18:13                             ` joakim
2015-01-17 18:39                             ` Eli Zaretskii
2015-01-17 23:08                               ` joakim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wq4lzp3j.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.