<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 27 May 2013 07:51, Pallai Roland <span dir="ltr"><<a href="mailto:pallair@magex.hu" target="_blank">pallair@magex.hu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br><br>I'm struggling with an issue: GTK focus lost when last document closed.<br></blockquote><div><br></div>
<div style>Can you describe more clearly what the problem you are trying to solve is? AFAICT Geany retains focus after the last document is closed.</div><div style><br></div><div style>Cheers</div><div style>Lex</div><div>
<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>To grab the focus by a plugin (eg. filebrowser) on such case would be an easy task, but not right, because the user can open documents from many widgets, the focus should return there.<br>

<br>I tried for a while with gtk_container_set_focus_chain() but no luck. Maybe my bad, I have no experience with GTK.<br><br>Other, simple solution if Geany provides a new API call. eg.:<br> void ui_focus_history_push(GtkWidget *widget);<br>

and widgets/plugins can call it on focus-out-event, so Geany (or a plugin) can restore the focus if there is no better strategy.<br><br>Another solution to extend<br> document_open_file(const gchar *locale_filename, gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc)<br>

with "GtkWidget *widget" or introduce a new function like<br> document_open_file_from_widget(const gchar *locale_filename, gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc, GtkWidget *widget)<br>to store opening widget with the document, but I think this can cause weird behavior if the last closed document were opened from a dialog window.<br>

<br>How should I fix it?<br><br><br>--<br> Roland Pallai<br><br>
<br>_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br>
<br></blockquote></div><br></div></div>