Summary: | NewtCanvasAWT.setCursor doesn't retain the set cursor | ||
---|---|---|---|
Product: | [JogAmp] Newt | Reporter: | William Bittle <wjbittle> |
Component: | awt | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | --- | ||
Version: | 1 | ||
Hardware: | pc_x86_64 | ||
OS: | windows | ||
Type: | --- | SCM Refs: | |
Workaround: | --- | ||
Attachments: | Not a junit test but illustrates the problem |
Description
William Bittle
2012-05-07 22:24:46 CEST
setCursor(..) is an AWT method / functionality and only works while the mouse cursor is within it's native peer bounds. Even thought NewtCanvasAWT is derived from AWT Canvas and hence an AWT component allowing you to call AWT's setCursor(..), it adds a native NEWT child to the AWT native peer. The NEWT child is ontop of the AWT native peer and visible, hiding the AWT one. This implies that the AWT native peer cursor setting is inactive so to speak while NEWT is ontop. Pls use NEWT's setPointerVisible(..) pointer methods to make the cursor disappear. (In reply to comment #1) > setCursor(..) is an AWT method / functionality and only works while the mouse > cursor > is within it's native peer bounds. > > Even thought NewtCanvasAWT is derived from AWT Canvas and hence an > AWT component allowing you to call AWT's setCursor(..), > it adds a native NEWT child to the AWT native peer. > The NEWT child is ontop of the AWT native peer and visible, > hiding the AWT one. > > This implies that the AWT native peer cursor setting is inactive > so to speak while NEWT is ontop. > > Pls use NEWT's setPointerVisible(..) pointer methods to make the cursor > disappear. To make sure it's clear, the problem here isn't that the cursor shouldn't be visible, but that it should be changed to another cursor (then changed back at some later point in time). Are you suggesting something like this?: 1. setPointerVisible(false) to hide the cursor 2. render the cursor manually using a quad + texture that follows the cursor 3. then use setPointerVisible(true) when it should change back William (In reply to comment #2) > To make sure it's clear, the problem here isn't that the cursor shouldn't be > visible, but that it should be changed to another cursor (then changed back at > some later point in time). Both are related to the native windowing toolkit's restriction of having a native child window (NEWT) opaque on top of the parent (NewtCanvasAWT). Your use case goes a bit further, i.e. changing the mouse cursor instead of simply turning it off. Since this feature is not [yet] implemented in NEWT your 'workaround' as you describe below seems to be a good idea where you render the cursor as a HUD above your geometry using OpenGL. > > Are you suggesting something like this?: > 1. setPointerVisible(false) to hide the cursor > 2. render the cursor manually using a quad + texture that follows the cursor > 3. then use setPointerVisible(true) when it should change back > Due to NEWT's lack of changing the cursor .. this would be a workaround. The missing NEWT feature is due to lack of time to properly impl. this feature for X11, Windows and OSX. However, if you or somebody else is willing to do so - we are for sure integrating it into NEWT. > William ~Sven |