This is in v0.6.2, as I do not have v0.7 yet I cannot test this there.
If you have a button with a tooltip, and the tooltip appears under the cursor, when you click the event is consumed by the tooltip and not the button. So the button doesnt fire and your window loses focus. Note that the tooltip must appear directly under the cursor, if the tooltip is offset from the cursor (because you are near the edge of the screen) this doesn't happen. To fix this, you can set MousePassThroughEnabled to true on the tooltip window; I believe this should be the default setting for a tooltip window.
v0.6.2 Tooltips and MousePassThrough
Moderators: CEGUI MVP, CEGUI Team
v0.6.2 Tooltips and MousePassThrough
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: v0.6.2 Tooltips and MousePassThrough
Hi,
I can see how this could be an issue. The thing about having pass-through enabled is that the tool-tip is not then informed about the mouse entering it; this notification is normally used to reposition the tool-tip window. Obviously you can set the state manually, or edit the looknfeel to set it as the default (I assume you already did this for yourself, though? ). I guess a compromise would be to detect clicks on the tooltip window and dismiss it when the user clicks it?
CE.
I can see how this could be an issue. The thing about having pass-through enabled is that the tool-tip is not then informed about the mouse entering it; this notification is normally used to reposition the tool-tip window. Obviously you can set the state manually, or edit the looknfeel to set it as the default (I assume you already did this for yourself, though? ). I guess a compromise would be to detect clicks on the tooltip window and dismiss it when the user clicks it?
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: v0.6.2 Tooltips and MousePassThrough
Right, I forgot about the repositioning.
Discarding click events wouldn't really help, because your still throwing away input when the user was obviously trying to click something - so in this respect there is no difference than if the tooltip consumes it. Imho, tooltips should be treated as transparent entities, and so the click should go through to the underlying window.
I think there are a couple of options. First, the tooltip window could appear offset from the cursor instead of the top-left corner being directly under it. Second, you could just forward click events from the tooltip to the target window. I'm not sure which is better...
Discarding click events wouldn't really help, because your still throwing away input when the user was obviously trying to click something - so in this respect there is no difference than if the tooltip consumes it. Imho, tooltips should be treated as transparent entities, and so the click should go through to the underlying window.
I think there are a couple of options. First, the tooltip window could appear offset from the cursor instead of the top-left corner being directly under it. Second, you could just forward click events from the tooltip to the target window. I'm not sure which is better...
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: v0.6.2 Tooltips and MousePassThrough
I'll fix the positioning anyway, since that's a very easy fix and I think would be better if offset from the image edge instead of the mouse 'hot-spot'.
I may add an option for forwarding the events
CE.
I may add an option for forwarding the events
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: v0.6.2 Tooltips and MousePassThrough
I looked at the positioning of the tooltip and it already takes account of the mouse image size - so really, unless space is extremely limited, the tooltip should only ever rarely appear directly beneath the cursor. Indeed, when I fixed bugs and implemented suggestions previously regarding this, I had to disable the repositioning code entirely in order to test! So this makes me wonder how you guys are doing this in the first place
With reference to what I said about mouse clicks, I did not mean to discard them, rather I meant that if the mouse is within the tooltip and you click the mouse button, the tooltip would go away exposing whatever is beneath.
Having thought about the 'forwarding' a little, this is not so straight forward; the logic of many widgets will check where the mouse is and decide what to do based on that - this means that when the mouse down / up events are forwarded the behaviour will rarely be correct since - under the conditions described earlier in the thread - the mouse is 'in' the ToolTip window. So for example, a PushButton would not fire the Clicked event under this arrangement, and similarly, things like checkboxes and radio buttons would not change state.
This leaves us with the original point of MousePassThough - which is user-configurable anyway via the looknfeel, although - as already discussed - doing this will cause the tip repositioning code to not do anything
CE.
With reference to what I said about mouse clicks, I did not mean to discard them, rather I meant that if the mouse is within the tooltip and you click the mouse button, the tooltip would go away exposing whatever is beneath.
Having thought about the 'forwarding' a little, this is not so straight forward; the logic of many widgets will check where the mouse is and decide what to do based on that - this means that when the mouse down / up events are forwarded the behaviour will rarely be correct since - under the conditions described earlier in the thread - the mouse is 'in' the ToolTip window. So for example, a PushButton would not fire the Clicked event under this arrangement, and similarly, things like checkboxes and radio buttons would not change state.
This leaves us with the original point of MousePassThough - which is user-configurable anyway via the looknfeel, although - as already discussed - doing this will cause the tip repositioning code to not do anything
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: v0.6.2 Tooltips and MousePassThrough
CrazyEddie wrote:I looked at the positioning of the tooltip and it already takes account of the mouse image size - so really, unless space is extremely limited, the tooltip should only ever rarely appear directly beneath the cursor. Indeed, when I fixed bugs and implemented suggestions previously regarding this, I had to disable the repositioning code entirely in order to test! So this makes me wonder how you guys are doing this in the first place
But it only uses the mouse-image size if you are using a CEGUI mouse-cursor, otherwise it uses 0x0 for the size. This leads to the top-left corner of the tooltip being set to the position of the mouse
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: v0.6.2 Tooltips and MousePassThrough
Yeah, I can see how this could be an issue. The reason being, of course, is that CEGUI only knows about it's own mouse cursor. What you could do is set a dummy image of the appropriate size, then the behaviour would be correct (yes, that's a hack )
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Return to “Bug Reports, Suggestions, Feature Requests”
Who is online
Users browsing this forum: No registered users and 5 guests