Board index FlightGear Development Canvas

Mouse button are inhibited whith Canvas window

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Mouse button are inhibited whith Canvas window

Postby F-JJTH » Tue May 13, 2014 8:31 pm

Hmm I think it's a bug but I'm really new into Canvas so I prefer to ask if I'm right or not.

1) Open a Canvas window (using the new GPSmap196 and click on the screen will open one)
2) Open the property browser

If the property browser is on top of the Canvas window your mouse has not effect in the property browser (can't scroll up/down, can't click, can't drag)
As soon as the Canvas window is not in the behind the property browser everything works fine.

It's reproducible with every GUI dialog and even with the menu (you can't click on menu item if the canvas window is behind the item)

If you try to move a dialog which is on top of the canvas window, the dialog will start to move only once your mouse is out of the canvas window.

Hoping this bug is easy to reproduce and easy to fix too ;)

Regards,
Clément
User avatar
F-JJTH
 
Posts: 697
Joined: Fri Sep 09, 2011 11:02 am

Re: Mouse button are inhibited whith Canvas window

Postby Hooray » Tue May 13, 2014 8:45 pm

yeah, it's a known issue - actually known since the early days (aka 2 years ago!) - the general consensus is that it's not a high priority because we're planning to get rid of PUI anyway and come up with Nasal framework to parse our existing GUI layouts/dialogs and turn them into Canvas widgets/dialogs, so Tom said that he preferred not to work around PUI bugs, which makes sense ...

I think we've had half a dozen discussions about this :D

And the wiki should actually contain 2-3 bold warnings about that, too :?:
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Mouse button are inhibited whith Canvas window

Postby F-JJTH » Tue May 13, 2014 8:52 pm

hmmm, so my apologies for the noise ;) (even feel you free to delete this topic)
User avatar
F-JJTH
 
Posts: 697
Joined: Fri Sep 09, 2011 11:02 am

Re: Mouse button are inhibited whith Canvas window

Postby Hooray » Tue May 13, 2014 8:54 pm

I guess it would be better to review our docs/examples (what did you use??) and fix up the docs to make the warning even more prominent, I'd suggest to add
{{Note|PUI dialogs and Canvas windows/dialogs are known to compete for mouse input}} somewhere
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Mouse button are inhibited whith Canvas window

Postby TheTom » Tue Jun 24, 2014 10:40 am

I've now pushed a fix which draws Canvas dialogs on top of PUI dialogs to match with the event handling order: https://gitorious.org/fg/flightgear/com ... f8bfdc0143
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Mouse button are inhibited whith Canvas window

Postby Hooray » Tue Jun 24, 2014 10:44 am

thanks, haven't yet looked at the patch - but does this also affect canvas tooltips for canvas dialogs as per viewtopic.php?f=71&t=22086 (I always found tooltips to be rendered behind the actual canvas) ?

I was going to show tooltips for navaids (frequencies) and airports (runways) using an interactive MapStructure layer that would respond to mouseover events, but they were always displayed behind the dialog.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Mouse button are inhibited whith Canvas window

Postby TheTom » Tue Jun 24, 2014 12:43 pm

You can always change the z-index of the tooltip to something >0 to show it on top of other (default) canvas windows.
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Mouse button are inhibited whith Canvas window

Postby Hooray » Tue Jun 24, 2014 12:55 pm

right, but I was just thinking that showing a tooltip for an existing canvas should always default to z_index+1 ? Maybe we should optionally accept a canvas argument so that this can be automatically handled ? I realize that it's currently "anonymous", i.e. works through fgcommands and doesn't know anything about the "parent" window - but API-wise, I'd kind of expect that setting a tooltip for a window would at least use z_index+1
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Mouse button are inhibited whith Canvas window

Postby TheTom » Tue Jun 24, 2014 1:38 pm

Now tooltips are always shown on top. There is no such thing as a parent window yet. For window/application modal dialogs I will add this after 3.2.
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am


Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest