Your message dated Thu, 19 Feb 2026 12:04:29 +0000
with message-id <[email protected]>
and subject line Bug#731216: fixed in xbattbar 1.4.9-5
has caused the Debian Bug report #731216,
regarding xbattbar: reposition the bar on screen resize
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
731216: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=731216
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xbattbar
Version: 1.4.4-1

Hello,

Attached is the patch which enables xbattbar to react to screen size
changes. However, probably, the proper way would be not to place in to
the edge of a root window, but to the edge of primary screen; that
would require to use Xinerama API or XRandR.

-- 
Cheers,
  Andrew
Subject: Resize bar when the root window size changes.
From: Andrew Shadura <[email protected]>

--- a/xbattbar.c
+++ b/xbattbar.c
@@ -92,6 +92,7 @@ int bi_thick = BI_THICKNESS;        /* t
 int bi_interval = PollingInterval;  /* interval of polling APM */
 
 Display *disp;
+Window root;
 Window winbar;                  /* bar indicator window */
 Window winstat = -1;            /* battery status window */
 GC gcbar;
@@ -163,21 +164,10 @@ Status AllocColor(char *name, unsigned l
   return(status);
 }
 
-/*
- * InitDisplay:
- * create small window in top or bottom
- */
-void InitDisplay(void)
+void ReshapeWindow(void)
 {
-  Window root;
   int x,y;
   unsigned int border,depth;
-  XSetWindowAttributes att;
-
-  if((disp = XOpenDisplay(NULL)) == NULL) {
-      fprintf(stderr, "xbattbar: can't open display.\n");
-      _exit(1);
-  }
 
   if(XGetGeometry(disp, DefaultRootWindow(disp), &root, &x, &y,
                  &width, &height, &border, &depth) == 0) {
@@ -185,14 +175,6 @@ void InitDisplay(void)
     _exit(1);
   }
 
-  if (!AllocColor(ONIN_C,&onin) ||
-       !AllocColor(OFFOUT_C,&offout) ||
-       !AllocColor(OFFIN_C,&offin) ||
-       !AllocColor(ONOUT_C,&onout)) {
-    fprintf(stderr, "xbattbar: can't allocate color resources\n");
-    _exit(1);
-  }
-
   switch (bi_direction) {
   case BI_Top: /* (0,0) - (width, bi_thick) */
     bi_width = width;
@@ -218,6 +200,30 @@ void InitDisplay(void)
     bi_x = width - bi_thick;
     bi_y = 0;
   }
+}
+
+/*
+ * InitDisplay:
+ * create small window in top or bottom
+ */
+void InitDisplay(void)
+{
+  XSetWindowAttributes att;
+
+  if((disp = XOpenDisplay(NULL)) == NULL) {
+      fprintf(stderr, "xbattbar: can't open display.\n");
+      _exit(1);
+  }
+
+  if (!AllocColor(ONIN_C,&onin) ||
+       !AllocColor(OFFOUT_C,&offout) ||
+       !AllocColor(OFFIN_C,&offin) ||
+       !AllocColor(ONOUT_C,&onout)) {
+    fprintf(stderr, "xbattbar: can't allocate color resources\n");
+    _exit(1);
+  }
+
+  ReshapeWindow();
 
   winbar = XCreateSimpleWindow(disp, DefaultRootWindow(disp),
                               bi_x, bi_y, bi_width, bi_height,
@@ -314,6 +320,7 @@ main(int argc, char **argv)
   signal(SIGALRM, (void *)(battery_check));
   battery_check();
   XSelectInput(disp, winbar, myEventMask);
+  XSelectInput(disp, root, StructureNotifyMask);
   while (1) {
     XWindowEvent(disp, winbar, myEventMask, &theEvent);
     switch (theEvent.type) {
@@ -342,6 +349,12 @@ main(int argc, char **argv)
 	      "xbattbar: unknown event (%d) captured\n",
 	      theEvent.type);
     }
+    XWindowEvent(disp, root, StructureNotifyMask, &theEvent);
+    switch (theEvent.type) {
+    case ConfigureNotify:
+      ReshapeWindow();
+      XMoveResizeWindow(disp, winbar, bi_x, bi_y, bi_width, bi_height);
+    }
   }
 }
 

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: xbattbar
Source-Version: 1.4.9-5
Done: Dmitry E. Oboukhov <[email protected]>

