Page 10 of 10

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Wed Oct 26, 2022 7:05 am
by yetneverdone
pirogronian wrote: Wed Oct 26, 2022 6:16 am
yetneverdone wrote: Wed Oct 26, 2022 2:10 am
pirogronian wrote: Mon Oct 24, 2022 2:31 pm

This issue is identified for long time. I've already posted about it and proposed some sollution, but based on event processing. It can be found here.

In fact, it's not a "bug". It's rather inavoidable result of chosen approavh, based on state only, without processing direct input events.
I think the solution to this was already addressed and PR'ed by megagrump which is now in the `master` and `v1.0.0` branches
Nope. AFAIK, there is no change in this matter in both branches for now... I want to be wrong, however.
Feel free to make PR :) It would be easier if we can compare the performance of the current `master` branch and your changes

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Wed Oct 26, 2022 7:53 am
by pirogronian
yetneverdone wrote: Wed Oct 26, 2022 7:05 am
pirogronian wrote: Wed Oct 26, 2022 6:16 am
yetneverdone wrote: Wed Oct 26, 2022 2:10 am

I think the solution to this was already addressed and PR'ed by megagrump which is now in the `master` and `v1.0.0` branches
Nope. AFAIK, there is no change in this matter in both branches for now... I want to be wrong, however.
Feel free to make PR :) It would be easier if we can compare the performance of the current `master` branch and your changes
It's not matter of performance but responsiveness and reliability. And it would mean deep architectural cganfes, as Slab by its design rely on updated state, and events needs some kind of callbacks or message queue. It's something completely different from immediate mode GUI Slab is. So, it would be hard...

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Thu Oct 27, 2022 5:03 am
by yetneverdone
Well, we can also compare responsiveness. I just want to make sure it will not take too much garbage

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Fri Oct 28, 2022 7:43 am
by pirogronian
yetneverdone wrote: Wed Oct 26, 2022 2:10 am
pirogronian wrote: Mon Oct 24, 2022 2:31 pm
yetneverdone wrote: Sun Dec 19, 2021 11:21 pm


Oh so this is indeed a bug. I also notice this on my quite large game but didnt realize it til now.
This issue is identified for long time. I've already posted about it and proposed some sollution, but based on event processing. It can be found here.

In fact, it's not a "bug". It's rather inavoidable result of chosen approavh, based on state only, without processing direct input events.
I think the solution to this was already addressed and PR'ed by megagrump which is now in the `master` and `v1.0.0` branches
Oj, I found the commit that addresses it, but dont understand, how it works without forwarding events from Love... @Grump, could you explain it?

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Fri Oct 28, 2022 3:43 pm
by yetneverdone
pirogronian wrote: Fri Oct 28, 2022 7:43 am
yetneverdone wrote: Wed Oct 26, 2022 2:10 am
pirogronian wrote: Mon Oct 24, 2022 2:31 pm

This issue is identified for long time. I've already posted about it and proposed some sollution, but based on event processing. It can be found here.

In fact, it's not a "bug". It's rather inavoidable result of chosen approavh, based on state only, without processing direct input events.
I think the solution to this was already addressed and PR'ed by megagrump which is now in the `master` and `v1.0.0` branches
Oj, I found the commit that addresses it, but dont understand, how it works without forwarding events from Love... @Grump, could you explain it?
Here are related info in the repo from megagrump

https://github.com/flamendless/Slab/pull/107
https://github.com/flamendless/Slab/issues/102

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Fri Oct 28, 2022 8:04 pm
by pgimeno
From the code patch, it appears that events were dropped because the table was iterated in forwards order, not in backwards order. It also appears that the events were treated as a stack, not a queue.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sat Oct 29, 2022 9:33 am
by pirogronian
yetneverdone wrote: Fri Oct 28, 2022 3:43 pm
pirogronian wrote: Fri Oct 28, 2022 7:43 am
yetneverdone wrote: Wed Oct 26, 2022 2:10 am

I think the solution to this was already addressed and PR'ed by megagrump which is now in the `master` and `v1.0.0` branches
Oj, I found the commit that addresses it, but dont understand, how it works without forwarding events from Love... @Grump, could you explain it?
Here are related info in the repo from megagrump

https://github.com/flamendless/Slab/pull/107
https://github.com/flamendless/Slab/issues/102
I have finally found the code and way Slab handles events. It's by overriding handlers directly. To me, it's very bad idea, as I may wish to handle events as well. But Slab takes everything for itself. I strongly recommend to enable forwarding funtions instead of overriding handlers.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sat Oct 29, 2022 11:26 am
by yetneverdone
pirogronian wrote: Sat Oct 29, 2022 9:33 am
yetneverdone wrote: Fri Oct 28, 2022 3:43 pm
pirogronian wrote: Fri Oct 28, 2022 7:43 am

Oj, I found the commit that addresses it, but dont understand, how it works without forwarding events from Love... @Grump, could you explain it?
Here are related info in the repo from megagrump

https://github.com/flamendless/Slab/pull/107
https://github.com/flamendless/Slab/issues/102
I have finally found the code and way Slab handles events. It's by overriding handlers directly. To me, it's very bad idea, as I may wish to handle events as well. But Slab takes everything for itself. I strongly recommend to enable forwarding funtions instead of overriding handlers.
PRs are welcome for the proposed changes :)

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Mon Oct 31, 2022 7:33 pm
by pirogronian
yetneverdone wrote: Sat Oct 29, 2022 11:26 am
pirogronian wrote: Sat Oct 29, 2022 9:33 am I have finally found the code and way Slab handles events. It's by overriding handlers directly. To me, it's very bad idea, as I may wish to handle events as well. But Slab takes everything for itself. I strongly recommend to enable forwarding funtions instead of overriding handlers.
PRs are welcome for the proposed changes :)
Ok, my another realisation: Slab actually calls all previously defined handlers by itself. It works with statically defined callbacks, but I'm unsure about other side effects of such a behaviour. Maybe it should be mentioned in documentation to avoid accidental and surprising misbehaviour if user will manipulate with callbacks more dynamically.