[plasma/kwin] /: [rules] Allow setting WindowType to KDE specific window type OSD

David Edmundson null at kde.org
Wed Jul 7 11:32:43 BST 2021


Git commit e35ed5088ab358536046ba6e38ef707257d75013 by David Edmundson.
Committed on 07/07/2021 at 10:32.
Pushed by davidedmundson into branch 'master'.

[rules] Allow setting WindowType to KDE specific window type OSD

An example use case is allowing a user to write rules to put firefox
Picture in picture windows above fullscreen users

CCBUG: 439573

M  +1    -0    doc/windowspecific/index.docbook
M  +2    -1    src/kcmkwin/kwinrules/rulesmodel.cpp
M  +1    -1    src/rulesettings.kcfg

https://invent.kde.org/plasma/kwin/commit/e35ed5088ab358536046ba6e38ef707257d75013

diff --git a/doc/windowspecific/index.docbook b/doc/windowspecific/index.docbook
index dac04f585..5b9698b6f 100644
--- a/doc/windowspecific/index.docbook
+++ b/doc/windowspecific/index.docbook
@@ -497,6 +497,7 @@ and <guibutton>Move Down</guibutton> buttons effects on how they are applied.</p
 <listitem><para>Splash Screen</para></listitem>
 <listitem><para>Desktop</para></listitem>
 <listitem><para>Standalone Menubar</para></listitem>
+<listitem><para>On Screen Display</para></listitem>
 </itemizedlist>
 
      </listitem>
diff --git a/src/kcmkwin/kwinrules/rulesmodel.cpp b/src/kcmkwin/kwinrules/rulesmodel.cpp
index b063a9222..2b18c9036 100644
--- a/src/kcmkwin/kwinrules/rulesmodel.cpp
+++ b/src/kcmkwin/kwinrules/rulesmodel.cpp
@@ -721,7 +721,8 @@ QList<OptionsModel::Data> RulesModel::windowTypesModelData() const
         { NET::Splash,  i18n("Splash Screen")     , QIcon::fromTheme("embosstool")               },
         { NET::Desktop, i18n("Desktop")           , QIcon::fromTheme("desktop")                  },
         // { NET::Override, i18n("Unmanaged Window")   },  deprecated
-        { NET::TopMenu, i18n("Standalone Menubar"), QIcon::fromTheme("open-menu-symbolic")       }
+        { NET::TopMenu, i18n("Standalone Menubar"), QIcon::fromTheme("open-menu-symbolic")       },
+        { NET::OnScreenDisplay, i18n("On Screen Display"), QIcon::fromTheme("osd-duplicate")     }
     };
     return modelData;
 }
diff --git a/src/rulesettings.kcfg b/src/rulesettings.kcfg
index 0cb10da7e..8b5e9b738 100644
--- a/src/rulesettings.kcfg
+++ b/src/rulesettings.kcfg
@@ -182,7 +182,7 @@
     <entry name="type" type="Int">
       <label>Set window type to</label>
       <min code="true">NET::Normal</min>
-      <max code="true">NET::Splash</max>
+      <max code="true">NET::CriticalNotification</max>
       <default code="true">NET::Unknown</default>
     </entry>
     <entry name="typerule" type="Int">


More information about the kde-doc-english mailing list