summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorHans Breuer <hans@breuer.org>2004-03-20 23:45:35 +0000
committerHans Breuer <hans@src.gnome.org>2004-03-20 23:45:35 +0000
commitf0afa3a497a0c0f305a5df71ec7b737ef7465170 (patch)
treec782c514639b787590cee7d21bd00a66f3e22fe2 /gdk
parent3483a90d403cd2b42f4d0e2369645c7387a49198 (diff)
downloadgdk-pixbuf-f0afa3a497a0c0f305a5df71ec7b737ef7465170.tar.gz
applied the undisputable and required [due to recent gtkfilesystem
2004-03-20 Hans Breuer <hans@breuer.org> * 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)
Diffstat (limited to 'gdk')
-rw-r--r--gdk/win32/gdkevents-win32.c30
1 files changed, 17 insertions, 13 deletions
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;