@kugel- commented on this pull request.


In src/socket.c:

> @@ -688,7 +698,10 @@ gboolean socket_lock_input_cb(GIOChannel *source, GIOCondition condition, gpoint
 				if (buf_len > 0 && buf[buf_len - 1] == '\n')
 					buf[buf_len - 1] = '\0';
 
-				handle_input_filename(buf);
+				// Important:
+				// avoid creating documents now because there could be a modal dialog open.
+				// modal code may call document_get_current and assume it hasn't changed
+				g_timeout_add(100, handle_input_filename, g_strdup(buf));

Interesting that g_idle_add() is problematic. I thought idle callbacks aren't run when a model dialog is open (because the API is synchornous) but I guess the API runs a separate mainloop internally which runs idle callbacks (and the GIO input callback here...).

100ms is a bit look for my taste. These could be user visible. I think 30ms could do the job as well without causing CPU problems. But I guess not a big deal for this niche problem.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/3395/review/1302329025@github.com>