We believe that the bug you reported is fixed in the latest version of
xbattbar, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dmitry E. Oboukhov <[email protected]> (supplier of updated xbattbar package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 19 Feb 2026 00:56:16 +0300
Source: xbattbar
Architecture: source
Version: 1.4.9-5
Distribution: unstable
Urgency: medium
Maintainer: Dmitry E. Oboukhov <[email protected]>
Changed-By: Dmitry E. Oboukhov <[email protected]>
Closes: 731216
Changes:
 xbattbar (1.4.9-5) unstable; urgency=medium
 .
   * xbattbar now handles monitor plugging, unplugging,
     and geometry changes correctly. Closes: #731216.
Checksums-Sha1:
 0d21f8eac044044f0480653e2f1e1cf4f5793ba0 1818 xbattbar_1.4.9-5.dsc
 61e83fe32d979fcbb8e29ef02a888e010bf418e3 9464 xbattbar_1.4.9-5.debian.tar.xz
 196f2175d62a694386200e1ce0488dd26c70f4e3 6297 xbattbar_1.4.9-5_amd64.buildinfo
Checksums-Sha256:
 09c31a7ebb78942bf96098717aea1607386afd55e96afb45e658c7453e010d51 1818 
xbattbar_1.4.9-5.dsc
 f6614b8af1723e893ddec8ef39bc790395612fd51a433bad41bdc59d34ffce62 9464 
xbattbar_1.4.9-5.debian.tar.xz
 0dff01b5aefbebf1abbffd4994cc1c998e975fce0a7a365af69fb34e436fccb2 6297 
xbattbar_1.4.9-5_amd64.buildinfo
Files:
 2c6d7b281cf889f2ea155513370ac975 1818 x11 optional xbattbar_1.4.9-5.dsc
 4174010a035e21b41efaae2db151efea 9464 x11 optional 
xbattbar_1.4.9-5.debian.tar.xz
 e1722ab210b740b94c5c7738dd223393 6297 x11 optional 
xbattbar_1.4.9-5_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEce2s/GgBDdka0ZuGjR+Wmgjup1YFAmmW9jEACgkQjR+Wmgju
p1bVRRAAtzsHURx5Y6SS8ACjhie8EOIQm/0EWAAL0gm85DHipElgNrkinoE1M4Ia
QRNnDAWRUks3C0xFVXj5kXt+BGyvlO5HpT2WJB8ppAy6TQRfzJKZuIPXscgFvTGD
Un3LTSYsWJyLg7CFqcxV6wiz1C7AyGvvuW1EkZzhxn4bWh773qRbgypz49Xv20JT
EBI7n4WJVFdAyXFoEkSrc9R7qevSKQGgDyhJ5VeLMbFZQiUVVYQhtuafQM3kL9iX
L1GXjn08vcKk2vwHv7Fmp7XWGEuT90MtC2DvPno+N5orEW+5CkdVon/ycZQA/2kc
8HozMORd6BPAw2SU3NaJ5MOkw72k2D0VOLbt/4CRkSYBz9eb61iPxwTvH3ip6CdR
XL+uPvg9ZZsvornsspY0yms7Vbe9L+FoF3E1/JnoL/kZnXQtaubgZ+hsyrWnv0Ew
/ClhozBpcOBVS562Xwy/GeN57qsgFQHp/eq/7ypZd7w/Ve5xjNR4MBbWCKawnGYk
6ayIh67Ror5kCtk6lnbx1j+1QcY6qwAAUf2++RKBJrC6eJrfHNaS4OR2+6j66/cn
JA+04gKuxVRIi5qZ3XXH1ISfV2A28sdJ4Nk1bvgaRJC9XtNtrUVNLHEsZwlNRFXj
za7U0TvqST+aDGmsrtdLK+slFBKmt+NChSOb+0vebgiKLspj7pY=
=HF60
-----END PGP SIGNATURE-----

Attachment: pgpoJ98wCo2Ek.pgp
Description: PGP signature


--- End Message ---

Reply via email to