diff --git a/ChangeLog b/ChangeLog index ddc3a5187d..e929094b92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2002-06-10 Tor Lillqvist + + [ merge from stable ] + + * gdk/win32/gdkmain-win32.c (gdk_screen_get_width_mm, + gdk_screen_get_height_mm): Use the "logical dpi" to calculate + (pseudo) physical sizes. Similar to the use of "logical dpi" in + Pango as suggested by Joaquin Cuenca Abela. + + Two fixes by Florent Duguet: + + * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Correct + semantics for setting cursor to NULL (should use cursor of parent + window). + + * gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get): Plug memory + leak. + 2002-06-10 Naba Kumar * configure.in: Added hi in ALL_LINGUAS diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ddc3a5187d..e929094b92 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,21 @@ +2002-06-10 Tor Lillqvist + + [ merge from stable ] + + * gdk/win32/gdkmain-win32.c (gdk_screen_get_width_mm, + gdk_screen_get_height_mm): Use the "logical dpi" to calculate + (pseudo) physical sizes. Similar to the use of "logical dpi" in + Pango as suggested by Joaquin Cuenca Abela. + + Two fixes by Florent Duguet: + + * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Correct + semantics for setting cursor to NULL (should use cursor of parent + window). + + * gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get): Plug memory + leak. + 2002-06-10 Naba Kumar * configure.in: Added hi in ALL_LINGUAS diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index ddc3a5187d..e929094b92 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,21 @@ +2002-06-10 Tor Lillqvist + + [ merge from stable ] + + * gdk/win32/gdkmain-win32.c (gdk_screen_get_width_mm, + gdk_screen_get_height_mm): Use the "logical dpi" to calculate + (pseudo) physical sizes. Similar to the use of "logical dpi" in + Pango as suggested by Joaquin Cuenca Abela. + + Two fixes by Florent Duguet: + + * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Correct + semantics for setting cursor to NULL (should use cursor of parent + window). + + * gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get): Plug memory + leak. + 2002-06-10 Naba Kumar * configure.in: Added hi in ALL_LINGUAS diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ddc3a5187d..e929094b92 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,21 @@ +2002-06-10 Tor Lillqvist + + [ merge from stable ] + + * gdk/win32/gdkmain-win32.c (gdk_screen_get_width_mm, + gdk_screen_get_height_mm): Use the "logical dpi" to calculate + (pseudo) physical sizes. Similar to the use of "logical dpi" in + Pango as suggested by Joaquin Cuenca Abela. + + Two fixes by Florent Duguet: + + * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Correct + semantics for setting cursor to NULL (should use cursor of parent + window). + + * gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get): Plug memory + leak. + 2002-06-10 Naba Kumar * configure.in: Added hi in ALL_LINGUAS diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ddc3a5187d..e929094b92 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,21 @@ +2002-06-10 Tor Lillqvist + + [ merge from stable ] + + * gdk/win32/gdkmain-win32.c (gdk_screen_get_width_mm, + gdk_screen_get_height_mm): Use the "logical dpi" to calculate + (pseudo) physical sizes. Similar to the use of "logical dpi" in + Pango as suggested by Joaquin Cuenca Abela. + + Two fixes by Florent Duguet: + + * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Correct + semantics for setting cursor to NULL (should use cursor of parent + window). + + * gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get): Plug memory + leak. + 2002-06-10 Naba Kumar * configure.in: Added hi in ALL_LINGUAS diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ddc3a5187d..e929094b92 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,21 @@ +2002-06-10 Tor Lillqvist + + [ merge from stable ] + + * gdk/win32/gdkmain-win32.c (gdk_screen_get_width_mm, + gdk_screen_get_height_mm): Use the "logical dpi" to calculate + (pseudo) physical sizes. Similar to the use of "logical dpi" in + Pango as suggested by Joaquin Cuenca Abela. + + Two fixes by Florent Duguet: + + * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Correct + semantics for setting cursor to NULL (should use cursor of parent + window). + + * gdk/win32/gdkgc-win32.c (gdk_win32_hdc_get): Plug memory + leak. + 2002-06-10 Naba Kumar * configure.in: Added hi in ALL_LINGUAS diff --git a/gdk/win32/gdkgc-win32.c b/gdk/win32/gdkgc-win32.c index 4d3a04f1ec..939f869f80 100644 --- a/gdk/win32/gdkgc-win32.c +++ b/gdk/win32/gdkgc-win32.c @@ -1011,6 +1011,8 @@ gdk_win32_hdc_get (GdkDrawable *drawable, if ((hrgn = ExtCreateRegion (NULL, nbytes, rgndata)) == NULL) WIN32_API_FAILED ("ExtCreateRegion"), ok = FALSE; + g_free (rgndata); + /* * XXX: combine the fillmode-stipple with the clip region possibly * this needs to be done with the hcliprgn below as well, but diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index 980ed1f382..a08915a9ed 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -170,13 +170,13 @@ gdk_screen_get_height (GdkScreen *screen) gint gdk_screen_get_width_mm (GdkScreen *screen) { - return GetDeviceCaps (gdk_display_hdc, HORZSIZE); + return (double) GetDeviceCaps (gdk_display_hdc, HORZRES) / GetDeviceCaps (gdk_display_hdc, LOGPIXELSX) * 25.4; } gint gdk_screen_get_height_mm (GdkScreen *screen) { - return GetDeviceCaps (gdk_display_hdc, VERTSIZE); + return (double) GetDeviceCaps (gdk_display_hdc, VERTRES) / GetDeviceCaps (gdk_display_hdc, LOGPIXELSY) * 25.4; } void diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 9e23a87b9c..b5159f3070 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -1601,6 +1601,7 @@ gdk_window_set_cursor (GdkWindow *window, { GdkWindowImplWin32 *impl; GdkCursorPrivate *cursor_private; + GdkWindowObject *parent_window; HCURSOR hcursor; HCURSOR hprevcursor; @@ -1644,9 +1645,10 @@ gdk_window_set_cursor (GdkWindow *window, hcursor, impl->hcursor)); } - /* Set new cursor in all cases if we're over our window */ + /* If the pointer is over our window, set new cursor if given */ if (gdk_window_get_pointer(window, NULL, NULL, NULL) == window) - SetCursor (impl->hcursor); + if (impl->hcursor != NULL) + SetCursor (impl->hcursor); /* Destroy the previous cursor: Need to make sure it's no longer in * use before we destroy it, in case we're not over our window but @@ -1655,7 +1657,25 @@ gdk_window_set_cursor (GdkWindow *window, if (hprevcursor != NULL) { if (GetCursor() == hprevcursor) - SetCursor (NULL); + { + /* Look for a suitable cursor to use instead */ + hcursor = NULL; + parent_window = GDK_WINDOW_OBJECT (window)->parent; + while (hcursor == NULL) + { + if (parent_window) + { + impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl); + hcursor = impl->hcursor; + parent_window = parent_window->parent; + } + else + { + hcursor = LoadCursor (NULL, IDC_ARROW); + } + } + SetCursor (hcursor); + } GDK_NOTE (MISC, g_print ("...DestroyCursor (%p)\n", hprevcursor));