ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
60.95k stars 10.29k forks source link

FullScreen Mode Issue on MacBook Air M3: Toolbar Buttons Misaligned and Unresponsive Due to Notch #7786

Open qqiu opened 3 months ago

qqiu commented 3 months ago

Version/Branch of Dear ImGui:

Version v1.90.9, Branch: master

Back-ends:

imgui_impl_sdl3.cpp

Compiler, OS:

macOS 14.5

Full config/build information:

No response

Details:

I've encountered an issue when running an application on a MacBook Air with an M3 chip and a notch on the screen. In full screen mode, the positions of the top toolbar buttons are incorrectly calculated because of the notch. This miscalculation also causes the buttons to not respond to mouse interactions.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
MoreCodeToExplainMyIssue();
ImGui::End();
ocornut commented 3 months ago

Please try open Tools->Metrics and report mouse inputs coordinates in a video showcasing the problem. It would also be good to see if the same issue happens with other backends.

qqiu-cyt commented 3 months ago

To update my earlier description: the position offset caused by the notch affects all widgets, not just the top toolbar buttons. The attached screenshot shows the cursor positioned well above the "Inputs" menu item, which is nonetheless highlighted. ImGui_Demo_Window

qqiu-cyt commented 3 months ago

MacBook with the M2 chip also faces the same issue in fullscreen mode, since it has a display with a notch as well.