Bug 440855 - BambooTracker instrument graphs invisible on Breeze master branch
Summary: BambooTracker instrument graphs invisible on Breeze master branch
Status: RESOLVED NOT A BUG
Alias: None
Product: Breeze
Classification: Plasma
Component: QStyle (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-11 04:42 UTC by nyanpasu64
Modified: 2021-08-11 09:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nyanpasu64 2021-08-11 04:42:55 UTC
SUMMARY
With Breeze theme's recent master installed, BambooTracker's instrument editor's graphs are replaced with white rectangles.

STEPS TO REPRODUCE
1. Install Breeze at or after f6ef4f4738a5d3b6a07b7b11451af19635c8acd9 "Draw background for frames".
2. Install and run BambooTracker.
3. Create and double-click an instrument.

OBSERVED RESULT
The rectangles on the bottom right have line graphs.

EXPECTED RESULT
The rectangles on the bottom right are empty and white.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Kernel Version: 5.13.8-zen1-1-zen (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GT 730/PCIe/SSE2

ADDITIONAL INFORMATION
I looked at the GUI in GammaRay. Each row ("Operator N") of the instrument dialog is a FMOperatorTable object. The instrument graph (envFrame) is a QFrame, not a subclass with a custom paint operation.

https://github.com/BambooTracker/BambooTracker/blob/master/BambooTracker/gui/instrument_editor/fm_operator_table.cpp#L205-L216

FMOperatorTable::eventFilter() intercepts QEvent::Paint and paints a graph onto the frame (copied from QPixmap envmap_). On newer versions of Breeze, according to GammaRay's "Paint Analyzer", it then gets overwritten by Breeze QFrame's standard paint event.

BambooTracker's method of painting the graph is unusual. But is it wrong? What's a better way of doing it? Should Breeze change to make this work?
Comment 1 David Edmundson 2021-08-11 09:22:35 UTC
> But is it wrong? 

Unquestionably, yes. 

Using the pattern it's using of an event filter (which is already weird) it should return true inside the if statement to stop the event running.

>What's a better way of doing it?

It shouldn't set the frame style to "Styled" if we don't want it styled. 
I think this is just trying to do QFrame::NoFrame, but if it does need to style it itself, it should set to Plain and subclass it.

Can you report to BabooTracker and link here.
Comment 2 nyanpasu64 2021-08-11 09:36:08 UTC
Reported at https://github.com/BambooTracker/BambooTracker/issues/403.

Though I think "it should return true inside the if statement to stop the event running" isn't an appropriate fix, because it would prevent the entire instrument editor groupbox (FMOperatorTable) from painting, not just the graph's frame and background.