workaround problem with chat view not displaying as it should with chinese

languages. It is a gtk bug, same as the one previously workarounded with
the GtkEntry. The same workaround works for the GtkTextView.
This commit is contained in:
Simon Morlat 2014-10-06 17:53:15 +02:00
parent aa298d645c
commit 400c26cf1e
2 changed files with 7 additions and 7 deletions

View file

@ -379,7 +379,7 @@ GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddres
GdkColor colorb;
int idx;
GtkWidget *button;
GtkWidget *entry;
GtkWidget *entry = linphone_gtk_get_widget(chat_view,"text_entry");
MSList *messages;
GHashTable *table;
char *with_str;
@ -423,7 +423,7 @@ GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddres
display_history_message(chat_view,messages,with);
button = linphone_gtk_get_widget(chat_view,"send");
g_signal_connect_swapped(G_OBJECT(button),"clicked",(GCallback)linphone_gtk_send_text,NULL);
entry = linphone_gtk_get_widget(chat_view,"text_entry");
g_signal_connect_swapped(G_OBJECT(entry),"activate",(GCallback)linphone_gtk_send_text,NULL);
g_signal_connect_swapped(G_OBJECT(entry),"changed",(GCallback)linphone_gtk_compose_text,NULL);
g_signal_connect(G_OBJECT(notebook),"switch_page",(GCallback)linphone_gtk_notebook_tab_select,NULL);

View file

@ -440,9 +440,9 @@ GtkWidget *linphone_gtk_create_widget(const char *filename, const char *widget_n
return w;
}
static void entry_unmapped(GtkWidget *entry){
g_message("Entry is unmapped, calling unrealize to workaround chinese bug.");
gtk_widget_unrealize(entry);
static void entry_unmapped(GtkWidget *widget){
ms_message("%s is unmapped, calling unrealize to workaround chinese bug.",G_OBJECT_TYPE_NAME(widget));
gtk_widget_unrealize(widget);
}
GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){
@ -459,10 +459,10 @@ GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){
g_error("No widget named %s found in xml interface.",name);
}
if (workaround_gtk_entry_chinese_bug){
if (strcmp(G_OBJECT_TYPE_NAME(w),"GtkEntry")==0){
if (strcmp(G_OBJECT_TYPE_NAME(w),"GtkEntry")==0 || strcmp(G_OBJECT_TYPE_NAME(w),"GtkTextView")==0){
if (g_object_get_data(G_OBJECT(w),"entry_bug_workaround")==NULL){
g_object_set_data(G_OBJECT(w),"entry_bug_workaround",GINT_TO_POINTER(1));
g_message("%s is a GtkEntry",name);
ms_message("%s is a %s",name,G_OBJECT_TYPE_NAME(w));
g_signal_connect(G_OBJECT(w),"unmap",(GCallback)entry_unmapped,NULL);
}
}