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

List:       kde-core-devel
Subject:    Re: dbusmenuqt and left-click
From:       Andriy Rysin <arysin () gmail ! com>
Date:       2010-08-25 22:49:03
Message-ID: AANLkTimeoYninuBb=xkPEwpKrqgo4Y_2wNiHZ6a9-H65 () mail ! gmail ! com
[Download RAW message or body]

2010/8/20 Christian Esken <esken@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 :)

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 <notmart@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
>

[Attachment #3 (text/html)]

<div class="gmail_quote">2010/8/20 Christian Esken <span dir="ltr">&lt;<a \
href="mailto:esken@kde.org">esken@kde.org</a>&gt;</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&#39;t set an associated widget, the<br>
&quot;mimimizeRestore&quot; won&#39;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&#39;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 &quot;show popup&quot; or &quot;show main window&quot;<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&#39;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 &quot;left-click = show main window&quot; 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 &lt;notmart@xxxxxxxxx&gt; wrote:<br>
<br>
&gt; On Thursday 05 August 2010, Andriy Rysin wrote:<br>
&gt;&gt; In keyboard layout indicator module I have a reaction to left-click via<br>
&gt;&gt; activateRequested(), which is to toggle the layout to the next one (as<br>
&gt;&gt; opposed to right-click which brings menu). Though currently (with latest<br>
&gt;&gt; dbusmenuqt) no matter whether I click left or right button it&#39;s \
always<br> &gt;&gt; context menu that appears.<br>
&gt;&gt;<br>
&gt;&gt; Is this a bug or something else is needed to make activateRequested() \
work?<br> &gt;<br>
&gt; yes, it was a bug.<br>
&gt; i did fix it yesterday for another problem (korgac showing the same problem)<br>
&gt;<br>
&gt; now if you -don&#39;t- set an associatedwidget the signal will work.<br>
&gt; if you set the menu, you&#39;ll get the menu with both mouse buttons.<br>
&gt; the keyboard layout indicator seems to work after the fix.<br>
Works now, thanks!<br>
<br>
Andriy<br>
</blockquote></div><br>



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

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