On 13-10-16 12:04 PM, Dimitar Zhekov wrote:
[snip]
Actually, I finished most of it, what remains is mainly blocking Geany while the new async tools execution is running.
Sync spawning is not good, because I'm using the Geany message loop for async I/O (somewhat similar to g_main_context_add_poll), not real Win32 events and threads as GLib does.
Locking the file, as Matthew suggested, will not be sufficient: one can still close it, reload it, and of course change the selection (SCI docs assume close/reload are be blocked for background saving).
Yeah, in a program like Geany where it doesn't use Actions to make it easy to control the multiple widgets that represent the same action, it's certainly less trivial. That's why I said "Assuming re-writing more of the code isn't actually a bad thing..." :) For example, if Geany was made to use actions, you could disable closing and reloading as simple as two calls like:
gtk_action_set_sensitive(actionClose, false); gtk_action_set_sensitive(actionReload, false);
or some document-specific variation of that. In the case of my little editor I was writing, I had the Qt actions and also the translucent overlay (mentioned but not shown) which prevented the user from interacting with the Scintilla view while locked.
Cheers, Matthew Brush