-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mouse event propagation after surface.setSize() doesn't fully work outside initial window size region #452
Comments
This sounds like a bug inside controlp5. Also with 4.0 you can/should use |
I couldn't get any region to detect the mousereleased event in beta 7. i didn't test beta 6 because of the file issue, however beta 5 could detect the event without issue. is there an example of beta 7 successfully handling mouse events such as mousereleased? update: the issue disappeared in a later iteration, so not sure what to make of it |
Thanks Ben. I tried with windowResize() and had the same results (also, good to know about windowResize() 😄 ). It appears that there is a related ControlP5 issue going back to November 2021 that experiences the same problem, though using setResizable() and reflowing the UI as the window scales ( sojamo/controlp5#175 ). I can repro their issue in 4.0b7 and 3.5.4. Both this issue above and the ControlP5 code (which hasn't been updated in 7-8 years) utilize registerMethod calls to update layout or catch mouse events. Could there be something in this chain that isn't passing the right canvas size? |
Sorry, I can't speak to the controlp5 code. It's possible they were relying on an undocumented feature of how |
Closing this for now since it seems to be a controlp5 issue; please report it with that project so it can get sorted out, or report back here if there's in fact a Processing bug. |
This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs. |
Description
In our existing app (SquiggleDraw), we start with an app window size of 100x100 and resize after startup as we load an image to process (we also resize on user-triggered image load). We use ControlP5 for GUI, which exists on the left side of the window area (a roughly 200x800px UI area).
In 4.0b7, mouse hover and press events do not get propagated to the ControlP5 UI widgets outside of the initial 100x100px area, but do work in the main app (e.g.: mousePressed). However, mouse drag events do work as you can click a UI widget within the initial 100x100px bounds and it responds to drags outside those bounds (e.g.: a slider control).
Expected Behavior
In 3.5.4, the ControlP5 GUI is responsive outside of the initial 100x100px area after loading the startup image and calling surface.setSize().
Current Behavior
In 4.0b7, the GUI is only fully responsive within the original 100x100px window area, even though the app window is now much larger after calling surface.setSize().
Steps to Reproduce
The following minimal code example demonstrates the issue.
The top slider responds to hover and press events only within the initial window size, represented by the rectangle. Clicking the top slider within the initial window size and dragging beyond the initial bounds does work.
The bottom slider does not respond to any mouse events.
Minimal code example (requires ControlP5 library):
Your Environment
Possible Causes / Solutions
It's possible this is not related to mouse handling at all, but rather something in surface.setSize() not updating internals fully. It's also entirely possible this is something within ControlP5 that needs updating, though since things work within that initial window area, I'm leaning towards this not being the case.
The text was updated successfully, but these errors were encountered: