dbusmenuqt and left-click

Andriy Rysin arysin at gmail.com
Wed Aug 25 23:49:03 BST 2010

2010/8/20 Christian Esken <esken at kde.org>

> Hello Andriy,
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 :)


P.S. now that kxkb is gone I start to miss its shortness, may be I should
just use KLI for keyboard layout indicator :)

> I tried your hint to not set associatedWidget for KMix, as KMix has
> comparable
> requirements.
> My problem is now: When I don't set an associated widget, the
> "mimimizeRestore" won't show up in the context menu. Also i cannot call the
> mimimizeRestore() functionality from the KMix dock area popup window, which
> I
> need.
> (It doesn't work, as the KStatusNotifierItemPrivate code operates on the
> associatedWidget Object, which is now undefined).
> I am currently considering to copy a lot of code, e.g. from
> minimizeRestore(bool show), but would like to avoid it, as it contains a
> lot
> of sophisticated #ifdef Q_WS_X11. Copying that code seems so wrong to me,
> so
> hopefully there is a better way.  See below for more detail.
> Any idea is very welcome.
>  Christian
> -----------------------------------------------------------------------------
> So what I need is:
> - Right-click should show menu with mimimizeRestore
> - Left-click should "show popup" or "show main window"
> And that means
> 1) I need to do my own left-click handling, even though there is already is
> an
> associatedWidget.
> 2) Define own context menu entries, but I still also need the original
> minimizeRestore action in there. I can't do it right now, as i can neither
> call KStatusNotifierItemPrivate::contextMenuAboutToShow(), nor do I have
> access to the essential checkVisibility() method [or possibly
> minimizeRestore(bool show)].
> 3) I need to execute the regular "left-click = show main window" action
>  [something like minimizeRestore(bool show)].
> Because of the implmentation details of KStatusNotifierItem(Private), I
> think
> copying code would currently be neccesary. (It could help, if left-click
> would
> not be hardcoded to do a minimizeRestore of the associatedWidget object).
> -----------------------------------------------------------------------------
> On Aug 5, 2010, at 5:10, Marco Martin <notmart at xxxxxxxxx> wrote:
> > On Thursday 05 August 2010, Andriy Rysin wrote:
> >> In keyboard layout indicator module I have a reaction to left-click via
> >> activateRequested(), which is to toggle the layout to the next one (as
> >> opposed to right-click which brings menu). Though currently (with latest
> >> dbusmenuqt) no matter whether I click left or right button it's always
> >> context menu that appears.
> >>
> >> Is this a bug or something else is needed to make activateRequested()
> work?
> >
> > yes, it was a bug.
> > i did fix it yesterday for another problem (korgac showing the same
> problem)
> >
> > now if you -don't- set an associatedwidget the signal will work.
> > if you set the menu, you'll get the menu with both mouse buttons.
> > the keyboard layout indicator seems to work after the fix.
> Works now, thanks!
> Andriy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100825/91bff754/attachment.htm>

More information about the kde-core-devel mailing list