[EMAIL PROTECTED] wrote:

[FVWM][FvwmErrorHandler]: <<ERROR>> *** internal error ***
[FVWM][FvwmErrorHandler]: <<ERROR>> Request 56, Error 13, EventType: 0
[FVWM][FvwmErrorHandler]: <<ERROR>> *** internal error ***
[FVWM][FvwmErrorHandler]: <<ERROR>> Request 72, Error 13, EventType: 0

(EventType may be 19.)

Tim, can you please take a look at this?

There is a problem with ReadWriteColors on a PseudoColor display, attached is a patch. I could not get the above errors to appear and I get no errors unless I run out of colors. Even then things work OK.

I'll try to get mono to have a pixmap tomorrow.

Cheers,
Tim.

Index: configure.in
===================================================================
RCS file: /u/phippst/share/cvsroot/fvwm/configure.in,v
retrieving revision 1.2
diff -u -r1.2 configure.in
--- configure.in        2002/04/18 12:18:57     1.2
+++ configure.in        2002/04/18 12:20:03
@@ -73,7 +73,7 @@
 
 dnl added -Wall for gcc, what about for others?
 if test "x$GCC" = "xyes"; then
-  CFLAGS="$CFLAGS -Wall"
+  CFLAGS="$CFLAGS -Wall -Wno-implicit-int"
 fi
 
 dnl Help finding POSIX functions on some systems
Index: fvwm/colorset.c
===================================================================
RCS file: /u/phippst/share/cvsroot/fvwm/fvwm/colorset.c,v
retrieving revision 1.2
diff -u -r1.2 colorset.c
--- fvwm/colorset.c     2002/04/18 14:37:56     1.2
+++ fvwm/colorset.c     2002/04/18 17:15:08
@@ -275,6 +275,13 @@
        Window win = Scr.SizeWindow;
        static GC gc = None, monoGC = None;
 
