Slab - An Immediate Mode GUI Library In Lua

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Slab - An Immediate Mode GUI Library In Lua

Post 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
pirogronian
Prole
Posts: 17
Joined: Sun Jun 30, 2019 5:38 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post 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...
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Slab - An Immediate Mode GUI Library In Lua

Post by yetneverdone »

Well, we can also compare responsiveness. I just want to make sure it will not take too much garbage
pirogronian
Prole
Posts: 17
Joined: Sun Jun 30, 2019 5:38 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post 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?
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Slab - An Immediate Mode GUI Library In Lua

Post 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
User avatar
pgimeno
Party member
Posts: 3672
Joined: Sun Oct 18, 2015 2:58 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post 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.
pirogronian
Prole
Posts: 17
Joined: Sun Jun 30, 2019 5:38 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post 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.
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Slab - An Immediate Mode GUI Library In Lua

Post 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 :)
pirogronian
Prole
Posts: 17
Joined: Sun Jun 30, 2019 5:38 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests