<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 03/04/2020 11:05, Juha Manninen via
lazarus wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAPN1EhBQowGCW00g6yTbTvH5a8T_yeFhrzzN_xGdkC6bzTr0WA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Apr 3, 2020 at 11:35
AM Rolf Wetjen via lazarus <<a
href="mailto:lazarus@lists.lazarus-ide.org"
moz-do-not-send="true">lazarus@lists.lazarus-ide.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>I wanted to ask for <a
href="https://bugs.freepascal.org/view.php?id=35362"
target="_blank" moz-do-not-send="true">https://bugs.freepascal.org/view.php?id=35362</a>
and <a
href="https://bugs.freepascal.org/view.php?id=36798"
target="_blank" moz-do-not-send="true">https://bugs.freepascal.org/view.php?id=36798</a>.<br>
</div>
</blockquote>
<div><br>
</div>
<div>OK, that makes more sense. :)</div>
<div>Issue #35362 is a regression. If your patch works it
surely should be applied and merged to 2.0.8 branch.</div>
<div>Apparently Michl is not active right now so I assigned
the issue to Martin.</div>
<div>I myself don't have a Windows now. I am setting up
Lazarus under Wine in my new super-computer (!) and then I
can test Windows patches, too.</div>
<div>Wine has improved steadily and is very good nowadays.</div>
</div>
</div>
</blockquote>
<br>
I did some tests. (more pending / some assumptions below)<br>
<br>
The problem with the patch is, that the LCL events (and the On...
events) will then all be called on mouse up.<br>
That is, the mouse down event, will be hold back, until the button
is released.<br>
<br>
As far as I can see the problem is, that the WindProc, first calls
the DefaultWindProc, which (some tests pending) does not return
until the mouse up occurs.<br>
<a class="moz-txt-link-freetext" href="https://docs.microsoft.com/en-us/windows/win32/controls/listview-message-processing">https://docs.microsoft.com/en-us/windows/win32/controls/listview-message-processing</a>
=> it goes into a modal loop....<br>
<br>
So If I am right, I guess this listview needs its own windproc, and
must trigger the LCL (DeliverMessage) for WMMouseDown before calling
DefaultProc.<br>
<br>
Downside: the OnMouseDownEvent is called before the OS widget even
knows. So maybe some state info will be different......<br>
<br>
But as far as I see it, its either that, or defer to mouse up.<br>
<br>
-------------------------<br>
In either case, I consider the changes to big for being merged.<br>
<br>
1) Defer the event: that is a major behaviour change, needs
documented<br>
2) own event proc. That needs a lot of testing, as it is easy to
overlook stuff and break it. (Not to say it needs to be
implemented).<br>
<br>
<br>
***** I think ***<br>
the immediate DeliverMessage is the better approach. (Despite the
possible not yet updated widget)<br>
<br>
But it may turn out to have downsides.<br>
<br>
So anyone else any preferences?<br>
</body>
</html>