[gedit] App: do not call gtk_window_set_role() (specific to X11)
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] App: do not call gtk_window_set_role() (specific to X11)
- Date: Mon, 2 Dec 2019 07:23:48 +0000 (UTC)
commit ac9c0a130e8b3135ef036d5025782fdceee0fe84
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon Dec 2 08:15:15 2019 +0100
App: do not call gtk_window_set_role() (specific to X11)
To try to get rid of X11-specific things in gedit.
This also permits to get rid of one use of g_get_current_time() and
GTimeVal (deprecated, not 2038-year-safe).
gtk_window_get_role() is not called in gedit. And with the unique string
for the window role, the window manager was never able to re-use its
knowledge about gedit windows.
gedit/gedit-app.c | 21 ---------------------
1 file changed, 21 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index edd898bd7..742b8a105 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -1438,22 +1438,6 @@ gedit_app_init (GeditApp *app)
#endif
}
-/* Generates a unique string for a window role */
-static gchar *
-gen_role (void)
-{
- GTimeVal result;
- static gint serial;
-
- g_get_current_time (&result);
-
- return g_strdup_printf ("gedit-window-%ld-%ld-%d-%s",
- result.tv_sec,
- result.tv_usec,
- serial++,
- g_get_host_name ());
-}
-
/**
* gedit_app_create_window:
* @app: the #GeditApp
@@ -1469,7 +1453,6 @@ gedit_app_create_window (GeditApp *app,
{
GeditAppPrivate *priv;
GeditWindow *window;
- gchar *role;
GdkWindowState state;
gint w, h;
@@ -1484,10 +1467,6 @@ gedit_app_create_window (GeditApp *app,
gtk_window_set_screen (GTK_WINDOW (window), screen);
}
- role = gen_role ();
- gtk_window_set_role (GTK_WINDOW (window), role);
- g_free (role);
-
state = g_settings_get_int (priv->window_settings,
GEDIT_SETTINGS_WINDOW_STATE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]