Commit 663ec013 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

[ merge from stable ]

2002-06-10  Tor Lillqvist  <tml@iki.fi>

	[ 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.
parent ebeb676c
2002-06-10 Tor Lillqvist <tml@iki.fi>
[ 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 <kh_naba@users.sourceforge.net> 2002-06-10 Naba Kumar <kh_naba@users.sourceforge.net>
* configure.in: Added hi in ALL_LINGUAS * configure.in: Added hi in ALL_LINGUAS
......
2002-06-10 Tor Lillqvist <tml@iki.fi>
[ 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 <kh_naba@users.sourceforge.net> 2002-06-10 Naba Kumar <kh_naba@users.sourceforge.net>
* configure.in: Added hi in ALL_LINGUAS * configure.in: Added hi in ALL_LINGUAS
......
2002-06-10 Tor Lillqvist <tml@iki.fi>
[ 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 <kh_naba@users.sourceforge.net> 2002-06-10 Naba Kumar <kh_naba@users.sourceforge.net>
* configure.in: Added hi in ALL_LINGUAS * configure.in: Added hi in ALL_LINGUAS
......
2002-06-10 Tor Lillqvist <tml@iki.fi>
[ 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 <kh_naba@users.sourceforge.net> 2002-06-10 Naba Kumar <kh_naba@users.sourceforge.net>
* configure.in: Added hi in ALL_LINGUAS * configure.in: Added hi in ALL_LINGUAS
......
2002-06-10 Tor Lillqvist <tml@iki.fi>
[ 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 <kh_naba@users.sourceforge.net> 2002-06-10 Naba Kumar <kh_naba@users.sourceforge.net>
* configure.in: Added hi in ALL_LINGUAS * configure.in: Added hi in ALL_LINGUAS
......
2002-06-10 Tor Lillqvist <tml@iki.fi>
[ 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 <kh_naba@users.sourceforge.net> 2002-06-10 Naba Kumar <kh_naba@users.sourceforge.net>
* configure.in: Added hi in ALL_LINGUAS * configure.in: Added hi in ALL_LINGUAS
......
...@@ -1011,6 +1011,8 @@ gdk_win32_hdc_get (GdkDrawable *drawable, ...@@ -1011,6 +1011,8 @@ gdk_win32_hdc_get (GdkDrawable *drawable,
if ((hrgn = ExtCreateRegion (NULL, nbytes, rgndata)) == NULL) if ((hrgn = ExtCreateRegion (NULL, nbytes, rgndata)) == NULL)
WIN32_API_FAILED ("ExtCreateRegion"), ok = FALSE; WIN32_API_FAILED ("ExtCreateRegion"), ok = FALSE;
g_free (rgndata);
/* /*
* XXX: combine the fillmode-stipple with the clip region possibly * XXX: combine the fillmode-stipple with the clip region possibly
* this needs to be done with the hcliprgn below as well, but * this needs to be done with the hcliprgn below as well, but
......
...@@ -170,13 +170,13 @@ gdk_screen_get_height (GdkScreen *screen) ...@@ -170,13 +170,13 @@ gdk_screen_get_height (GdkScreen *screen)
gint gint
gdk_screen_get_width_mm (GdkScreen *screen) 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 gint
gdk_screen_get_height_mm (GdkScreen *screen) 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 void
......
...@@ -1601,6 +1601,7 @@ gdk_window_set_cursor (GdkWindow *window, ...@@ -1601,6 +1601,7 @@ gdk_window_set_cursor (GdkWindow *window,
{ {
GdkWindowImplWin32 *impl; GdkWindowImplWin32 *impl;
GdkCursorPrivate *cursor_private; GdkCursorPrivate *cursor_private;
GdkWindowObject *parent_window;
HCURSOR hcursor; HCURSOR hcursor;
HCURSOR hprevcursor; HCURSOR hprevcursor;
...@@ -1644,9 +1645,10 @@ gdk_window_set_cursor (GdkWindow *window, ...@@ -1644,9 +1645,10 @@ gdk_window_set_cursor (GdkWindow *window,
hcursor, impl->hcursor)); 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) 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 /* 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 * use before we destroy it, in case we're not over our window but
...@@ -1655,7 +1657,25 @@ gdk_window_set_cursor (GdkWindow *window, ...@@ -1655,7 +1657,25 @@ gdk_window_set_cursor (GdkWindow *window,
if (hprevcursor != NULL) if (hprevcursor != NULL)
{ {
if (GetCursor() == hprevcursor) 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", GDK_NOTE (MISC, g_print ("...DestroyCursor (%p)\n",
hprevcursor)); hprevcursor));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment