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 is always on top doesn't work if User interacts with FileDialog #94794

Open
VasiliyChernyaev opened this issue Jul 26, 2024 · 2 comments

Comments

@VasiliyChernyaev
Copy link

VasiliyChernyaev commented Jul 26, 2024

Tested versions

Was always present?

System information

Windows 11, Godot 4.1.1 stable / Godot 4.3rc1

Issue description

Window loses "always on" setting after loading data using FileDialog (Open File, File system).

Can you also add global keys support (maybe as option)?
I already solved the issue, use this code (add it to whatever script that responsible for Window always on top):

#include <windows.h>

int main()
{
    while (true) {
        HWND iriska; ##iriska is my game's name, I guess you can return game_name from Class(project_name).
        iriska = FindWindow( NULL, "Iriska (DEBUG)" ); ## I have to use this script, because my GDExtention doesn't want to install
        SetWindowPos(iriska, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
        Sleep(100);
        if( iriska == NULL ){
            return 0;
        }
        if (GetAsyncKeyState(VK_NUMPAD0)){
            PostMessage(iriska, WM_KEYDOWN, VK_NUMPAD0, 0); ## Put Keycode (Latin Equivalent) for the dedicated key(s).
    }
    return 0;
}

Steps to reproduce

Create FileDialogue and use it.

Minimal reproduction project (MRP)

N/A

@AThousandShips
Copy link
Member

Please try with a supported version, at least 4.1.4, but better 4.2.2 or 4.3.rc1, 4.1.1 is a very old and outdated version

@VasiliyChernyaev
Copy link
Author

VasiliyChernyaev commented Jul 26, 2024

Please try with a supported version, at least 4.1.4, but better 4.2.2 or 4.3.rc1, 4.1.1 is a very old and outdated version

I tried 4.3.rc1. Liked that my right click "options" menu can also stay on the top. Still the window loses priority over anything besides desktop, I guess they have HWND_TOP instead of HWND_TOPMOST.

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

No branches or pull requests

2 participants