[Geany-Devel] Focus lost when last document closed

Lex Trotman elextr at xxxxx
Mon May 27 01:03:55 UTC 2013

On 27 May 2013 07:51, Pallai Roland <pallair at magex.hu> wrote:

> Hi,
> I'm struggling with an issue: GTK focus lost when last document closed.

Can you describe more clearly what the problem you are trying to solve is?
AFAICT Geany retains focus after the last document is closed.


> 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.
> I tried for a while with gtk_container_set_focus_chain() but no luck.
> Maybe my bad, I have no experience with GTK.
> Other, simple solution if Geany provides a new API call. eg.:
>  void ui_focus_history_push(GtkWidget *widget);
> 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.
> Another solution to extend
>  document_open_file(const gchar *locale_filename, gboolean readonly,
> GeanyFiletype *ft, const gchar *forced_enc)
> with "GtkWidget *widget" or introduce a new function like
>  document_open_file_from_widget(const gchar *locale_filename, gboolean
> readonly, GeanyFiletype *ft, const gchar *forced_enc, GtkWidget *widget)
> 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.
> How should I fix it?
> --
>  Roland Pallai
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20130527/3ee6a474/attachment.html>

More information about the Devel mailing list