Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Harald Koenig <koenig@tat.physik.uni-tuebingen.de>
Subject: Re: procps-1.01 patches
Date: Mon, 17 Jun 1996 12:01:35 +0200 (MET DST)	[thread overview]
Message-ID: <199606171005.MAA22486@ceres.tat.physik.uni-tuebingen.de> (raw)
In-Reply-To: <199606170309.UAA02809@koala.azstarnet.com>

> OK, I bit the bullet and upgraded to procps-1.01.  There is now a new
> patch at:
> 
>  ftp://ftp.azstarnet.com/pub/linux/axp/glibc/procps-1.01axp.patch.gz

I haven't checked your patches yet but here are some patches for
xcpustate which fix the 16/32bpp problem and also fixes the problem.
of resource initialisation.  

just using base==0 for XtGetApplicationResources() is not portable 
when sizeof(int) < sizeof (void*).  I've tested the patch below on
i386 too.

> Harald, now I have a bug report for you (or any X-server hacker, I
> suppose): xcpustate prints the bar-chart all in black when running the
> latest XF86_S3 server in 16bpp mode.  In 8bpp mode, the stippling
> works just fine.  Bug or feature?

client bug; patch see below.  I don't like this b/w display so I never
run xcpustate other than for a quick compilation check (which almost
ever happens on 8bpp as my default depth).

-------------------------------------------------------------------------------
--- procps-1.01/xcpustate/xcpustate.c.orig	Mon Jun 17 09:49:00 1996
+++ procps-1.01/xcpustate/xcpustate.c	Mon Jun 17 11:03:06 1996
@@ -28,9 +28,9 @@
 /* Application Resources - no particular widget */
 static XtResource application_resources[] = {
     {"interval", "Interval", XtRInt, sizeof(int),
-	    (Cardinal)&interval, XtRInt, (caddr_t) &defaultInterval},
+	    0, XtRInt, (caddr_t) &defaultInterval},
     {"count", "Count", XtRInt, sizeof(int),
-	    (Cardinal)&count, XtRInt, (caddr_t) &defaultCount},
+	    0, XtRInt, (caddr_t) &defaultCount},
 };
 
 /*
@@ -147,8 +147,13 @@
 
     if (argc > 1)
 	usage();
-	
-    XtGetApplicationResources(topLevel, 0, application_resources,
+
+    application_resources[0].resource_offset = 
+      (Cardinal)&interval - (Cardinal)&application_resources;
+    application_resources[1].resource_offset = 
+      (Cardinal)&count - (Cardinal)&application_resources;
+
+    XtGetApplicationResources(topLevel, application_resources, application_resources,
 			      XtNumber(application_resources), NULL, 0 );
 
     form = XtCreateManagedWidget("form", formWidgetClass, topLevel,
--- procps-1.01/xcpustate/Bar.c.orig	Mon Jun 17 11:14:51 1996
+++ procps-1.01/xcpustate/Bar.c	Mon Jun 17 11:45:43 1996
@@ -160,15 +160,15 @@
 	bcp->gray = (Pixmap *) XtMalloc(MAXGRAY * sizeof(Pixmap));
 	for(i = 0; i < MAXGRAY; i++) {
 	    bcp->gray[i] = XCreatePixmapFromBitmapData(XtDisplay(new),
-	     DefaultRootWindow(XtDisplay(new)), gray_bits[i], 3, 3,
-	     WhitePixelOfScreen(XtScreen(new)),
-	     BlackPixelOfScreen(XtScreen(new)), 1);
+	     DefaultRootWindow(XtDisplay(new)), gray_bits[i], 3, 3, 1, 0, 1);
 	}
     }
     gcValues.stipple = bcp->gray[0];
     gcValues.fill_style = FillOpaqueStippled;
+    gcValues.foreground = BlackPixelOfScreen(XtScreen(new));
+    gcValues.background = WhitePixelOfScreen(XtScreen(new));
     w->bar.gc = XCreateGC(XtDisplay(new), DefaultRootWindow(XtDisplay(new)),
-     GCFillStyle | GCStipple, &gcValues);
+     GCFillStyle | GCStipple | GCForeground | GCBackground, &gcValues);
     /* Width and height override length and thickness */
     if (w->bar.length == def_dimension)
 	w->bar.length = DEF_LENGTH;

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

  reply	other threads:[~1996-06-17 10:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-17  3:09 procps-1.01 patches David Mosberger-Tang
1996-06-17 10:01 ` Harald Koenig [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-06-17 17:11 David Mosberger-Tang
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox