{"id":6413,"date":"2015-09-04T15:20:45","date_gmt":"2015-09-04T15:20:45","guid":{"rendered":"http:\/\/notmart.org\/blog\/?p=6413"},"modified":"2015-09-04T15:20:45","modified_gmt":"2015-09-04T15:20:45","slug":"there-is-a-blur-in-my-wayland","status":"publish","type":"post","link":"https:\/\/notmart.org\/blog\/2015\/09\/there-is-a-blur-in-my-wayland\/","title":{"rendered":"There is a Blur in my Wayland"},"content":{"rendered":"<p>Over the last few days I decided to help Martin a bit with the ongoing effort on Wayland, since there are still many parts of work missing in order to have a full Plasma Wayland session to just work, but it&#8217;s impressive how fast it&#8217;s getting there.<br \/>\nIt was just a tiny part but is worth sharing it as it brings pretty pictures! (and shows how easy is to contribute).<br \/>\nThe popups of the plasma shell need custom positioning code as normal applications can&#8217;t position themselves anymore for security reasons, plus KWin uses its effects framework to do a couple of things on plasma panels and popups:<\/p>\n<ul>\n<li>Shadows: the shadows are rendered by KWin, they aren&#8217;t really a part of the window, as the shadow must not count anything in the position and resizing phase, but just a visual effect on it, it&#8217;s also more semantically correct.<\/li>\n<li>Background effects: both the panel and the popups have a blurred background plus a contrast\/saturation effect, to make it more readable and prettier.<\/li>\n<\/ul>\n<p>After hooking a protocol to control such effects into wayland, here&#8217;s the result, <em>almost<\/em> undistinguishable (there is still a pretty visible graphical issue, points for finding it) from your current X11 Plasma 5.4 session:<\/p>\n<p><a href=\"http:\/\/notmart.org\/blog\/wp-content\/uploads\/2015\/09\/snapshot5.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/notmart.org\/blog\/wp-content\/uploads\/2015\/09\/snapshot5-300x241.png\" alt=\"snapshot5\" width=\"300\" height=\"241\" class=\"aligncenter size-medium wp-image-6414\" srcset=\"https:\/\/notmart.org\/blog\/wp-content\/uploads\/2015\/09\/snapshot5-300x241.png 300w, https:\/\/notmart.org\/blog\/wp-content\/uploads\/2015\/09\/snapshot5.png 1024w, https:\/\/notmart.org\/blog\/wp-content\/uploads\/2015\/09\/snapshot5-624x500.png 624w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>So, what needed to be done?<\/p>\n<ul>\n<li>KWayland protocols: each KWin effect that can now be controlled with X properties need its own wayland protocol extension in order to achieve the same thing, I wrote one for blur behind and background contrast (shadow was already there). The good news here is that Martin is working on a tool to auto generate the binding code from the XML specification of the protocol.<\/li>\n<li>KWayland-integration repo: The effects that had KWndowSystem API to control them, need a Wayland implementation as well, this goes in the KWindowSystem wayland plugin contained in the kwayland-integration.git repo.<\/li>\n<li>Modify the KWin effect: then the kwin effect needs to read the data that the client wrote on the surface with the new kwayland protocol and control the effect, in  a way that is behaviorally identical to the X11 way, that came from reading X properties from the window<\/li>\n<\/ul>\n<p>As an &#8220;user&#8221; of the infrastructure, I&#8217;m very impressed about the work that went in the Wayland port of KWin and from the KWayland framework: it really makes using a <em>very<\/em> challenging and &#8220;peculiar&#8221; plain C API very easy and elegant in a way familiar with our cozy C++\/Qt world.<br \/>\nI can say that is a learning curve soft enough for everyone to jump in and help the big scary transition if they feel to.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the last few days I decided to help Martin a bit with the ongoing effort on Wayland, since there are still many parts of work missing in order to have a full Plasma Wayland session to just work, but it&#8217;s impressive how fast it&#8217;s getting there. It was just a tiny part but is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[2,154,7,139,153],"class_list":["post-6413","post","type-post","status-publish","format-standard","hentry","category-software","tag-kde","tag-kwin","tag-plasma","tag-plasma5","tag-wayland"],"_links":{"self":[{"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/posts\/6413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/comments?post=6413"}],"version-history":[{"count":6,"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/posts\/6413\/revisions"}],"predecessor-version":[{"id":6420,"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/posts\/6413\/revisions\/6420"}],"wp:attachment":[{"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/media?parent=6413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/categories?post=6413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notmart.org\/blog\/wp-json\/wp\/v2\/tags?post=6413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}