Comments (16)
I cannot reproduce this on samples of native behaviors from the SDK.
For each particular element/behavior HANDLE_INITIALIZATION shall happen on element construction/destruction.
It appears as your code reloads document in a loop or something like that.
from sciter-sdk.
Why 6143 and every single version before was working then? I only changed DLL. Some latest changes caused that, don't even know where to look... Without SciterAttachEventHandler() program does not have any signs of activity, so I doubt it's doing anything. Also that endless loop is without any delays, so program's UI thread just uses all resources of 1 CPU core and freezes completely.
from sciter-sdk.
@Mikanoshi Just out of curiosity: can you try 6143 again?
from sciter-sdk.
Yes, 6143 works. This seems to be the problem:
https://github.com/Mikanoshi/SciDe/blob/master/source/Sciter.pas#L3992
If event param has a target that is not null new element object is being created and new listener is attached, hence the loop.
from sciter-sdk.
I have some doubts about this:
function ElementFactory(const ASciter: TSciter; const he: HELEMENT): TElement;
begin
Result := TElement.Create(ASciter, he);
end;
What if he
(DOM element) already has TElement
instance created for it?
Why it creates new instance each time when it gets called for the same element?
I think it shall check first if that element is already in this map:
FSciter.ManagedElements.Add(Self);
No?
Otherwise this will create new TElement on each MOUSE_MOVE event for example. No?
from sciter-sdk.
For me, the question is why would you want to attach a new event handler to the params.heTarget
instead of just wrapping it in TElement
? Or, even, doing that lazily during TElementOnControlEventArgs.Target
reading?
What was the idea behind of the SciterAttachEventHandler
in TElement
?
from sciter-sdk.
What was the idea behind of the SciterAttachEventHandler in TElement?
I suspect that they want to catch element destruction notification from engine's side. But why they would need that is unknown. As soon as TElement holds reference of DOM element it is alive, it could be not connected to the DOM but is valid.
from sciter-sdk.
Because it causes Access Violation? No idea, I didn't write the wrapper :)
You get element and event handler attached to it supposed to make all the event listeners work, e.g.:
var
el: IElement;
begin
el := Sciter.Select('#test');
TElement(el).OnMouse = TreatMouseEvents;
end;
But var has to be used elsewhere, because it's an interface and manages references automatically, variable is destroyed if no longer used. I tried to add elements to ManagedElements and then check them, but it doesn't work for 2 reasons - above one is the first, FTarget is destroyed after HandleMouse() finishes, second one is that Sciter keeps sending mouse events for < html > element even after listener is detached.
I added logging to element creation/destruction and on old version creating and destroying TElement for root (< html >) does not cause additional events when moving mouse over Sciter window.
from sciter-sdk.
TElement(el).OnMouse = TreatMouseEvents;
It needs event handler creation only on OnMouse property assignment.
from sciter-sdk.
Does it matter? If there is no assignment the TElement is destroyed and event handler is detached. But I think that Sciter does not do that for root html, so elements for the target param are being created and destroyed, but listeners pile up.
from sciter-sdk.
that Sciter does not do that for root html
Does not do what exactly?
from sciter-sdk.
but listeners pile up.
Yes, that architecture of Delphi wrapper is tend to pile up memory. Yet to slow down event handling on each event received.
from sciter-sdk.
Listeners pile up in Sciter, not Delphi :)
Does not do what exactly?
Remove listener after SciterDetachEventHandler() call.
I only have 1 place where SciterAttachEventHandler() is called, and for each call there is a SciterDetachEventHandler() call with the same arguments, but 6172 keeps sending events to the event proc (_SciterElementEventProc).
from sciter-sdk.
There is a problem with SciterDetachEventHandler()
at the moment. Looking.
from sciter-sdk.
I've updated Windows binaries here, on GitHub. Check them please.
from sciter-sdk.
Fixed π
from sciter-sdk.
Related Issues (20)
- Sciter-sdk 4.4.7.3 HOT 1
- build error on linux platform (miss sciter-sqlite.make file) HOT 1
- libsciter-gtk.so doesn't support in ARM64 platform HOT 14
- sciter.dll from bin.win folder does not work HOT 4
- samples\animations-lottie\lottie-player.htm has issues on Windows
- Question: #define _WINSOCKAPI_ within Sciter (and Boost.Asio) HOT 1
- Update please HOT 6
- bin.osx.zip
- 1000+ Data performance HOT 7
- Sciter.Lite: Custom gfx layers/rendering backends HOT 11
- Mac OS εΊη¨η¨εΊβinspectorβζ ζ³ζεΌγ HOT 3
- Missing `license.htm`
- sigfault usciter/wsciter on Linux x64 and Win x64
- how to download old version
- libsciter-gtk.so for Linux 32 bit HOT 14
- get html code
- Editing input value in document fragment crash the app
- Cannot open file from commandline HOT 4
- I found a bug, I don't know if this is a bug, maybe the author can try to fix it.
- CMake doesn't find implemantation of sciter methods HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sciter-sdk.