Commit 1acfb9ae authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Merge from gtk-2-0:

2002-09-12  Tor Lillqvist  <tml@iki.fi>

	Merge from gtk-2-0:

	* gdk/win32/gdkevents-win32.c: Some spacing and indentation cleanup.

	* gdk/win32/gdkevents-win32.c (_gdk_events_init): Search if the
	system has some input locale identifier that uses a Latin
	keyboard. This is needed to be able to get the virtual-key code
	for the latin characters corresponding to ASCII control
	characters. If no such keyboard is present, try to load one
	then. Will this upset users with no wish to ever use a Latin-based
	keyboard layout?

	(vk_from_char): Convert all ASCII control chars to the
	corresponding uppercase char before calling VkKeyScanEx(). Idea by
	Florent Duguet. Makes Control-C work again. To make it hopefully
	work like I think it should on non-Latin keyboards, too, use
	latin_locale when looking for the corresponding keycode.

	Fix for #81831 by Tim Evans:

	* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
	_gdk_event_button_generate() here, it would append the double- or
	triple-click events too early, before the single-click event.

	(real_window_procedure): If we got a single-click event, call
	_gdk_event_button_generate() to perhaps append the double- or
	triple-click event after that.

	Merge from gtk-1-3-win32-production branch:

	* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
	NULL before trying to propagate to it, and return FALSE in that
	case. (If parent is NULL, we are handling gdk_parent_root, and
	probably should have noticed that and bailed out earlier. But
	better late than never.)
