[gimp] app: make sure the welcome dialog is centered on the GIMP main window.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: make sure the welcome dialog is centered on the GIMP main window.
- Date: Tue, 22 Feb 2022 12:20:08 +0000 (UTC)
commit d31d417cf19b828d5fc3c11297d6b290572a4bd7
Author: Jehan <jehan girinstud io>
Date: Tue Feb 22 13:19:06 2022 +0100
app: make sure the welcome dialog is centered on the GIMP main window.
If there are several windows (when loading files on startup), let's just
use the first. This avoids weird placements in some cases.
app/dialogs/welcome-dialog.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/app/dialogs/welcome-dialog.c b/app/dialogs/welcome-dialog.c
index 55263d9ccf..dd556c051b 100644
--- a/app/dialogs/welcome-dialog.c
+++ b/app/dialogs/welcome-dialog.c
@@ -64,6 +64,8 @@ welcome_dialog_create (Gimp *gimp)
GdkMonitor *monitor;
GdkRectangle workarea;
+ GList *windows;
+
GtkWidget *main_vbox;
GtkWidget *stack;
GtkWidget *grid;
@@ -153,11 +155,15 @@ welcome_dialog_create (Gimp *gimp)
/* Translators: the %s string will be the version, e.g. "3.0". */
title = g_strdup_printf (_("Welcome to GIMP %s"), GIMP_VERSION);
+ windows = gimp_get_image_windows (gimp);
welcome_dialog = gimp_dialog_new (title,
"gimp-welcome-dialog",
- NULL, 0, NULL, NULL,
+ windows ? windows->data : NULL,
+ 0, NULL, NULL,
NULL);
+ g_list_free (windows);
gtk_window_set_resizable (GTK_WINDOW (welcome_dialog), FALSE);
+ gtk_window_set_position (GTK_WINDOW (welcome_dialog), GTK_WIN_POS_CENTER_ON_PARENT);
g_free (title);
g_signal_connect (welcome_dialog,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]