Reduce flashing redraw from automatic partition selection (#696149)

Automatic selection of the largest unallocated partition caused flashing
redraw of the partition graphic and partition list.  Both the partition
graphic and partition list were being drawn blank then redrawn fully
populated.  This only happened on some distributions including:
CentOS 5.10, 6.5, 7.0, Debian 6, Fedora 14, 20, Xubuntu 14.04 LTS.  Did
not happen on: Kubuntu 12.04 LTS.

This is a workaround, not a complete fix.  It moves automatic selection
of the largest unallocated partition to after processing of the GTK
Event loop in Refresh_Visual() which redraws the partition graphic and
partition list.  These visuals are now drawn only once, fully populated,
however this draws them without the selected partition.  The partition
selection is then drawn afterwards which causes the selection to flash
instead.  This is significant improvement to the whole partition graphic
and partition list flashing when redrawn.

Bug #696149 - Double refresh of display introduced with default
              unallocated space
This commit is contained in:
Mike Fleetwood 2014-08-23 10:41:42 +01:00 committed by Curtis Gedak
parent 52ee26f971
commit 0fb8cce699
1 changed files with 10 additions and 4 deletions

View File

@ -893,15 +893,21 @@ void Win_GParted::Refresh_Visual()
set_valid_operations() ;
// Process Gtk events to redraw visuals with reloaded partition details
while ( Gtk::Main::events_pending() )
Gtk::Main::iteration();
if ( largest_unalloc_size >= 0 )
{
//Inform visuals of selection of the largest unallocated partition
// Flashing redraw work around. Inform visuals of selection of the
// largest unallocated partition after drawing those visuals above.
drawingarea_visualdisk .set_selected( selected_partition ) ;
treeview_detail .set_selected( selected_partition ) ;
}
while ( Gtk::Main::events_pending() )
Gtk::Main::iteration() ;
// Process Gtk events to draw selection
while ( Gtk::Main::events_pending() )
Gtk::Main::iteration();
}
}
bool Win_GParted::Quit_Check_Operations()