[Technical Question] - How to trigger the applets actions menu from a second window of a Panel? (e.g. Now Dock 0.5)

Michail Vourlakos mvourlakos at gmail.com
Tue Nov 29 16:51:46 UTC 2016


Hello everyone,


A couple of days ago, in a discussion with plasma developers it was 
decided that Now Dock should better support window masking (for 
animations etc.) in a separate window than the main panel one. What is 
doing in the following 0.5 version is a technique based on a plasma 
mobile technique in which all the presentation of the plasmoids for the 
panel are done in a secondary window except on widgets unlocked state 
for which a reparenting is taken into place and the plasmoids are moved 
to original panel window in order for the user to be able to add, 
remove, move plasmoids etc... This has worked flawlessly and the 
animations and masking (transparent areas are allowing the mouse events 
to go to underneath windows) are working great.


But one small problem arose with this approach. The plasmoids when they 
are in the secondary window (in locked widgets state that is) do not 
show their menu with right-click. As it appears, I should provide that 
functionality from my c++ code but I have a problem, the code which is 
doing its magic is from containmentinterface.cpp:

----

    Plasma::Applet *applet = 0;
     foreach (QObject *appletObject, m_appletInterfaces) {
         if (AppletInterface *ai = qobject_cast<AppletInterface 
*>(appletObject)) {
             if (ai->isVisible() && ai->contains(ai->mapFromItem(this, 
event->posF()))) {
                 applet = ai->applet();
                 break;
             } else {
                 ai = 0;
             }
         }
     }

---

for the m_appletsInterfaces I can use the plasmoid.applets variable to 
get them but AppletInterface is not exposed in plasma library and I need 
it in order to get its applet()   ///Plasma::Applet


any ideas ???


regards,

michail

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161129/58ba2da4/attachment.html>


More information about the Plasma-devel mailing list