-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Bug] Certain tooltips steal focus from main window #2113
Comments
Thanks for the report. I am not able to reproduce this problem. The description for reproduction is too vague so I tried a few things:
If the issue here is not covered by any of the cases above, please post a set of step by step instructions for reproduction with as much detail as possible. Even if it seems that it is not necessary to add some detail it may help to mention it so that we don't have to try all the alternative steps that are possible and may be related to the issue. |
I have not tried to reproduce on other operating systems or window managers, only with Xfce on Debian. That is likely why you are having issues reproducing the issue. On my system it is very easy to reliably reproduce by hovering over an underlined error in the pattern editor. The main window loses focus (most notably indicated by the window decoration styling changing to the unfocused style) and cannot be typed in until the tooltip is moved away from. I will try to reproduce this issue on a couple other window managers, and on a clean slate Xfce system. From experience, this issue is likely window manager related. This does not mean that there isn't a bug in ImHex, but it likely only appears on certain WMs. My guess is that Windows does not have this issue. |
The issue seems to only occur when the tooltip is able to escape the parent window. This happens most often for large error messages like for the pattern Reproduction steps:
The tabs of the pattern editor or other subwindow should change color, typing should result in no text being input into the previously focused subwindow, and the window manager's decorations (if applicable) will reflect that the window is now in the background. |
Thank you. The solution for this is really to just disable the multi window support again. It's disabled by default on Linux because various desktop environments don't play nice with it there. Gnome and KDE work decently with it but there's tons others sadly that don't. Ultimately it's an ImGui issue and should be reported there, I don't believe there's much I can do over here, sorry. |
For posterity, I tested the following platforms:
|
Huh you're right about gnome for the very least, for me it also appears in the middle of the screen now. This definitely used to work better in the past. Not perfectly, but better for sure |
Nevermind, the Wayland issues have always been there. The reason is that Wayland, by design, does not allow applications to move their own windows around programmatically. So ImGui has basically no way of handling these popups or even detached windows correctly. The focus stealing might be some Window flag that needs to be set (at least Windows has something like this) but I'm not entirely sure about Linux |
I don't think focus stealing is an issue if popups are contained in main docking window. It is possible to move an image visualization outside of the window and it will also remove focus from main window. you need to click on the main docking window to close the visualizer anyway. |
It's fine for detached windows yeah. But it makes things unusable with tooltips |
fwiw ImGui tries to prevent this issue from happening but, from the looks of it, those window attributes seem to be entirely ignored by the WM. Prebuilt versions of ImHex use GLFW 3.3 or 3.4 now so GLFW_FOCUS_ON_SHOW should be supported // GLFW 3.2 unfortunately always set focus on glfwCreateWindow() if GLFW_VISIBLE is set, regardless of GLFW_FOCUSED
// With GLFW 3.3, the hint GLFW_FOCUS_ON_SHOW fixes this problem
glfwWindowHint(GLFW_VISIBLE, false);
glfwWindowHint(GLFW_FOCUSED, false);
#if GLFW_HAS_FOCUS_ON_SHOW
glfwWindowHint(GLFW_FOCUS_ON_SHOW, false);
#endif |
Operating System
Linux
What's the issue you encountered?
When hovering over certain types of items which present tooltips, the main window's focus is given to the tooltip. This prevents typing if there is a tooltip currently on screen, and can interfere with basic window operations.
This occurs with errors in the pattern editor, as well as image tooltips in the pattern data view.
How can the issue be reproduced?
Create an erroneous pattern in the editor, then hover over any errors.
ImHex Version
1.36.2
ImHex Build Type
Installation type
AppImage
Additional context?
Using Debian 12 with Xfce.
The text was updated successfully, but these errors were encountered: