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

SDL_RaiseWindow doesn't seem to do anything. #9207

Open
niooii opened this issue Mar 6, 2024 · 2 comments
Open

SDL_RaiseWindow doesn't seem to do anything. #9207

niooii opened this issue Mar 6, 2024 · 2 comments
Assignees
Milestone

Comments

@niooii
Copy link

niooii commented Mar 6, 2024

The SDL_RaiseWindow() function doesn't raise the given window at all. I am quite new to github and github issues so please let me know if more info is needed.

Tested on Windows 10 and linux (arch) using SDL2, ran as administrator and sudo respectively:

int main()
{
    SDL_Window* w;
    SDL_Event e;
    SDL_Init(SDL_INIT_EVERYTHING);
    w = SDL_CreateWindow("test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 600, SDL_WINDOW_SHOWN);

    while(true)
    {
        while(SDL_PollEvent(&e))
        {
            if (e.type == SDL_QUIT)
            {
                exit(0);
            }
        }
        SDL_RaiseWindow(w);
    }
}
@Semphriss
Copy link
Contributor

Tried this on Ubuntu 22.04. The window indeed does not raise, but my desktop environment (GNOME) sent me constant notifications that "[window title] is ready". I'm not sure if this is in SDL; it's possible that the DE is designed to prevent poorly designed apps from hoarding the user focus.

@slouken
Copy link
Collaborator

slouken commented Mar 19, 2024

We need to document this. Most desktop environments no longer allow windows to raise and take focus, instead the raise call turns into an alert that the window wants attention.

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

No branches or pull requests

3 participants