parent 86a90abf
...@@ -2,8 +2,43 @@ ...@@ -2,8 +2,43 @@
Merge from gtk-2-0: Merge from gtk-2-0:
* gdk/win32/gdkdrawable-win32.c
* gdk/win32/gdkevents-win32.c: Some spacing and indentation cleanup.
* gdk/win32/gdkdrawable-win32.c (render_line_horizontal, * gdk/win32/gdkdrawable-win32.c (render_line_horizontal,
render_line_vertical): Some spacing cleanup. Return TRUE. render_line_vertical): Return TRUE.
* gdk/win32/gdkevents-win32.c (_gdk_events_init): Search if the
system has some input locale identifier that uses a Latin
keyboard. This is needed to be able to get the virtual-key code
for the latin characters corresponding to ASCII control
characters. If no such keyboard is present, try to load one
then. Will this upset users with no wish to ever use a Latin-based
keyboard layout?
(vk_from_char): Convert all ASCII control chars to the
corresponding uppercase char before calling VkKeyScanEx(). Idea by
Florent Duguet. Makes Control-C work again. To make it hopefully
work like I think it should on non-Latin keyboards, too, use
latin_locale when looking for the corresponding keycode.
Fix for #81831 by Tim Evans:
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
_gdk_event_button_generate() here, it would append the double- or
triple-click events too early, before the single-click event.
(real_window_procedure): If we got a single-click event, call
_gdk_event_button_generate() to perhaps append the double- or
triple-click event after that.
Merge from gtk-1-3-win32-production branch:
* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
NULL before trying to propagate to it, and return FALSE in that
case. (If parent is NULL, we are handling gdk_parent_root, and
probably should have noticed that and bailed out earlier. But
better late than never.)
Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com> Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com>
......
...@@ -2,8 +2,43 @@ ...@@ -2,8 +2,43 @@
Merge from gtk-2-0: Merge from gtk-2-0:
* gdk/win32/gdkdrawable-win32.c
* gdk/win32/gdkevents-win32.c: Some spacing and indentation cleanup.
* gdk/win32/gdkdrawable-win32.c (render_line_horizontal, * gdk/win32/gdkdrawable-win32.c (render_line_horizontal,
render_line_vertical): Some spacing cleanup. Return TRUE. render_line_vertical): Return TRUE.
* gdk/win32/gdkevents-win32.c (_gdk_events_init): Search if the
system has some input locale identifier that uses a Latin
keyboard. This is needed to be able to get the virtual-key code
for the latin characters corresponding to ASCII control
characters. If no such keyboard is present, try to load one
then. Will this upset users with no wish to ever use a Latin-based
keyboard layout?
(vk_from_char): Convert all ASCII control chars to the
corresponding uppercase char before calling VkKeyScanEx(). Idea by
Florent Duguet. Makes Control-C work again. To make it hopefully
work like I think it should on non-Latin keyboards, too, use
latin_locale when looking for the corresponding keycode.
Fix for #81831 by Tim Evans:
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
_gdk_event_button_generate() here, it would append the double- or
triple-click events too early, before the single-click event.
(real_window_procedure): If we got a single-click event, call
_gdk_event_button_generate() to perhaps append the double- or
triple-click event after that.
Merge from gtk-1-3-win32-production branch:
* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
NULL before trying to propagate to it, and return FALSE in that
case. (If parent is NULL, we are handling gdk_parent_root, and
probably should have noticed that and bailed out earlier. But
better late than never.)
Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com> Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com>
......
...@@ -2,8 +2,43 @@ ...@@ -2,8 +2,43 @@
Merge from gtk-2-0: Merge from gtk-2-0:
* gdk/win32/gdkdrawable-win32.c
* gdk/win32/gdkevents-win32.c: Some spacing and indentation cleanup.
* gdk/win32/gdkdrawable-win32.c (render_line_horizontal, * gdk/win32/gdkdrawable-win32.c (render_line_horizontal,
render_line_vertical): Some spacing cleanup. Return TRUE. render_line_vertical): Return TRUE.
* gdk/win32/gdkevents-win32.c (_gdk_events_init): Search if the
system has some input locale identifier that uses a Latin
keyboard. This is needed to be able to get the virtual-key code
for the latin characters corresponding to ASCII control
characters. If no such keyboard is present, try to load one
then. Will this upset users with no wish to ever use a Latin-based
keyboard layout?
(vk_from_char): Convert all ASCII control chars to the
corresponding uppercase char before calling VkKeyScanEx(). Idea by
Florent Duguet. Makes Control-C work again. To make it hopefully
work like I think it should on non-Latin keyboards, too, use
latin_locale when looking for the corresponding keycode.
Fix for #81831 by Tim Evans:
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
_gdk_event_button_generate() here, it would append the double- or
triple-click events too early, before the single-click event.
(real_window_procedure): If we got a single-click event, call
_gdk_event_button_generate() to perhaps append the double- or
triple-click event after that.
Merge from gtk-1-3-win32-production branch:
* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
NULL before trying to propagate to it, and return FALSE in that
case. (If parent is NULL, we are handling gdk_parent_root, and
probably should have noticed that and bailed out earlier. But
better late than never.)
Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com> Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com>
......
...@@ -2,8 +2,43 @@ ...@@ -2,8 +2,43 @@
Merge from gtk-2-0: Merge from gtk-2-0:
* gdk/win32/gdkdrawable-win32.c
* gdk/win32/gdkevents-win32.c: Some spacing and indentation cleanup.
* gdk/win32/gdkdrawable-win32.c (render_line_horizontal, * gdk/win32/gdkdrawable-win32.c (render_line_horizontal,
render_line_vertical): Some spacing cleanup. Return TRUE. render_line_vertical): Return TRUE.
* gdk/win32/gdkevents-win32.c (_gdk_events_init): Search if the
system has some input locale identifier that uses a Latin
keyboard. This is needed to be able to get the virtual-key code
for the latin characters corresponding to ASCII control
characters. If no such keyboard is present, try to load one
then. Will this upset users with no wish to ever use a Latin-based
keyboard layout?
(vk_from_char): Convert all ASCII control chars to the
corresponding uppercase char before calling VkKeyScanEx(). Idea by
Florent Duguet. Makes Control-C work again. To make it hopefully
work like I think it should on non-Latin keyboards, too, use
latin_locale when looking for the corresponding keycode.
Fix for #81831 by Tim Evans:
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
_gdk_event_button_generate() here, it would append the double- or
triple-click events too early, before the single-click event.
(real_window_procedure): If we got a single-click event, call
_gdk_event_button_generate() to perhaps append the double- or
triple-click event after that.
Merge from gtk-1-3-win32-production branch:
* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
NULL before trying to propagate to it, and return FALSE in that
case. (If parent is NULL, we are handling gdk_parent_root, and
probably should have noticed that and bailed out earlier. But
better late than never.)
Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com> Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com>
......
...@@ -2,8 +2,43 @@ ...@@ -2,8 +2,43 @@
Merge from gtk-2-0: Merge from gtk-2-0:
* gdk/win32/gdkdrawable-win32.c
* gdk/win32/gdkevents-win32.c: Some spacing and indentation cleanup.
* gdk/win32/gdkdrawable-win32.c (render_line_horizontal, * gdk/win32/gdkdrawable-win32.c (render_line_horizontal,
render_line_vertical): Some spacing cleanup. Return TRUE. render_line_vertical): Return TRUE.
* gdk/win32/gdkevents-win32.c (_gdk_events_init): Search if the
system has some input locale identifier that uses a Latin
keyboard. This is needed to be able to get the virtual-key code
for the latin characters corresponding to ASCII control
characters. If no such keyboard is present, try to load one
then. Will this upset users with no wish to ever use a Latin-based
keyboard layout?
(vk_from_char): Convert all ASCII control chars to the
corresponding uppercase char before calling VkKeyScanEx(). Idea by
Florent Duguet. Makes Control-C work again. To make it hopefully
work like I think it should on non-Latin keyboards, too, use
latin_locale when looking for the corresponding keycode.
Fix for #81831 by Tim Evans:
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
_gdk_event_button_generate() here, it would append the double- or
triple-click events too early, before the single-click event.
(real_window_procedure): If we got a single-click event, call
_gdk_event_button_generate() to perhaps append the double- or
triple-click event after that.
Merge from gtk-1-3-win32-production branch:
* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
NULL before trying to propagate to it, and return FALSE in that
case. (If parent is NULL, we are handling gdk_parent_root, and
probably should have noticed that and bailed out earlier. But
better late than never.)
Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com> Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com>
......
...@@ -2,8 +2,43 @@ ...@@ -2,8 +2,43 @@
Merge from gtk-2-0: Merge from gtk-2-0:
* gdk/win32/gdkdrawable-win32.c
* gdk/win32/gdkevents-win32.c: Some spacing and indentation cleanup.
* gdk/win32/gdkdrawable-win32.c (render_line_horizontal, * gdk/win32/gdkdrawable-win32.c (render_line_horizontal,
render_line_vertical): Some spacing cleanup. Return TRUE. render_line_vertical): Return TRUE.
* gdk/win32/gdkevents-win32.c (_gdk_events_init): Search if the
system has some input locale identifier that uses a Latin
keyboard. This is needed to be able to get the virtual-key code
for the latin characters corresponding to ASCII control
characters. If no such keyboard is present, try to load one
then. Will this upset users with no wish to ever use a Latin-based
keyboard layout?
(vk_from_char): Convert all ASCII control chars to the
corresponding uppercase char before calling VkKeyScanEx(). Idea by
Florent Duguet. Makes Control-C work again. To make it hopefully
work like I think it should on non-Latin keyboards, too, use
latin_locale when looking for the corresponding keycode.
Fix for #81831 by Tim Evans:
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Don't call
_gdk_event_button_generate() here, it would append the double- or
triple-click events too early, before the single-click event.
(real_window_procedure): If we got a single-click event, call
_gdk_event_button_generate() to perhaps append the double- or
triple-click event after that.
Merge from gtk-1-3-win32-production branch:
* gdk/win32/gdkevents-win32.c (propagate): Check for parent being
NULL before trying to propagate to it, and return FALSE in that
case. (If parent is NULL, we are handling gdk_parent_root, and
probably should have noticed that and bailed out earlier. But
better late than never.)
Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com> Wed Sep 11 15:48:38 2002 Jonathan Blandford <jrb@redhat.com>
......
...@@ -135,6 +135,9 @@ static PFN_TrackMouseEvent track_mouse_event = NULL; ...@@ -135,6 +135,9 @@ static PFN_TrackMouseEvent track_mouse_event = NULL;
static gboolean use_ime_composition = FALSE; static gboolean use_ime_composition = FALSE;
static HKL latin_locale = NULL;
static gboolean latin_locale_loaded = FALSE;
static LRESULT static LRESULT
real_window_procedure (HWND hwnd, real_window_procedure (HWND hwnd,
UINT message, UINT message,
...@@ -235,6 +238,9 @@ real_window_procedure (HWND hwnd, ...@@ -235,6 +238,9 @@ real_window_procedure (HWND hwnd,
else else
{ {
_gdk_event_queue_append (display, eventp); _gdk_event_queue_append (display, eventp);
if (eventp->type == GDK_BUTTON_PRESS)
_gdk_event_button_generate (display, eventp);
#if 1 #if 1
/* Wake up WaitMessage */ /* Wake up WaitMessage */
PostMessage (NULL, gdk_ping_msg, 0, 0); PostMessage (NULL, gdk_ping_msg, 0, 0);
...@@ -293,6 +299,43 @@ _gdk_events_init (void) ...@@ -293,6 +299,43 @@ _gdk_events_init (void)
HMODULE user32, imm32; HMODULE user32, imm32;
HINSTANCE commctrl32; HINSTANCE commctrl32;
#endif #endif
int i, j, n;
/* List of languages that use a latin keyboard. Somewhat sorted in
* "order of least surprise", in case we have to load one of them if
* the user only has arabic loaded, for instance.
*/
static int latin_languages[] = {
LANG_ENGLISH,
LANG_SPANISH,
LANG_PORTUGUESE,
LANG_FRENCH,
LANG_GERMAN,
/* Rest in numeric order */
LANG_CZECH,
LANG_DANISH,
LANG_FINNISH,
LANG_HUNGARIAN,
LANG_ICELANDIC,
LANG_ITALIAN,
LANG_DUTCH,
LANG_NORWEGIAN,
LANG_POLISH,
LANG_ROMANIAN,
LANG_SLOVAK,
LANG_ALBANIAN,
LANG_SWEDISH,
LANG_TURKISH,
LANG_INDONESIAN,
LANG_SLOVENIAN,
LANG_ESTONIAN,
LANG_LATVIAN,
LANG_LITHUANIAN,
LANG_VIETNAMESE,
LANG_AFRIKAANS,
LANG_FAEROESE,
LANG_SWAHILI
};
gdk_ping_msg = RegisterWindowMessage ("gdk-ping"); gdk_ping_msg = RegisterWindowMessage ("gdk-ping");
GDK_NOTE (EVENTS, g_print ("gdk-ping = %#x\n", gdk_ping_msg)); GDK_NOTE (EVENTS, g_print ("gdk-ping = %#x\n", gdk_ping_msg));
...@@ -305,6 +348,47 @@ _gdk_events_init (void) ...@@ -305,6 +348,47 @@ _gdk_events_init (void)
msh_mousewheel_msg = RegisterWindowMessage ("MSWHEEL_ROLLMSG"); msh_mousewheel_msg = RegisterWindowMessage ("MSWHEEL_ROLLMSG");
GDK_NOTE (EVENTS, g_print ("MSH_MOUSEWHEEL = %#x\n", msh_mousewheel_msg)); GDK_NOTE (EVENTS, g_print ("MSH_MOUSEWHEEL = %#x\n", msh_mousewheel_msg));
/* Check if we have some input locale identifier loaded that uses a
* latin keyboard, to be able to get the virtual-key code for the
* latin characters corresponding to ASCII control characters.
*/
if ((n = GetKeyboardLayoutList (0, NULL)) == 0)
WIN32_API_FAILED ("GetKeyboardLayoutList");
else
{
HKL *hkl_list = g_new (HKL, n);
if (GetKeyboardLayoutList (n, hkl_list) == 0)
WIN32_API_FAILED ("GetKeyboardLayoutList");
else
{
for (i = 0; latin_locale == NULL && i < n; i++)
for (j = 0; j < G_N_ELEMENTS (latin_languages); j++)
if (PRIMARYLANGID (LOWORD (hkl_list[i])) == latin_languages[j])
{
latin_locale = hkl_list [i];
break;
}
}
g_free (hkl_list);
}
if (latin_locale == NULL)
{
/* Try to load a keyboard layout with latin characters then.
*/
i = 0;
while (latin_locale == NULL && i < G_N_ELEMENTS (latin_languages))
{
char id[9];
sprintf (id, "%08x", MAKELANGID (latin_languages[i++], SUBLANG_DEFAULT));
latin_locale = LoadKeyboardLayout (id, KLF_NOTELLSHELL|KLF_SUBSTITUTE_OK);
if (latin_locale != NULL)
latin_locale_loaded = TRUE;
}
}
GDK_NOTE (EVENTS, g_print ("latin_locale = %08x\n", (guint) latin_locale));
source = g_source_new (&event_funcs, sizeof (GSource)); source = g_source_new (&event_funcs, sizeof (GSource));
g_source_set_priority (source, GDK_PRIORITY_EVENTS); g_source_set_priority (source, GDK_PRIORITY_EVENTS);
...@@ -841,15 +925,21 @@ build_pointer_event_state (MSG *msg) ...@@ -841,15 +925,21 @@ build_pointer_event_state (MSG *msg)
static guint static guint
vk_from_char (guint c) vk_from_char (guint c)
{ {
switch (c) HKL locale = _gdk_input_locale;
/* For some control characters (control-C, control-J and control-M),
* VkKeyScanEx returns special keycodes (different from the
* corresponding uncontrolified character). Thus, for control
* characters, uncontrolify it first and return the virtual-key code
* it would have on a Latin-based keyboard, otherwise stuff breaks.
*/
if (latin_locale != NULL && c >= '\000' && c <= '\032')
{ {
case '\b': c += '@';
return 'H'; locale = latin_locale;
case '\t':
return 'I';
default:
return (VkKeyScanEx (c, _gdk_input_locale) & 0xFF);
} }
return (VkKeyScanEx (c, locale) & 0xFF);
} }
static void static void
...@@ -1111,6 +1201,11 @@ print_event (GdkEvent *event) ...@@ -1111,6 +1201,11 @@ print_event (GdkEvent *event)
(event->crossing.detail == GDK_NOTIFY_NONLINEAR ? "NONLINEAR" : (event->crossing.detail == GDK_NOTIFY_NONLINEAR ? "NONLINEAR" :
"???")))); "???"))));
break; break;
case GDK_CONFIGURE:
g_print ("x:%d y:%d w:%d h:%d",
event->configure.x, event->configure.y,
event->configure.width, event->configure.height);
break;
case GDK_SCROLL: case GDK_SCROLL:
g_print ("%s ", g_print ("%s ",
(event->scroll.direction == GDK_SCROLL_UP ? "UP" : (event->scroll.direction == GDK_SCROLL_UP ? "UP" :
...@@ -1322,6 +1417,7 @@ synthesize_crossing_events (GdkWindow *window, ...@@ -1322,6 +1417,7 @@ synthesize_crossing_events (GdkWindow *window,
if (current_window) if (current_window)
gdk_window_unref (current_window); gdk_window_unref (current_window);
current_window = window; current_window = window;
if (current_window)
gdk_window_ref (current_window); gdk_window_ref (current_window);
} }
...@@ -1527,6 +1623,11 @@ propagate (GdkWindow **window, ...@@ -1527,6 +1623,11 @@ propagate (GdkWindow **window,
return FALSE; return FALSE;
} }
} }
else if (GDK_WINDOW_OBJECT (*window)->parent == NULL)
{
GDK_NOTE (EVENTS, g_print ("...parent NULL (?), undelivered\n"));
return FALSE;
}
else else
{ {
gdk_drawable_unref (*window); gdk_drawable_unref (*window);
...@@ -1886,7 +1987,7 @@ gdk_event_translate (GdkDisplay *display, ...@@ -1886,7 +1987,7 @@ gdk_event_translate (GdkDisplay *display,
* removed it. Repost the same message to our queue so that * removed it. Repost the same message to our queue so that
* we will get it later when we are prepared. * we will get it later when we are prepared.
*/ */
GDK_NOTE(MISC, g_print("gdk_event_translate: %p %s posted.\n", GDK_NOTE (MISC, g_print("gdk_event_translate: %p %s posted.\n",
msg->hwnd, msg->hwnd,
msg->message == WM_MOVE ? msg->message == WM_MOVE ?
"WM_MOVE" : "WM_SIZE")); "WM_MOVE" : "WM_SIZE"));
...@@ -1899,8 +2000,8 @@ gdk_event_translate (GdkDisplay *display, ...@@ -1899,8 +2000,8 @@ gdk_event_translate (GdkDisplay *display,
{ {
window = (UNALIGNED GdkWindow*) (((LPCREATESTRUCT) msg->lParam)->lpCreateParams); window = (UNALIGNED GdkWindow*) (((LPCREATESTRUCT) msg->lParam)->lpCreateParams);
GDK_WINDOW_HWND (window) = msg->hwnd; GDK_WINDOW_HWND (window) = msg->hwnd;
GDK_NOTE (EVENTS, g_print ("gdk_event_translate: created %#x\n", GDK_NOTE (EVENTS, g_print ("gdk_event_translate: created %p\n",
(guint) msg->hwnd)); msg->hwnd));
# if 0 # if 0
/* This should handle allmost all the other window==NULL cases. /* This should handle allmost all the other window==NULL cases.
* This code is executed while gdk_window_new is in it's * This code is executed while gdk_window_new is in it's
...@@ -1908,14 +2009,14 @@ gdk_event_translate (GdkDisplay *display, ...@@ -1908,14 +2009,14 @@ gdk_event_translate (GdkDisplay *display,
* Don't insert xid there a second time, if it's done here. * Don't insert xid there a second time, if it's done here.
*/ */
gdk_drawable_ref (window); gdk_drawable_ref (window);
gdk_win32_handle_table_insert (&GDK_WINDOW_HWND(window), window); gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window);
# endif # endif
} }
else else
{ {
GDK_NOTE (EVENTS, g_print ("gdk_event_translate: %s for %#x (NULL)\n", GDK_NOTE (EVENTS, g_print ("gdk_event_translate: %s for %p (NULL)\n",
gdk_win32_message_name(msg->message), gdk_win32_message_name(msg->message),
(guint) msg->hwnd)); msg->hwnd));
} }
#endif #endif
return FALSE; return FALSE;
...@@ -2067,7 +2168,7 @@ gdk_event_translate (GdkDisplay *display, ...@@ -2067,7 +2168,7 @@ gdk_event_translate (GdkDisplay *display,
case WM_SYSKEYUP: case WM_SYSKEYUP:
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_print ("WM_SYSKEY%s: %p %s vk:%.02x %s\n", g_print ("WM_SYSKEY%s: %p %s ch:%.02x %s\n",
(msg->message == WM_SYSKEYUP ? "UP" : "DOWN"), (msg->message == WM_SYSKEYUP ? "UP" : "DOWN"),
msg->hwnd, msg->hwnd,
(GetKeyNameText (msg->lParam, buf, (GetKeyNameText (msg->lParam, buf,
...@@ -2099,7 +2200,7 @@ gdk_event_translate (GdkDisplay *display, ...@@ -2099,7 +2200,7 @@ gdk_event_translate (GdkDisplay *display,
case WM_KEYUP: case WM_KEYUP:
case WM_KEYDOWN: case WM_KEYDOWN:
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_print ("WM_KEY%s: %p %s vk:%.02x %s\n", g_print ("WM_KEY%s: %p %s ch:%.02x %s\n",
(msg->message == WM_KEYUP ? "UP" : "DOWN"), (msg->message == WM_KEYUP ? "UP" : "DOWN"),
msg->hwnd, msg->hwnd,
(GetKeyNameText (msg->lParam, buf, (GetKeyNameText (msg->lParam, buf,
...@@ -2127,7 +2228,7 @@ gdk_event_translate (GdkDisplay *display, ...@@ -2127,7 +2228,7 @@ gdk_event_translate (GdkDisplay *display,
case VK_BACK: case VK_BACK:
event->key.keyval = GDK_BackSpace; break; event->key.keyval = GDK_BackSpace; break;
case VK_TAB: case VK_TAB:
event->key.keyval = (GetKeyState(VK_SHIFT) < 0 ? event->key.keyval = (GetKeyState (VK_SHIFT) < 0 ?
GDK_ISO_Left_Tab : GDK_Tab); GDK_ISO_Left_Tab : GDK_Tab);
break; break;
case VK_CLEAR: case VK_CLEAR:
...@@ -2524,8 +2625,6 @@ gdk_event_translate (GdkDisplay *display, ...@@ -2524,8 +2625,6 @@ gdk_event_translate (GdkDisplay *display,
event->button.button = button; event->button.button = button;
event->button.device = display->core_pointer; event->button.device = display->core_pointer;
_gdk_event_button_generate (display, event);
return_val = !GDK_WINDOW_DESTROYED (window); return_val = !GDK_WINDOW_DESTROYED (window);
break; break;
...@@ -2608,8 +2707,8 @@ gdk_event_translate (GdkDisplay *display, ...@@ -2608,8 +2707,8 @@ gdk_event_translate (GdkDisplay *display,
break; break;
/* HB: only process mouse move messages if we own the active window. */ /* HB: only process mouse move messages if we own the active window. */
GetWindowThreadProcessId(GetActiveWindow(), &pidActWin); GetWindowThreadProcessId (GetActiveWindow (), &pidActWin);
GetWindowThreadProcessId(msg->hwnd, &pidThis); GetWindowThreadProcessId (msg->hwnd, &pidThis);
if (pidActWin != pidThis) if (pidActWin != pidThis)
break; break;
...@@ -3122,8 +3221,8 @@ gdk_event_translate (GdkDisplay *display, ...@@ -3122,8 +3221,8 @@ gdk_event_translate (GdkDisplay *display,
break; break;
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD
&& !IsIconic(msg->hwnd) && !IsIconic (msg->hwnd)
&& IsWindowVisible(msg->hwnd)) && IsWindowVisible (msg->hwnd))
{ {
event->configure.type = GDK_CONFIGURE; event->configure.type = GDK_CONFIGURE;
event->configure.window = window; event->configure.window = window;
...@@ -3150,8 +3249,8 @@ gdk_event_translate (GdkDisplay *display, ...@@ -3150,8 +3249,8 @@ gdk_event_translate (GdkDisplay *display,
break; break;
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD
&& !IsIconic(msg->hwnd) && !IsIconic (msg->hwnd)
&& IsWindowVisible(msg->hwnd)) && IsWindowVisible (msg->hwnd))
{ {
LPWINDOWPOS lpwp = (LPWINDOWPOS) (msg->lParam); LPWINDOWPOS lpwp = (LPWINDOWPOS) (msg->lParam);
...@@ -3294,7 +3393,7 @@ gdk_event_translate (GdkDisplay *display, ...@@ -3294,7 +3393,7 @@ gdk_event_translate (GdkDisplay *display,
/* Fall through */ /* Fall through */
wintab: wintab:
event->any.window = window; event->any.window = window;
return_val = _gdk_input_other_event(event, msg, window); return_val = _gdk_input_other_event (event, msg, window);
break; break;
#endif #endif
...@@ -3348,34 +3447,8 @@ _gdk_events_queue (GdkDisplay *display) ...@@ -3348,34 +3447,8 @@ _gdk_events_queue (GdkDisplay *display)
TranslateMessage (&msg); TranslateMessage (&msg);
#endif #endif
#if 1 /* It was like this all the time */
DispatchMessage (&msg);
#else /* but this one is more similar to the X implementation. Any effect ? */
event = _gdk_event_new ();
event->any.type = GDK_NOTHING;
event->any.window = NULL;
event->any.send_event = InSendMessage ();
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
_gdk_event_queue_append (display, event);
node = _gdk_queued_tail;
if (gdk_event_translate (display, event, &msg, NULL, NULL, FALSE))
{
((GdkEventPrivate *)event)->flags &= ~GDK_EVENT_PENDING;
}
else
{
_gdk_event_queue_remove_link (display, node);
g_list_free_1 (node);
gdk_event_free (event);
DispatchMessage (&msg); DispatchMessage (&msg);
} }
#endif
}
} }
static gboolean static gboolean
......
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