diff --git a/fiv.c b/fiv.c index 6e67ad2..d5d2871 100644 --- a/fiv.c +++ b/fiv.c @@ -18,6 +18,9 @@ #include #include #include +#ifdef GDK_WINDOWING_QUARTZ +#include +#endif // GDK_WINDOWING_QUARTZ #include #include @@ -2009,6 +2012,13 @@ main(int argc, char *argv[]) unit = MAX(200, unit); gtk_window_set_default_size(GTK_WINDOW(g.window), 4 * unit, 3 * unit); +#ifdef GDK_WINDOWING_QUARTZ + // Otherwise the window simply opens at (0, 0), + // while other macOS applications are more likely to start centered. + if (GDK_IS_QUARTZ_DISPLAY(display)) + gtk_window_set_position(GTK_WINDOW(g.window), GTK_WIN_POS_CENTER); +#endif // GDK_WINDOWING_QUARTZ + // XXX: The widget wants to read the display's profile. The realize is ugly. gtk_widget_realize(g.view);