diff --git a/ChangeLog b/ChangeLog index 92da536287..e811c5083f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-08-08 Tor Lillqvist + + * gdk/win32/gdkevents-win32.c (print_event): Print also the root + coordinates for events that have such. Print coordinates for enter + and leave events. + + (gdk_event_translate): Don't use event uninitialixed in the + return_exposes branch of the WM_PAINT handler. + + * gdk/win32/gdkwindow-win32.c (gdk_window_new, + _gdk_windowing_window_get_pointer, _gdk_windowing_window_at_pointer): + Must offset top-level window coordinates here, too. + 2003-08-08 Matthias Clasen * demos/gtk-demo/appwindow.c (do_appwindow): Hide the resize grip when maximized or fullscreen. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 92da536287..e811c5083f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +2003-08-08 Tor Lillqvist + + * gdk/win32/gdkevents-win32.c (print_event): Print also the root + coordinates for events that have such. Print coordinates for enter + and leave events. + + (gdk_event_translate): Don't use event uninitialixed in the + return_exposes branch of the WM_PAINT handler. + + * gdk/win32/gdkwindow-win32.c (gdk_window_new, + _gdk_windowing_window_get_pointer, _gdk_windowing_window_at_pointer): + Must offset top-level window coordinates here, too. + 2003-08-08 Matthias Clasen * demos/gtk-demo/appwindow.c (do_appwindow): Hide the resize grip when maximized or fullscreen. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 92da536287..e811c5083f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +2003-08-08 Tor Lillqvist + + * gdk/win32/gdkevents-win32.c (print_event): Print also the root + coordinates for events that have such. Print coordinates for enter + and leave events. + + (gdk_event_translate): Don't use event uninitialixed in the + return_exposes branch of the WM_PAINT handler. + + * gdk/win32/gdkwindow-win32.c (gdk_window_new, + _gdk_windowing_window_get_pointer, _gdk_windowing_window_at_pointer): + Must offset top-level window coordinates here, too. + 2003-08-08 Matthias Clasen * demos/gtk-demo/appwindow.c (do_appwindow): Hide the resize grip when maximized or fullscreen. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 92da536287..e811c5083f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +2003-08-08 Tor Lillqvist + + * gdk/win32/gdkevents-win32.c (print_event): Print also the root + coordinates for events that have such. Print coordinates for enter + and leave events. + + (gdk_event_translate): Don't use event uninitialixed in the + return_exposes branch of the WM_PAINT handler. + + * gdk/win32/gdkwindow-win32.c (gdk_window_new, + _gdk_windowing_window_get_pointer, _gdk_windowing_window_at_pointer): + Must offset top-level window coordinates here, too. + 2003-08-08 Matthias Clasen * demos/gtk-demo/appwindow.c (do_appwindow): Hide the resize grip when maximized or fullscreen. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 92da536287..e811c5083f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +2003-08-08 Tor Lillqvist + + * gdk/win32/gdkevents-win32.c (print_event): Print also the root + coordinates for events that have such. Print coordinates for enter + and leave events. + + (gdk_event_translate): Don't use event uninitialixed in the + return_exposes branch of the WM_PAINT handler. + + * gdk/win32/gdkwindow-win32.c (gdk_window_new, + _gdk_windowing_window_get_pointer, _gdk_windowing_window_at_pointer): + Must offset top-level window coordinates here, too. + 2003-08-08 Matthias Clasen * demos/gtk-demo/appwindow.c (do_appwindow): Hide the resize grip when maximized or fullscreen. diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 5e7f887bce..75ed67212c 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -953,8 +953,9 @@ print_event (GdkEvent *event) event->expose.count); break; case GDK_MOTION_NOTIFY: - g_print ("(%.4g,%.4g) %s", + g_print ("(%.4g,%.4g) (%.4g,%.4g) %s", event->motion.x, event->motion.y, + event->motion.x_root, event->motion.y_root, event->motion.is_hint ? "HINT " : ""); print_event_state (event->motion.state); break; @@ -962,9 +963,10 @@ print_event (GdkEvent *event) case GDK_2BUTTON_PRESS: case GDK_3BUTTON_PRESS: case GDK_BUTTON_RELEASE: - g_print ("%d (%.4g,%.4g) ", + g_print ("%d (%.4g,%.4g) (%.4g,%.4g)", event->button.button, - event->button.x, event->button.y); + event->button.x, event->button.y, + event->button.x_root, event->button.y_root); print_event_state (event->button.state); break; case GDK_KEY_PRESS: @@ -984,7 +986,10 @@ print_event (GdkEvent *event) break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: - g_print ("%s %s%s", + g_print ("%p (%.4g,%.4g) (%.4g,%.4g) %s %s%s", + event->crossing.subwindow == NULL ? NULL : GDK_WINDOW_HWND (event->crossing.subwindow), + event->crossing.x, event->crossing.y, + event->crossing.x_root, event->crossing.y_root, (event->crossing.mode == GDK_CROSSING_NORMAL ? "NORMAL" : (event->crossing.mode == GDK_CROSSING_GRAB ? "GRAB" : (event->crossing.mode == GDK_CROSSING_UNGRAB ? "UNGRAB" : @@ -997,6 +1002,7 @@ print_event (GdkEvent *event) (event->crossing.detail == GDK_NOTIFY_UNKNOWN ? "UNKNOWN" : "???")))))), event->crossing.focus ? " FOCUS" : ""); + print_event_state (event->crossing.state); break; case GDK_CONFIGURE: g_print ("x:%d y:%d w:%d h:%d", @@ -1004,8 +1010,9 @@ print_event (GdkEvent *event) event->configure.width, event->configure.height); break; case GDK_SCROLL: - g_print ("(%.4g,%.4g) %s", + g_print ("(%.4g,%.4g) (%.4g,%.4g)%s", event->scroll.x, event->scroll.y, + event->scroll.x_root, event->scroll.y_root, (event->scroll.direction == GDK_SCROLL_UP ? "UP" : (event->scroll.direction == GDK_SCROLL_DOWN ? "DOWN" : (event->scroll.direction == GDK_SCROLL_LEFT ? "LEFT" : @@ -2567,7 +2574,7 @@ gdk_event_translate (GdkDisplay *display, if (!gdk_win32_handle_table_lookup ((GdkNativeWindow) wndnow)) { /* we are only interested if we don't know the new window */ - GDK_NOTE (EVENTS, g_print ("WM_MOUSELEAVE: %p %d (%d,%d)\n", + GDK_NOTE (EVENTS, g_print ("WM_MOUSELEAVE: %p %d (%ld,%ld)\n", msg->hwnd, HIWORD (msg->wParam), pt.x, pt.y)); synthesize_enter_or_leave_event (current_window, msg, GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL, GDK_NOTIFY_UNKNOWN, @@ -2575,7 +2582,7 @@ gdk_event_translate (GdkDisplay *display, } else { - GDK_NOTE (EVENTS, g_print ("WM_MOUSELEAVE: %p %d (%d,%d) ignored\n", + GDK_NOTE (EVENTS, g_print ("WM_MOUSELEAVE: %p %d (%ld,%ld) ignored\n", msg->hwnd, HIWORD (msg->wParam), pt.x, pt.y)); } } @@ -2783,8 +2790,8 @@ gdk_event_translate (GdkDisplay *display, list = list->next; } + append_event (display, event); } - append_event (display, event); return_val = TRUE; } @@ -3049,8 +3056,8 @@ gdk_event_translate (GdkDisplay *display, impl = GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl); mmi = (MINMAXINFO*) msg->lParam; - GDK_NOTE (EVENTS, g_print ("...mintrack:%dx%d maxtrack:%dx%d " - "maxpos:+%d+%d maxsize:%dx%d\n", + GDK_NOTE (EVENTS, g_print ("...mintrack:%ldx%ld maxtrack:%ldx%ld " + "maxpos:+%ld+%ld maxsize:%ldx%ld\n", mmi->ptMinTrackSize.x, mmi->ptMinTrackSize.y, mmi->ptMaxTrackSize.x, mmi->ptMaxTrackSize.y, mmi->ptMaxPosition.x, mmi->ptMaxPosition.y, @@ -3083,8 +3090,8 @@ gdk_event_translate (GdkDisplay *display, if (impl->hint_flags & (GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE)) { /* Don't call DefWindowProc() */ - GDK_NOTE (EVENTS, g_print ("...handled, mintrack:%dx%d maxtrack:%dx%d " - "maxpos:+%d+%d maxsize:%dx%d\n", + GDK_NOTE (EVENTS, g_print ("...handled, mintrack:%ldx%ld maxtrack:%ldx%ld " + "maxpos:+%ld+%ld maxsize:%ldx%ld\n", mmi->ptMinTrackSize.x, mmi->ptMinTrackSize.y, mmi->ptMaxTrackSize.x, mmi->ptMaxTrackSize.y, mmi->ptMaxPosition.x, mmi->ptMaxPosition.y, diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 04f2c8ccba..ea5699a3ef 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -427,6 +427,7 @@ gdk_window_new (GdkWindow *parent, const gchar *title; char *mbtitle; gint window_width, window_height; + gint offset_x = 0, offset_y = 0; g_return_val_if_fail (attributes != NULL, NULL); @@ -522,6 +523,8 @@ gdk_window_new (GdkWindow *parent, case GDK_WINDOW_TOPLEVEL: dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN; hparent = _gdk_root_window; + offset_x = _gdk_offset_x; + offset_y = _gdk_offset_y; break; case GDK_WINDOW_CHILD: @@ -534,6 +537,8 @@ gdk_window_new (GdkWindow *parent, dwExStyle |= WS_EX_TOPMOST; /* //HB: want this? */ #endif hparent = _gdk_root_window; + offset_x = _gdk_offset_x; + offset_y = _gdk_offset_y; break; case GDK_WINDOW_TEMP: @@ -541,6 +546,8 @@ gdk_window_new (GdkWindow *parent, /* a temp window is not necessarily a top level window */ dwStyle |= (_gdk_parent_root == parent ? WS_POPUP : WS_CHILDWINDOW); dwExStyle |= WS_EX_TOOLWINDOW; + offset_x = _gdk_offset_x; + offset_y = _gdk_offset_y; break; case GDK_WINDOW_ROOT: @@ -601,8 +608,8 @@ gdk_window_new (GdkWindow *parent, mbtitle, dwStyle, ((attributes_mask & GDK_WA_X) ? - impl->position_info.x : CW_USEDEFAULT), - impl->position_info.y, + impl->position_info.x - offset_x : CW_USEDEFAULT), + impl->position_info.y - offset_y, window_width, window_height, hparent, NULL, @@ -616,8 +623,8 @@ gdk_window_new (GdkWindow *parent, mbtitle, dwStyle, ((attributes_mask & GDK_WA_X) ? - impl->position_info.x : CW_USEDEFAULT), - impl->position_info.y, + impl->position_info.x - offset_x: CW_USEDEFAULT), + impl->position_info.y - offset_y, window_width, window_height, hparent, NULL, @@ -653,8 +660,8 @@ gdk_window_new (GdkWindow *parent, mbtitle, window_width, window_height, ((attributes_mask & GDK_WA_X) ? - impl->position_info.x : CW_USEDEFAULT), - impl->position_info.y, + impl->position_info.x - offset_x: CW_USEDEFAULT), + impl->position_info.y - offset_y, hparent, GDK_WINDOW_HWND (window))); @@ -1943,6 +1950,12 @@ _gdk_windowing_window_get_pointer (GdkDisplay *display, *x = point.x; *y = point.y; + if (window == _gdk_parent_root) + { + *x += _gdk_offset_x; + *y += _gdk_offset_y; + } + hwnd = WindowFromPoint (screen_point); if (hwnd != NULL) { @@ -2017,8 +2030,8 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display, if (hwnd == NULL) { window = _gdk_parent_root; - *win_x = pointc.x; - *win_y = pointc.y; + *win_x = pointc.x + _gdk_offset_x; + *win_y = pointc.y + _gdk_offset_y; return window; } @@ -2039,8 +2052,8 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display, *win_y = point.y - rect.top; } - GDK_NOTE (MISC, g_print ("_gdk_windowing_window_at_pointer: +%ld+%ld %p%s\n", - point.x, point.y, + GDK_NOTE (MISC, g_print ("_gdk_windowing_window_at_pointer: +%d+%d %p%s\n", + *win_x, *win_y, hwnd, (window == NULL ? " NULL" : "")));