← Back to team overview

unity-dev team mailing list archive

Re: [Ayatana-dev] Mentorship, Signal Propagation in Unity

 

On Wed, Jan 5, 2011 at 11:05 AM, Josh Headapohl <joshhead@xxxxxxxxx> wrote:
> Thanks Sam, for replying to my question and for pointing me in the right
> direction.
> I didn't see the inheritance structure before and everything makes a little
> more sense now.
> You are correct that the code that handles drag events does not look at
> which button is pressed. The LauncherIcon class does handle clicks and
> quicklist creation, while drag events are handled by the Launcher class. If
> I add a check in the Launcher class to consider which button is pressed, I
> can prevent the right mouse button from initiating drags.

Cool, that's part one at least

> Unfortunately, whether or not the launcher icon is dragged, if the mouse is
> initially depressed over a launcher icon, the quicklist ignores or doesn't
> receive events until the mouse is released.

Yes, this is a bit of an annoying shortcoming (there is no way to
transfer the grab to another widget in nux). I think the way you will
need to do it is to XUngrabPointer (grep other bits of the code on how
to do this - I think the menus do it) and then then open the menu and
make sure it is "grabbed" currently.


Cheers,

Sam

> I guess that I am halfway to a functioning solution: The right mouse doesn't
> initiate launcher or icon drags, but I can't yet open the quicklist and make
> a selection in one click.
> Josh
>
>
> On Sun, Jan 2, 2011 at 8:12 PM, Sam Spilsbury <smspillaz@xxxxxxxxx> wrote:
>>
>> On Wed, Dec 29, 2010 at 12:27 PM, Josh Headapohl <joshhead@xxxxxxxxx>
>> wrote:
>> > Hello, I'm working on bug 688830 in Unity, which is about letting the
>> > user
>> > select a quicklist item with just one right click. Currently, you have
>> > to
>> > let go of the mouse button first or you will just start dragging the
>> > launcher icon. This behavior is annoying and the bug is tagged as
>> > bite-size
>> > so I decided to try to help fix it.
>> > Dieder Roche commented it could be "bitesize with good mentorship," so I
>> > hope I can get a little assistance here in figuring out Unity's
>> > technical
>> > design. Okay, maybe more than the design. :) There's a lot to take in.
>> > I see that when there is an OnMouseDown signal emitted, a Launcher
>> > instance
>> > will handle it, and I can see where later in the chain of method calls,
>> > the
>> > quicklist menu item is created and shown in LauncherIcon::RecvMouseDown.
>> > What I haven't found yet is what sends the OnMouseDown signal in the
>> > first
>> > place.
>> > For example, in Launcher.cpp line 186,
>> > OnMouseDown.connect  (sigc::mem_fun (this, &Launcher::RecvMouseDown));
>> > What is OnMouseDown and where is it instantiated? Does it happen outside
>> > of
>> > Unity or am I just overlooking the place where it is created?
>> > I think if I could see a higher level source of input events (or do I
>> > mean
>> > lower?) , if would be easier to see what to do with them further down
>> > the
>> > line.
>>
>> The launcher class has a fairly long inheritance tree:
>>
>> InputArea -> View -> Launcher.
>>
>> InputArea is found in nux/Nux/InputArea.h/cpp . It handles raw events
>> (either from X11 or elsewhere) and makes the OnMouseDown etc signals
>> actually emit () once appropriate events are recieved.
>>
>> I have not looked at this particular code in detail, but I would
>> assume  that whatever LauncherIcon::OnMouseDown is connected to
>> handles the quicklist creation, button clicks and dragging - although
>> the code that does the dragging isn't checking which button is
>> actually pressed.
>>
>> Regards,
>>
>> Sam
>>
>> > Also, if it sounds like I'm approaching the whole problem the wrong way,
>> > feel free to point me in a new direction.
>> > Thanks,
>> > Josh
>> > https://bugs.launchpad.net/unity/+bug/688830
>> > _______________________________________________
>> > Mailing list: https://launchpad.net/~ayatana-dev
>> > Post to     : ayatana-dev@xxxxxxxxxxxxxxxxxxx
>> > Unsubscribe : https://launchpad.net/~ayatana-dev
>> > More help   : https://help.launchpad.net/ListHelp
>> >
>> >
>>
>>
>>
>> --
>> Sam Spilsbury
>
>



-- 
Sam Spilsbury



Follow ups

References