Commit 5a4e1abb authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist
Browse files

Store just pixel value of background colour.

2000-03-04  Tor Lillqvist  <tml@iki.fi>

* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
just pixel value of background colour.

* gdk/win32/gdkgc-win32.c (gdk_colormap_color): New function
containing code snippet previously duplicated in a couple of
places.

* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_points): Use
gdk_colormap_color.

* gdk/win32/gdkevents-win32.c (gdk_event_translate): Generate
GDK_SCROLL events for WM_MOUSEWHEEL messages. Don't generate
events for autorepeated Shift, Control and Alt keys. Use
gdk_colormap_color.

* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): If the
pointer is inside the window the cursor of which we are setting,
call SetCursor immediately.

* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: If we don't have the build number stamp
file, use zero.

* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size as empty.

* gtk/gtk.def: Remove gtk_paned_set_gutter_size.
parent 2468916b
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
just pixel value of background colour.
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): New function
containing code snippet previously duplicated in a couple of
places.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_points): Use
gdk_colormap_color.
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Generate
GDK_SCROLL events for WM_MOUSEWHEEL messages. Don't generate
events for autorepeated Shift, Control and Alt keys. Use
gdk_colormap_color.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): If the
pointer is inside the window the cursor of which we are setting,
call SetCursor immediately.
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: If we don't have the build number stamp
file, use zero.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size as empty.
* gtk/gtk.def: Remove gtk_paned_set_gutter_size.
Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org> Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org>
* gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
......
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
just pixel value of background colour.
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): New function
containing code snippet previously duplicated in a couple of
places.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_points): Use
gdk_colormap_color.
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Generate
GDK_SCROLL events for WM_MOUSEWHEEL messages. Don't generate
events for autorepeated Shift, Control and Alt keys. Use
gdk_colormap_color.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): If the
pointer is inside the window the cursor of which we are setting,
call SetCursor immediately.
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: If we don't have the build number stamp
file, use zero.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size as empty.
* gtk/gtk.def: Remove gtk_paned_set_gutter_size.
Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org> Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org>
* gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
......
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
just pixel value of background colour.
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): New function
containing code snippet previously duplicated in a couple of
places.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_points): Use
gdk_colormap_color.
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Generate
GDK_SCROLL events for WM_MOUSEWHEEL messages. Don't generate
events for autorepeated Shift, Control and Alt keys. Use
gdk_colormap_color.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): If the
pointer is inside the window the cursor of which we are setting,
call SetCursor immediately.
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: If we don't have the build number stamp
file, use zero.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size as empty.
* gtk/gtk.def: Remove gtk_paned_set_gutter_size.
Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org> Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org>
* gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
......
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
just pixel value of background colour.
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): New function
containing code snippet previously duplicated in a couple of
places.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_points): Use
gdk_colormap_color.
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Generate
GDK_SCROLL events for WM_MOUSEWHEEL messages. Don't generate
events for autorepeated Shift, Control and Alt keys. Use
gdk_colormap_color.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): If the
pointer is inside the window the cursor of which we are setting,
call SetCursor immediately.
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: If we don't have the build number stamp
file, use zero.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size as empty.
* gtk/gtk.def: Remove gtk_paned_set_gutter_size.
Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org> Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org>
* gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
......
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
just pixel value of background colour.
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): New function
containing code snippet previously duplicated in a couple of
places.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_points): Use
gdk_colormap_color.
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Generate
GDK_SCROLL events for WM_MOUSEWHEEL messages. Don't generate
events for autorepeated Shift, Control and Alt keys. Use
gdk_colormap_color.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): If the
pointer is inside the window the cursor of which we are setting,
call SetCursor immediately.
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: If we don't have the build number stamp
file, use zero.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size as empty.
* gtk/gtk.def: Remove gtk_paned_set_gutter_size.
Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org> Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org>
* gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
......
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
just pixel value of background colour.
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): New function
containing code snippet previously duplicated in a couple of
places.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_points): Use
gdk_colormap_color.
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Generate
GDK_SCROLL events for WM_MOUSEWHEEL messages. Don't generate
events for autorepeated Shift, Control and Alt keys. Use
gdk_colormap_color.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): If the
pointer is inside the window the cursor of which we are setting,
call SetCursor immediately.
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: If we don't have the build number stamp
file, use zero.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size as empty.
* gtk/gtk.def: Remove gtk_paned_set_gutter_size.
Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org> Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org>
* gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
......
2000-03-04 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkprivate-win32.h (struct _GdkWindowWin32Data): Store
just pixel value of background colour.
* gdk/win32/gdkgc-win32.c (gdk_colormap_color): New function
containing code snippet previously duplicated in a couple of
places.
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_points): Use
gdk_colormap_color.
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Generate
GDK_SCROLL events for WM_MOUSEWHEEL messages. Don't generate
events for autorepeated Shift, Control and Alt keys. Use
gdk_colormap_color.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): If the
pointer is inside the window the cursor of which we are setting,
call SetCursor immediately.
* gdk/win32/makefile.cygwin
* gtk/makefile.cygwin: If we don't have the build number stamp
file, use zero.
* gtk/gtkcompat.h.in: Define gtk_paned_gutter_size and
gtk_paned_set_gutter_size as empty.
* gtk/gtk.def: Remove gtk_paned_set_gutter_size.
Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org> Tue Feb 29 13:10:00 GMT 2000 Tony Gale <gale@gtk.org>
* gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
......
...@@ -5,10 +5,8 @@ http://www.iki.fi/tml/gimp/win32/ . ...@@ -5,10 +5,8 @@ http://www.iki.fi/tml/gimp/win32/ .
To build GTk+ on Win32, you need either the Microsoft compiler and To build GTk+ on Win32, you need either the Microsoft compiler and
tools, or gcc-2.95 or later running under cygwin-b20.1 or tools, or gcc-2.95 or later running under cygwin-b20.1 or
later. Compile in gdk\win32 and gtk with `nmake -f makefile.msc` or later. Compile in gdk\win32, gdk and gtk with `nmake -f makefile.msc` or
`make -f makefile.cygwin`. Before doing a install, check the BIN `make -f makefile.cygwin`.
definition in gdk\win32\makefile.msc (or makefile.cygwin) and
gtk\makefile.msc (or makefile.cygwin).
See the README.win32 file in the GLib distribution for instructions See the README.win32 file in the GLib distribution for instructions
how to build with gcc. how to build with gcc.
......
...@@ -726,26 +726,26 @@ gdk_win32_draw_points (GdkDrawable *drawable, ...@@ -726,26 +726,26 @@ gdk_win32_draw_points (GdkDrawable *drawable,
GdkPoint *points, GdkPoint *points,
gint npoints) gint npoints)
{ {
GdkGCPrivate *gc_private = (GdkGCPrivate*) gc;
GdkGCWin32Data *gc_data = GDK_GC_WIN32DATA (gc_private);
HDC hdc; HDC hdc;
COLORREF fg; COLORREF fg;
GdkGCPrivate *gc_private = (GdkGCPrivate*) gc;
GdkGCWin32Data *gc_data = GDK_GC_WIN32DATA (gc_private);
GdkDrawablePrivate *drawable_private = (GdkDrawablePrivate *) drawable;
GdkColormapPrivateWin32 *colormap_private =
(GdkColormapPrivateWin32 *) drawable_private->colormap;
int i; int i;
GDK_NOTE (MISC, g_print ("gdk_draw_points: %#x destdc: (%d) %#x " hdc = gdk_gc_predraw (drawable, gc_private, 0);
"npoints: %d\n",
GDK_DRAWABLE_XID (drawable), fg = gdk_colormap_color (colormap_private, gc_data->foreground);
gc_private, hdc,
npoints));
hdc = gdk_gc_predraw (drawable, gc_private, GDK_GC_FOREGROUND); GDK_NOTE (MISC, g_print ("gdk_draw_points: %#x %dx%.06x\n",
fg = GetTextColor (hdc); GDK_DRAWABLE_XID (drawable), npoints, fg));
for (i = 0; i < npoints; i++) for (i = 0; i < npoints; i++)
{ SetPixel (hdc, points[i].x, points[i].y, fg);
SetPixel (hdc, points[i].x, points[i].y, fg);
} gdk_gc_postdraw (drawable, gc_private, 0);
gdk_gc_postdraw (drawable, gc_private, GDK_GC_FOREGROUND);
} }
static void static void
......
...@@ -2594,6 +2594,7 @@ print_event (GdkEvent *event) ...@@ -2594,6 +2594,7 @@ print_event (GdkEvent *event)
case GDK_CLIENT_EVENT: g_print ("GDK_CLIENT_EVENT "); break; case GDK_CLIENT_EVENT: g_print ("GDK_CLIENT_EVENT "); break;
case GDK_VISIBILITY_NOTIFY: g_print ("GDK_VISIBILITY_NOTIFY "); break; case GDK_VISIBILITY_NOTIFY: g_print ("GDK_VISIBILITY_NOTIFY "); break;
case GDK_NO_EXPOSE: g_print ("GDK_NO_EXPOSE "); break; case GDK_NO_EXPOSE: g_print ("GDK_NO_EXPOSE "); break;
case GDK_SCROLL: g_print ("GDK_SCROLL "); break;
} }
g_print ("%#x ", GDK_DRAWABLE_XID (event->any.window)); g_print ("%#x ", GDK_DRAWABLE_XID (event->any.window));
...@@ -2638,12 +2639,21 @@ print_event (GdkEvent *event) ...@@ -2638,12 +2639,21 @@ print_event (GdkEvent *event)
break; break;
case GDK_ENTER_NOTIFY: case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY: case GDK_LEAVE_NOTIFY:
g_print (" %s", g_print ("%s ",
(event->crossing.detail == GDK_NOTIFY_INFERIOR ? "INFERIOR" : (event->crossing.detail == GDK_NOTIFY_INFERIOR ? "INFERIOR" :
(event->crossing.detail == GDK_NOTIFY_ANCESTOR ? "ANCESTOR" : (event->crossing.detail == GDK_NOTIFY_ANCESTOR ? "ANCESTOR" :
(event->crossing.detail == GDK_NOTIFY_NONLINEAR ? "NONLINEAR" : (event->crossing.detail == GDK_NOTIFY_NONLINEAR ? "NONLINEAR" :
"???")))); "???"))));
break; break;
case GDK_SCROLL:
g_print ("%s ",
(event->scroll.direction == GDK_SCROLL_UP ? "UP" :
(event->scroll.direction == GDK_SCROLL_DOWN ? "DOWN" :
(event->scroll.direction == GDK_SCROLL_LEFT ? "LEFT" :
(event->scroll.direction == GDK_SCROLL_RIGHT ? "RIGHT" :
"???")))));
print_event_state (event->scroll.state);
break;
} }
g_print ("\n"); g_print ("\n");
} }
...@@ -2659,7 +2669,7 @@ synthesize_crossing_events (GdkWindow *window, ...@@ -2659,7 +2669,7 @@ synthesize_crossing_events (GdkWindow *window,
*/ */
if (p_TrackMouseEvent == NULL if (p_TrackMouseEvent == NULL
&& curWnd && curWnd
&& (GDK_WINDOW_WIN32DATA(curWnd)->event_mask & GDK_LEAVE_NOTIFY_MASK)) && (GDK_WINDOW_WIN32DATA (curWnd)->event_mask & GDK_LEAVE_NOTIFY_MASK))
{ {
GDK_NOTE (EVENTS, g_print ("synthesizing LEAVE_NOTIFY event\n")); GDK_NOTE (EVENTS, g_print ("synthesizing LEAVE_NOTIFY event\n"));
...@@ -2688,7 +2698,7 @@ synthesize_crossing_events (GdkWindow *window, ...@@ -2688,7 +2698,7 @@ synthesize_crossing_events (GdkWindow *window,
GDK_NOTE (EVENTS, print_event (event)); GDK_NOTE (EVENTS, print_event (event));
} }
if (GDK_WINDOW_WIN32DATA(window)->event_mask & GDK_ENTER_NOTIFY_MASK) if (GDK_WINDOW_WIN32DATA (window)->event_mask & GDK_ENTER_NOTIFY_MASK)
{ {
GDK_NOTE (EVENTS, g_print ("synthesizing ENTER_NOTIFY event\n")); GDK_NOTE (EVENTS, g_print ("synthesizing ENTER_NOTIFY event\n"));
...@@ -2789,7 +2799,7 @@ propagate (GdkWindow **window, ...@@ -2789,7 +2799,7 @@ propagate (GdkWindow **window,
} }
while (TRUE) while (TRUE)
{ {
if ((*doesnt_want_it) (GDK_WINDOW_WIN32DATA(*window)->event_mask, xevent)) if ((*doesnt_want_it) (GDK_WINDOW_WIN32DATA (*window)->event_mask, xevent))
{ {
/* Owner doesn't want it, propagate to parent. */ /* Owner doesn't want it, propagate to parent. */
if (((GdkWindowPrivate *) *window)->parent == gdk_parent_root) if (((GdkWindowPrivate *) *window)->parent == gdk_parent_root)
...@@ -2886,29 +2896,37 @@ doesnt_want_button_motion (gint mask, ...@@ -2886,29 +2896,37 @@ doesnt_want_button_motion (gint mask,
&& (mask & GDK_BUTTON3_MOTION_MASK))); && (mask & GDK_BUTTON3_MOTION_MASK)));
} }
static gboolean
doesnt_want_scroll (gint mask,
MSG *xevent)
{
return !(mask & GDK_SCROLL_MASK);
}
static gboolean static gboolean
gdk_event_translate (GdkEvent *event, gdk_event_translate (GdkEvent *event,
MSG *xevent, MSG *xevent,
gboolean *ret_val_flagp, gboolean *ret_val_flagp,
gint *ret_valp) gint *ret_valp)
{ {
GdkWindow *window, *orig_window;
GdkColormapPrivateWin32 *colormap_private;
HWND owner;
DWORD pidActWin; DWORD pidActWin;
DWORD pidThis; DWORD pidThis;
DWORD dwStyle; DWORD dwStyle;
PAINTSTRUCT paintstruct; PAINTSTRUCT paintstruct;
HDC hdc; HDC hdc;
HDC bgdc;
HGDIOBJ oldbitmap;
HBRUSH hbr; HBRUSH hbr;
COLORREF bg;
RECT rect; RECT rect;
POINT pt; POINT pt;
MINMAXINFO *lpmmi; MINMAXINFO *lpmmi;
HWND hwnd;
GdkWindow *window, *orig_window, *newwindow;
GdkColormapPrivateWin32 *colormap_private;
GdkEventMask mask; GdkEventMask mask;
GdkPixmap *pixmap; GdkPixmap *pixmap;
GdkDrawablePrivate *pixmap_private; GdkDrawablePrivate *pixmap_private;
HDC bgdc;
HGDIOBJ oldbitmap;
int button; int button;
int i, j, n, k; int i, j, n, k;
gchar buf[256]; gchar buf[256];
...@@ -3074,9 +3092,9 @@ gdk_event_translate (GdkEvent *event, ...@@ -3074,9 +3092,9 @@ gdk_event_translate (GdkEvent *event,
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_print ("WM_INPUTLANGCHANGE: %#x charset %d locale %x\n", g_print ("WM_INPUTLANGCHANGE: %#x charset %d locale %x\n",
xevent->hwnd, xevent->wParam, xevent->lParam)); xevent->hwnd, xevent->wParam, xevent->lParam));
GDK_WINDOW_WIN32DATA(window)->input_locale = (HKL) xevent->lParam; GDK_WINDOW_WIN32DATA (window)->input_locale = (HKL) xevent->lParam;
TranslateCharsetInfo ((DWORD FAR *) xevent->wParam, TranslateCharsetInfo ((DWORD FAR *) xevent->wParam,
&GDK_WINDOW_WIN32DATA(window)->charset_info, &GDK_WINDOW_WIN32DATA (window)->charset_info,
TCI_SRCCHARSET); TCI_SRCCHARSET);
break; break;
...@@ -3149,15 +3167,29 @@ gdk_event_translate (GdkEvent *event, ...@@ -3149,15 +3167,29 @@ gdk_event_translate (GdkEvent *event,
case VK_RETURN: case VK_RETURN:
event->key.keyval = GDK_Return; break; event->key.keyval = GDK_Return; break;
case VK_SHIFT: case VK_SHIFT:
event->key.keyval = GDK_Shift_L; break; /* Don't let Shift auto-repeat */
if (xevent->message == WM_KEYDOWN
&& (xevent->lParam & 0x40000000))
ignore_WM_CHAR = FALSE;
else
event->key.keyval = GDK_Shift_L;
break;
case VK_CONTROL: case VK_CONTROL:
if (xevent->lParam & 0x01000000) /* And not Control either */
if (xevent->message == WM_KEYDOWN
&& (xevent->lParam & 0x40000000))
ignore_WM_CHAR = FALSE;
else if (xevent->lParam & 0x01000000)
event->key.keyval = GDK_Control_R; event->key.keyval = GDK_Control_R;
else else
event->key.keyval = GDK_Control_L; event->key.keyval = GDK_Control_L;
break; break;
case VK_MENU: case VK_MENU:
if (xevent->lParam & 0x01000000) /* And not Alt */
if (xevent->message == WM_KEYDOWN
&& (xevent->lParam & 0x40000000))
ignore_WM_CHAR = FALSE;
else if (xevent->lParam & 0x01000000)
{ {
/* AltGr key comes in as Control+Right Alt */ /* AltGr key comes in as Control+Right Alt */
if (GetKeyState (VK_CONTROL) < 0) if (GetKeyState (VK_CONTROL) < 0)
...@@ -3370,30 +3402,30 @@ gdk_event_translate (GdkEvent *event, ...@@ -3370,30 +3402,30 @@ gdk_event_translate (GdkEvent *event,
event->key.window = window; event->key.window = window;
return_val = !GDK_DRAWABLE_DESTROYED (window); return_val = !GDK_DRAWABLE_DESTROYED (window);
if (return_val && (event->key.window == k_grab_window if (return_val && (event->key.window == k_grab_window
|| (GDK_WINDOW_WIN32DATA(window)->event_mask & GDK_KEY_RELEASE_MASK))) || (GDK_WINDOW_WIN32DATA (window)->event_mask & GDK_KEY_RELEASE_MASK)))
{ {
if (window == k_grab_window if (window == k_grab_window
|| (GDK_WINDOW_WIN32DATA(window)->event_mask & GDK_KEY_PRESS_MASK)) || (GDK_WINDOW_WIN32DATA (window)->event_mask & GDK_KEY_PRESS_MASK))
{ {
/* Append a GDK_KEY_PRESS event to the pushback list /* Append a GDK_KEY_PRESS event to the pushback list
* (from which it will be fetched before the release * (from which it will be fetched before the release
* event). * event).
*/ */
GdkEvent *event2 = gdk_event_new (); GdkEvent *event2 = gdk_event_new ();
build_keypress_event (GDK_WINDOW_WIN32DATA(window), event2, xevent); build_keypress_event (GDK_WINDOW_WIN32DATA (window), event2, xevent);
event2->key.window = window; event2->key.window = window;
gdk_window_ref (window); gdk_window_ref (window);
gdk_event_queue_append (event2); gdk_event_queue_append (event2);
GDK_NOTE (EVENTS, print_event (event2)); GDK_NOTE (EVENTS, print_event (event2));
} }
/* Return the key release event. */ /* Return the key release event. */
build_keyrelease_event (GDK_WINDOW_WIN32DATA(window), event, xevent); build_keyrelease_event (GDK_WINDOW_WIN32DATA (window), event, xevent);
} }
else if (return_val else if (return_val
&& (GDK_WINDOW_WIN32DATA(window)->event_mask & GDK_KEY_PRESS_MASK)) && (GDK_WINDOW_WIN32DATA (window)->event_mask & GDK_KEY_PRESS_MASK))
{ {
/* Return just the key press event. */ /* Return just the key press event. */
build_keypress_event (GDK_WINDOW_WIN32DATA(window), event, xevent); build_keypress_event (GDK_WINDOW_WIN32DATA (window), event, xevent);
} }
else else
return_val = FALSE; return_val = FALSE;
...@@ -3443,13 +3475,13 @@ gdk_event_translate (GdkEvent *event, ...@@ -3443,13 +3475,13 @@ gdk_event_translate (GdkEvent *event,
{ {
/* No explicit active grab, let's start one automatically */ /* No explicit active grab, let's start one automatically */
gint owner_events = gint owner_events =
GDK_WINDOW_WIN32DATA(window)->event_mask GDK_WINDOW_WIN32DATA (window)->event_mask
& (GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK); & (GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK);
GDK_NOTE (EVENTS, g_print ("...automatic grab started\n")); GDK_NOTE (EVENTS, g_print ("...automatic grab started\n"));
gdk_pointer_grab (window, gdk_pointer_grab (window,
owner_events, owner_events,
GDK_WINDOW_WIN32DATA(window)->event_mask, GDK_WINDOW_WIN32DATA (window)->event_mask,
NULL, NULL, 0); NULL, NULL, 0);
p_grab_automatic = TRUE; p_grab_automatic = TRUE;
} }
...@@ -3594,7 +3626,7 @@ gdk_event_translate (GdkEvent *event, ...@@ -3594,7 +3626,7 @@ gdk_event_translate (GdkEvent *event,
LOWORD (xevent->lParam), HIWORD (xevent->lParam))); LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
if (p_TrackMouseEvent == NULL if (p_TrackMouseEvent == NULL
&& curWnd != NULL && curWnd != NULL
&& (GDK_WINDOW_WIN32DATA(curWnd)->event_mask & GDK_LEAVE_NOTIFY_MASK)) && (GDK_WINDOW_WIN32DATA (curWnd)->event_mask & GDK_LEAVE_NOTIFY_MASK))
{