[Bug 910] Notes : When edit the title, the last letter not committed.

[email protected]
Newsgroups gmane.comp.desktop.xfce.goodies.devel
Message-ID <[email protected]>
Do NOT reply to this email.  To make further comments on this bug, use
the URL below:
http://bugzilla.xfce.org/show_bug.cgi?id=910





------- Additional Comments From [email protected]  2005-04-14 12:45 UTC -------
GtkEntry has "activate" signal which will be emitted when user press return key.
I think this problem can be solved by connecting to "activate" signal instead of 
"key-press-event".

I made a patch, but I did not test it :)
See below:

--- notes.c.orig        2005-04-14 21:40:45.000000000 +0900
+++ notes.c     2005-04-14 21:42:52.000000000 +0900
@@ -82,14 +82,10 @@
     return;
 }

-gboolean
-on_title_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
+void
+on_title_activate(GtkWidget *widget, gpointer data)
 {
-    if (event->type == GDK_KEY_PRESS) {
-       if ((event->keyval == GDK_Return) || (event->keyval == GDK_KP_Enter)) {
-           on_title_change_done((Note *)data);
-       }
-    }
+    on_title_change_done((Note *)data);
     return FALSE;
 }

@@ -272,8 +268,8 @@
     /* when double-clicked the title becomes visible, send Note as data */
     g_signal_connect(G_OBJECT(event_box), "button_press_event",
                     G_CALLBACK(on_title_change), (gpointer)note);
-    g_signal_connect(G_OBJECT(title), "key-press-event",
-                    G_CALLBACK(on_title_key_press), (gpointer)note);
+    g_signal_connect(G_OBJECT(title), "activate",
+                    G_CALLBACK(on_title_activate), (gpointer)note);

     g_signal_connect(G_OBJECT(text_view), "focus-in-event",
                     G_CALLBACK(on_text_view_focus_in), (gpointer)note);


-- 
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.