Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
3860e1c4
Commit
3860e1c4
authored
Jun 29, 2012
by
Simon Morlat
Browse files
attempt workaround for GtkEntry bug under windows and chinese language.
parent
9f02a12f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
gtk/main.c
gtk/main.c
+18
-0
No files found.
gtk/main.c
View file @
3860e1c4
...
...
@@ -77,6 +77,7 @@ static gboolean iconified=FALSE;
static
gchar
*
workingdir
=
NULL
;
static
char
*
progpath
=
NULL
;
gchar
*
linphone_logfile
=
NULL
;
static
gboolean
workaround_gtk_entry_chinese_bug
=
FALSE
;
static
GOptionEntry
linphone_options
[]
=
{
{
...
...
@@ -347,6 +348,11 @@ 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
);
}
GtkWidget
*
linphone_gtk_get_widget
(
GtkWidget
*
window
,
const
char
*
name
){
GtkBuilder
*
builder
=
(
GtkBuilder
*
)
g_object_get_data
(
G_OBJECT
(
window
),
"builder"
);
GObject
*
w
;
...
...
@@ -358,6 +364,15 @@ GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){
if
(
w
==
NULL
){
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
(
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
);
g_signal_connect
(
G_OBJECT
(
w
),
"unmap"
,(
GCallback
)
entry_unmapped
,
NULL
);
}
}
}
return
GTK_WIDGET
(
w
);
}
...
...
@@ -1765,6 +1780,9 @@ int main(int argc, char *argv[]){
char
tmp
[
128
];
snprintf
(
tmp
,
sizeof
(
tmp
),
"LANG=%s"
,
lang
);
_putenv
(
tmp
);
if
(
strncmp
(
lang
,
"zh"
,
2
)
==
0
){
workaround_gtk_entry_chinese_bug
=
TRUE
;
}
#else
setenv
(
"LANG"
,
lang
,
1
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment