[ 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.
This commit is contained in:
Tor Lillqvist 2002-06-10 20:27:15 +00:00 committed by Tor Lillqvist
parent ebeb676cf1
commit 663ec013a4
9 changed files with 135 additions and 5 deletions

View File

@ -1,3 +1,21 @@
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>
* configure.in: Added hi in ALL_LINGUAS

View File

@ -1,3 +1,21 @@
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>
* configure.in: Added hi in ALL_LINGUAS

View File

@ -1,3 +1,21 @@
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>
* configure.in: Added hi in ALL_LINGUAS

View File

@ -1,3 +1,21 @@
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>
* configure.in: Added hi in ALL_LINGUAS

View File

@ -1,3 +1,21 @@
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>
* configure.in: Added hi in ALL_LINGUAS

View File

@ -1,3 +1,21 @@
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>
* configure.in: Added hi in ALL_LINGUAS

View File

@ -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

View File

@ -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

View File

@ -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));