[gedit] Do not create two tabs with "gedit --new-window"



commit 626fe8ad175fcc27591f55891b3bd7dcaa943e8f
Author: Timothy Arceri <t_arceri yahoo com au>
Date:   Sun Nov 11 13:08:30 2012 +1100

    Do not create two tabs with "gedit --new-window"
    
    Remove call to create extra tab when using 'gedit --new-window'
    as new tab is already created when handling the command line.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673741

 gedit/gedit-dbus.c |   33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 deletions(-)
---
diff --git a/gedit/gedit-dbus.c b/gedit/gedit-dbus.c
index eaa040a..5bc9c86 100644
--- a/gedit/gedit-dbus.c
+++ b/gedit/gedit-dbus.c
@@ -847,7 +847,7 @@ window_from_display_arguments (gboolean           new_window,
 {
 	GdkScreen *screen = NULL;
 	GeditApp *app;
-	GeditWindow *ret;
+	GeditWindow *ret = NULL;
 
 	/* get correct screen using the display_name and screen_number */
 	if (dparams->display_name != NULL && *dparams->display_name)
@@ -861,25 +861,20 @@ window_from_display_arguments (gboolean           new_window,
 
 	app = gedit_app_get_default ();
 
-	if (new_window)
+	if (!new_window)
 	{
-		ret = gedit_app_create_window (app, screen);
-		gedit_window_create_tab (ret, TRUE);
-
-		return ret;
-	}
-
-	if (screen != NULL)
-	{
-		ret = _gedit_app_get_window_in_viewport (app,
-		                                         screen,
-		                                         dparams->workspace == -1 ? 0 : dparams->workspace,
-		                                         dparams->viewport_x == -1 ? 0 : dparams->viewport_x,
-		                                         dparams->viewport_y == -1 ? 0 : dparams->viewport_y);
-	}
-	else
-	{
-		ret = gedit_app_get_active_window (app);
+		if (screen != NULL)
+		{
+			ret = _gedit_app_get_window_in_viewport (app,
+				                                 screen,
+				                                 dparams->workspace == -1 ? 0 : dparams->workspace,
+				                                 dparams->viewport_x == -1 ? 0 : dparams->viewport_x,
+				                                 dparams->viewport_y == -1 ? 0 : dparams->viewport_y);
+		}
+		else
+		{
+			ret = gedit_app_get_active_window (app);
+		}
 	}
 
 	if (!ret)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]