unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: 74876@debbugs.gnu.org
Subject: bug#74876: 31.0.50; Force fringe refresh / force-window-update not affecting fringes
Date: Sat, 14 Dec 2024 22:28:07 +0200	[thread overview]
Message-ID: <86zfkyrovc.fsf@gnu.org> (raw)
In-Reply-To: <7yl87cc0algqh3xvlrywg2z8@mina86.com> (message from Michal Nazarewicz on Sat, 14 Dec 2024 20:31:00 +0100)

> From: Michal Nazarewicz <mina86@mina86.com>
> Date: Sat, 14 Dec 2024 20:31:00 +0100
> 
> I’m implementing fringe dimming in non-selected windows as an extension
> of the NonGNU ELPA auto-dim-other-buffers package (see
> <https://github.com/mina86/auto-dim-other-buffers.el/issues/27>).
> 
> <https://github.com/mina86/auto-dim-other-buffers.el/tree/fringes> is
> a test code which tries to achieve it.  The expected behaviour is that
> after enabling auto-dim-other-buffers-mode defined there, as you switch
> between windows, the fringes of non-selected windows will be red.
> 
> Alas, it appears that fringes are redrawn lazily such that changing
> window does not refresh the fringes.

Yes, because redrawing the fringes is expensive, especially in large
frames.  So I'm not surprised that you see what you see, since no one
expected the fringe face to be changed frequently during the session.

> For a bit more context, the package uses face-remap-add-relative and
> :filtered faces, i.e. something like:
> 
>     (face-remap-add-relative
>      'fringe
>      '(:filtered (:window adob--dim t) auto-dim-other-buffers-fringe-face))
> 
> I’ve tried toggling fringe-mode when forcing window update with the
> below code, but it did not do the trick.
> 
>     (defun adob--force-window-update (object)
>       (force-window-update object)
>       ;; Force fringes to be updated
>       (when fringe-mode
>         (dolist (wnd (if (windowp object)
>                          (list object)
>                        (get-buffer-window-list object nil t)))
>           (let* ((frame  (window-frame wnd))
>                  (params (frame-parameters frame))
>                  (left   (alist-get 'left-fringe  params))
>                  (right  (alist-get 'right-fringe params)))
>             (when (and left right)
>               (modify-frame-parameters
>                frame '((left-fringe nil) (right-fringe nil)))
>               (modify-frame-parameters
>                frame `((left-fringe . ,left) (right-fringe . ,right))))))))
> 
> I think what I’d like is for force-window-update to force full fringe
> redraw?  Honestly, I haven’t yet dug through all of the window and
> fringe code so I’m not entirely sure where the main issue lays.

Can you show a simple Lisp which could be used to investigate the
behavior and perhaps see how what you want could be enabled?  It is
not easy to do that by having the code of the whole package.
Presumably, what the package does to dynamically change the face of
the fringe can be done by a short Lisp function, which could then be
used from "emacs -Q" to see what prevents the fringe face from being
updated immediately.





  reply	other threads:[~2024-12-14 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-14 19:31 bug#74876: 31.0.50; Force fringe refresh / force-window-update not affecting fringes Michal Nazarewicz
2024-12-14 20:28 ` Eli Zaretskii [this message]
2024-12-14 21:39   ` Michal Nazarewicz

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=86zfkyrovc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=74876@debbugs.gnu.org \
    --cc=mina86@mina86.com \
    /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).