unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: joakim@verona.se
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: how to find out when display property is deleted in C?
Date: Mon, 12 May 2008 16:58:29 +0200	[thread overview]
Message-ID: <m3y76fsh62.fsf@verona.se> (raw)
In-Reply-To: <jwv4p93ppqh.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 12 May 2008 10:25:28 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> How do I find out when a display property is deleted in C?
>
> You don't/can't.

Hmm.

>
>> In the xwidget patch I need to delete the corresponding xwdiget when
>> the display property is deleted.
>
> What happens if the display property is later re-added?
> If that situations is not problematic, then you can keep your xwidgets
> in a cache which you can flush every once in a while.

But I need to remove the gtk widget from display the precise moment the
display property goes away, or there will be very awkward display bugs.

As it is now, the widgets happily live on in the emacs window even after
their display property has been deleted. It looks very odd.

Images work differently, since you either draw them or you don't. In the
xwidget case, its the toolkit that owns the actual gtk widget, and the
toolkit must be informed when the widget is not to be drawn.

I could maybe have a new phase at the end of emacs redisplay, where all
xwidgets which haven't been drawn in this redisplay will be deleted.

This will be problematic for widgets that have been moved off screen
by cursor movement in the window though.

> Also what happens if the same display property gets added at two places
> (either in the same buffer or in different buffers)?

They cant be the same, because I require a unique id for every xwidget
in the display property:

(put-text-property (point) (+ 1 (point)) 'display '(xwidget :xwidget-id 3 :type 3 :title "3" :width 400 :height 200))

adding the same id twice is an error, as currently designed.

>
>         Stefan
-- 
Joakim Verona




  reply	other threads:[~2008-05-12 14:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-12  9:34 how to find out when display property is deleted in C? joakim
2008-05-12 14:25 ` Stefan Monnier
2008-05-12 14:58   ` joakim [this message]
2008-05-12 16:57     ` Stefan Monnier
2008-05-12 20:08     ` Eli Zaretskii
2008-05-13  6:55       ` joakim
2008-05-13 18:53         ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m3y76fsh62.fsf@verona.se \
    --to=joakim@verona.se \
    --cc=emacs-devel@gnu.org \
    --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 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).