From f0afa3a497a0c0f305a5df71ec7b737ef7465170 Mon Sep 17 00:00:00 2001 From: Hans Breuer Date: Sat, 20 Mar 2004 23:45:35 +0000 Subject: applied the undisputable and required [due to recent gtkfilesystem 2004-03-20 Hans Breuer * gtk/gtkfilesystemwin32.c : applied the undisputable and required [due to recent gtkfilesystem internal api semantic changes] part of patches to fix bug #137543 (Tor Lillqvist, J. Ali Harlow) * gdk/gdkevents-win32.c (handle_configure_event) : (gdk_event_translate), WM_WINDOWPOSCHANGED : initialize GdkWindowObject::x, y with screen coords to make gdk_window_get_position () return the right thing and thus fix drag and drop positioning (e.g. Gimp tabs, fixes bug #137192) --- gdk/win32/gdkevents-win32.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'gdk') diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index d8290856c..608da8f19 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -1685,23 +1685,25 @@ handle_configure_event (MSG *msg, GdkWindow *window) { RECT client_rect; + POINT point; GetClientRect (msg->hwnd, &client_rect); - + point.x = client_rect.left; /* always 0 */ + point.y = client_rect.top; + /* top level windows need screen coords */ + if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL) + ClientToScreen (msg->hwnd, &point); + GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->width = client_rect.right - client_rect.left; GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->height = client_rect.bottom - client_rect.top; - ((GdkWindowObject *) window)->x = client_rect.left; - ((GdkWindowObject *) window)->y = client_rect.top; + ((GdkWindowObject *) window)->x = point.x; + ((GdkWindowObject *) window)->y = point.y; if (((GdkWindowObject *) window)->event_mask & GDK_STRUCTURE_MASK) { - POINT point; GdkEvent *event = gdk_event_new (GDK_CONFIGURE); - point.x = point.y = 0; - ClientToScreen (msg->hwnd, &point); - event->configure.window = window; event->configure.width = client_rect.right - client_rect.left; @@ -2980,23 +2982,25 @@ gdk_event_translate (GdkDisplay *display, !GDK_WINDOW_DESTROYED (window)) { RECT client_rect; + POINT point; GetClientRect (msg->hwnd, &client_rect); + point.x = client_rect.left; /* always 0 */ + point.y = client_rect.top; + /* top level windows need screen coords */ + if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL) + ClientToScreen (msg->hwnd, &point); GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->width = client_rect.right - client_rect.left; GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->height = client_rect.bottom - client_rect.top; - ((GdkWindowObject *) window)->x = client_rect.left; - ((GdkWindowObject *) window)->y = client_rect.top; + ((GdkWindowObject *) window)->x = point.x; + ((GdkWindowObject *) window)->y = point.y; if (((GdkWindowObject *) window)->event_mask & GDK_STRUCTURE_MASK) { - POINT point; GdkEvent *event = gdk_event_new (GDK_CONFIGURE); - point.x = point.y = 0; - ClientToScreen (msg->hwnd, &point); - event->configure.window = window; event->configure.width = client_rect.right - client_rect.left; -- cgit v1.2.1