MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / RunDialogWithFocus

Function RunDialogWithFocus

extern/nfd/nfd_gtk.cpp:370–382  ·  view source on GitHub ↗

wrapper for gtk_dialog_run() that brings the dialog to the front see issues at: https://github.com/btzy/nativefiledialog-extended/issues/31 https://github.com/mlabbe/nativefiledialog/pull/92 https://github.com/guillaumechereau/noc/pull/11

Source from the content-addressed store, hash-verified

368// https://github.com/mlabbe/nativefiledialog/pull/92
369// https://github.com/guillaumechereau/noc/pull/11
370gint RunDialogWithFocus(GtkDialog* dialog) {
371#if defined(GDK_WINDOWING_X11)
372 gtk_widget_show_all(GTK_WIDGET(dialog)); // show the dialog so that it gets a display
373 if (GDK_IS_X11_DISPLAY(gtk_widget_get_display(GTK_WIDGET(dialog)))) {
374 GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(dialog));
375 gdk_window_set_events(
376 window,
377 static_cast<GdkEventMask>(gdk_window_get_events(window) | GDK_PROPERTY_CHANGE_MASK));
378 gtk_window_present_with_time(GTK_WINDOW(dialog), gdk_x11_get_server_time(window));
379 }
380#endif
381 return gtk_dialog_run(dialog);
382}
383
384} // namespace
385

Callers 4

NFD_OpenDialogNFunction · 0.85
NFD_OpenDialogMultipleNFunction · 0.85
NFD_SaveDialogNFunction · 0.85
NFD_PickFolderNFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected