• Albert Gräf's avatar
    Fix the findbox regression, part 2. · 12ab314b
    Albert Gräf authored
    This gets rid of some race conditions in the find operation, by ensuring
    that edit mode is only updated *after* mapping a subpatch window.
    
    This bug manifested itself when searching for objects in subpatches
    which are not visible at the time the find operation gets invoked. In
    this case, on the GUI side we both have to create the subpatch window
    and put it in edit mode. In the previous implementation these two
    operations would be executed separately and asynchronously. The end
    result was that usually the latter operation setting the edit mode in
    the GUI would win out, and the edit mode would later get overwritten
    again when the window was created.
    
    We fixed that race condition by ensuring that the engine is queried for
    its current edit mode status after creating a canvas window. The engine
    replies with a call to gui_canvas_set_editmode() in the GUI and thus the
    edit mode in the GUI now properly reflects the status in the engine
    after a window is mapped.
    
    TL;DR: This fix should now make sure that edit mode on the GUI side
    reflects that of the engine at all times.
    12ab314b
g_editor.c 291 KB