Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#15548 closed bug (fixed)

Flickering when drawing background

Reported by: X512 Owned by: stippi
Priority: normal Milestone: R1/beta2
Component: Servers/app_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #2416, #3038, #6616, #9536, #9986
Platform: All

Description

This is hrev53634 gcc2hybrid.

When resizing windows or moving one window on top of another, background is drawn and copied to front buffer immidiately causing flickering. Drawing background should be a part of update process and be synchronized with application redraw handler.

Proposed patch: https://review.haiku-os.org/c/haiku/+/2021. No obvious regressions observed for now.

Change History (38)

comment:1 by X512, 2 years ago

Related tickets:

Last edited 2 years ago by X512 (previous) (diff)

comment:2 by diver, 2 years ago

Blocking: 2416 added

comment:3 by diver, 2 years ago

Blocking: 9536 added

comment:4 by diver, 2 years ago

Blocking: 9986 added

comment:5 by diver, 2 years ago

Blocking: 3038 added

comment:6 by diver, 2 years ago

Blocking: 6616 added

comment:7 by diver, 2 years ago

I've tested the patch and it's awesome! :) Now I can finally enjoy flicker free Haiku experience, so yay!

The only apps so far that still flicker are WonderBrush (but it uses liblayout, so maybe not related) and Genesis Commander (possibly custom widgets).

So far I haven't noticed any regressions so +1 from me to merging it.

comment:8 by X512, 2 years ago

This fix is also allow to remove workarounds to reduce flickering like SetViewColor(B_TRANSPARENT_COLOR) or custom double buffering.

comment:9 by X512, 2 years ago

I do not see any flickering in Genesis Commander.

comment:10 by diver, 2 years ago

Odd, I can clearly see them easily...

comment:11 by diver, 2 years ago

BTW, could you please take a look at #4335 while you're at it? :)

comment:12 by X512, 2 years ago

Genesis Commander flickering is observed on slow machine (VirtualBox). ​https://review.haiku-os.org/c/haiku/+/2021 seems not completely solves problem.

Last edited 2 years ago by diver (previous) (diff)

comment:13 by diver, 2 years ago

Owner: changed from axeld to stippi
Status: newassigned

Interestingly, every control flickers except for menubar, popup menus and scrollbars. Maybe controls use custom double buffering like you mentioned before?

in reply to:  13 comment:14 by X512, 2 years ago

Replying to diver:

Interestingly, every control flickers except for menubar, popup menus and scrollbars. Maybe controls use custom double buffering like you mentioned before?

Some controls don't flicker because background is not erased by app_server for them or backbuffer was flushed after drawing them for some reason. Haiku use global screen backbuffer. Flickering is caused by improper backbuffer flushing. Backbuffer should be flushed when all drawing is done, but sometimes it is flushed after only background is drawn and this issue is about it.

comment:15 by X512, 2 years ago

I debugged Genesis Commander on VirtualBox and found that https://xref.landonf.org/source/xref/haiku/src/kits/interface/Window.cpp#1221 fails sometimes with B_BAD_VALUE and window will not draw anything.

Last edited 2 years ago by X512 (previous) (diff)

comment:16 by X512, 2 years ago

For some reason data sent after https://xref.landonf.org/source/xref/haiku/src/servers/app/Window.cpp#1945 is not received sometimes. That cause read fail on libbe.so side.

comment:17 by X512, 2 years ago

Genesis Commander case fixed in https://review.haiku-os.org/c/haiku/+/2099.

Issue still present in WebPositive.

comment:18 by X512, 2 years ago

Sorry, WebPositive is also fixed. gcc4+ version of libbe.so was not updated.

comment:19 by diver, 2 years ago

Great! I'm gonna test it now. Have you looked into WinderBrush? Maybe it's also fixed now?

in reply to:  17 comment:20 by diver, 2 years ago

Replying to X512:

Genesis Commander case fixed in https://review.haiku-os.org/c/haiku/+/2099.

Issue still present in WebPositive.

Confirmed that both WonderBrush and Genesis Commander flickering is fixed with this patch. It also fixes #8895 (tested) and possibly #8525. Very cool! :P

comment:21 by diver, 2 years ago

Odd, after starting many apps flickering is back in WonderBrush, WebPositive and #8895.

comment:22 by X512, 2 years ago

In my case 2 bottom lists are flickering in WonderBrush. They flicker even if separator between lists is dragging. Probably WonderBrush is doing something wrong like drawing outside of update session.

in reply to:  21 comment:23 by X512, 2 years ago

Replying to diver:

Odd, after starting many apps flickering is back in WonderBrush, WebPositive and #8895.

Was something changed in flickering? Does menu artifacts persists after stopping moving/resizing?

Note that 2 patches (https://review.haiku-os.org/c/haiku/+/2021, https://review.haiku-os.org/c/haiku/+/2099) should be applied.

Last edited 2 years ago by X512 (previous) (diff)

in reply to:  22 comment:24 by diver, 2 years ago

Replying to X512:

In my case 2 bottom lists are flickering in WonderBrush. They flicker even if separator between lists is dragging.

I see that too.

Was something changed in flickering? Does menu artifacts persists after stopping moving/resizing?

Note that 2 patches (​https://review.haiku-os.org/c/haiku/+/2021, ​https://review.haiku-os.org/c/haiku/+/2099) should be applied.

Yes, both patches are applied. I can't reproduce flickering in Genesis Commander/WonderBrush/WebPositive right after reboot. But after starting all of the apps in Deskbar->Applications they are back in said apps.

comment:25 by X512, 2 years ago

WonderBrush flicker may be caused by problems in liblayout. Is source of liblayout available?

comment:26 by diver, 2 years ago

Interestingly, when mentioned apps (including WonderBrush) start to flicker reopening them fixes that. PM me on telegram (@diversys) if you still need liblayout sources.

comment:27 by X512, 2 years ago

What platform is used (x86, x86_64)? Does multiple CPU cores used?

comment:28 by diver, 2 years ago

This is x86_64 in VMware Fusion with 2 processor cores.

comment:29 by diver, 2 years ago

Ok, it seems that I found a way to reproduce it.

All of the mentioned apps do not flicker when started via QuickLaunch!
However, when started from Tracker they do flicker and this is how I've been launching them starting from comment:23.

comment:30 by diver, 2 years ago

Ouch! Finally realised what was going on. I had libbe.so with one of your previous patches in non-packaged/lib. With this out of the way there is no flickering at all! Sorry for the confusion.

So, +1 for both fixes, no regressions observed so far. \o/

comment:31 by diver, 2 years ago

Resolution: fixed
Status: assignedclosed

Finally fixed in hrev53711.

comment:32 by diver, 2 years ago

Flickering can still be observed in Genesis commander and many other apps by resizing its window using left border. You need to hold middle mouse button above left border to enable resize mode.

comment:33 by X512, 2 years ago

Flickering confirmed, but with right mouse button. Midlle mouse button has no effect. Observed only on slow machine. This resizing mode was not present in BeOS and was introduced in Haiku recently. Maybe it introduce new issues.

Last edited 2 years ago by X512 (previous) (diff)

comment:34 by X512, 2 years ago

It seems that window move sometimes cause backbuffer flush.

comment:35 by X512, 2 years ago

Created new ticket #15631 for that.

comment:36 by diver, 2 years ago

Blocking: 11073 added

comment:37 by diver, 2 years ago

Blocking: 11073 removed

comment:38 by nielx, 2 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.