[gedit] [osx] Create new window if necessary when opening recent file
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] [osx] Create new window if necessary when opening recent file
- Date: Tue, 26 Aug 2014 19:03:56 +0000 (UTC)
commit dab1460015a1fe99996f7c340bf8fea90a3c802f
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Tue Aug 26 21:00:18 2014 +0200
[osx] Create new window if necessary when opening recent file
gedit/gedit-app-osx.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gedit/gedit-app-osx.c b/gedit/gedit-app-osx.c
index fc2a11c..fefda2e 100644
--- a/gedit/gedit-app-osx.c
+++ b/gedit/gedit-app-osx.c
@@ -263,14 +263,23 @@ recent_file_activated (GAction *action,
GVariant *parameter,
RecentFileInfo *info)
{
- GtkWindow *window;
+ GeditWindow *window;
const gchar *uri;
GFile *file;
uri = gtk_recent_info_get_uri (info->info);
file = g_file_new_for_uri (uri);
- window = gtk_application_get_active_window (GTK_APPLICATION (info->app));
+ window = GEDIT_WINDOW (gtk_application_get_active_window (GTK_APPLICATION (info->app)));
+
+ if (window == NULL)
+ {
+ window = gedit_app_create_window (GEDIT_APP (info->app), NULL);
+
+ gtk_widget_show (GTK_WIDGET (window));
+ gtk_window_present (GTK_WINDOW (window));
+ }
+
gedit_commands_load_location (GEDIT_WINDOW (window), file, NULL, 0, 0);
g_object_unref (file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]