Summary: | window decorations colours on 30-bit colour depth (10-bit/channel) displays are wrong (garbled) | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | bogdan |
Component: | decorations | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bernie, bogdan, kde, nate, postix |
Priority: | NOR | ||
Version: | 5.19.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=423014 | ||
Latest Commit: | https://invent.kde.org/plasma/kwin/commit/0c67eb983c84ac06a0e34ca0aaa87b840c503348 | Version Fixed In: | 5.19.4 |
Sentry Crash Report: | |||
Attachments: |
Example of wrong colours in title bar and borders
attachment-5583-0.html Purple decorations with 30bit visual |
Description
bogdan
2019-04-07 15:30:12 UTC
It is Open Suse Leap 15.0 Created attachment 119284 [details]
Example of wrong colours in title bar and borders
Please look carefully at both window decorations: title bar and borders
Heh, I guess Aurorae decorations suffer from the issue, right? Is it the same with compositing on? Created attachment 119628 [details] attachment-5583-0.html Yes, I have compositing on. I have not tried 30 bit color in some time. Before I fixed things using QT_NATIVE but this is not working in the new QT. On Thu, Apr 25, 2019, 06:12 David Edmundson, <bugzilla_noreply@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=406302 > > David Edmundson <kde@davidedmundson.co.uk> changed: > > What |Removed |Added > > ---------------------------------------------------------------------------- > CC| |kde@davidedmundson.co.uk > > --- Comment #4 from David Edmundson <kde@davidedmundson.co.uk> --- > Is it the same with compositing on? > > -- > You are receiving this mail because: > You are on the CC list for the bug. >Yes, I have compositing on.
Are you sure? I can't see any shadows there.
Can I have your qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation
I guess that this is what you were looking for: Compositing =========== Compositing is not active You were right, it was not active, but not because I din not enable it but because it crashed and was not reenabled at reboot. I went in Systemsettings and I had to press the "Reenable OpenGL" button. Now the decorations are fine and the shadow is there. Next time if it crashes I will know what to do, but perhaps it would help to make this more obvious? Or to try to reenable it by default at startup, but I understand that it may go into a infinite loop. Thanks for the hint. I was so sure that I have compositing on, and it was but disabled due to a previous crash of the OpenGL library This is still happening with plasma 5.19 and latest mesa / libdri. I'm seeing purple window decorations both on a laptop with i915 graphics and on a PC with amdgpu: https://codewiz.org/pub/kwin-decorations-30bpp.png NOTE: only happens with a 30-bit visual and compositing *off*. NOTE: also affects kwinft built from git Created attachment 129380 [details]
Purple decorations with 30bit visual
(In reply to bernie from comment #8) > NOTE: only happens with a 30-bit visual and compositing *off*. I had the same problem but I learned from the comments. You need compositing on for 30 bit colors. Read the comments on this thread. This may not be a bug. Someone working on this will probably confirm. (In reply to bogdan from comment #10) > I had the same problem but I learned from the comments. You need > compositing on for 30 bit colors. Read the comments on this thread. > > This may not be a bug. Someone working on this will probably confirm. Well, but why is everything rendering fine *except* for window decorations? And it's only *some* decorations: - System Settings: purple - Konsole (qt5): ok (why???) - Quassel IRC (qt5): purple - Signal Desktop (electron): purple - Firefox (gtk3 client-side decorations): ok - Chrome no system decorations: ok - Chrome system decorations: ok I'm not 100% sure, but maybe the problem is that we're using QImage::Format_ARGB32_Premultiplied instead of QImage::Format_A2RGB30_Premultiplied over here https://invent.kde.org/plasma/kwin/-/blob/1d34d29222398417961875b36d0fb3b5db9fa5b3/decorations/decorationrenderer.cpp#L70 (In reply to Vlad Zahorodnii from comment #12) > I'm not 100% sure, but maybe the problem is that we're using > QImage::Format_ARGB32_Premultiplied instead of > QImage::Format_A2RGB30_Premultiplied over here > https://invent.kde.org/plasma/kwin/-/blob/ > 1d34d29222398417961875b36d0fb3b5db9fa5b3/decorations/decorationrenderer. > cpp#L70 Switching to Format_A2RGB30_Premultiplied fixes the decorations when compositing is off. However, it breaks them when compisiting is *enabled*! Looks like kwin extracts the bits from the QImage to draw it via xcb_put_image(): https://invent.kde.org/plasma/kwin/-/blob/master/plugins/scenes/xrender/scene_xrender.cpp#L1249-1253 I don't see a way to specify the pixel format. Do we need to convert the QImage to match the screen format beforehand? A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/97 This is my proposed fix: https://invent.kde.org/plasma/kwin/-/merge_requests/97 It's not elegant, but should get the job done. Please review and test. Oops, my fix triggers a crash in QOpenGLContext::format(). I can't investigate it at the moment because I don't have Qt built with debuginfo, but here's the backtrace: Thread 1 "kwin_x11" received signal SIGSEGV, Segmentation fault. 0x00007ffff4bfe8f7 in QOpenGLContext::format() const () from /usr/lib/libQt5Gui.so.5 (gdb) bt #0 0x00007ffff4bfe8f7 in QOpenGLContext::format() const () at /usr/lib/libQt5Gui.so.5 #1 0x00007ffff6fc3287 in QSGBatchRenderer::Renderer::Renderer(QSGDefaultRenderContext*) () at /usr/lib/libQt5Quick.so.5 #2 0x00007ffff70148a4 in QSGDefaultRenderContext::createRenderer() () at /usr/lib/libQt5Quick.so.5 #3 0x00007ffff7081183 in QQuickWindowPrivate::syncSceneGraph() () at /usr/lib/libQt5Quick.so.5 #4 0x00007ffff70005e4 in () at /usr/lib/libQt5Quick.so.5 #5 0x00007ffff70024ca in () at /usr/lib/libQt5Quick.so.5 #6 0x00007ffff4bc7955 in QWindow::event(QEvent*) () at /usr/lib/libQt5Gui.so.5 #7 0x00007fff03378f70 in PlasmaQuick::Dialog::event(QEvent*) (this=0x555556260de0, event=0x7fffffffd670) at /home/bernie/kde/src/plasma-framework/src/plasmaquick/dialog.cpp:1212 #8 0x00007ffff52ae702 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5 #9 0x000055555555c687 in KWin::ApplicationX11::notify(QObject*, QEvent*) (this=0x7fffffffd870, o=0x555556260de0, e=0x7fffffffd670) at /home/bernie/kde/src/kwin/main_x11.cpp:273 #10 0x00007ffff47de7ba in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5 #11 0x00007ffff4bbc7e0 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () at /usr/lib/libQt5Gui.so.5 #12 0x00007ffff4b90b4c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5 #13 0x00007fffefdaa076 in () at /usr/lib/libQt5XcbQpa.so.5 #14 0x00007ffff47dd13c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5 #15 0x00007ffff47e55c4 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5 #16 0x000055555555dea2 in main(int, char**) (argc=2, argv=0x7fffffffd9f8) at /home/bernie/kde/src/kwin/main_x11.cpp:479 (gdb) frame 1 #1 0x00007ffff6fc3287 in QSGBatchRenderer::Renderer::Renderer(QSGDefaultRenderContext*) () from /usr/lib/libQt5Quick.so.5 (gdb) bt #0 0x00007ffff4bfe8f7 in QOpenGLContext::format() const () at /usr/lib/libQt5Gui.so.5 #1 0x00007ffff6fc3287 in QSGBatchRenderer::Renderer::Renderer(QSGDefaultRenderContext*) () at /usr/lib/libQt5Quick.so.5 #2 0x00007ffff70148a4 in QSGDefaultRenderContext::createRenderer() () at /usr/lib/libQt5Quick.so.5 #3 0x00007ffff7081183 in QQuickWindowPrivate::syncSceneGraph() () at /usr/lib/libQt5Quick.so.5 #4 0x00007ffff70005e4 in () at /usr/lib/libQt5Quick.so.5 #5 0x00007ffff70024ca in () at /usr/lib/libQt5Quick.so.5 #6 0x00007ffff4bc7955 in QWindow::event(QEvent*) () at /usr/lib/libQt5Gui.so.5 #7 0x00007fff03378f70 in PlasmaQuick::Dialog::event(QEvent*) (this=0x555556260de0, event=0x7fffffffd670) at /home/bernie/kde/src/plasma-framework/src/plasmaquick/dialog.cpp:1212 #8 0x00007ffff52ae702 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5 #9 0x000055555555c687 in KWin::ApplicationX11::notify(QObject*, QEvent*) (this=0x7fffffffd870, o=0x555556260de0, e=0x7fffffffd670) at /home/bernie/kde/src/kwin/main_x11.cpp:273 #10 0x00007ffff47de7ba in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5 #11 0x00007ffff4bbc7e0 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () at /usr/lib/libQt5Gui.so.5 #12 0x00007ffff4b90b4c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5 #13 0x00007fffefdaa076 in () at /usr/lib/libQt5XcbQpa.so.5 #14 0x00007ffff47dd13c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5 #15 0x00007ffff47e55c4 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5 #16 0x000055555555dea2 in main(int, char**) (argc=2, argv=0x7fffffffd9f8) at /home/bernie/kde/src/kwin/main_x11.cpp:479 Git commit 0c67eb983c84ac06a0e34ca0aaa87b840c503348 by Bernie Innocenti. Committed on 10/07/2020 at 13:08. Pushed by davidedmundson into branch 'master'. [decorations] Fix rendering for depth 30 (10bpc) When the display is set to 30-bit depth (10-bit per color component), decorations of some clients appear garbled when compositing is disabled. This is because the pixel format of the QImage in which the decorations were rendered differed from the the X pixmap into which the pixels were being copied by means of xcb_put_image(). For lack of a more robust way, this change guesses A2RGB30 for depth=30, and keeps using ARGB32 as before for any other depth. I don't expect anything other to 32bpp to be supported by KWin anyway. Tested on amdgpu with KWIN_OPENGL_INTERFACE=egl. FIXED-IN: 5.19.4 M +20 -1 decorations/decorationrenderer.cpp https://invent.kde.org/plasma/kwin/commit/0c67eb983c84ac06a0e34ca0aaa87b840c503348 bogdan@, if you can build kwin from source, could you please test the fix and report back? @bernie I could try this weekend. but I can't promise. |