changeset 3267:2c796174231a

Fixed #291: Updated calculation of tray window width and height
author unexist
date Tue, 26 Dec 2017 14:17:39 +0100
parents a1c16aa2c952
children 63b83837ae1b
files src/subtle/screen.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/screen.c	Tue Dec 26 14:17:13 2017 +0100
+++ b/src/subtle/screen.c	Tue Dec 26 14:17:39 2017 +0100
@@ -513,7 +513,18 @@
 
           /* Set panel position */
           if(p->flags & SUB_PANEL_TRAY)
-            XMoveWindow(subtle->dpy, subtle->windows.tray, x[offset], 0);
+            {
+              if(0 < subtle->trays->ndata)
+                {
+                  XMapRaised(subtle->dpy, subtle->windows.tray);
+                  XMoveResizeWindow(subtle->dpy, subtle->windows.tray, 
+                    x[offset] + STYLE_LEFT(subtle->styles.tray),
+                    STYLE_TOP(subtle->styles.tray),
+                    p->width - STYLE_WIDTH(subtle->styles.tray),
+                    subtle->ph - STYLE_HEIGHT(subtle->styles.tray));
+                }
+            }
+
           p->x = x[offset];
 
           /* Add separator after panel item */