Page 1 of 1

Client flickering after window occlusions [Linux client 4.7.2]

Posted: Wed Apr 01, 2020 2:38 pm
by jezek
There is a client flickering in linux client, after window occlusions (see animated gif of flickering tomenet).

So I made a small bug-hunt adventure and located and captured... ehm... fixed the bug (see animated gif of not flickering tomenet).

And here is the flickering fix commit: https://github.com/jezek/tomene-srct/co ... diff=split

This could be also cherry-picked to new client. ;)

Re: Client flickering after window occlusions [Linux client 4.7.2]

Posted: Sun Apr 05, 2020 10:39 am
by mikaelh
Nice work. I cherry-picked it into our git repository now.

Your fix is quite similar to the latest Angband code:

https://github.com/angband/angband/blob ... 11.c#L1834

I think the " + 1" isn't necessary for x2 and y2. The Angband code is rounding down all the results. Angband has also added ox and oy to the infowin struct which don't exist in our code. Our code has an inner window instead of having an offset.

I actually wasn't able to reproduce this on my system. I'm running KDE Plasma and I don't get any expose events when putting another window over the TomeNET windows. I did get expose events when running Fluxbox. Even there I didn't see any flickering. I probably have v-sync enabled or something similar.

Re: Client flickering after window occlusions [Linux client 4.7.2]

Posted: Sun Apr 05, 2020 2:13 pm
by jezek
To be honest, I copypasted & edited the x2, y2 formulas from TomeNET's client code for windows. I did not think deeply about it. My reasoning was, that someone had a reason to put the +1 into windows code, so it is needed there. That's the dark side of copy-paste. :D If it bugs me to much, I'll look into it.

I'm on Ubuntu Mate 19.10 right now on an older notebook. Here the fickering was visible and annoying. Maybe KDE plasma has som kind of mirrored window buffer and does not need expose event (pastes right from buffer).

Re: Client flickering after window occlusions [Linux client 4.7.2]

Posted: Sun Apr 05, 2020 2:26 pm
by jezek
Took not so long, the +1 bugged me. I thought about it, did some calculation and little testing. You were right, the +1 is not needed.

Here is the new/changed commit: https://github.com/jezek/tomenet-src/co ... diff=split. (sorry for the force pull/push)

Edit: made a pull request on https://github.com/TomenetGame/tomenet

Re: Client flickering after window occlusions [Linux client 4.7.2]

Posted: Sun Apr 05, 2020 4:31 pm
by mikaelh
Yeah, it should be fine without the +1.

I see you also removed the struct copy. I didn't complain about the struct copy because it gets optimized away by the compiler. So the main benefit is that the code is more compact.

I merged the pull request.