]> Pileus Git - ~andy/gtk/commitdiff
don't modify the passed in GdkSegment(s) in place, we may get them again
authorHans Breuer <hans@breuer.org>
Sun, 2 May 2004 13:20:49 +0000 (13:20 +0000)
committerHans Breuer <hans@src.gnome.org>
Sun, 2 May 2004 13:20:49 +0000 (13:20 +0000)
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 :)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkdrawable-win32.c
gdk/win32/gdkwindow-win32.c
gtk/makefile.msc.in

index 5248747127a3f7e2b361c838a678f5f02b2e1d1b..2c734bedf3f6968cdebdbeae2449e20af00e1061 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 5248747127a3f7e2b361c838a678f5f02b2e1d1b..2c734bedf3f6968cdebdbeae2449e20af00e1061 100644 (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
index 5248747127a3f7e2b361c838a678f5f02b2e1d1b..2c734bedf3f6968cdebdbeae2449e20af00e1061 100644 (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
index 5248747127a3f7e2b361c838a678f5f02b2e1d1b..2c734bedf3f6968cdebdbeae2449e20af00e1061 100644 (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
index 5248747127a3f7e2b361c838a678f5f02b2e1d1b..2c734bedf3f6968cdebdbeae2449e20af00e1061 100644 (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
index acc6757f786774bd988e4537ea9260950ad83eaa..cd3c8741849291589d31209402dd85e903e562c7 100644 (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
index 958df71c91017eb98d4740cc5eca5bf82f0040c2..ae67429e6c86bb96d503c2c556a3883f2e4cc6fd 100644 (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);
 }
index 59d578f03fb3e764fb95eaac6464d15e0bd6008e..432c8862ae24da8fbb56a3ba2f325b7813bf32b0 100644 (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