summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-11-02 15:43:10 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-11-02 15:43:10 +0000
commitc91bb9d1382277a5ac80d0dce524d5e2c8fd3cda (patch)
tree67c34687413977075eeddbc46c4dfd7989643c7a
parent9ab32f9cc919fa13017ded258983db457d6eb658 (diff)
downloadnautilus-c91bb9d1382277a5ac80d0dce524d5e2c8fd3cda.tar.gz
remove GtkText workaround (I'm also checking in a fix for the bug being
2001-11-01 Havoc Pennington <hp@pobox.com> * libnautilus/nautilus-clipboard.c (select_all): remove GtkText workaround (I'm also checking in a fix for the bug being worked around) * libnautilus-private/nautilus-bookmark.c (nautilus_bookmark_menu_item_new): replace some PixmapMenuItem with ImageMenuItem * src/file-manager/fm-directory-view.c (set_script_environment_variables): use eel_gtk_window_get_geometry_string * src/nautilus-zoom-control.c: just nuke the draw method, it ain't coming back * src/nautilus-window.c (set_initial_window_geometry): remove gtk_window_set_policy() that was useless, and replace set_usize with set_size_request. (nautilus_window_constructed): remove menu_bar_no_resize_hack, I have no idea what GTK bug it's talking about, neither does the referenced bug report say, but if we see it again we'll fix it. (plus it says the bug is unsigned math, and GTK 2 pretty much did a global s/uint/int/, especially in the size request/alloc code) * src/nautilus-desktop-window.c (realize): just remove the gnome_win_hints stuff, as the FIXME says, it's dead. (realize): remove the set_decorations, set_functions, and the move_resize, all cruft (nautilus_desktop_window_init): simplify some cruft in here * src/nautilus-bookmarks-window.c (nautilus_bookmarks_window_save_geometry): use eel_gtk_window_get_geometry_string * src/nautilus-window.c (nautilus_window_save_geometry): ditto
-rw-r--r--ChangeLog39
-rw-r--r--libnautilus-private/nautilus-bookmark.c21
-rw-r--r--libnautilus/nautilus-clipboard.c18
-rw-r--r--src/file-manager/fm-directory-view.c8
-rw-r--r--src/nautilus-bookmarks-window.c5
-rw-r--r--src/nautilus-desktop-window.c72
-rw-r--r--src/nautilus-navigation-window-menus.c2
-rw-r--r--src/nautilus-navigation-window.c99
-rw-r--r--src/nautilus-object-window.c99
-rw-r--r--src/nautilus-spatial-window.c99
-rw-r--r--src/nautilus-window-menus.c2
-rw-r--r--src/nautilus-window.c99
-rw-r--r--src/nautilus-zoom-control.c23
13 files changed, 121 insertions, 465 deletions
diff --git a/ChangeLog b/ChangeLog
index 5db8415bb..b3c31f072 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+2001-11-01 Havoc Pennington <hp@pobox.com>
+
+ * libnautilus/nautilus-clipboard.c (select_all): remove GtkText
+ workaround (I'm also checking in a fix for the bug being worked
+ around)
+
+ * libnautilus-private/nautilus-bookmark.c
+ (nautilus_bookmark_menu_item_new): replace some PixmapMenuItem
+ with ImageMenuItem
+
+ * src/file-manager/fm-directory-view.c
+ (set_script_environment_variables): use
+ eel_gtk_window_get_geometry_string
+
+ * src/nautilus-zoom-control.c: just nuke the draw method, it ain't
+ coming back
+
+ * src/nautilus-window.c (set_initial_window_geometry): remove
+ gtk_window_set_policy() that was useless, and replace set_usize
+ with set_size_request.
+ (nautilus_window_constructed): remove menu_bar_no_resize_hack, I
+ have no idea what GTK bug it's talking about, neither does the
+ referenced bug report say, but if we see it
+ again we'll fix it. (plus it says the bug is unsigned math,
+ and GTK 2 pretty much did a global s/uint/int/, especially
+ in the size request/alloc code)
+
+ * src/nautilus-desktop-window.c (realize): just remove the
+ gnome_win_hints stuff, as the FIXME says, it's dead.
+ (realize): remove the set_decorations, set_functions, and
+ the move_resize, all cruft
+ (nautilus_desktop_window_init): simplify some cruft in here
+
+ * src/nautilus-bookmarks-window.c
+ (nautilus_bookmarks_window_save_geometry):
+ use eel_gtk_window_get_geometry_string
+
+ * src/nautilus-window.c (nautilus_window_save_geometry): ditto
+
2001-11-01 Darin Adler <darin@bentspoon.com>
More changes to make Nautilus get closer to running.
diff --git a/libnautilus-private/nautilus-bookmark.c b/libnautilus-private/nautilus-bookmark.c
index 48c125761..d2f193495 100644
--- a/libnautilus-private/nautilus-bookmark.c
+++ b/libnautilus-private/nautilus-bookmark.c
@@ -32,7 +32,7 @@
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <gtk/gtkaccellabel.h>
-#include <gtk/gtksignal.h>
+#include <gtk/gtkimagemenuitem.h>
#include <libgnome/gnome-util.h>
#include <libgnomevfs/gnome-vfs-types.h>
#include <libgnomevfs/gnome-vfs-uri.h>
@@ -564,24 +564,15 @@ nautilus_bookmark_menu_item_new (NautilusBookmark *bookmark)
GtkWidget *pixmap_widget;
GtkWidget *label;
char *display_name;
-
- /* Could check gnome_preferences_get_menus_have_icons here, but these
- * are more important than stock menu icons, since they're connected to
- * user data. For now let's not let them be turn-offable and see if
- * anyone objects strenuously.
- */
-#if GNOME2_CONVERSION_COMPLETE
- menu_item = gtk_pixmap_menu_item_new ();
-#else
- menu_item = NULL;
-#endif
+
+ menu_item = gtk_image_menu_item_new ();
pixmap_widget = create_pixmap_widget_for_bookmark (bookmark);
if (pixmap_widget != NULL) {
gtk_widget_show (pixmap_widget);
-#if GNOME2_CONVERSION_COMPLETE
- gtk_pixmap_menu_item_set_pixmap (GTK_PIXMAP_MENU_ITEM (menu_item), pixmap_widget);
-#endif
+
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), \
+ pixmap_widget);
}
display_name = eel_truncate_text_for_menu_item (bookmark->details->name);
label = gtk_label_new (display_name);
diff --git a/libnautilus/nautilus-clipboard.c b/libnautilus/nautilus-clipboard.c
index 0da902ee4..e9982c377 100644
--- a/libnautilus/nautilus-clipboard.c
+++ b/libnautilus/nautilus-clipboard.c
@@ -136,21 +136,9 @@ clear_callback (BonoboUIComponent *ui,
static void
select_all (GtkEditable *editable)
-{
- int end;
-
- /* Workaround for bug in GtkText. It can't handle a -1
- * passed in to set_position.
- */
- end = -1;
-#if GNOME2_CONVERSION_COMPLETE
- if (GTK_IS_TEXT (editable)) {
- end = gtk_text_get_length (GTK_TEXT (editable));
- }
-#endif
-
- gtk_editable_set_position (editable, end);
- gtk_editable_select_region (editable, 0, end);
+{
+ gtk_editable_set_position (editable, -1);
+ gtk_editable_select_region (editable, 0, -1);
}
static gboolean
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 8943910cb..c3164faaf 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -3545,9 +3545,7 @@ set_script_environment_variables (FMDirectoryView *view, GList *selected_files)
char *file_paths;
char *uris;
char *uri;
-#if GNOME2_CONVERSION_COMPLETE
char *geometry_string;
-#endif
if (nautilus_directory_is_local (view->details->model)) {
file_paths = get_file_paths_as_newline_delimited_string (selected_files);
@@ -3565,12 +3563,10 @@ set_script_environment_variables (FMDirectoryView *view, GList *selected_files)
eel_setenv ("NAUTILUS_SCRIPT_CURRENT_URI", uri, TRUE);
g_free (uri);
-#if GNOME2_CONVERSION_COMPLETE
- geometry_string = gnome_geometry_string
- (GTK_WIDGET (fm_directory_view_get_containing_window (view))->window);
+ geometry_string = eel_gtk_window_get_geometry_string
+ (GTK_WINDOW (fm_directory_view_get_containing_window (view)));
eel_setenv ("NAUTILUS_SCRIPT_WINDOW_GEOMETRY", geometry_string, TRUE);
g_free (geometry_string);
-#endif
}
/* Unset all the special script environment variables. */
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index a85f44be6..7212cb569 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -350,13 +350,12 @@ nautilus_bookmarks_window_save_geometry (GtkWindow *window)
/* Don't bother if window is already closed */
if (GTK_WIDGET_VISIBLE (window)) {
-#if GNOME2_CONVERSION_COMPLETE
char *geometry_string;
- geometry_string = gnome_geometry_string (GTK_WIDGET (window)->window);
+ geometry_string = eel_gtk_window_get_geometry_string (window);
+
nautilus_bookmark_list_set_window_geometry (bookmarks, geometry_string);
g_free (geometry_string);
-#endif
}
}
diff --git a/src/nautilus-desktop-window.c b/src/nautilus-desktop-window.c
index b28a42627..e28ebba56 100644
--- a/src/nautilus-desktop-window.c
+++ b/src/nautilus-desktop-window.c
@@ -71,30 +71,17 @@ nautilus_desktop_window_init (NautilusDesktopWindow *window)
{
window->details = g_new0 (NautilusDesktopWindowDetails, 1);
- /* FIXME bugzilla.gnome.org 41251:
- * Although Havoc had this call to set_default_size in
- * his code, it seems to have no effect for me. But the
- * set_usize below does seem to work.
- */
- gtk_window_set_default_size (GTK_WINDOW (window),
+ gtk_widget_set_size_request (GTK_WIDGET (window),
gdk_screen_width (),
gdk_screen_height ());
- /* These calls seem to have some effect, but it's not clear if
- * they are the right thing to do.
- */
- gtk_widget_set_uposition (GTK_WIDGET (window), 0, 0);
- gtk_widget_set_usize (GTK_WIDGET (window),
- gdk_screen_width (),
- gdk_screen_height ());
-
- /* Tell the window manager to never resize this. This is not
- * known to have any specific beneficial effect with any
- * particular window manager for the case of the desktop
- * window, but it doesn't seem to do any harm.
+ gtk_window_move (GTK_WINDOW (window), 0, 0);
+
+ /* shouldn't really be needed given our semantic type
+ * of _NET_WM_TYPE_DESKTOP, but why not
*/
- gtk_window_set_policy (GTK_WINDOW (window),
- FALSE, FALSE, FALSE);
+ gtk_window_set_resizable (GTK_WINDOW (window),
+ FALSE);
}
static void
@@ -295,51 +282,6 @@ realize (GtkWidget *widget)
/* This is the new way to set up the desktop window */
set_wmspec_desktop_hint (widget->window);
-
-#if GNOME2_CONVERSION_COMPLETE
- /* FIXME all this gnome_win_hints stuff is legacy cruft */
-
- /* Put this window behind all the others. */
- gnome_win_hints_set_layer (widget, WIN_LAYER_DESKTOP);
-
- /* Make things like the task list ignore this window and make
- * it clear that it it's at its full size.
- *
- * We originally included WIN_STATE_HIDDEN here, but IceWM
- * interprets that (wrongly, imho) as meaning `don't display
- * this window'. Not including this bit seems to make
- * no difference though, so..
- */
- gnome_win_hints_set_state (widget,
- WIN_STATE_STICKY
- | WIN_STATE_MAXIMIZED_VERT
- | WIN_STATE_MAXIMIZED_HORIZ
- | WIN_STATE_FIXED_POSITION
- | WIN_STATE_ARRANGE_IGNORE);
-
- /* Make sure that focus, and any window lists or task bars also
- * skip the window.
- */
- gnome_win_hints_set_hints (widget,
- WIN_HINTS_SKIP_WINLIST
- | WIN_HINTS_SKIP_TASKBAR
- | WIN_HINTS_SKIP_FOCUS);
-#endif
-
- /* FIXME bugzilla.gnome.org 41255:
- * Should we do a gdk_window_move_resize here, in addition to
- * the calls in initialize above that set the size?
- */
- gdk_window_move_resize (widget->window,
- 0, 0,
- gdk_screen_width (),
- gdk_screen_height ());
-
- /* Get rid of the things that window managers add to resize
- * and otherwise manipulate the window.
- */
- gdk_window_set_decorations (widget->window, 0);
- gdk_window_set_functions (widget->window, 0);
}
static void
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 16ea0b4a8..c7ceb50fd 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -371,7 +371,7 @@ forget_history_if_confirmed (NautilusWindow *window)
_("Cancel"),
GTK_WINDOW (window));
g_free (prompt);
-
+
#if GNOME2_CONVERSION_COMPLETE
gtk_signal_connect
(GTK_OBJECT (eel_gnome_dialog_get_button_by_index
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index dfaafaf85..0f5076cb1 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -506,92 +506,32 @@ set_initial_window_geometry (NautilusWindow *window)
* is evil. So we choose semi-arbitrary initial and
* minimum widths instead of letting GTK decide.
*/
-
+ /* FIXME - the above comment suggests that the size request
+ * of the content view area is wrong, probably because of
+ * another stupid set_usize someplace. If someone gets the
+ * content view area's size request right then we can
+ * probably remove this broken set_size_request() here.
+ * - hp@redhat.com
+ */
+
max_width_for_screen = get_max_forced_width ();
max_height_for_screen = get_max_forced_height ();
- gtk_widget_set_usize (GTK_WIDGET (window),
- MIN (NAUTILUS_WINDOW_MIN_WIDTH,
- max_width_for_screen),
- MIN (NAUTILUS_WINDOW_MIN_HEIGHT,
- max_height_for_screen));
+ gtk_widget_set_size_request (GTK_WIDGET (window),
+ MIN (NAUTILUS_WINDOW_MIN_WIDTH,
+ max_width_for_screen),
+ MIN (NAUTILUS_WINDOW_MIN_HEIGHT,
+ max_height_for_screen));
gtk_window_set_default_size (GTK_WINDOW (window),
MIN (NAUTILUS_WINDOW_DEFAULT_WIDTH,
max_width_for_screen),
MIN (NAUTILUS_WINDOW_DEFAULT_HEIGHT,
max_height_for_screen));
-
- gtk_window_set_policy (GTK_WINDOW (window),
- FALSE, /* don't let window be stretched
- smaller than usize */
- TRUE, /* do let the window be stretched
- larger than default size */
- FALSE); /* don't shrink the window
- automatically to fit contents */
-
}
#if GNOME2_CONVERSION_COMPLETE
-static void
-menu_bar_no_resize_hack_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- /* do nothing */
-}
-
-static void
-menu_bar_no_resize_hack_menu_bar_finder (GtkWidget *child, gpointer data)
-{
- if (GTK_IS_MENU_BAR (child)) {
- * (GtkObject **) data = GTK_OBJECT (child);
- }
-}
-
-/* Since there's only one desktop at a time, we can keep track
- * of our faux-class with a single static.
- */
-static GtkObjectClass *menu_bar_no_resize_hack_class;
-
-static void
-menu_bar_no_resize_hack_class_free (void)
-{
- g_free (menu_bar_no_resize_hack_class);
-}
-
-/* This call is used to keep the desktop menu bar from resizing.
- * It patches out its class with one where the size_allocate
- * method has been replaced with a no-op.
- */
-static void
-menu_bar_no_resize_hack (NautilusWindow *window)
-{
- GtkObject *menu_bar;
- GtkTypeQuery *type_query;
-
- menu_bar = NULL;
-
- eel_gtk_container_foreach_deep (GTK_CONTAINER (window),
- menu_bar_no_resize_hack_menu_bar_finder,
- &menu_bar);
-
- g_return_if_fail (menu_bar != NULL);
-
- if (menu_bar_no_resize_hack_class == NULL) {
- g_atexit (menu_bar_no_resize_hack_class_free);
- }
-
- type_query = gtk_type_query (menu_bar->klass->type);
- g_free (menu_bar_no_resize_hack_class);
- menu_bar_no_resize_hack_class = g_memdup (menu_bar->klass, type_query->class_size);
- g_free (type_query);
-
- ((GtkWidgetClass *) menu_bar_no_resize_hack_class)->size_allocate
- = menu_bar_no_resize_hack_size_allocate;
-
- menu_bar->klass = menu_bar_no_resize_hack_class;
-}
-
static gboolean
location_change_at_idle_callback (gpointer callback_data)
{
@@ -787,14 +727,6 @@ nautilus_window_constructed (NautilusWindow *window)
STATUS_BAR_PATH, TRUE);
nautilus_bonobo_set_hidden (window->details->shell_ui,
MENU_BAR_PATH, TRUE);
-
-#if GNOME2_CONVERSION_COMPLETE
- /* FIXME bugzilla.gnome.org 44752:
- * If we ever get the unsigned math errors in
- * gtk_menu_item_size_allocate fixed this can be removed.
- */
- menu_bar_no_resize_hack (window);
-#endif
}
/* Wrap the location bar in a control and set it up. */
@@ -1012,19 +944,18 @@ nautilus_window_destroy (GtkObject *object)
static void
nautilus_window_save_geometry (NautilusWindow *window)
{
-#if GNOME2_CONVERSION_COMPLETE
char *geometry_string;
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
g_return_if_fail (GTK_WIDGET_VISIBLE (window));
- geometry_string = gnome_geometry_string (GTK_WIDGET (window)->window);
+ geometry_string = eel_gtk_window_get_geometry_string (GTK_WINDOW (window));
+
nautilus_file_set_metadata (window->details->viewed_file,
NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY,
NULL,
geometry_string);
g_free (geometry_string);
-#endif
}
void
diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c
index dfaafaf85..0f5076cb1 100644
--- a/src/nautilus-object-window.c
+++ b/src/nautilus-object-window.c
@@ -506,92 +506,32 @@ set_initial_window_geometry (NautilusWindow *window)
* is evil. So we choose semi-arbitrary initial and
* minimum widths instead of letting GTK decide.
*/
-
+ /* FIXME - the above comment suggests that the size request
+ * of the content view area is wrong, probably because of
+ * another stupid set_usize someplace. If someone gets the
+ * content view area's size request right then we can
+ * probably remove this broken set_size_request() here.
+ * - hp@redhat.com
+ */
+
max_width_for_screen = get_max_forced_width ();
max_height_for_screen = get_max_forced_height ();
- gtk_widget_set_usize (GTK_WIDGET (window),
- MIN (NAUTILUS_WINDOW_MIN_WIDTH,
- max_width_for_screen),
- MIN (NAUTILUS_WINDOW_MIN_HEIGHT,
- max_height_for_screen));
+ gtk_widget_set_size_request (GTK_WIDGET (window),
+ MIN (NAUTILUS_WINDOW_MIN_WIDTH,
+ max_width_for_screen),
+ MIN (NAUTILUS_WINDOW_MIN_HEIGHT,
+ max_height_for_screen));
gtk_window_set_default_size (GTK_WINDOW (window),
MIN (NAUTILUS_WINDOW_DEFAULT_WIDTH,
max_width_for_screen),
MIN (NAUTILUS_WINDOW_DEFAULT_HEIGHT,
max_height_for_screen));
-
- gtk_window_set_policy (GTK_WINDOW (window),
- FALSE, /* don't let window be stretched
- smaller than usize */
- TRUE, /* do let the window be stretched
- larger than default size */
- FALSE); /* don't shrink the window
- automatically to fit contents */
-
}
#if GNOME2_CONVERSION_COMPLETE
-static void
-menu_bar_no_resize_hack_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- /* do nothing */
-}
-
-static void
-menu_bar_no_resize_hack_menu_bar_finder (GtkWidget *child, gpointer data)
-{
- if (GTK_IS_MENU_BAR (child)) {
- * (GtkObject **) data = GTK_OBJECT (child);
- }
-}
-
-/* Since there's only one desktop at a time, we can keep track
- * of our faux-class with a single static.
- */
-static GtkObjectClass *menu_bar_no_resize_hack_class;
-
-static void
-menu_bar_no_resize_hack_class_free (void)
-{
- g_free (menu_bar_no_resize_hack_class);
-}
-
-/* This call is used to keep the desktop menu bar from resizing.
- * It patches out its class with one where the size_allocate
- * method has been replaced with a no-op.
- */
-static void
-menu_bar_no_resize_hack (NautilusWindow *window)
-{
- GtkObject *menu_bar;
- GtkTypeQuery *type_query;
-
- menu_bar = NULL;
-
- eel_gtk_container_foreach_deep (GTK_CONTAINER (window),
- menu_bar_no_resize_hack_menu_bar_finder,
- &menu_bar);
-
- g_return_if_fail (menu_bar != NULL);
-
- if (menu_bar_no_resize_hack_class == NULL) {
- g_atexit (menu_bar_no_resize_hack_class_free);
- }
-
- type_query = gtk_type_query (menu_bar->klass->type);
- g_free (menu_bar_no_resize_hack_class);
- menu_bar_no_resize_hack_class = g_memdup (menu_bar->klass, type_query->class_size);
- g_free (type_query);
-
- ((GtkWidgetClass *) menu_bar_no_resize_hack_class)->size_allocate
- = menu_bar_no_resize_hack_size_allocate;
-
- menu_bar->klass = menu_bar_no_resize_hack_class;
-}
-
static gboolean
location_change_at_idle_callback (gpointer callback_data)
{
@@ -787,14 +727,6 @@ nautilus_window_constructed (NautilusWindow *window)
STATUS_BAR_PATH, TRUE);
nautilus_bonobo_set_hidden (window->details->shell_ui,
MENU_BAR_PATH, TRUE);
-
-#if GNOME2_CONVERSION_COMPLETE
- /* FIXME bugzilla.gnome.org 44752:
- * If we ever get the unsigned math errors in
- * gtk_menu_item_size_allocate fixed this can be removed.
- */
- menu_bar_no_resize_hack (window);
-#endif
}
/* Wrap the location bar in a control and set it up. */
@@ -1012,19 +944,18 @@ nautilus_window_destroy (GtkObject *object)
static void
nautilus_window_save_geometry (NautilusWindow *window)
{
-#if GNOME2_CONVERSION_COMPLETE
char *geometry_string;
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
g_return_if_fail (GTK_WIDGET_VISIBLE (window));
- geometry_string = gnome_geometry_string (GTK_WIDGET (window)->window);
+ geometry_string = eel_gtk_window_get_geometry_string (GTK_WINDOW (window));
+
nautilus_file_set_metadata (window->details->viewed_file,
NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY,
NULL,
geometry_string);
g_free (geometry_string);
-#endif
}
void
diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c
index dfaafaf85..0f5076cb1 100644
--- a/src/nautilus-spatial-window.c
+++ b/src/nautilus-spatial-window.c
@@ -506,92 +506,32 @@ set_initial_window_geometry (NautilusWindow *window)
* is evil. So we choose semi-arbitrary initial and
* minimum widths instead of letting GTK decide.
*/
-
+ /* FIXME - the above comment suggests that the size request
+ * of the content view area is wrong, probably because of
+ * another stupid set_usize someplace. If someone gets the
+ * content view area's size request right then we can
+ * probably remove this broken set_size_request() here.
+ * - hp@redhat.com
+ */
+
max_width_for_screen = get_max_forced_width ();
max_height_for_screen = get_max_forced_height ();
- gtk_widget_set_usize (GTK_WIDGET (window),
- MIN (NAUTILUS_WINDOW_MIN_WIDTH,
- max_width_for_screen),
- MIN (NAUTILUS_WINDOW_MIN_HEIGHT,
- max_height_for_screen));
+ gtk_widget_set_size_request (GTK_WIDGET (window),
+ MIN (NAUTILUS_WINDOW_MIN_WIDTH,
+ max_width_for_screen),
+ MIN (NAUTILUS_WINDOW_MIN_HEIGHT,
+ max_height_for_screen));
gtk_window_set_default_size (GTK_WINDOW (window),
MIN (NAUTILUS_WINDOW_DEFAULT_WIDTH,
max_width_for_screen),
MIN (NAUTILUS_WINDOW_DEFAULT_HEIGHT,
max_height_for_screen));
-
- gtk_window_set_policy (GTK_WINDOW (window),
- FALSE, /* don't let window be stretched
- smaller than usize */
- TRUE, /* do let the window be stretched
- larger than default size */
- FALSE); /* don't shrink the window
- automatically to fit contents */
-
}
#if GNOME2_CONVERSION_COMPLETE
-static void
-menu_bar_no_resize_hack_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- /* do nothing */
-}
-
-static void
-menu_bar_no_resize_hack_menu_bar_finder (GtkWidget *child, gpointer data)
-{
- if (GTK_IS_MENU_BAR (child)) {
- * (GtkObject **) data = GTK_OBJECT (child);
- }
-}
-
-/* Since there's only one desktop at a time, we can keep track
- * of our faux-class with a single static.
- */
-static GtkObjectClass *menu_bar_no_resize_hack_class;
-
-static void
-menu_bar_no_resize_hack_class_free (void)
-{
- g_free (menu_bar_no_resize_hack_class);
-}
-
-/* This call is used to keep the desktop menu bar from resizing.
- * It patches out its class with one where the size_allocate
- * method has been replaced with a no-op.
- */
-static void
-menu_bar_no_resize_hack (NautilusWindow *window)
-{
- GtkObject *menu_bar;
- GtkTypeQuery *type_query;
-
- menu_bar = NULL;
-
- eel_gtk_container_foreach_deep (GTK_CONTAINER (window),
- menu_bar_no_resize_hack_menu_bar_finder,
- &menu_bar);
-
- g_return_if_fail (menu_bar != NULL);
-
- if (menu_bar_no_resize_hack_class == NULL) {
- g_atexit (menu_bar_no_resize_hack_class_free);
- }
-
- type_query = gtk_type_query (menu_bar->klass->type);
- g_free (menu_bar_no_resize_hack_class);
- menu_bar_no_resize_hack_class = g_memdup (menu_bar->klass, type_query->class_size);
- g_free (type_query);
-
- ((GtkWidgetClass *) menu_bar_no_resize_hack_class)->size_allocate
- = menu_bar_no_resize_hack_size_allocate;
-
- menu_bar->klass = menu_bar_no_resize_hack_class;
-}
-
static gboolean
location_change_at_idle_callback (gpointer callback_data)
{
@@ -787,14 +727,6 @@ nautilus_window_constructed (NautilusWindow *window)
STATUS_BAR_PATH, TRUE);
nautilus_bonobo_set_hidden (window->details->shell_ui,
MENU_BAR_PATH, TRUE);
-
-#if GNOME2_CONVERSION_COMPLETE
- /* FIXME bugzilla.gnome.org 44752:
- * If we ever get the unsigned math errors in
- * gtk_menu_item_size_allocate fixed this can be removed.
- */
- menu_bar_no_resize_hack (window);
-#endif
}
/* Wrap the location bar in a control and set it up. */
@@ -1012,19 +944,18 @@ nautilus_window_destroy (GtkObject *object)
static void
nautilus_window_save_geometry (NautilusWindow *window)
{
-#if GNOME2_CONVERSION_COMPLETE
char *geometry_string;
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
g_return_if_fail (GTK_WIDGET_VISIBLE (window));
- geometry_string = gnome_geometry_string (GTK_WIDGET (window)->window);
+ geometry_string = eel_gtk_window_get_geometry_string (GTK_WINDOW (window));
+
nautilus_file_set_metadata (window->details->viewed_file,
NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY,
NULL,
geometry_string);
g_free (geometry_string);
-#endif
}
void
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 16ea0b4a8..c7ceb50fd 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -371,7 +371,7 @@ forget_history_if_confirmed (NautilusWindow *window)
_("Cancel"),
GTK_WINDOW (window));
g_free (prompt);
-
+
#if GNOME2_CONVERSION_COMPLETE
gtk_signal_connect
(GTK_OBJECT (eel_gnome_dialog_get_button_by_index
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index dfaafaf85..0f5076cb1 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -506,92 +506,32 @@ set_initial_window_geometry (NautilusWindow *window)
* is evil. So we choose semi-arbitrary initial and
* minimum widths instead of letting GTK decide.
*/
-
+ /* FIXME - the above comment suggests that the size request
+ * of the content view area is wrong, probably because of
+ * another stupid set_usize someplace. If someone gets the
+ * content view area's size request right then we can
+ * probably remove this broken set_size_request() here.
+ * - hp@redhat.com
+ */
+
max_width_for_screen = get_max_forced_width ();
max_height_for_screen = get_max_forced_height ();
- gtk_widget_set_usize (GTK_WIDGET (window),
- MIN (NAUTILUS_WINDOW_MIN_WIDTH,
- max_width_for_screen),
- MIN (NAUTILUS_WINDOW_MIN_HEIGHT,
- max_height_for_screen));
+ gtk_widget_set_size_request (GTK_WIDGET (window),
+ MIN (NAUTILUS_WINDOW_MIN_WIDTH,
+ max_width_for_screen),
+ MIN (NAUTILUS_WINDOW_MIN_HEIGHT,
+ max_height_for_screen));
gtk_window_set_default_size (GTK_WINDOW (window),
MIN (NAUTILUS_WINDOW_DEFAULT_WIDTH,
max_width_for_screen),
MIN (NAUTILUS_WINDOW_DEFAULT_HEIGHT,
max_height_for_screen));
-
- gtk_window_set_policy (GTK_WINDOW (window),
- FALSE, /* don't let window be stretched
- smaller than usize */
- TRUE, /* do let the window be stretched
- larger than default size */
- FALSE); /* don't shrink the window
- automatically to fit contents */
-
}
#if GNOME2_CONVERSION_COMPLETE
-static void
-menu_bar_no_resize_hack_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- /* do nothing */
-}
-
-static void
-menu_bar_no_resize_hack_menu_bar_finder (GtkWidget *child, gpointer data)
-{
- if (GTK_IS_MENU_BAR (child)) {
- * (GtkObject **) data = GTK_OBJECT (child);
- }
-}
-
-/* Since there's only one desktop at a time, we can keep track
- * of our faux-class with a single static.
- */
-static GtkObjectClass *menu_bar_no_resize_hack_class;
-
-static void
-menu_bar_no_resize_hack_class_free (void)
-{
- g_free (menu_bar_no_resize_hack_class);
-}
-
-/* This call is used to keep the desktop menu bar from resizing.
- * It patches out its class with one where the size_allocate
- * method has been replaced with a no-op.
- */
-static void
-menu_bar_no_resize_hack (NautilusWindow *window)
-{
- GtkObject *menu_bar;
- GtkTypeQuery *type_query;
-
- menu_bar = NULL;
-
- eel_gtk_container_foreach_deep (GTK_CONTAINER (window),
- menu_bar_no_resize_hack_menu_bar_finder,
- &menu_bar);
-
- g_return_if_fail (menu_bar != NULL);
-
- if (menu_bar_no_resize_hack_class == NULL) {
- g_atexit (menu_bar_no_resize_hack_class_free);
- }
-
- type_query = gtk_type_query (menu_bar->klass->type);
- g_free (menu_bar_no_resize_hack_class);
- menu_bar_no_resize_hack_class = g_memdup (menu_bar->klass, type_query->class_size);
- g_free (type_query);
-
- ((GtkWidgetClass *) menu_bar_no_resize_hack_class)->size_allocate
- = menu_bar_no_resize_hack_size_allocate;
-
- menu_bar->klass = menu_bar_no_resize_hack_class;
-}
-
static gboolean
location_change_at_idle_callback (gpointer callback_data)
{
@@ -787,14 +727,6 @@ nautilus_window_constructed (NautilusWindow *window)
STATUS_BAR_PATH, TRUE);
nautilus_bonobo_set_hidden (window->details->shell_ui,
MENU_BAR_PATH, TRUE);
-
-#if GNOME2_CONVERSION_COMPLETE
- /* FIXME bugzilla.gnome.org 44752:
- * If we ever get the unsigned math errors in
- * gtk_menu_item_size_allocate fixed this can be removed.
- */
- menu_bar_no_resize_hack (window);
-#endif
}
/* Wrap the location bar in a control and set it up. */
@@ -1012,19 +944,18 @@ nautilus_window_destroy (GtkObject *object)
static void
nautilus_window_save_geometry (NautilusWindow *window)
{
-#if GNOME2_CONVERSION_COMPLETE
char *geometry_string;
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
g_return_if_fail (GTK_WIDGET_VISIBLE (window));
- geometry_string = gnome_geometry_string (GTK_WIDGET (window)->window);
+ geometry_string = eel_gtk_window_get_geometry_string (GTK_WINDOW (window));
+
nautilus_file_set_metadata (window->details->viewed_file,
NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY,
NULL,
geometry_string);
g_free (geometry_string);
-#endif
}
void
diff --git a/src/nautilus-zoom-control.c b/src/nautilus-zoom-control.c
index fc72a64b8..5b0f8e1f9 100644
--- a/src/nautilus-zoom-control.c
+++ b/src/nautilus-zoom-control.c
@@ -344,26 +344,6 @@ draw_zoom_control_image (GtkWidget *widget, GdkRectangle *box)
}
}
-#if GNOME2_CONVERSION_COMPLETE
-
-static void
-nautilus_zoom_control_draw (GtkWidget *widget, GdkRectangle *box)
-{
- g_return_if_fail (widget != NULL);
- g_return_if_fail (NAUTILUS_IS_ZOOM_CONTROL (widget));
-
- /* Clear the widget get the default widget background before drawing our stuff */
- gdk_window_clear_area (widget->window,
- 0,
- 0,
- widget->allocation.width,
- widget->allocation.height);
- draw_zoom_control_image (widget, box);
- draw_number (widget, box);
-}
-
-#endif
-
/* handle expose events */
static int
@@ -740,9 +720,6 @@ nautilus_zoom_control_class_init (NautilusZoomControlClass *zoom_control_class)
object_class->destroy = nautilus_zoom_control_destroy;
-#if GNOME2_CONVERSION_COMPLETE
- widget_class->draw = nautilus_zoom_control_draw;
-#endif
widget_class->expose_event = nautilus_zoom_control_expose;
widget_class->button_press_event = nautilus_zoom_control_button_press_event;
widget_class->leave_notify_event = nautilus_zoom_control_leave_notify;