summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-12-15 20:54:30 +0000
committerAntónio Fernandes <antoniof@gnome.org>2022-01-05 11:32:12 +0000
commit8d974ecc6043ee565f3f8924f66b54f47c0bca45 (patch)
treecbe4063e699f5332d8926b126dc0b26678d701ad
parent2413531c76b796185c9ff6f835f49459bf0edfcd (diff)
downloadnautilus-8d974ecc6043ee565f3f8924f66b54f47c0bca45.tar.gz
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.
-rw-r--r--eel/eel-gtk-extensions.c27
-rw-r--r--eel/eel-gtk-extensions.h5
-rw-r--r--src/nautilus-files-view.c6
3 files changed, 1 insertions, 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 9b7578daa..bfb56bfd1 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -5201,7 +5201,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);
@@ -5214,10 +5213,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. */
@@ -5227,7 +5222,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