Subject: bug#78861: [PATCH] Avoid calendar flicker

From: Manuel Giraud <[email-masked]>
Date: Sun, 22 Jun 2025 13:46:28 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Manuel Giraud <[email-masked]>
>> Date: Sun, 22 Jun 2025 09:00:02 +0200
>> 
>> When you have diary marks activated in the calendar (with 'm',
>> diary-mark-entries) and when moving around (for example with '<' and
>> '>') you will see some flicker on dates where you have marks.
>
> Please elaborate: which part(s) of the display flicker?  I tried a
> simple recipe to reproduce the problem, and saw no flickering on my
> system.

I see the date digits flicker when moving: the digits glimpse in black
before turning to red (with default theme).

> Did you see the flickering in "emacs -Q"?

Here is a recipe:
     - emacs -Q
     - Open "/tmp/diary" and insert the following content:
--8<---------------cut here---------------start------------->8---
%%(diary-block 6 22 2025 8 30 2025) Looong break
--8<---------------cut here---------------end--------------->8---
     - M-: (setq diary-file "/tmp/diary") <RET>
     - M-x calendar <RET>
     - Hit 'm' and then alternatively '>' and '<' to see the flicker

> And what is the state of double-buffering in the session where you saw
> it?

I'm not sure but I think I'm good.  Here's an excerpt of xdpyinfo:

number of extensions:    28
    BIG-REQUESTS
    Composite
    DAMAGE
    DOUBLE-BUFFER
    DPMS
    DRI2
    DRI3
    GLX
    Generic Event Extension
    MIT-SCREEN-SAVER
    MIT-SHM
    Present
    RANDR
    RECORD
    RENDER
    SECURITY
    SHAPE
    SYNC
    X-Resource
    XC-MISC
    XFIXES
    XFree86-DGA
    XFree86-VidModeExtension
    XINERAMA
    XInputExtension
    XKEYBOARD
    XTEST
    XVideo
default screen number:    0
number of screens:    1

>> This patch fixes this.
>
> Sorry, the inhibit-redisplay flag is not meant to be used for these
> purposes, so this patch is not TRT, from where I stand.  We need
> instead to understand why the display flickers and fix that to avoid
> the flickering.  So let's please take a step back and try to come up
> with a reproducible recipe that exhibits this flickering, and then see
> why it happens.

Ok.
-- 
Manuel Giraud