Skip to content
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

enhancement: Layers levels and mouse pass through problem #465

Closed
baleksey opened this issue Jan 17, 2024 · 9 comments
Closed

enhancement: Layers levels and mouse pass through problem #465

baleksey opened this issue Jan 17, 2024 · 9 comments
Labels
waiting-for-release Finished, but not shipped yet.

Comments

@baleksey
Copy link

There are several cases when we need to place some temporary popup element on top of current rendered scene:

  1. Drop down list
  2. Modal dialog
  3. Popup color picker etc

But we have a problems with it right now:
Elements under that element (with layer: "-99") still react on mouse move/click/wheel etc. So we easily can click on invisible element behind our modal dialog accidently.

Is there a way right now to "don't allow pass through mouse events" for "rect"? So we can assign this property to our popup element background or the whole screen overlay to stop that behaviour for elements behind.

@baleksey baleksey changed the title Layers levels and mouse through problem Layers levels and mouse pass through problem Jan 17, 2024
@marc2332
Copy link
Owner

Yeah... This is caused by the lack of event bubbling. When Dioxus 0.5 gets released ( a matter of weeks from what they have said in the discord) I should be able to fix this 😢

@marc2332
Copy link
Owner

marc2332 commented Jan 17, 2024

I am sorry I cannot fix this right now, I wish I could, it has prevented me from developing new features such as popups and other ideas... But again, once Dioxus 0.5 gets released, I should be able to implement a proper event bubbling system, which should fix this cross-layer issues 🙏

@baleksey
Copy link
Author

Omg, this issue exist for too long already... The one way I thought it can be hacked (for example in case of modal dialog):

  1. Just before we are going to invoke popup element we capture the whole gui skia canvas and store it as image etc.
  2. Then we rerender all gui, but leave only 2 layers: background "rect" with image from step 1 (dimmed or blurred, or just as is) and draw our dialog rect on top of it.

In this way we "see" our background gui and think it still there :) but no more worries about clicks etc.

What do you think? Can this workaround can be done the easiest possible way?

@marc2332
Copy link
Owner

Thats very inefficient and the problems isn't about rendering, it's not even related to skia, is just that event bubbling across different components in Dioxus is currently broken in the latest stable release

@baleksey
Copy link
Author

baleksey commented Jan 17, 2024

I got it. I just thinking about how to make current project working (with all that popup things) while we are waiting for the fix for an known issue since july...

@marc2332
Copy link
Owner

I have gotten a decent implementation in #268, so when Dioxus 0.5 goes out I will release Freya 0.2 shortly after

@marc2332
Copy link
Owner

This is fixed in the main branch btw

@marc2332 marc2332 added the waiting-for-release Finished, but not shipped yet. label Apr 1, 2024
@marc2332 marc2332 changed the title Layers levels and mouse pass through problem enhancement: Layers levels and mouse pass through problem Apr 22, 2024
@marc2332
Copy link
Owner

Fixed in 0.2 :)

@baleksey
Copy link
Author

Thanks, mate! Started making my own Skia based gui while tired of waiting for Dioxus to update things. Not an easiest way but pretty interesting :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-release Finished, but not shipped yet.
Projects
None yet
Development

No branches or pull requests

2 participants