[nautilus/gtk4-preparation-trunk: 15/60] files-view: Drop NAUTILUS_SCRIPT_WINDOW_GEOMETRY envar




commit 2250e278a86fc6dd27639c888cc990841e37d835
Author: António Fernandes <antoniof gnome org>
Date:   Wed Dec 15 20:54:30 2021 +0000

    files-view: Drop NAUTILUS_SCRIPT_WINDOW_GEOMETRY envar
    
    It relies on X11-only information, such as the window position on the
    screen, which is not known to the application under Wayland.
    So, this was already broken.
    
    Also, its implementation relies on GtkWindow API which is gone in GTK 4.

 eel/eel-gtk-extensions.c  | 27 ---------------------------
 eel/eel-gtk-extensions.h  |  5 +----
 src/nautilus-files-view.c |  6 ------
 3 files changed, 1 insertion(+), 37 deletions(-)
---
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index 45b072db3..2c3d8ac6d 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -46,33 +46,6 @@
 #define MINIMUM_ON_SCREEN_HEIGHT        100
 
 
-/**
- * eel_gtk_window_get_geometry_string:
- * @window: a #GtkWindow
- *
- * Obtains the geometry string for this window, suitable for
- * set_geometry_string(); assumes the window has NorthWest gravity
- *
- * Return value: geometry string, must be freed
- **/
-char *
-eel_gtk_window_get_geometry_string (GtkWindow *window)
-{
-    char *str;
-    int w, h, x, y;
-
-    g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
-    g_return_val_if_fail (gtk_window_get_gravity (window) ==
-                          GDK_GRAVITY_NORTH_WEST, NULL);
-
-    gtk_window_get_position (window, &x, &y);
-    gtk_window_get_size (window, &w, &h);
-
-    str = g_strdup_printf ("%dx%d+%d+%d", w, h, x, y);
-
-    return str;
-}
-
 GtkMenuItem *
 eel_gtk_menu_append_separator (GtkMenu *menu)
 {
diff --git a/eel/eel-gtk-extensions.h b/eel/eel-gtk-extensions.h
index 0a5eac1dc..afbd19631 100644
--- a/eel/eel-gtk-extensions.h
+++ b/eel/eel-gtk-extensions.h
@@ -28,10 +28,7 @@
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gtk/gtk.h>
 
-/* GtkWindow */
-char *                eel_gtk_window_get_geometry_string              (GtkWindow            *window);
-
 /* GtkMenu and GtkMenuItem */
 GtkMenuItem *         eel_gtk_menu_append_separator                   (GtkMenu              *menu);
 GtkMenuItem *         eel_gtk_menu_insert_separator                   (GtkMenu              *menu,
-                                                                      int                   index);
\ No newline at end of file
+                                                                      int                   index);
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 2358f7dba..cde917daa 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -5259,7 +5259,6 @@ set_script_environment_variables (NautilusFilesView *view,
     g_autofree gchar *file_paths = NULL;
     g_autofree gchar *uris = NULL;
     g_autofree gchar *uri = NULL;
-    g_autofree gchar *geometry_string = NULL;
     NautilusFilesViewPrivate *priv;
 
     priv = nautilus_files_view_get_instance_private (view);
@@ -5272,10 +5271,6 @@ set_script_environment_variables (NautilusFilesView *view,
 
     uri = nautilus_directory_get_uri (priv->model);
     g_setenv ("NAUTILUS_SCRIPT_CURRENT_URI", uri, TRUE);
-
-    geometry_string = eel_gtk_window_get_geometry_string
-                          (GTK_WINDOW (nautilus_files_view_get_containing_window (view)));
-    g_setenv ("NAUTILUS_SCRIPT_WINDOW_GEOMETRY", geometry_string, TRUE);
 }
 
 /* Unset all the special script environment variables. */
@@ -5285,7 +5280,6 @@ unset_script_environment_variables (void)
     g_unsetenv ("NAUTILUS_SCRIPT_SELECTED_FILE_PATHS");
     g_unsetenv ("NAUTILUS_SCRIPT_SELECTED_URIS");
     g_unsetenv ("NAUTILUS_SCRIPT_CURRENT_URI");
-    g_unsetenv ("NAUTILUS_SCRIPT_WINDOW_GEOMETRY");
 }
 
 static void


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