From 6b84771a1ba0df4ff356bd9cc9e6175dcfd5b569 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Wed, 24 Feb 2021 11:34:39 -0600 Subject: session: stop saving window role in the session state Apparently, when running under X11 it is possible to tell GTK to restore particular windows on particular workspaces. That's cute, but I don't like X11-specific code, and it's gone in GTK 4. We'll have to remove this in the future no matter what, so might as well get rid of it now. --- src/ephy-session.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/ephy-session.c b/src/ephy-session.c index 5dda793ba..a8767a759 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -409,21 +409,6 @@ window_added_cb (GtkApplication *application, g_signal_connect_object (tab_view, "notify::selected-page", G_CALLBACK (tab_view_notify_selected_page_cb), session, G_CONNECT_AFTER); - - /* Set unique identifier as role, so that on restore, the WM can - * place the window on the right workspace - */ - - if (gtk_window_get_role (window) == NULL) { - /* I guess rand() is unique enough, otherwise we could use - * time + pid or something - */ - char *role; - - role = g_strdup_printf ("epiphany-window-%x", rand ()); - gtk_window_set_role (window, role); - g_free (role); - } } static void @@ -539,7 +524,6 @@ typedef struct { GdkRectangle geometry; gboolean is_maximized; gboolean is_fullscreen; - char *role; GList *tabs; gint active_tab; @@ -629,7 +613,6 @@ session_window_new (EphyWindow *window, session_window = g_new0 (SessionWindow, 1); get_window_geometry (window, session_window); - session_window->role = g_strdup (gtk_window_get_role (GTK_WINDOW (window))); tab_view = ephy_window_get_tab_view (window); for (l = tabs; l != NULL; l = l->next) { @@ -649,7 +632,6 @@ session_window_new (EphyWindow *window, static void session_window_free (SessionWindow *session_window) { - g_free (session_window->role); g_list_free_full (session_window->tabs, (GDestroyNotify)session_tab_free); g_free (session_window); @@ -821,14 +803,6 @@ write_ephy_window (xmlTextWriterPtr writer, if (ret < 0) return ret; - if (window->role != NULL) { - ret = xmlTextWriterWriteAttribute (writer, - (const xmlChar *)"role", - (const xmlChar *)window->role); - if (ret < 0) - return ret; - } - for (l = window->tabs; l != NULL; l = l->next) { SessionTab *tab = (SessionTab *)l->data; ret = write_tab (writer, tab); @@ -1170,8 +1144,6 @@ session_parse_window (SessionParserContext *context, } else if (strcmp (names[i], "is-fullscreen") == 0) { ephy_string_to_int (values[i], &int_value); is_fullscreen = int_value != 0; - } else if (strcmp (names[i], "role") == 0) { - gtk_window_set_role (GTK_WINDOW (context->window), values[i]); } else if (strcmp (names[i], "active-tab") == 0) { ephy_string_to_int (values[i], &int_value); context->active_tab = int_value; -- cgit v1.2.1