• Mike Fleetwood's avatar
    Prevent the UI hanging while gpart data rescue is running (#772123) · aeebee9c
    Mike Fleetwood authored
    Running Device > Attempt Data Rescue... hangs the GParted UI for as long
    as gpart takes to scan the whole disk device looking for file system
    signatures.
    
    Originally when gpart support was added by commit [1] a separate thread
    was created to run gpart.  Then most threading was removed by commit [2]
    which left gpart running in the main thread blocking the UI.
    
    [1] ef37bdb7
        Added support to lost data recovery using gpart
    
    [2] 52a2a9b0
        Reduce threading (#685740)
    
    guess_partition_table() hand codes using Glib to run the gpart command
    asynchronously reading standard output, but it just doesn't run the Gtk
    main loop to process events, hence the UI hangs.  Instead just use
    Utils::execute_command() which handles everything already.  It runs the
    commands asynchronously, reading output and if being run in the main
    thread also calls the Gtk main loop to keep the UI responsive.
    
    Bug 772123 - GParted is unresponsive while gpart is running
    aeebee9c
GParted_Core.cc 141 KB