From 963a4fdc81e884c3cf27ac6c67010cc4d2a9fd32 Mon Sep 17 00:00:00 2001 From: Josh Elsasser Date: Fri, 23 Feb 2007 11:49:18 +0000 Subject: [PATCH] Clamp file progress to 0.0-1.0 Clear focus when opening files dialog. --- gtk/util.c | 1 + libtransmission/torrent.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/gtk/util.c b/gtk/util.c index 76f44db7e..42c86213f 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -372,6 +372,7 @@ windowsizehack( GtkWidget * wind, GtkWidget * scroll, GtkWidget * view, } gtk_widget_show_now( wind ); gtk_window_resize( GTK_WINDOW( wind ), width, height ); + gtk_window_set_focus( GTK_WINDOW( wind ), NULL ); } void diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 5a2916e95..7258ed479 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -533,6 +533,8 @@ float * tr_torrentCompletion( tr_torrent_t * tor ) assert( -0.1 < weight && 1.1 > weight ); if( fileoff == filelen ) { + ret[file] = MIN( 1.0, ret[file] ); + ret[file] = MAX( 0.0, ret[file] ); filestart += fileoff; fileoff = 0; file++;