[gparted] Prevent visual disk display area from disappearing



commit ec876448b4539a1e25272fe3f9ebb44552d3df53
Author: Curtis Gedak <gedakc gmail com>
Date:   Wed Jan 19 15:32:56 2011 -0700

    Prevent visual disk display area from disappearing
    
    Added a display refresh to the event queue to address this
    problem.
    
    Previously, the display area of the visual disk seemed to
    disappear when enough operations had been added to the queue so
    that a scrollbar was required (about 4 operations).
    
    If the three lines in HBoxOperations::load_operations method for
    "//make scrollwindow focus on the last operation in the list"
    were commented out then this also prevented the problem from
    occurring.
    
    Interestingly, if I changed the "set_cursor" method to
    a "scroll_to_row" method, then this problem does not occur for an
    additional 2 operations (about 6 operations total).
    
    Ubuntu launchpad bug 583746 - Partition graph disappears after a
                                  swap partition has been deleted
    https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/583746

 src/Win_GParted.cc |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index c36b573..fed0347 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -689,6 +689,16 @@ void Win_GParted::Add_Operation( Operation * operation, int index )
 			
 			if ( operations .size() == 1 ) //first operation, open operationslist
 				open_operationslist() ;
+
+			//FIXME:  A slight flicker may be introduced by this extra display refresh.
+			//An extra display refresh seems to prevent the disk area visual disk from
+			//  disappearing when enough operations are added to require a scrollbar
+			//  (about 4 operations with default window size).
+			//  Note that commenting out the code to
+			//  "//make scrollwindow focus on the last operation in the list"
+			//  in HBoxOperations::load_operations() prevents this problem from occurring as well.
+			//  See also Win_GParted::activate_undo().
+			drawingarea_visualdisk .queue_draw() ;
 		}
 		else
 		{
@@ -2143,6 +2153,13 @@ void Win_GParted::activate_undo()
 	
 	if ( ! operations .size() )
 		close_operationslist() ;
+
+	//FIXME:  A slight flicker may be introduced by this extra display refresh.
+	//An extra display refresh seems to prevent the disk area visual disk from
+	//  disappearing when there enough operations to require a scrollbar
+	//  (about 4+ operations with default window size) and a user clicks on undo.
+	//  See also Win_GParted::Add_operation().
+	drawingarea_visualdisk .queue_draw() ;
 }
 
 void Win_GParted::remove_operation( int index, bool remove_all ) 



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