[epiphany/mcatanzaro/ephy-session: 6/6] session: stop saving window role in the session state
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/ephy-session: 6/6] session: stop saving window role in the session state
- Date: Wed, 24 Feb 2021 18:11:30 +0000 (UTC)
commit 6e20bd47a246ca75ece17e795bf5d2b8392b004b
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Feb 24 11:34:39 2021 -0600
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 cabe51a2f..fb3887bbb 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]