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

"window_set_mouse_passthrough" With Transparent Window causes white flickering during runtime #80098

Closed
riazey opened this issue Jul 31, 2023 · 3 comments · Fixed by #80153
Closed

Comments

@riazey
Copy link

riazey commented Jul 31, 2023

Godot version

4.1.1.stable

System information

Godot v4.1.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1080 Ti (NVIDIA; 31.0.15.3179) - Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz (6 Threads)

Issue description

2bee64064748618fcec7520c87bb8813.mp4

When using window_set_mouse_passthrough with a transparent window in my project (a desktop Tamagotchi-like game) it causes white flickering/flashing across the newly set passthrough area (but not consistently)? I used the same setup in Godot 3.5 without flickering.
The issue is occurring in my project when the player performs an action that would update the mouse passthrough such as dragging the device around on the monitor or adding new charms/etc which change the clickable area (and is very disorienting)!

Steps to reproduce

Set up a clickthrough area with a transparent window + change the clickable area periodically.
Display > Window settings:
f5e9c76abf2620a9fac93d6c487ac283

Minimal reproduction project

This project is set up the way mine is which causes the MOST flickering (setting the window area to cover all monitors), however you can comment out set_game_window() to only cover a normal project area (flickering happens way less often but still happens).

Pressing TAB while the window is selected will cause the selected area to swap between full coverage and the little red square (present for your sanity). You will likely have to click the red square to actually focus on the window!

Test_passthrough_Flicker.zip

@Sauermann
Copy link
Contributor

I am unable to replicate the flickering on LInux:
Godot v4.2.dev (dcd187d) - Debian GNU/Linux 12 (bookworm) 12 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 (nvidia)

@bruvzg
Copy link
Member

bruvzg commented Aug 1, 2023

Unrelated to the issue, but covering multiple screens with the single window will not work in many cases (if screens have different DPI, for example).

In general, if you want a moveable window like one in your video, the best way to do it should be:

  • use as smaller window as possible (exactly the same as image bounding box).
  • only set a pass-through for the center cutout once, on window init.
  • use DisplayServer::mouse_get_position (mouse position in the screen coordinates) to change the actual position of the window.

@riazey
Copy link
Author

riazey commented Aug 1, 2023

@bruvzg Ah I see, good points!
I originally started this in 3 so I am loving the new DisplayServer features! I am unsure I'd be able to figure out the window moving physics for the swinging charms using a window on my own though.

It's meant to be always on top so I'd like it to be as non-intrusive click-area wise* as I can possibly get it, I've included a video of my project so you can see why it might still need the runtime updates- which is why I'm VERY appreciative you're taking this on for me! (I just noticed my pet up and left the room while recording it how rude).

The biggest issue I've seen when I had a 4k/2k/1k all at once monitor setup was that depending on your highest resolution monitor the "base" size of the tama changes so I made it so it's resizable!

09d8dc68d5c453d06c95a6dc33e15faf.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants