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

GTK+3: Dialog does not disappear #3

Closed
paniq opened this issue Jan 13, 2015 · 12 comments
Closed

GTK+3: Dialog does not disappear #3

paniq opened this issue Jan 13, 2015 · 12 comments

Comments

@paniq
Copy link

paniq commented Jan 13, 2015

When using NFD from SDL, I noticed that the dialog never disappears after clicking Cancel or OK. It freezes and control is returned to the application as expected, but still remains in the foreground of the application. I can then call the window to the background and continue work. On the next call, the window appears as expected, but predictably shows the same behavior.

I would expect that the dialog disappears and focus is returned to the previous window.

@mlabbe
Copy link
Owner

mlabbe commented Jan 13, 2015

That's just not happening for me over here. I have NFD_SaveDialog() successfully disappearing in a program that hands its window management and event loop over to SDL. I am linking against SDL 2.0.1 and libGTK-3 as ships with Ubuntu 14.04 (and Linux Mint 17).

I need advice on how to reproduce this or a pared down program that demonstrates the problem.

@paniq
Copy link
Author

paniq commented Jan 15, 2015

I'm running this in Ubuntu 12.10 with latest SDL from https://hg.libsdl.org/SDL and GTK+ 3.6.0.

Based on a hunch I just tried the obvious and called WaitForCleanup() another time right after gtk_widget_destroy(dialog), and that fixed the problem. You might want to do the same.

@wysiwyng
Copy link

wysiwyng commented Feb 8, 2015

I'm experiencing the exact same issue running arch linux with sdl 1.2.15 and GTK+ 3.14.7. Using the fix described above fixes the problem for me.

@mlabbe
Copy link
Owner

mlabbe commented Feb 9, 2015

I'm going to integrate the change as described as soon as I have time to test it. I use NFD with SDL and it hasn't happened, but I don't want this to waste any more developer time.

@mlabbe
Copy link
Owner

mlabbe commented Feb 9, 2015

Okay, I can't repro this bug, but I am going to fix it. Can you confirm the solution is:

gtk_widget_destroy(dialog);

WaitForCleanup();
+WaitForCleanup();

return result;

}

@wysiwyng
Copy link

wysiwyng commented Feb 9, 2015

Yes, that fixes the problem for me. The same happens with the open multiple dialog.

mlabbe added a commit that referenced this issue Feb 15, 2015
Solution is to call WaitForCleanup multiple times.

Not reproducible on all systems, but seems to be 100%
repro on systems that report it.
@mlabbe
Copy link
Owner

mlabbe commented Feb 15, 2015

Since I can't repro this over here, if you could pull my fix and test it, I would appreciate that.

@wysiwyng
Copy link

Nope, the dialog stays after calling and becomes unresponsive after selecting a file and clicking open. This only happens to the open and open multiple dialog though, the save dialog works fine. I believe the order of the function calls makes the difference. Putting waitForCleanup(2) after gtk_widget_destroy() fixes the problem, resp. doesn't introduce it in the first place in the save dialog.

@mlabbe
Copy link
Owner

mlabbe commented Feb 15, 2015

Okay, I now understand. Our previous conversation was not granular enough about the issue. Proper fix coming up.

mlabbe added a commit that referenced this issue Feb 15, 2015
@mlabbe
Copy link
Owner

mlabbe commented Feb 15, 2015

Fixed to that specification. Would appreciate a test and confirm.

@wysiwyng
Copy link

Yup, that does it. All three dialogs disappear beautifully. Thanks!

@mlabbe
Copy link
Owner

mlabbe commented Feb 15, 2015

Thanks for helping drain the native file dialog swamp!

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