After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692643 - Hide a CompletionInfo window
Hide a CompletionInfo window
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on: 697200
Blocks:
 
 
Reported: 2013-01-27 16:34 UTC by Sébastien Wilmet
Modified: 2013-04-15 10:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Doc: explain when to hide a CompletionInfo window (1.13 KB, patch)
2013-01-27 16:34 UTC, Sébastien Wilmet
committed Details | Review

Description Sébastien Wilmet 2013-01-27 16:34:25 UTC
If a CompletionInfo window is used without the Completion machinery, the application must hide the window explicitly on certain signals.

So it's better to document this.

To make the life easier for application writers, we can use the "GtkWindow:transient-for" or "GtkWindow:attached-to" properties of the CompletionInfo window, to hide the window when the focus-out-event signal is emitted on the specified widget. Do you think it's a good idea?
Comment 1 Sébastien Wilmet 2013-01-27 16:34:27 UTC
Created attachment 234546 [details] [review]
Doc: explain when to hide a CompletionInfo window
Comment 2 Ignacio Casal Quinteiro (nacho) 2013-01-27 16:37:04 UTC
Review of attachment 234546 [details] [review]:

Looks good by fix the comment inline. Feel free to push after fixing it.

::: gtksourceview/gtksourcecompletioninfo.c
@@ +51,3 @@
+ * you should hide it when the #GtkWidget::focus-out-event signal is emitted by
+ * the #GtkTextView. You may also be interested by the
+ * #GtkTextBuffer:cursor-position property (when its value is modified). If you

#GtkTextBuffer::cursor-position <- missing :
Comment 3 Sébastien Wilmet 2013-01-27 17:02:46 UTC
A property takes only one ":", else the link doesn't work IIRC.

For the idea about the "GtkWindow:transient-for" or "GtkWindow:attached-to" properties, I think the "attached-to" property is better, because it can be any GtkWidget, while the "transient-for" property is a GtkWindow.

For example, we can attach the calltip to the GtkSourceView widget, so when the document tab is changed in the text editor, the focus-out-event signal is emitted and the calltip is hidden.

With the "transient-for", it's when the complete window looses focus.
Comment 4 Sébastien Wilmet 2013-04-03 17:56:32 UTC
After a discussion on IRC, Jesse has said it's a good idea, for the "attached-to".

It is implemented on the wip/completion-next-cycle branch.
Comment 5 Sébastien Wilmet 2013-04-15 10:53:58 UTC
Pushed on the master branch.