From kde-core-devel Wed Aug 25 22:49:03 2010 From: Andriy Rysin Date: Wed, 25 Aug 2010 22:49:03 +0000 To: kde-core-devel Subject: Re: dbusmenuqt and left-click Message-Id: X-MARC-Message: https://marc.info/?l=kde-core-devel&m=128277659521637 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--0016e65a0d4637363b048eadb00f" --0016e65a0d4637363b048eadb00f Content-Type: text/plain; charset=ISO-8859-1 2010/8/20 Christian Esken > 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 :) Andriy 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 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 > --0016e65a0d4637363b048eadb00f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2010/8/20 Christian Esken <= esken@kde.org>
Hello Andriy,
I think you wanted to address Marco inst= ead of me as I would not be able to help much with KStatusNotifierItem - I = am just using it in keyboard layout indicator :)

Andriy

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

=A0

I tried your hint to not set associatedWidget for KMix, as KMix has compara= ble
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 c= annot call the
mimimizeRestore() functionality from the KMix dock area popup window, which= I
need.
(It doesn't work, as the KStatusNotifierItemPrivate code operates on th= e
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 lo= t
of sophisticated #ifdef Q_WS_X11. Copying that code seems so wrong to me, s= o
hopefully there is a better way. =A0See below for more detail.

Any idea is very welcome.

=A0Christian

---------------------------------------------------------------------------= --
So what I need is:
- Right-click should show menu with mimimizeRestore
- Left-click should "show popup" or "show main window"<= br>
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 neit= her
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 =3D show main window"= ; action
=A0[something like minimizeRestore(bool show)].

Because of the implmentation details of KStatusNotifierItem(Private), I thi= nk
copying code would currently be neccesary. (It could help, if left-click wo= uld
not be hardcoded to do a minimizeRestore of the associatedWidget object). ---------------------------------------------------------------------------= --



On Aug 5, 2010, at 5:10, Marco Martin <notmart@xxxxxxxxx> wrote:

> On Thursday 05 August 2010, Andriy Rysin wrote:
>> In keyboard layout indicator module I have a reaction to left-clic= k 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 activateRequeste= d() work?
>
> yes, it was a bug.
> i did fix it yesterday for another problem (korgac showing the same pr= oblem)
>
> 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.<= br> > the keyboard layout indicator seems to work after the fix.
Works now, thanks!

Andriy

--0016e65a0d4637363b048eadb00f--