Icons ending up under the dock

Cyrus Rahman <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <CAJmxoQO8SeBKNd6r63GJELgfRRdQWm0v9JMzbnJg9fBy9qhwqw@mail.gmail.com>
While I love the new maximizing functions, in the process of
developing them the code to keep icons from under the dock was lost.

I have created a patch to prevent this problem.

I realize it's not in the preferred patch format but I have not yet
had a chance to get this machine fully functional.  I hope an attached
context diff will be satisfactory as the patch is small.  I've also
included it inline for inspection.

Cyrus

--- src/placement.c.orig        2017-02-28 15:11:19.717093000 -0700
+++ src/placement.c     2017-02-28 15:16:39.006177000 -0700
@@ -117,6 +117,16 @@ void PlaceIcon(WScreen *scr, int *x_ret,
        WMBagIterator iter;
        WArea area = wGetUsableAreaForHead(scr, head, NULL, False);

+       /* Do not place icons under the dock. */
+       if (scr->dock) {
+               int offset = wPreferences.icon_size + DOCK_EXTRA_SPACE;
+
+               if (scr->dock->on_right_side)
+                       area.x2 -= offset;
+               else
+                   area.x1 += offset;
+       }
+
        /* Find out screen boundaries. */

        /* Allows each head to have miniwindows */
patch-src__placement.c (text/x-csrc, 567 B)
--- src/placement.c.orig	2017-02-28 15:11:19.717093000 -0700
+++ src/placement.c	2017-02-28 15:16:39.006177000 -0700
@@ -117,6 +117,16 @@ void PlaceIcon(WScreen *scr, int *x_ret,
 	WMBagIterator iter;
 	WArea area = wGetUsableAreaForHead(scr, head, NULL, False);
 
+	/* Do not place icons under the dock. */
+	if (scr->dock) {
+		int offset = wPreferences.icon_size + DOCK_EXTRA_SPACE;
+
+		if (scr->dock->on_right_side)
+			area.x2 -= offset;
+		else
+		    area.x1 += offset;
+	}
+
 	/* Find out screen boundaries. */
 
 	/* Allows each head to have miniwindows */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.