[evolution] Ensure transient parent for ETimezoneDialog
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Ensure transient parent for ETimezoneDialog
- Date: Tue, 3 Apr 2018 12:15:14 +0000 (UTC)
commit 1554cdb13b4eeccd1d8ab79fdec1b74d29e76ef1
Author: Milan Crha <mcrha redhat com>
Date: Tue Apr 3 14:16:04 2018 +0200
Ensure transient parent for ETimezoneDialog
src/calendar/gui/calendar-config.c | 5 ++++-
src/calendar/gui/calendar-config.h | 4 ++--
src/calendar/gui/e-day-view-time-item.c | 2 +-
src/calendar/gui/e-timezone-entry.c | 5 +++++
src/modules/calendar/e-calendar-preferences.c | 2 +-
5 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/src/calendar/gui/calendar-config.c b/src/calendar/gui/calendar-config.c
index b79784b..f3a2e3f 100644
--- a/src/calendar/gui/calendar-config.c
+++ b/src/calendar/gui/calendar-config.c
@@ -389,7 +389,7 @@ calendar_config_get_day_second_zone (void)
}
void
-calendar_config_select_day_second_zone (void)
+calendar_config_select_day_second_zone (GtkWidget *parent)
{
icaltimezone *zone = NULL;
ETimezoneDialog *tzdlg;
@@ -409,6 +409,9 @@ calendar_config_select_day_second_zone (void)
dialog = e_timezone_dialog_get_toplevel (tzdlg);
+ if (GTK_IS_WINDOW (parent))
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
const gchar *location = NULL;
diff --git a/src/calendar/gui/calendar-config.h b/src/calendar/gui/calendar-config.h
index ff1c158..552b5b2 100644
--- a/src/calendar/gui/calendar-config.h
+++ b/src/calendar/gui/calendar-config.h
@@ -28,7 +28,7 @@
#define _CALENDAR_CONFIG_H_
#include <gio/gio.h>
-#include <gdk/gdk.h>
+#include <gtk/gtk.h>
#include <libecal/libecal.h>
#include <e-util/e-util.h>
@@ -65,7 +65,7 @@ GSList *calendar_config_get_day_second_zones (void);
void calendar_config_free_day_second_zones (GSList *zones);
void calendar_config_set_day_second_zone (const gchar *location);
gchar * calendar_config_get_day_second_zone (void);
-void calendar_config_select_day_second_zone (void);
+void calendar_config_select_day_second_zone (GtkWidget *parent);
void calendar_config_add_notification_day_second_zone (CalendarConfigChangedFunc func, gpointer data);
diff --git a/src/calendar/gui/e-day-view-time-item.c b/src/calendar/gui/e-day-view-time-item.c
index 0afec82..9175896 100644
--- a/src/calendar/gui/e-day-view-time-item.c
+++ b/src/calendar/gui/e-day-view-time-item.c
@@ -752,7 +752,7 @@ static void
edvti_on_select_zone (GtkWidget *item,
EDayViewTimeItem *time_item)
{
- calendar_config_select_day_second_zone ();
+ calendar_config_select_day_second_zone (gtk_widget_get_toplevel (item));
}
static void
diff --git a/src/calendar/gui/e-timezone-entry.c b/src/calendar/gui/e-timezone-entry.c
index 3757528..6ef670f 100644
--- a/src/calendar/gui/e-timezone-entry.c
+++ b/src/calendar/gui/e-timezone-entry.c
@@ -158,6 +158,7 @@ static void
timezone_entry_button_clicked_cb (ETimezoneEntry *timezone_entry)
{
ETimezoneDialog *timezone_dialog;
+ GtkWidget *toplevel;
GtkWidget *dialog;
icaltimezone *timezone;
@@ -168,6 +169,10 @@ timezone_entry_button_clicked_cb (ETimezoneEntry *timezone_entry)
dialog = e_timezone_dialog_get_toplevel (timezone_dialog);
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (timezone_entry));
+ if (GTK_IS_WINDOW (toplevel))
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (toplevel));
+
if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_ACCEPT)
goto exit;
diff --git a/src/modules/calendar/e-calendar-preferences.c b/src/modules/calendar/e-calendar-preferences.c
index fbf3ac2..8551e4b 100644
--- a/src/modules/calendar/e-calendar-preferences.c
+++ b/src/modules/calendar/e-calendar-preferences.c
@@ -341,7 +341,7 @@ on_select_day_second_zone (GtkWidget *item,
{
g_return_if_fail (prefs != NULL);
- calendar_config_select_day_second_zone ();
+ calendar_config_select_day_second_zone (gtk_widget_get_toplevel (item));
update_day_second_zone_caption (prefs);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]