[PATCH] Use correct logic for delaying updates while loading

Good day all,

I'm trying to resolve the bug at Launchpad #390662 [1] and might be
related to gnome #599680 [2]. A patch which works for me is attached.

The problem is that when you first open a window there is a period of
about one second where if you click on a file and immediately press
ctrl-c or a related accelerator it does not take effect.

The problem seems to be in changes_timeout_callback() which is
responsible for incrementing or resetting the FMDirectoryView's
update_interval. This update_interval is used as a callback timeout
which calls real_update_menus(), allowing the keyboard shortcut to work.

If the view loads quickly and view->details->loading quickly becomes
false, up until UPDATE_INTERVAL_RESET*1000 (one second) the
update_interval is increased in a couple of steps of 250, then is reset
to 100. If you click on the file while this number is elevated it takes
longer before you can use the shortcuts.

My best guess is that the logic is wrong: shouldn't the update interval
be increased if the view is still loading, rather than only if it has?
If if this is incorrect or the wrong approach, please let me know!



[1] https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/390662
[2] https://bugzilla.gnome.org/show_bug.cgi?id=599680
From 8e597d4b4426fb74ee8eb2442ecb43a65c9c8db5 Mon Sep 17 00:00:00 2001
From: Thomas Karpiniec <arctanx arctanx id au>
Date: Tue, 8 Jun 2010 20:57:53 +1000
Subject: [PATCH] Use correct logic for delaying updates while loading

 src/file-manager/fm-directory-view.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 24b24a9..171be04 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -3107,7 +3107,7 @@ changes_timeout_callback (gpointer data)
 	if (time_delta < UPDATE_INTERVAL_RESET*1000) {
 		if (view->details->update_interval < UPDATE_INTERVAL_MAX &&
-			!view->details->loading) {
+			view->details->loading) {
 			/* Increase */
 			view->details->update_interval += UPDATE_INTERVAL_INC;

Attachment: signature.asc
Description: OpenPGP digital signature

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