Commit 5413892b authored by Isopod's avatar Isopod
Browse files

Formatting

parent e6f05da6
......@@ -666,7 +666,7 @@ gdk_event_copy (const GdkEvent *event)
#ifdef GDK_WINDOWING_WIN32
new_private->translation_len = private->translation_len;
new_private->translation = g_memdup(private->translation, private->translation_len*sizeof(private->translation[0]));
new_private->translation = g_memdup (private->translation, private->translation_len * sizeof (private->translation[0]));
#endif
}
......@@ -773,7 +773,7 @@ gdk_event_free (GdkEvent *event)
g_clear_object (&private->device);
g_clear_object (&private->source_device);
#ifdef GDK_WINDOWING_WIN32
g_free(private->translation);
g_free (private->translation);
#endif
}
......
......@@ -2604,25 +2604,27 @@ gdk_event_translate (MSG *msg,
WM_CHAR messages - they generate WM_DEAD_CHAR instead, but we are not interested in those
messages). */
if (gdk_event_is_allocated(event)) { /* Should always be true */
GdkEventPrivate *event_priv = (GdkEventPrivate*)event;
MSG msg2;
while (PeekMessageW(&msg2, msg->hwnd, 0, 0, 0) && (msg2.message == WM_CHAR || msg2.message == WM_SYSCHAR)) {
/* The character is encoded in WPARAM as UTF-16. */
gunichar2 c = msg2.wParam;
if (!g_unichar_iscntrl(c)) { /* Ignore control sequences like Backspace */
/* Append character to translation string. */
event_priv->translation_len++;
event_priv->translation = g_realloc(event_priv->translation, event_priv->translation_len*sizeof(event_priv->translation[0]));
event_priv->translation[event_priv->translation_len-1] = c;
}
if (gdk_event_is_allocated (event)) /* Should always be true */
{
GdkEventPrivate *event_priv = (GdkEventPrivate*) event;
/* Remove message from queue */
GetMessageW(&msg2, msg->hwnd, 0, 0);
MSG msg2;
while (PeekMessageW (&msg2, msg->hwnd, 0, 0, 0) && (msg2.message == WM_CHAR || msg2.message == WM_SYSCHAR))
{
/* The character is encoded in WPARAM as UTF-16. */
gunichar2 c = msg2.wParam;
if (!g_unichar_iscntrl(c)) { /* Ignore control sequences like Backspace */
/* Append character to translation string. */
event_priv->translation_len ++;
event_priv->translation = g_realloc (event_priv->translation, event_priv->translation_len * sizeof (event_priv->translation[0]));
event_priv->translation[event_priv->translation_len - 1] = c;
}
/* Remove message from queue */
GetMessageW (&msg2, msg->hwnd, 0, 0);
}
}
}
if (HIWORD (msg->lParam) & KF_EXTENDED)
{
......
......@@ -328,15 +328,15 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
context_ime = GTK_IM_CONTEXT_IME (context);
g_return_val_if_fail (gdk_event_is_allocated(event), FALSE);
g_return_val_if_fail (gdk_event_is_allocated (event), FALSE);
event_priv = (GdkEventPrivate*)event;
event_priv = (GdkEventPrivate*) event;
if (event_priv->translation_len == 0)
return FALSE;
utf8 = g_utf16_to_utf8(event_priv->translation, event_priv->translation_len, NULL, NULL, NULL);
utf8 = g_utf16_to_utf8 (event_priv->translation, event_priv->translation_len, NULL, NULL, NULL);
g_signal_emit_by_name (context_ime, "commit", utf8);
g_free(utf8);
g_free (utf8);
return TRUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment