don't modify the passed in GdkSegment(s) in place, we may get them again

2004-05-02  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkdrawable-win32.c (draw_segments) : don't
	modify the passed in GdkSegment(s) in place, we may get
	them again to draw at the same place. Fixes bug #129095,
	bug #137177, ...
	(draw_segments) draw the end pixel again to get the
	pixmap mask right, fixes bug #126710, #130202

	* gdk/win32/gdkwindow-win32.c : use SetForegroundWindow,
	fixes bug #106013, John Ehresman

	* gtk/makefile.msc.in : don't try to link gtk.res but
	use gtk-win32.res (as supposed to be fixed below :)
This commit is contained in:
Hans Breuer 2004-05-02 13:20:49 +00:00 committed by Hans Breuer
parent a516adebbe
commit 6efc9a6a12
8 changed files with 116 additions and 18 deletions

View File

@ -1,3 +1,18 @@
2004-05-02 Hans Breuer <hans@breuer.org>
* gdk/win32/gdkdrawable-win32.c (draw_segments) : don't
modify the passed in GdkSegment(s) in place, we may get
them again to draw at the same place. Fixes bug #129095,
bug #137177, ...
(draw_segments) draw the end pixel again to get the
pixmap mask right, fixes bug #126710, #130202
* gdk/win32/gdkwindow-win32.c : use SetForegroundWindow,
fixes bug #106013, John Ehresman
* gtk/makefile.msc.in : don't try to link gtk.res but
use gtk-win32.res (as supposed to be fixed below :)
2004-05-01 Hans Breuer <hans@breuer.org>
* tests/Makefile.am : tests/makefile.msc is in CVS for

View File

@ -1,3 +1,18 @@
2004-05-02 Hans Breuer <hans@breuer.org>
* gdk/win32/gdkdrawable-win32.c (draw_segments) : don't
modify the passed in GdkSegment(s) in place, we may get
them again to draw at the same place. Fixes bug #129095,
bug #137177, ...
(draw_segments) draw the end pixel again to get the
pixmap mask right, fixes bug #126710, #130202
* gdk/win32/gdkwindow-win32.c : use SetForegroundWindow,
fixes bug #106013, John Ehresman
* gtk/makefile.msc.in : don't try to link gtk.res but
use gtk-win32.res (as supposed to be fixed below :)
2004-05-01 Hans Breuer <hans@breuer.org>
* tests/Makefile.am : tests/makefile.msc is in CVS for

View File

@ -1,3 +1,18 @@
2004-05-02 Hans Breuer <hans@breuer.org>
* gdk/win32/gdkdrawable-win32.c (draw_segments) : don't
modify the passed in GdkSegment(s) in place, we may get
them again to draw at the same place. Fixes bug #129095,
bug #137177, ...
(draw_segments) draw the end pixel again to get the
pixmap mask right, fixes bug #126710, #130202
* gdk/win32/gdkwindow-win32.c : use SetForegroundWindow,
fixes bug #106013, John Ehresman
* gtk/makefile.msc.in : don't try to link gtk.res but
use gtk-win32.res (as supposed to be fixed below :)
2004-05-01 Hans Breuer <hans@breuer.org>
* tests/Makefile.am : tests/makefile.msc is in CVS for

View File

@ -1,3 +1,18 @@
2004-05-02 Hans Breuer <hans@breuer.org>
* gdk/win32/gdkdrawable-win32.c (draw_segments) : don't
modify the passed in GdkSegment(s) in place, we may get
them again to draw at the same place. Fixes bug #129095,
bug #137177, ...
(draw_segments) draw the end pixel again to get the
pixmap mask right, fixes bug #126710, #130202
* gdk/win32/gdkwindow-win32.c : use SetForegroundWindow,
fixes bug #106013, John Ehresman
* gtk/makefile.msc.in : don't try to link gtk.res but
use gtk-win32.res (as supposed to be fixed below :)
2004-05-01 Hans Breuer <hans@breuer.org>
* tests/Makefile.am : tests/makefile.msc is in CVS for

View File

@ -1,3 +1,18 @@
2004-05-02 Hans Breuer <hans@breuer.org>
* gdk/win32/gdkdrawable-win32.c (draw_segments) : don't
modify the passed in GdkSegment(s) in place, we may get
them again to draw at the same place. Fixes bug #129095,
bug #137177, ...
(draw_segments) draw the end pixel again to get the
pixmap mask right, fixes bug #126710, #130202
* gdk/win32/gdkwindow-win32.c : use SetForegroundWindow,
fixes bug #106013, John Ehresman
* gtk/makefile.msc.in : don't try to link gtk.res but
use gtk-win32.res (as supposed to be fixed below :)
2004-05-01 Hans Breuer <hans@breuer.org>
* tests/Makefile.am : tests/makefile.msc is in CVS for

View File

@ -1179,13 +1179,17 @@ draw_segments (GdkGCWin32 *gcwin32,
nsegs = va_arg (args, gint);
if (x_offset != 0 || y_offset != 0)
for (i = 0; i < nsegs; i++)
{
segs[i].x1 -= x_offset;
segs[i].y1 -= y_offset;
segs[i].x2 -= x_offset;
segs[i].y2 -= y_offset;
}
{
/* must not modify in place, but could splice in the offset all below */
segs = g_memdup (segs, nsegs * sizeof (GdkSegment));
for (i = 0; i < nsegs; i++)
{
segs[i].x1 -= x_offset;
segs[i].y1 -= y_offset;
segs[i].x2 -= x_offset;
segs[i].y2 -= y_offset;
}
}
if (gcwin32->pen_dashes && !IS_WIN_NT ())
{
@ -1237,18 +1241,32 @@ draw_segments (GdkGCWin32 *gcwin32,
* e.g. at xpm icons produced with gdk_pixbuf_new_from_xpm_data trough
* gdk_pixbuf_render_threshold_alpha (testgtk folder icon or
* Dia's toolbox icons) but only on win9x ... --hb
*
* Update : see bug #81895 and bug #126710 why this is finally
* needed on any win32 platform ;-)
*/
if (gcwin32->pen_width <= 1 && !IS_WIN_NT())
if (gcwin32->pen_width <= 1)
{
GdkSegment *ps = &segs[nsegs-1];
int xc = (ps->y2 == ps->y1) ? 0 : ((ps->x1 < ps->x2) ? 1 : -1);
int yc = (ps->x2 == ps->x1) ? 0 : ((ps->y1 < ps->y2) ? 1 : -1);
/* don't forget single point lines */
xc = (0 == xc && 0 == yc) ? 1 : xc;
int xc = 0, yc = 0;
if (ps->y2 == ps->y1 && ps->x2 == ps->x1)
xc = 1; /* just a point */
else if (ps->y2 == ps->y1)
xc = (ps->x1 < ps->x2) ? 1 : -1; /* advance x only */
else if (ps->x2 == ps->x1)
yc = (ps->y1 < ps->y2) ? 1 : -1; /* advance y only */
else
{
xc = (ps->x1 < ps->x2) ? 1 : -1;
yc = (ps->y1 < ps->y2) ? 1 : -1;
}
GDI_CALL (LineTo, (hdc, ps->x2 + xc, ps->y2 + yc));
}
}
if (x_offset != 0 || y_offset != 0)
g_free (segs);
}
static void

View File

@ -1041,11 +1041,16 @@ show_window_internal (GdkWindow *window,
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
if (raise)
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP)
SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
else
BringWindowToTop (GDK_WINDOW_HWND (window));
{
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP)
SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL
|| GDK_WINDOW_TYPE (window) == GDK_WINDOW_DIALOG)
SetForegroundWindow (GDK_WINDOW_HWND (window));
else
BringWindowToTop (GDK_WINDOW_HWND (window));
}
else if (old_active_window != GDK_WINDOW_HWND (window))
SetActiveWindow (old_active_window);
}

View File

@ -491,7 +491,7 @@ gtk-win32.res : gtk-win32.rc
# Linking:
#
libgtk-win32-$(GTK_VER)-0.dll : $(gtk_OBJECTS) gtk.def gtk-win32.res
$(CC) $(CFLAGS) -LD -Fm -Fe$@ $(gtk_OBJECTS) gtk.res \
$(CC) $(CFLAGS) -LD -Fm -Fe$@ $(gtk_OBJECTS) gtk-win32.res \
$(GDK_LIBS) $(GDK_PIXBUF_LIBS) $(PANGO_LIBS) $(INTL_LIBS) $(GLIB_LIBS) \
gdi32.lib user32.lib advapi32.lib wsock32.lib shell32.lib \
$(LDFLAGS) /implib:gtk-win32-$(GTK_VER).lib /def:gtk.def