Client flickering after window occlusions [Linux client 4.7.2]

Bug reports and discussion about bugs.
Post Reply
User avatar
jezek
Posts: 23
Joined: Tue Mar 10, 2020 3:07 pm

Client flickering after window occlusions [Linux client 4.7.2]

Post 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. ;)
Last edited by jezek on Sun Apr 05, 2020 3:53 pm, edited 1 time in total.

mikaelh
Developer
Posts: 202
Joined: Sun Dec 13, 2009 3:18 pm

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

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

User avatar
jezek
Posts: 23
Joined: Tue Mar 10, 2020 3:07 pm

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

Post 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).
Last edited by jezek on Sun Apr 05, 2020 3:54 pm, edited 1 time in total.

User avatar
jezek
Posts: 23
Joined: Tue Mar 10, 2020 3:07 pm

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

Post 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

mikaelh
Developer
Posts: 202
Joined: Sun Dec 13, 2009 3:18 pm

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

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

Post Reply