Subject: StickyIconsAreReallySticky (was Re: FVWM: non-auto-compacted icons?)

From: Benjamin Low <[email-masked]>
Date: Thu, 09 Sep 1999 00:32:15 +1000

Dan Espen wrote:
... 
> In my opinion, the functionality requested is reasonable.  I might
> apply a patch if it was submitted.  (Hacks won't do.)
> 
> I think this is better described as "icons automatically remember 
> their place".

Attached is a unified diff against fvwm-2.2.2. Basically, it enhances
the symantics of StickIcons to also mean "FixedIcons" (or
"IconsThatRememberTheirPlace" or whatever is deemed the best way to
describe this :-) (StickyIconsAreReallySticky??)

With this patch, StickyIcons are AutoPlaced when first iconised, from
then on stay where they were placed, exactly as if they were manually
placed. Non-StickyIcons will shuffle aside when changing pages to avoid
landing on top of a StickyIcon.

Works a treat :-)

Regards,

Ben

--- fvwm-2.2.2.orig/fvwm/icons.c	Thu Jan 14 12:42:52 1999
+++ fvwm-2.2.2/fvwm/icons.c	Thu Sep  9 00:00:52 1999
@@ -418,7 +418,7 @@
       int end_at;                       /* ending edge */
       int base;                         /* base for screen */
       int icon_dimension;               /* height or width */
-      int nom_dimension;                /* nonminal height or width */
+      int nom_dimension;                /* nominal height or width */
       int screen_dimension;             /* screen height or width */
     } dimension;
     dimension dim[3];                   /* space for work, 1st, 2nd dimen */
@@ -532,7 +532,9 @@
           while((test_window != (FvwmWindow *)0)
                 &&(loc_ok == True)) { /* test overlap */
             if(test_window->Desk == t->Desk) {
-              if((test_window->flags&ICONIFIED) &&
+            if((test_window->flags&ICONIFIED || 
+                 /* include non-iconised StickyIcon windows in decision BDL */
+ 			     test_window->flags&StickyIcon) && 
                  (!(test_window->flags&TRANSIENT) ||
 		  !test_window->tmpflags.IconifiedByParent) &&
                  (test_window->icon_w||test_window->icon_pixmap_w) &&
@@ -560,6 +562,12 @@
       return;                         /* just leave it */
     t->icon_x_loc = real_x;
     t->icon_y_loc = real_y;
+
+	if (t->flags&StickyIcon)
+	{
+		/* make StickyIcons icons stay where they've been placed BDL */
+		t->flags |= ICON_MOVED;
+	}
 
     if(t->icon_pixmap_w)
       XMoveWindow(dpy,t->icon_pixmap_w,t->icon_x_loc, t->icon_y_loc);
--- fvwm-2.2.2.orig/fvwm/virtual.c	Sat Feb 27 01:47:14 1999
+++ fvwm-2.2.2/fvwm/virtual.c	Wed Sep  8 23:30:28 1999
@@ -589,10 +589,10 @@
       for (t = Scr.FvwmRoot.next; t != NULL; t = t->next)
 	{
           t->tmpflags.ViewportMoved = False; /* Clear double move blocker. */
-	  /* If its an icon, and its sticking, autoplace it so
+	  /* If its an icon, and is *not* sticking (BDL), autoplace it so
 	   * that it doesn't wind up on top a a stationary
 	   * icon */
-	  if(((t->flags & STICKY)||(t->flags & StickyIcon))&&
+	  if(((!(t->flags & STICKY)||(t->flags & StickyIcon)))&&
 	     (t->flags & ICONIFIED)&&(!(t->flags & ICON_MOVED))&&
 	     (!(t->flags & ICON_UNMAPPED)))
 	    AutoPlace(t);

---

From: Dan Espen <[email-masked]>
Date: Wed, 08 Sep 1999 11:38:35 -0400

> landing on top of a StickyIcon.

It may work, but...

The patch should be against the current CVS sources (2.3.8).

The patch should preserve existing functionality.  (I think existing
users of sticky icons, would still want them to autoarrange.)

The patch must include a man page update.

There should be a ChangeLog entry.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Benjamin Low <[email-masked]>
Date: Thu, 09 Sep 1999 11:40:28 +1000

Dan Espen wrote:
...
> There should be a ChangeLog entry.

Ok, I'll go via the CVS tree, and add appropriate documentation.

I wanted to add a separate Style label for this 'FixedIcons', but the
Style flags bitmask is full. I see others have come across the same
problem (i.e. tmpflags, new_flags), but really can't see how I can add a
new flag without major changes to the whole shebang.

As I also think that, symantically, having 'fixed' StickyIcons makes
sense, I chose to add use that flag.

Suggestions as to how to incorporate this new/modifed style are
welcome...

Regards,

-- 
 Benjamin Low, BEng (Comp) Hons I
 Telecommunications and Information Technology Research Institute
 University of Wollongong, Wollongong, NSW Australia
 02 4221 4398  04 1365 6010  [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Thu, 09 Sep 1999 07:56:52 -0400

> new flag without major changes to the whole shebang.

Check out the latest CVS sources, we are no longer out of style flags.

> sense, I chose to add use that flag.

I think icons  that follow  you desk  to  desk and  page  to page  are
different than icons that hold their initial position.  (StayInPlace).

Well, there  is  a  relationship,  if  an   icon is both    sticky and
stayinplace, and you change desks, your going to have  icons end up on
top of each other.