-
Notifications
You must be signed in to change notification settings - Fork 95
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
GTK Focus issue when used with SDL #31
Comments
Test case (modified from mlabbe/nativefiledialog#79): main.c: #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <SDL.h>
#include <nfd.h>
int main()
{
SDL_Init(SDL_INIT_VIDEO);
NFD_Init();
SDL_Window *window = SDL_CreateWindow("nativefiledialog issue 79", SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, 800, 480, SDL_WINDOW_SHOWN);
int w, h;
SDL_GetWindowSize(window, &w, &h);
bool running = true;
while (running) {
SDL_Event e;
while (SDL_PollEvent(&e)) {
if (e.type == SDL_QUIT) {
running = false;
break;
}
if (e.type == SDL_MOUSEBUTTONDOWN) {
nfdchar_t *filename;
nfdresult_t res = NFD_OpenDialog(&filename, NULL, 0, NULL);
if (res == NFD_OKAY) {
printf("Got filename: %s\n", filename);
free(filename);
}
}
}
}
SDL_DestroyWindow(window);
NFD_Quit();
SDL_Quit();
return 0;
} CMakeLists.txt:
|
btzy
added a commit
that referenced
this issue
Apr 2, 2021
btzy
added a commit
that referenced
this issue
Apr 2, 2021
btzy
added a commit
that referenced
this issue
Apr 2, 2021
btzy
added a commit
that referenced
this issue
Apr 11, 2021
btzy
added a commit
that referenced
this issue
Apr 11, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the same as mlabbe/nativefiledialog#79, where the file dialog goes under an existing SDL window. It does not happen in the tests where we are launching the dialog directly from the terminal.
Tested on Ubuntu 20.04.
The text was updated successfully, but these errors were encountered: