On Feb 8, 17:55, Dominik Vogt wrote:
> Subject: Re: Notification: incoming/853
> On Thu, Feb 07, 2002 at 07:38:36AM -0600, fvwm-bug wrote:
> > FVWM Bug Tracking notification
> > 
> > new message incoming/853
> > 
> > Full_Name: Markus Schwarzenberg
> > Version: 2.4.5.
> > CVS_Date: 
> > OS: sunos 5.7
> > X_Server: 
> > Submission from: (NULL) (153.96.96.2)
> > 
> > 
> > after fvwm2 -restart  the FvwmWindow.flags.is_map_pending  bit
> > sometimes seems not to be set properly. 
> > This causes the function Iconify(in icons.c) to return in: 

[ snip ]

> 
> Can you please make a patch with the 'diff' command?
> 
>   $ diff -u icons.c.orig icons.c
> 

Shure (attached). BTW, in the meantime I added the workaround also to 
the function DeIconify (In very rare circumstances it could
be necessary there too).

Markus Schwarzenberg





--- icons.c.orig        Wed Jan 16 21:39:38 2002
+++ icons.c     Mon Feb 11 09:44:37 2002
@@ -1289,14 +1289,32 @@
   FvwmWindow *t,*tmp;
   FvwmWindow *sf = get_focus_window();
 
-  if (!tmp_win)
+  XWindowAttributes winattrs = {0};
+
+  if(!tmp_win)
+    return;
+  
+  if (!XGetWindowAttributes(dpy, tmp_win->w, &winattrs))
+  {
     return;
+  }
+  
+  /* make shure  tmp_win->flags.is_map_pending  is OK */
+  if((winattrs.map_state == IsViewable) && IS_MAP_PENDING(tmp_win)) {
+    fprintf(stderr,"\
+Window '%s':\nDeIconify: XGetWindowAttributes: IsViewable, \
+but MAP_PENDING set ... resetting it!\n",
+    tmp_win->name ? tmp_win->name : "NULL_name");
+    SET_MAP_PENDING(tmp_win, 0);
+  }
+  
   if (IS_MAP_PENDING(tmp_win))
   {
     /* final state: de-iconified */
     SET_ICONIFY_AFTER_MAP(tmp_win, 0);
     return;
   }
+  
   while (IS_ICONIFIED_BY_PARENT(tmp_win))
   {
     for (t = Scr.FvwmRoot.next; t != NULL; t = t->next)
@@ -1448,17 +1466,28 @@
 
   if(!tmp_win)
     return;
-  if (IS_MAP_PENDING(tmp_win))
+  
+  if (!XGetWindowAttributes(dpy, tmp_win->w, &winattrs))
   {
-    /* final state: iconified */
-    SET_ICONIFY_AFTER_MAP(tmp_win, 1);
     return;
   }
-  if (!XGetWindowAttributes(dpy, tmp_win->w, &winattrs))
+  eventMask = winattrs.your_event_mask;
+  
+  /* make shure  tmp_win->flags.is_map_pending  is OK */
+  if((winattrs.map_state == IsViewable) && IS_MAP_PENDING(tmp_win)) {
+    fprintf(stderr, "\
+Window '%s':\nDeIconify: XGetWindowAttributes: IsViewable, \
+but MAP_PENDING set ... resetting it!\n",
+    tmp_win->name ? tmp_win->name : "NULL_name");
+    SET_MAP_PENDING(tmp_win, 0);
+  }
+  
+  if (IS_MAP_PENDING(tmp_win))
   {
+    /* final state: iconified */
+    SET_ICONIFY_AFTER_MAP(tmp_win, 1);
     return;
   }
-  eventMask = winattrs.your_event_mask;
 #if 0
   if (tmp_win == Scr.Hilite && HAS_CLICK_FOCUS(tmp_win) && tmp_win->next)
   {

Reply via email to