<div class="gmail_quote">2010/8/20 Christian Esken <span dir="ltr"><<a href="mailto:esken@kde.org">esken@kde.org</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello Andriy,<br></blockquote><div>I think you wanted to address Marco instead of me as I would not be able to help much with KStatusNotifierItem - I am just using it in keyboard layout indicator :)<br><br>Andriy<br><br>P.S. now that kxkb is gone I start to miss its shortness, may be I should just use KLI for keyboard layout indicator :)<br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
I tried your hint to not set associatedWidget for KMix, as KMix has comparable<br>
requirements.<br>
<br>
My problem is now: When I don't set an associated widget, the<br>
"mimimizeRestore" won't show up in the context menu. Also i cannot call the<br>
mimimizeRestore() functionality from the KMix dock area popup window, which I<br>
need.<br>
(It doesn't work, as the KStatusNotifierItemPrivate code operates on the<br>
associatedWidget Object, which is now undefined).<br>
<br>
I am currently considering to copy a lot of code, e.g. from<br>
minimizeRestore(bool show), but would like to avoid it, as it contains a lot<br>
of sophisticated #ifdef Q_WS_X11. Copying that code seems so wrong to me, so<br>
hopefully there is a better way.  See below for more detail.<br>
<br>
Any idea is very welcome.<br>
<br>
  Christian<br>
<br>
-----------------------------------------------------------------------------<br>
So what I need is:<br>
- Right-click should show menu with mimimizeRestore<br>
- Left-click should "show popup" or "show main window"<br>
<br>
And that means<br>
1) I need to do my own left-click handling, even though there is already is an<br>
associatedWidget.<br>
2) Define own context menu entries, but I still also need the original<br>
minimizeRestore action in there. I can't do it right now, as i can neither<br>
call KStatusNotifierItemPrivate::contextMenuAboutToShow(), nor do I have<br>
access to the essential checkVisibility() method [or possibly<br>
minimizeRestore(bool show)].<br>
3) I need to execute the regular "left-click = show main window" action<br>
  [something like minimizeRestore(bool show)].<br>
<br>
Because of the implmentation details of KStatusNotifierItem(Private), I think<br>
copying code would currently be neccesary. (It could help, if left-click would<br>
not be hardcoded to do a minimizeRestore of the associatedWidget object).<br>
-----------------------------------------------------------------------------<br>
<br>
<br>
<br>
On Aug 5, 2010, at 5:10, Marco Martin <notmart@xxxxxxxxx> wrote:<br>
<br>
> On Thursday 05 August 2010, Andriy Rysin wrote:<br>
>> In keyboard layout indicator module I have a reaction to left-click via<br>
>> activateRequested(), which is to toggle the layout to the next one (as<br>
>> opposed to right-click which brings menu). Though currently (with latest<br>
>> dbusmenuqt) no matter whether I click left or right button it's always<br>
>> context menu that appears.<br>
>><br>
>> Is this a bug or something else is needed to make activateRequested() work?<br>
><br>
> yes, it was a bug.<br>
> i did fix it yesterday for another problem (korgac showing the same problem)<br>
><br>
> now if you -don't- set an associatedwidget the signal will work.<br>
> if you set the menu, you'll get the menu with both mouse buttons.<br>
> the keyboard layout indicator seems to work after the fix.<br>
Works now, thanks!<br>
<br>
Andriy<br>
</blockquote></div><br>