+       /* initialize statucs */
+       if (gc == None)
+       {
+               gc = fvwmlib_XCreateGC(dpy, win, 0, &xgcv);
+               monoGC = fvwmlib_XCreateGC(dpy, Scr.ScratchMonoPixmap,0, &xgcv);
+       }
+
        /* make sure it exists and has sensible contents */
        if (nColorsets <= n) {
                Colorset = (colorset_struct *)saferealloc(
@@ -288,6 +295,7 @@
        while (nColorsets <= n)
        {
                colorset_struct *ncs = &Colorset[nColorsets];
+
                have_pixels_changed = True;
                if (privateCells && XAllocColorCells(
                        /* grab four writeable cells */
@@ -317,36 +325,27 @@
                        /* grab four shareable colors */
                        if (Pdepth < 2) {
                                /* monochrome monitors get black on white */
-                               /* FIXME: add a gray pixmap background */
-                               Colorset[nColorsets].fg = GetColor(black);
-                               Colorset[nColorsets].bg = GetColor(white);
-                               Colorset[nColorsets].hilite = GetColor(white);
-                               Colorset[nColorsets].shadow = GetColor(black);
+                               /* FIXME: with a gray pixmap background */
+                               ncs->fg = GetColor(black);
+                               ncs->bg = GetColor(white);
+                               ncs->hilite = GetColor(white);
+                               ncs->shadow = GetColor(black);
                        }
                        else
                        {
-                               Colorset[nColorsets].fg = GetColor(black);
-                               Colorset[nColorsets].bg = GetColor(gray);
-                               Colorset[nColorsets].hilite =
-                                       GetHilite(Colorset[nColorsets].bg);
-                               Colorset[nColorsets].shadow =
-                                       GetShadow(Colorset[nColorsets].bg);
+                               ncs->fg = GetColor(black);
+                               ncs->bg = GetColor(gray);
+                               ncs->hilite = GetHilite(ncs->bg);
+                               ncs->shadow = GetShadow(ncs->bg);
                        }
                        /* set flags for fg contrast, bg average */
                        /* in case just a pixmap is given */
-                       Colorset[nColorsets].color_flags =
-                               FG_CONTRAST | BG_AVERAGE;
+                       ncs->color_flags = FG_CONTRAST | BG_AVERAGE;
                }
                nColorsets++;
        }
 
        cs = &Colorset[n];
-       if (gc == None)
-       {
-               fvwm_msg(DBG, name, "Creating GCs");
-               gc = fvwmlib_XCreateGC(dpy, win, 0, &xgcv);
-               monoGC = fvwmlib_XCreateGC(dpy, Scr.ScratchMonoPixmap,0, &xgcv);
-       }
 
        /* ---------- Parse the options ---------- */
        while (line && *line)
@@ -951,30 +950,10 @@
        /* do nothing if it already exists */
        if (n < nColorsets)
                return;
-
-       /* increment n to get the required array size, get a new array */
-       Colorset = (colorset_struct *)saferealloc(
-               (char *)Colorset, ++n * sizeof(colorset_struct));
-
-       /* zero out the new members */
-       memset(
-               &Colorset[nColorsets], 0,
-               (n - nColorsets) * sizeof(colorset_struct));
-
-       /* copy colorset 0 pixels into new members so that if undefined ones are
-        * referenced at least they don't give black on black */
-       if (n > 1)
-       {
-               for ( ; nColorsets < n; nColorsets++)
-               {
-                       Colorset[nColorsets].fg = Colorset[0].fg;
-                       Colorset[nColorsets].bg = Colorset[0].bg;
-                       Colorset[nColorsets].hilite = Colorset[0].hilite;
-                       Colorset[nColorsets].shadow = Colorset[0].shadow;
-               }
-       }
 
-       nColorsets = n;
+       /* parse_colorset resizes the array if necessary
+          so just use it to get a sensible default */
+       parse_colorset(n, "");
 }
 
 /* ---------------------------- builtin commands ---------------------------- 
*/
Index: fvwm/fvwm.c
===================================================================
RCS file: /u/phippst/share/cvsroot/fvwm/fvwm/fvwm.c,v
retrieving revision 1.2
diff -u -r1.2 fvwm.c
--- fvwm/fvwm.c 2002/04/18 12:18:58     1.2
+++ fvwm/fvwm.c 2002/04/18 16:50:57
@@ -758,6 +758,10 @@
 #define startFuncName "StartFunction"
   const char *initFuncName;
 
+  /* make sure colorset 0 exists in case modules get started that use colorsets
+     and the startup files/commands have not created any */
+  alloc_colorset(0);
+
   CaptureAllWindows(False);
   /* Turn off the SM stuff after the initial capture so that new windows will
    * not be matched by accident. */
@@ -1390,13 +1394,7 @@
   Scr.DefaultIcon = NULL;
 
   Scr.DefaultColorset = -1;
-  alloc_colorset(0);
-  /* set up colorset 0 so that if FvwmTheme fails to start any modules
-   * using colorsets don't appear black on black */
-  Colorset[0].fg = Scr.StdFore = GetColor(DEFAULT_FORE_COLOR);
-  Colorset[0].bg = Scr.StdBack = GetColor(DEFAULT_BACK_COLOR);
-  Colorset[0].hilite = Scr.StdHilite = GetHilite(Scr.StdBack);
-  Colorset[0].shadow = Scr.StdShadow = GetShadow(Scr.StdBack);
+
   Scr.StdGC = 0;
   Scr.StdReliefGC = 0;
   Scr.StdShadowGC = 0;
Index: modules/FvwmScript/Scripts/FvwmScript-Colorset
===================================================================
RCS file: 
/u/phippst/share/cvsroot/fvwm/modules/FvwmScript/Scripts/FvwmScript-Colorset,v
retrieving revision 1.1
diff -u -r1.1 FvwmScript-Colorset
--- modules/FvwmScript/Scripts/FvwmScript-Colorset      2002/04/18 10:47:52     
1.1
+++ modules/FvwmScript/Scripts/FvwmScript-Colorset      2002/04/18 11:09:02
@@ -2,7 +2,7 @@
 # I can't believe how big this is
 # I haven't got the energy to implement a Save button
 # Just goes to show that command lines are better
-# Don't switch on Dynamic update unless using *FvwmThemeReadWriteColors
+# Don't switch on Dynamic update unless using ReadWriteColors
 WindowTitle    {Colorset Editor}
 WindowSize     380 290
 Colorset 0
@@ -13,7 +13,7 @@
   Set $Cset = 0
   Set $OldCset = 0
   Set $Color = (GetBack 1)
-  Do {SendToModule FvwmTheme Colorset } $Cset { Pixmap, Background #} $Color 
{, Foreground Contrast}
+  Do {Colorset } $Cset { Pixmap, Background #} $Color {, Foreground Contrast}
   # Sliders are initially hidden
   HideWidget 1
   HideWidget 2
@@ -183,10 +183,10 @@
    End
   Else
    Begin
-    # I think ther might be a bug in FvwmTheme that resets a colrset to a copy 
of 0
+    # I think there might be a bug in Colorset that resets a colorset to a 
copy of 0
     # if {pixmap} is used to select a plain background
     Set $Color = (GetBack 1)
-    Do {SendToModule FvwmTheme Colorset } $Cset { Pixmap, Background #} $Color 
{, Foreground Contrast}
+    Do {Colorset } $Cset { Pixmap, Background #} $Color {, Foreground Contrast}
     Set $OldCset = $Cset
    End
  End
@@ -239,7 +239,7 @@
   Set $Color = $Color {/} (NumToHex (GetValue 2) 2)
   Set $Color = $Color {/} (NumToHex (GetValue 3) 2)
   # pick the current colorset
-  Set $Command = {SendToModule FvwmTheme Colorset } $Cset
+  Set $Command = {Colorset } $Cset
   # pick the type to set
   If (GetValue 10) == 1 Then
    Set $Command = $Command { Foreground } $Color

Reply via email to