Undo tabs-in-processes, it didn't work out

We are not literally undoing in the sense of
reverting, this is actually about undoing
the individual parts of the last refactoring
that implemented the socket/ plug logic.

As turned out, the idea was nice but the
implementation was absolutely not, embedding
of processes in a graphical way is not
at all reliable enough for complex use cases.

Naturally this change should solve all sorts
of peculiar issues, including actual
regressions in functionality. Relieving.
This commit is contained in:
Christian Dywan 2008-10-15 03:07:38 +02:00
parent d72579711c
commit 7597e2026d
7 changed files with 259 additions and 1111 deletions

View file

@ -127,13 +127,6 @@ The following arguments are supported if you call Midori from a command line.
+-------+--------------------+------------------------------------------------+
| Short | Long option | Function |
+=======+====================+================================================+
| -s | --single-process | This forces all tabs to be opened inside the |
| | | one single browser process. |
+-------+--------------------+------------------------------------------------+
| -i | --id | This is an internal identifier. It is used to |
| | | spawn child processes for new tabs. Do not use |
| | | it unless you know what you are doing. |
+-------+--------------------+------------------------------------------------+
| -v | --version | Show version information and exit. |
+-------+--------------------+------------------------------------------------+

View file

@ -1030,8 +1030,6 @@ int
main (int argc,
char** argv)
{
gboolean single_process;
guint socket_id;
gboolean version;
gchar** uris;
MidoriApp* app;
@ -1039,18 +1037,12 @@ main (int argc,
GError* error;
GOptionEntry entries[] =
{
{ "single-process", 's', 0, G_OPTION_ARG_NONE, &single_process,
N_("Run everything in the same process"), NULL },
{ "id", 'i', 0, G_OPTION_ARG_INT, &socket_id,
N_("Internal identifier"), NULL },
{ "version", 'v', 0, G_OPTION_ARG_NONE, &version,
N_("Display program version"), NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &uris,
N_("URIs"), NULL },
{ NULL }
};
GtkWidget* view;
GtkWidget* plug;
JSGlobalContextRef js_context;
gchar* exception;
MidoriStartup load_on_startup;
@ -1077,7 +1069,6 @@ main (int argc,
#endif
/* Parse cli options */
socket_id = 0;
version = FALSE;
uris = NULL;
error = NULL;
@ -1090,26 +1081,8 @@ main (int argc,
}
stock_items_init ();
if (socket_id)
{
/* If an ID was specified we create a view in a plug.
This allows us to open views in separate processes. */
g_set_application_name ("midori-plug");
view = g_object_new (MIDORI_TYPE_VIEW, "socket-id", socket_id, NULL);
gtk_widget_show (view);
plug = gtk_plug_new (socket_id);
gtk_container_add (GTK_CONTAINER (plug), view);
g_signal_connect (plug, "destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show (plug);
gtk_main ();
return 0;
}
if (single_process)
midori_view_single_process (TRUE);
g_set_application_name (_("Midori"));
if (version)
{
g_print (
@ -1140,8 +1113,6 @@ main (int argc,
return 1;
}
sokoke_remember_argv0 (argv[0]);
app = midori_app_new ();
if (midori_app_instance_is_running (app))
{

View file

@ -384,12 +384,6 @@ midori_view_notify_load_status_cb (GtkWidget* view,
"remember-last-visited-pages"))
midori_location_action_add_uri (MIDORI_LOCATION_ACTION (action), uri);
}
else if (midori_view_get_load_status (MIDORI_VIEW (view))
== MIDORI_LOAD_FINISHED)
{
/* g_signal_emit (browser, signals[WINDOW_OBJECT_CLEARED], 0,
web_frame, js_context, js_window); */
}
if (view == midori_browser_get_current_tab (browser))
{
@ -417,6 +411,17 @@ midori_view_notify_progress_cb (GtkWidget* view,
_midori_browser_update_progress (browser, MIDORI_VIEW (view));
}
static void
midori_view_window_object_cleared_cb (GtkWidget* view,
WebKitWebFrame* web_frame,
JSContextRef js_context,
JSObjectRef js_window,
MidoriBrowser* browser)
{
g_signal_emit (browser, signals[WINDOW_OBJECT_CLEARED], 0,
web_frame, js_context, js_window);
}
/*
static void
midori_web_view_news_feed_ready_cb (MidoriWebView* web_view,
@ -768,6 +773,8 @@ _midori_browser_add_tab (MidoriBrowser* browser,
midori_view_notify_load_status_cb, browser,
"signal::notify::progress",
midori_view_notify_progress_cb, browser,
"signal::window-object-cleared",
midori_view_window_object_cleared_cb, browser,
/* "signal::news-feed-ready",
midori_view_news_feed_ready_cb, browser, */
"signal::notify::title",
@ -1666,7 +1673,8 @@ _action_source_view_activate (GtkAction* action,
uri = g_strdup_printf ("view-source:%s",
midori_view_get_display_uri (MIDORI_VIEW (view)));
source_view = midori_view_new_with_uri (uri);
source_view = midori_view_new ();
midori_view_set_uri (MIDORI_VIEW (source_view), uri);
g_free (uri);
gtk_widget_show (source_view);
n = midori_browser_add_tab (browser, source_view);

File diff suppressed because it is too large Load diff

View file

@ -53,9 +53,6 @@ midori_view_get_type (void);
GtkWidget*
midori_view_new (void);
GtkWidget*
midori_view_new_with_uri (const gchar* uri);
void
midori_view_set_settings (MidoriView* view,
MidoriWebSettings* settings);

View file

@ -24,32 +24,6 @@
#include <glib/gi18n.h>
#include <glib/gprintf.h>
/**
* sokoke_remember_argv0:
* @argv0: the contents of argv[0] or %NULL
*
* Stores or retrieves the value of argv[0].
*
* Call it with a string for argv0 to store.
*
* Passing %NULL for argv0 will preserve
* a previously stored value.
*
* Return value: the contents of argv[0] or %NULL
**/
const gchar*
sokoke_remember_argv0 (const gchar* argv0)
{
static const gchar* remembered_argv0 = NULL;
if (argv0)
remembered_argv0 = argv0;
g_return_val_if_fail (remembered_argv0 != NULL, NULL);
return remembered_argv0;
}
static void
error_dialog (const gchar* short_message,
const gchar* detailed_message)

View file

@ -19,9 +19,6 @@
/* Many themes need this hack for small toolbars to work */
#define GTK_ICON_SIZE_SMALL_TOOLBAR GTK_ICON_SIZE_BUTTON
const gchar*
sokoke_remember_argv0 (const gchar* argv0);
gboolean
sokoke_spawn_program (const gchar* command,
const gchar* argument);