Cannot switch cursor correctly between two windows (C++ SDK 2.0.2f2)
Posted: 12 Jun 2017, 09:23
Hi,
I created two windows, each with its own XAML root element. I set different cursors to the two elements:
Element 1
Element 2
Then I spawn the two windows (inside the same process) side by side, and move the mouse around.
1. First, I move the mouse to the first window -> the cursor changed to Hand cursor
2. Then I move the cursor to the second window -> the cursor changed to Arrow window
3. Then I move the cursor to the first window -> the cursor doesn't change (still Arrow).
Now, no matter what I do, the cursor keeps as Arrow.
I also observed that the callback to cursor handler (set by Noesis::GUI::SetCursorCallback) is only called twice at step 1 and 2 above, and never called again.
I suspect this is because NoesisGUI's View doesn't get MouseEnter/MouseLeave event forwarded by the client (there no API to forward them, I believe). Thus, it cannot detect that the mouse has leave or newly enter its view, which are the timing to call the callback to notify that the cursor may need to be set again.
I created two windows, each with its own XAML root element. I set different cursors to the two elements:
Element 1
Code: Select all
<Grid Cursor="Hand">
...
</Grid>
Code: Select all
<Grid Cursor="Arrow">
...
</Grid>
1. First, I move the mouse to the first window -> the cursor changed to Hand cursor
2. Then I move the cursor to the second window -> the cursor changed to Arrow window
3. Then I move the cursor to the first window -> the cursor doesn't change (still Arrow).
Now, no matter what I do, the cursor keeps as Arrow.
I also observed that the callback to cursor handler (set by Noesis::GUI::SetCursorCallback) is only called twice at step 1 and 2 above, and never called again.
I suspect this is because NoesisGUI's View doesn't get MouseEnter/MouseLeave event forwarded by the client (there no API to forward them, I believe). Thus, it cannot detect that the mouse has leave or newly enter its view, which are the timing to call the callback to notify that the cursor may need to be set again.