[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Review Request: Add appmenu support to kwin
From:       Bellegarde_Cédric <gnumdk () gmail ! com>
Date:       2012-10-05 17:14:10
Message-ID: 20121005171410.2485.18939 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Oct. 5, 2012, 2:54 p.m., Aaron J. Seigo wrote:
> > kwin/clients/oxygen/oxygenclient.cpp, lines 212-216
> > <http://git.reviewboard.kde.org/r/104344/diff/21/?file=88394#file88394line212>
> > 
> > this now appears visually a bit reversed:
> > 
> > the application specific menu appears under a generic menu icon and the generic \
> > window actions appears under the window's (specific) icons :) 
> > i'd recommend that, at least if App Menu is turned on, the application menu \
> > appear in the button with the window's icon. 
> > alternatively, instead of a completely separate button, these 2 buttons could be \
> > merged into 1, with the window actions menu becoming a submenu (perhaps at the \
> > end of the menu?) and the app menu populating the rest of the menu. 
> > this limits the # of buttons and resolves the generic/specific icon issue AND as \
> > an extra special bonus it gives the menu a keyboard shortcut!
> 
> Bellegarde Cédric wrote:
> It's not possible, we remove menu drawing from kwin and put it in kded-module... 
> Kwin just do a dbus call: org.kde.kded /modules/appmenu org.kde.kded.showMenu(int \
> x, int y, qulonglong WId) 
> Maybe renaming "Window Menu" to "Window actions" may fix issue ?
> 
> Aaron J. Seigo wrote:
> uh-oh. this may also create problems for usage outside of Plasma Desktop. i suppose \
> we could patch the kded module to do a QML version of the menu that is touch \
> friendly, which we need for Plasma Active, which can optionally replace \
> VerticalMenu in the kded module .. but then we'll run into the same issues there as \
> with kwin -> if we wish to merge this menu with other entries already on the Peek \
> panel in Plasma Active, we won't be able to. which means a whole other button just \
> for the app menu. this is doable, i suppose, just not perfect. 
> personally, i think the design we use for the system tray is a bit nicer -> the \
> menu is simply advertised and the host actually does the rendering. 
> looking a bit more at the kded module code, we could patch it for Plasma Active \
> (though this is going to be a little invasive, and i'm not 100% sure what the \
> cleanest way to do it would be .. a config option where which style to use is \
> defined? a check for the KDE_PLASMA_COMPONENTS_PLATFORM env var and if it is set \
> try and load relevant QML? full on plugins? we really will want to be able to \
> switch this at runtime (consider the use case when docking a touch device ...). \
> bonus points for nominal extensibility, but perhaps not a requirement. 
> for Plasma Desktop, and specifically KWin in that scenario, this becomes a real \
> issue as it limits what can be done leading to the sub-optimal result described in \
> my original comment. we obviously don't want the code in the kded module to be \
> duplicated all over the place though ... 
> and i wonder how this approach will work under wayland? i imagine that either the \
> workspace shell or the window manager will need to take care of this in any case \
> due to relative positioning of windows being restricted (afaiu it anyways). 
> *ponders* what about having the ability to register a DBus interface that manages \
> the menu display. then the shell could optionally provide the rendering service and \
> use the kded module as the central management location for the data? then the QML \
> presentation could be put into plasma-device, and when kwin is running in Desktop \
> it could handle it? (in fact -> default could be kwin, and then the shell could \
> "steal" the interface and hold on to it; a neat feature of DBus)

kded-appmenu is doing the rendering because libdbusmenu-qt only give us a QMenu \
(issue pointed by Alex Fiestas) so not really usable with QML and because KWin devs \
tell me removing menu rendering from KWin was a good idea ;)

dbusmenu is deprecated, i think the first thing to do is to have a discussion with \
Canonical devs and Qt devs on what KDE needs for Qt version of GMenuModule (new dbus \
standard for menu used by gnome3 and developped by Canonical, it has really happened \
\o/ ).

For now, the only way to have a pretty support for plasma active should be, i think, \
to create a lib based on Alex Fiestas krunner-appmenu works (using directly dbusmenu \
API instead of libdbusmenu-qt).


- Bellegarde


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104344/#review19968
-----------------------------------------------------------


On Oct. 4, 2012, 11:27 a.m., Bellegarde Cédric wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104344/
> -----------------------------------------------------------
> 
> (Updated Oct. 4, 2012, 11:27 a.m.)
> 
> 
> Review request for kwin.
> 
> 
> Description
> -------
> 
> Here a patch to add appmenu support to kwin via a menu button in titlebar
> 
> Works by Lionel Chauvin and me, original review request: \
> https://git.reviewboard.kde.org/r/101162/ 
> It depends on:
> http://quickgit.kde.org/index.php?p=kded-appmenu.git
> 
> It looks like this:
> https://www.youtube.com/watch?v=x1bm7Q6_SH4&hd=1
> 
> New version, all drawing code moved to kded-appmenu as asked.
> 
> 
> Diffs
> -----
> 
> kcontrol/style/finetuning.ui 2d384bc 
> kcontrol/style/kcmstyle.h cd1472f 
> kcontrol/style/kcmstyle.cpp 849a49b 
> kwin/CMakeLists.txt 458c341 
> kwin/bridge.h 64108e5 
> kwin/bridge.cpp 6dbf1bd 
> kwin/client.h 130a67a 
> kwin/client.cpp 07ffe03 
> kwin/clients/oxygen/oxygenbutton.h ea11717 
> kwin/clients/oxygen/oxygenbutton.cpp 28aa8b1 
> kwin/clients/oxygen/oxygenclient.cpp 0b39d7d 
> kwin/clients/oxygen/oxygenfactory.h b38b097 
> kwin/clients/oxygen/oxygenfactory.cpp 5502a6a 
> kwin/config-kwin.h.cmake e5ed2a6 
> kwin/kcmkwin/kwindecoration/buttons.cpp 2d12244 
> kwin/kcmkwin/kwindecoration/preview.h 52645fd 
> kwin/kcmkwin/kwindecoration/preview.cpp 587df7c 
> kwin/libkdecorations/kcommondecoration.h 3fe9fcf 
> kwin/libkdecorations/kcommondecoration.cpp e3e884b 
> kwin/libkdecorations/kdecoration.h 7b1f3e0 
> kwin/libkdecorations/kdecoration.cpp 71f4f8d 
> kwin/libkdecorations/kdecorationbridge.h b7d0619 
> kwin/useractions.cpp 8fcdba2 
> kwin/workspace.h c4fd281 
> kwin/workspace.cpp e86e39e 
> 
> Diff: http://git.reviewboard.kde.org/r/104344/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Bellegarde Cédric
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/104344/">http://git.reviewboard.kde.org/r/104344/</a>
  </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 5th, 2012, 2:54 p.m., <b>Aaron J. \
Seigo</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/104344/diff/21/?file=88394#file88394line212" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/clients/oxygen/oxygenclient.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 21)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">namespace Oxygen</pre></td>

  </tr>
 </tbody>






 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">212</font></th>  <td bgcolor="#ffffff" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span \
class="k">case</span> <span class="nl">MenuButton:</span></pre></td>  <th \
bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">212</font></th>  <td bgcolor="#ffffff" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            \
<span class="k">case</span> <span class="nl">MenuButton:</span></pre></td>  </tr>

 </tbody>


 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">213</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span \
class="k">return</span> <span class="k">new</span> <span class="n">Button</span><span \
class="p">(</span><span class="o">*</span><span class="k">this</span><span \
class="p">,</span> <span class="n">i18n</span><span class="p">(</span><span \
class="s">&quot;Menu&quot;</span><span class="p">),</span> <span \
class="n">ButtonMenu</span><span class="p">);</span></pre></td>  <th \
bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">213</font></th>  <td bgcolor="#fdfebc" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            \
<span class="k">return</span> <span class="k">new</span> <span \
class="n">Button</span><span class="p">(</span><span class="o">*</span><span \
class="k">this</span><span class="p">,</span> <span class="n">i18n</span><span \
class="p">(</span><span class="s">&quot;<span class="hl">Window \
</span>Menu&quot;</span><span class="p">),</span> <span \
class="n">ButtonMenu</span><span class="p">);</span></pre></td>  </tr>

 </tbody>



 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">214</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  \
</tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">215</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            \
<span class="k">case</span> <span class="nl">AppMenuButton:</span></pre></td>  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">216</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            \
<span class="k">return</span> <span class="k">new</span> <span \
class="n">Button</span><span class="p">(</span><span class="o">*</span><span \
class="k">this</span><span class="p">,</span> <span class="n">i18n</span><span \
class="p">(</span><span class="s">&quot;Application Menu&quot;</span><span \
class="p">),</span> <span class="n">ButtonApplicationMenu</span><span \
class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this now appears \
visually a bit reversed:

the application specific menu appears under a generic menu icon and the generic \
window actions appears under the window&#39;s (specific) icons :)

i&#39;d recommend that, at least if App Menu is turned on, the application menu \
appear in the button with the window&#39;s icon.

alternatively, instead of a completely separate button, these 2 buttons could be \
merged into 1, with the window actions menu becoming a submenu (perhaps at the end of \
the menu?) and the app menu populating the rest of the menu.

this limits the # of buttons and resolves the generic/specific icon issue AND as an \
extra special bonus it gives the menu a keyboard shortcut!</pre>  </blockquote>



 <p>On October 5th, 2012, 3:40 p.m., <b>Bellegarde Cédric</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">It&#39;s not possible, \
we remove menu drawing from kwin and put it in kded-module...  Kwin just do a dbus \
call: org.kde.kded /modules/appmenu org.kde.kded.showMenu(int x, int y, qulonglong \
WId)

Maybe renaming &quot;Window Menu&quot; to &quot;Window actions&quot; may fix issue \
?</pre>  </blockquote>





 <p>On October 5th, 2012, 4:46 p.m., <b>Aaron J. Seigo</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">uh-oh. this may also \
create problems for usage outside of Plasma Desktop. i suppose we could patch the \
kded module to do a QML version of the menu that is touch friendly, which we need for \
Plasma Active, which can optionally replace VerticalMenu in the kded module .. but \
then we&#39;ll run into the same issues there as with kwin -&gt; if we wish to merge \
this menu with other entries already on the Peek panel in Plasma Active, we won&#39;t \
be able to. which means a whole other button just for the app menu. this is doable, i \
suppose, just not perfect.

personally, i think the design we use for the system tray is a bit nicer -&gt; the \
menu is simply advertised and the host actually does the rendering.

looking a bit more at the kded module code, we could patch it for Plasma Active \
(though this is going to be a little invasive, and i&#39;m not 100% sure what the \
cleanest way to do it would be .. a config option where which style to use is \
defined? a check for the KDE_PLASMA_COMPONENTS_PLATFORM env var and if it is set try \
and load relevant QML? full on plugins? we really will want to be able to switch this \
at runtime (consider the use case when docking a touch device ...). bonus points for \
nominal extensibility, but perhaps not a requirement.

for Plasma Desktop, and specifically KWin in that scenario, this becomes a real issue \
as it limits what can be done leading to the sub-optimal result described in my \
original comment. we obviously don&#39;t want the code in the kded module to be \
duplicated all over the place though ...

and i wonder how this approach will work under wayland? i imagine that either the \
workspace shell or the window manager will need to take care of this in any case due \
to relative positioning of windows being restricted (afaiu it anyways).

*ponders* what about having the ability to register a DBus interface that manages the \
menu display. then the shell could optionally provide the rendering service and use \
the kded module as the central management location for the data? then the QML \
presentation could be put into plasma-device, and when kwin is running in Desktop it \
could handle it? (in fact -&gt; default could be kwin, and then the shell could \
&quot;steal&quot; the interface and hold on to it; a neat feature of DBus)</pre>  \
</blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">kded-appmenu is doing the rendering because libdbusmenu-qt only give us \
a QMenu (issue pointed by Alex Fiestas) so not really usable with QML and because \
KWin devs tell me removing menu rendering from KWin was a good idea ;)

dbusmenu is deprecated, i think the first thing to do is to have a discussion with \
Canonical devs and Qt devs on what KDE needs for Qt version of GMenuModule (new dbus \
standard for menu used by gnome3 and developped by Canonical, it has really happened \
\o/ ).

For now, the only way to have a pretty support for plasma active should be, i think, \
to create a lib based on Alex Fiestas krunner-appmenu works (using directly dbusmenu \
API instead of libdbusmenu-qt).</pre> <br />




<p>- Bellegarde</p>


<br />
<p>On October 4th, 2012, 11:27 a.m., Bellegarde Cédric wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kwin.</div>
<div>By Bellegarde Cédric.</div>


<p style="color: grey;"><i>Updated Oct. 4, 2012, 11:27 a.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Here a patch to add appmenu support to kwin via a menu button in \
titlebar

Works by Lionel Chauvin and me, original review request: \
https://git.reviewboard.kde.org/r/101162/

It depends on:
http://quickgit.kde.org/index.php?p=kded-appmenu.git

It looks like this:
https://www.youtube.com/watch?v=x1bm7Q6_SH4&amp;hd=1

New version, all drawing code moved to kded-appmenu as asked.</pre>
  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kcontrol/style/finetuning.ui <span style="color: grey">(2d384bc)</span></li>

 <li>kcontrol/style/kcmstyle.h <span style="color: grey">(cd1472f)</span></li>

 <li>kcontrol/style/kcmstyle.cpp <span style="color: grey">(849a49b)</span></li>

 <li>kwin/CMakeLists.txt <span style="color: grey">(458c341)</span></li>

 <li>kwin/bridge.h <span style="color: grey">(64108e5)</span></li>

 <li>kwin/bridge.cpp <span style="color: grey">(6dbf1bd)</span></li>

 <li>kwin/client.h <span style="color: grey">(130a67a)</span></li>

 <li>kwin/client.cpp <span style="color: grey">(07ffe03)</span></li>

 <li>kwin/clients/oxygen/oxygenbutton.h <span style="color: \
grey">(ea11717)</span></li>

 <li>kwin/clients/oxygen/oxygenbutton.cpp <span style="color: \
grey">(28aa8b1)</span></li>

 <li>kwin/clients/oxygen/oxygenclient.cpp <span style="color: \
grey">(0b39d7d)</span></li>

 <li>kwin/clients/oxygen/oxygenfactory.h <span style="color: \
grey">(b38b097)</span></li>

 <li>kwin/clients/oxygen/oxygenfactory.cpp <span style="color: \
grey">(5502a6a)</span></li>

 <li>kwin/config-kwin.h.cmake <span style="color: grey">(e5ed2a6)</span></li>

 <li>kwin/kcmkwin/kwindecoration/buttons.cpp <span style="color: \
grey">(2d12244)</span></li>

 <li>kwin/kcmkwin/kwindecoration/preview.h <span style="color: \
grey">(52645fd)</span></li>

 <li>kwin/kcmkwin/kwindecoration/preview.cpp <span style="color: \
grey">(587df7c)</span></li>

 <li>kwin/libkdecorations/kcommondecoration.h <span style="color: \
grey">(3fe9fcf)</span></li>

 <li>kwin/libkdecorations/kcommondecoration.cpp <span style="color: \
grey">(e3e884b)</span></li>

 <li>kwin/libkdecorations/kdecoration.h <span style="color: \
grey">(7b1f3e0)</span></li>

 <li>kwin/libkdecorations/kdecoration.cpp <span style="color: \
grey">(71f4f8d)</span></li>

 <li>kwin/libkdecorations/kdecorationbridge.h <span style="color: \
grey">(b7d0619)</span></li>

 <li>kwin/useractions.cpp <span style="color: grey">(8fcdba2)</span></li>

 <li>kwin/workspace.h <span style="color: grey">(c4fd281)</span></li>

 <li>kwin/workspace.cpp <span style="color: grey">(e86e39e)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/104344/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic