public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: "S.J. Luo" <sjaluo@gmail.com>,
	The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: Window flickering problem in XWin multiwindow mode
Date: Sat, 30 Apr 2022 16:25:24 +0100	[thread overview]
Message-ID: <c15e37c6-53d9-3837-5b66-ceacf348dc8b@dronecode.org.uk> (raw)
In-Reply-To: <CAMoHPCaPjj-XyzRXc4yv1U5=1PXK_tASbEd5Caxi0dSPZA89og@mail.gmail.com>

On 26/04/2022 04:53, S.J. Luo wrote:

> I have some EDA tools running on a Linux machine and display on my Windows
> PC using xorg-server-21.1.3 XWin multiwindow mode
> Sometimes the application window flickers forever for an unknown reason.
> The problem became more severe after my PC upgrade to Windows10.
> 
> Googling the problem, I did not find such issue reported.
> I decided to take advantage of open source nature and solve it by myself.
> After re-compiling and debugging, I found a calling loop triggered.
> Here I eliminate the detail of the cause. I may write later if someone requires.
> 
> Knowing the root cause, I am now able to demonstrate the issue with a small
> test case as well as a patch that works for me. Both are attached below.

Thanks very much for taking the time to look into this, and writing a patch.

I will apply it.

But I'd like to add a bit more commentary, which perhaps you can supply, 
about the analysis you did to determine:

1. how the code is misbehaving
2. how this change remedies that
3. how this change doesn't effect anything else

What your fix does is examine the queue of pending WM messages to 
determine if there are any more pending for the window receiving a 
WM_WM_CHANGE_STATE message, and if there are, ignore it.

It seems to me that is error prone, in a couple of ways:

1. it should check the message type as well, as e.g. a pending message 
of a different type could cause a WM_WM_CHANGE_STATE message to be ignored.

2. even then, assuming that successive WM_WM_CHANGE_STATE messages 
cancel out each other isn't always true e.g. consider a sequence of 
_NET_WM_STATE_ADD _NET_WM_STATE_MAXIMIZED_VERT followed by 
_NET_WM_STATE_ADD _NET_WM_STATE_MAXIMIZED_HORZ.


If you were to send other patches in future, please send them as 
attachments, or even better, using git format-patch/git send-email, as 
that makes it much easier to apply them without white-space damage and 
with correct attribution.


  parent reply	other threads:[~2022-04-30 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26  3:53 S.J. Luo
2022-04-30  1:40 ` S.J. Luo
2022-04-30  2:06   ` Mark Geisert
2022-04-30  3:58     ` Mark Geisert
2022-04-30 15:25 ` Jon Turney [this message]
     [not found]   ` <CAMoHPCZ18Q_G=JTwOwu2ij3feJ6cd9CHxddONuProrL3kwgBKw@mail.gmail.com>
2022-05-07  2:01     ` S.J. Luo
2022-08-14 11:08       ` Jon Turney

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=c15e37c6-53d9-3837-5b66-ceacf348dc8b@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin@cygwin.com \
    --cc=sjaluo@gmail.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.
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).