Explorar el Código

Turn the top-bar power text into status icons

Show the battery percentage only in a hover tooltip below the far-right power icon, and drop the CPU prefix from the temperature.  The icon is a plug while the adapter is online and a level-filled battery on battery.

Draw the tooltip after the windows in every render path, including window moves and drags, so it always stays above them.  Keep the bar hover highlight above the rainbow separator.

Update AGENTS.md and the graphics/drivers/cpu pages.
Johannes Zellner hace 1 semana
padre
commit
63a76a46bc
Se han modificado 5 ficheros con 210 adiciones y 81 borrados
  1. 13 11
      AGENTS.md
  2. 1 1
      docs/cpu.html
  3. 6 3
      docs/drivers.html
  4. 6 3
      docs/graphics.html
  5. 184 63
      ucmd_wm.c

+ 13 - 11
AGENTS.md

@@ -327,13 +327,14 @@ it to `0x7E00`.  The kernel region itself only has one wall (`_end` below
   The right-aligned date/time text is itself a click target: `draw_bar()`
   records its rectangle, the pointer highlights it, and a click spawns
   `/ramfs/bin/settime` (the `Clock` launcher still opens the analog clock).
-  A network status icon is the rightmost bar item (the date/time, temperature
-  and AC/battery cluster sits to its left): a cable for a wired netdev,
-  signal bars for an associated WiFi link, a USB mark for RNDIS tethering,
-  and a red X otherwise.  The WM polls `SYS_NET_INFO` (and
-  `SYS_WIFI_STATUS` only while WiFi is active) at 1 Hz; clicking the icon
-  spawns one `/ramfs/bin/netmenu` window and anchors it under the icon once
-  its window exists (`u_wm_set_geom`).
+  The rightmost bar item is the AC/battery status icon: a plug while the
+  adapter is online and a level-filled battery on battery.  Hovering it paints
+  a percentage tooltip below the bar, above every window.  To its left is the
+  network status icon: a cable for a wired netdev, signal bars for an
+  associated WiFi link, a USB mark for RNDIS tethering, and a red X otherwise.
+  The WM polls `SYS_NET_INFO` (and `SYS_WIFI_STATUS` only while WiFi is active)
+  at 1 Hz; clicking the network icon spawns one `/ramfs/bin/netmenu` window and
+  anchors it under the icon once its window exists (`u_wm_set_geom`).
   The last launcher, `Chat`, spawns `/ramfs/bin/chat`; `WM_BTN_END_X`
   (`wm_abi.h`) is the launchers' right edge, and the bar notice and the
   right-aligned status never draw left of it.
@@ -822,10 +823,11 @@ it to `0x7E00`.  The kernel region itself only has one wall (`_end` below
   125 °C, 230 = 100, other Bonnell = 90, otherwise 100).  The 330's 125 °C
   is Linux coretemp's empirical value; Intel only specifies TJ = 90 °C and
   Tcase-max = 85.2 °C, so `sensors` prints the raw delta and the 90/100/125 °C
-  scales as well as the top bar's `CPU 43C` before the clock (with
-  `AC on`/`AC off` and `BAT 87%` to its left on ThinkPads and the HP
-  Chromebook) and `cpuinfo`'s value plus EIST state.  Platforms without DTS
-  (QEMU, Pentium) hide it.
+  scales as well as the top bar's bare `43C` before the clock and, on
+  ThinkPads and the HP Chromebook, the AC/battery icon at the far right (a
+  plug while on AC, a level-filled battery on battery, with a percentage
+  tooltip below it on hover) and `cpuinfo`'s value plus EIST state.  Platforms
+  without DTS (QEMU, Pentium) hide it.
 - **Board sensors**: `it87.c/h` — read-only probe of the IT87xx Super I/O
   (the AT3IONT-I exposes three temperatures and three fan tachometers), used
   by `SYS_SENSORS` and the ring-3 `sensors` command to cross-check the DTS

+ 1 - 1
docs/cpu.html

@@ -349,7 +349,7 @@
 			<li><strong>Nehalem/Westmere P-states.</strong> <code>power_init</code> enables SpeedStep, raises the package C-state limit to C6 when unlocked, reads min/max ratios from <code>PLATFORM_INFO</code> and starts at the maximum non-turbo ratio. The target ratio goes in bits 15:8 of <code>IA32_PERF_CTL</code> with the low byte zero.</li>
 			<li><strong>Airmont/Braswell P-states.</strong> Family 6 model <code>0x4C</code> reads the Atom ratio/VID MSRs (<code>0x66A..0x66D</code>), <code>MSR_FSB_FREQ</code> and the FSB table. The N3060 reports pstates 6..20, BCLK 80 MHz (1600 MHz nominal), turbo pstate 31 (2480 MHz) and VID 0x2D..0x3C. <code>power_init</code> enters at max non-turbo and the governor drops to pstate 6 (480 MHz); <code>IA32_PERF_CTL</code> carries the pstate in 15:8 and the Linux-interpolated VID in 7:0. Turbo is detected but not requested. The probe deliberately avoids package/power-SKU MSRs; an unsupported <code>rdmsr</code> before the IDT triple-faults.</li>
 			<li><strong>Governor.</strong> A 100 ms window picks min/max/linear target pstates; short busy streaks jump to max immediately. Each CPU writes its own <code>IA32_PERF_CTL</code>; <code>cpufreq [auto|min|max|off|&lt;pstate&gt;]</code> overrides it.</li>
-			<li><strong>Telemetry.</strong> <code>power</code> prints effective MHz from APERF/MPERF, the current/requested pstate and, on Airmont, the FSB, nominal MHz, turbo pstate/VID, VID range and live <code>PERF_CTL</code>; <code>sensors</code> prints DTS, board sensors and both EC types; <code>powerinfo</code> prints the AC adapter and battery state, and the WM top bar shows AC and battery percentage on ThinkPads and Chromebooks.</li>
+			<li><strong>Telemetry.</strong> <code>power</code> prints effective MHz from APERF/MPERF, the current/requested pstate and, on Airmont, the FSB, nominal MHz, turbo pstate/VID, VID range and live <code>PERF_CTL</code>; <code>sensors</code> prints DTS, board sensors and both EC types; <code>powerinfo</code> prints the AC adapter and battery state, and the WM top bar shows the temperature plus a far-right AC plug or level-filled battery icon (percentage tooltip below it on hover) on ThinkPads and Chromebooks.</li>
 			<li><strong>Thermal.</strong> Each CPU samples its DTS once a second from its scheduler tick; the hottest core is exposed to ring 3. TjMax comes from <code>IA32_TEMPERATURE_TARGET</code> on Nehalem/Westmere, the coretemp 90 °C table on Airmont, and the Bonnell table on older Atoms.</li>
 			<li><strong>Limits.</strong> Package C-states/S0ix remain firmware-managed; Airmont reports no C3/C6 residency and does not request the turbo pstate. The explicit <code>idle c6</code> override is the Nehalem <code>0x20</code> hint; use <code>idle auto</code> for the Airmont C6N (<code>0x58</code>) path.</li>
 		</ul>

+ 6 - 3
docs/drivers.html

@@ -509,9 +509,12 @@
 			adapter, battery model/manufacturer/serial, capacities, voltage,
 			rate and cycle count through <code>SYS_POWER_INFO</code>;
 			<code>power</code> prints ratios, effective MHz and C-state hints.
-			The WM top bar shows the AC adapter state and the first present
-			battery with a valid percentage next to the CPU temperature on
-			both ThinkPads and Chromebooks; machines without an EC show neither.
+			The WM top bar shows the CPU temperature and, on both ThinkPads
+			and Chromebooks, a status icon at the far right for the first
+			present battery: a plug while the AC adapter is online, a
+			level-filled battery on battery, with a percentage tooltip below
+			the icon on hover.  The tooltip is painted after the windows, so
+			it always stays on top.  Machines without an EC show neither.
 		</p>
 	</section>
 

+ 6 - 3
docs/graphics.html

@@ -139,11 +139,14 @@
 		<p>
 			The WM is a process that owns the desktop and a fixed array of eight
 			windows. It draws a system bar with the banner, launcher buttons,
-			clock, the CPU temperature and, on ThinkPads, the AC adapter state
-			and battery percentage, plus draggable
+			clock, the temperature, and, on ThinkPads and Chromebooks, an
+			AC/battery status icon at the far right (a plug on AC, a
+			level-filled battery on battery, with a percentage tooltip below
+			the bar on hover, painted above the windows), plus draggable
 			terminal and canvas windows with a title bar and close button.
 			Click-to-focus, drag-by-title-bar and close are routed through the
-			same pointer path. At the far right, a network status icon shows a
+			same pointer path. To the left of the rightmost AC/battery status
+			icon, a network status icon shows a
 			cable for wired Ethernet, signal bars for a connected WiFi link, a
 			USB mark for RNDIS tethering, or a red X when no link is up;
 			clicking it opens the anchored <code>bin/netmenu</code> window.

+ 184 - 63
ucmd_wm.c

@@ -51,6 +51,20 @@ static int bar_temp_c = -1;
 static int bar_batt_pct = -1;
 static int bar_batt_charging;
 static int bar_ac_online = -1;
+/* Battery/AC status icon: a plug on AC, a level-filled battery otherwise.
+ * The rightmost bar item; hovering it shows a percentage tooltip below it. */
+#define BAR_PWR_W 24
+#define BAR_PWR_Y 6
+#define BAR_TIP_H 20
+static int bar_pwr_x = -1;
+static int bar_pwr_hot;
+static int bar_pwr_tip_x = -1;
+static int bar_pwr_tip_y;
+static unsigned int bar_pwr_tip_w, bar_pwr_tip_h;
+static int bar_pwr_tip_want;       /* tooltip computed for this frame */
+static int bar_pwr_tip_on;         /* tooltip pixels currently on screen */
+static int bar_pwr_tip_on_x, bar_pwr_tip_on_y;
+static unsigned int bar_pwr_tip_on_w, bar_pwr_tip_on_h;
 static char bar_msg[24];
 static unsigned int bar_msg_until;
 static int bar_msg_dirty;
@@ -277,15 +291,11 @@ static unsigned int temp_color(int c)
 	return 0x55FF55u;
 }
 
-/* "CPU 43C" (no libc printf here). */
+/* "43C" (no libc printf here). */
 static unsigned int temp_text(char *b, int c)
 {
 	unsigned int n = 0, v = (unsigned int)c;
 
-	b[n++] = 'C';
-	b[n++] = 'P';
-	b[n++] = 'U';
-	b[n++] = ' ';
 	if (v >= 100)
 		b[n++] = (char)('0' + (v / 100) % 10);
 	if (v >= 10)
@@ -296,15 +306,11 @@ static unsigned int temp_text(char *b, int c)
 	return n;
 }
 
-/* "BAT 87%" (no libc printf here). */
-static unsigned int batt_text(char *b, int pct)
+/* "87%" (no libc printf here). */
+static unsigned int pct_text(char *b, int pct)
 {
 	unsigned int n = 0, v = (unsigned int)pct;
 
-	b[n++] = 'B';
-	b[n++] = 'A';
-	b[n++] = 'T';
-	b[n++] = ' ';
 	if (v >= 100)
 		b[n++] = (char)('0' + (v / 100) % 10);
 	if (v >= 10)
@@ -326,29 +332,75 @@ static unsigned int batt_color(int pct, int charging, int ac)
 	return 0x55D2FFu;
 }
 
-/* "AC on" / "AC off" (no libc printf here).  Only drawn on machines whose
- * ThinkPad EC reported the adapter state. */
-static unsigned int ac_text(char *b, int online)
+/* Battery pictogram: outline, terminal and a fill proportional to the
+ * percentage.  A critical charge turns the outline red as well. */
+static void bar_icon_battery(int x, int y, int pct, unsigned int c)
 {
-	unsigned int n = 0;
+	unsigned int frame = pct <= 10 ? c : 0xD2D2D2u;
+	unsigned int fill = (unsigned int)((14 * pct + 99) / 100);
+
+	usurf_fill(&screen, x + 1, y + 2, 18, 2, frame);
+	usurf_fill(&screen, x + 1, y + 14, 18, 2, frame);
+	usurf_fill(&screen, x + 1, y + 2, 2, 14, frame);
+	usurf_fill(&screen, x + 17, y + 2, 2, 14, frame);
+	usurf_fill(&screen, x + 19, y + 6, 3, 6, frame);
+	if (fill > 14)
+		fill = 14;
+	if (fill)
+		usurf_fill(&screen, x + 3, y + 4, fill, 8, c);
+}
 
-	b[n++] = 'A';
-	b[n++] = 'C';
-	b[n++] = ' ';
-	b[n++] = 'o';
-	if (online) {
-		b[n++] = 'n';
-	} else {
-		b[n++] = 'f';
-		b[n++] = 'f';
-	}
-	b[n] = '\0';
-	return n;
+/* AC plug pictogram: two prongs and the body, kept compact in height. */
+static void bar_icon_plug(int x, int y, unsigned int c)
+{
+	usurf_fill(&screen, x + 7, y + 2, 3, 5, c);
+	usurf_fill(&screen, x + 14, y + 2, 3, 5, c);
+	usurf_fill(&screen, x + 5, y + 7, 14, 7, c);
+	usurf_fill(&screen, x + 7, y + 9, 10, 3, COL_BG);
+}
+
+/* Percentage tooltip: a small box below the status icon.  It is drawn after
+ * the windows (see bar_tooltip_overlay), so it always sits on top. */
+static void bar_draw_tooltip(void)
+{
+	char lb[8];
+	unsigned int lw;
+	int tx;
+
+	if (!bar_pwr_tip_want || bar_pwr_tip_x < 0)
+		return;
+	usurf_fill(&screen, bar_pwr_tip_x, bar_pwr_tip_y,
+		   bar_pwr_tip_w, bar_pwr_tip_h, 0x161622u);
+	usurf_fill(&screen, bar_pwr_tip_x, bar_pwr_tip_y,
+		   bar_pwr_tip_w, 1, 0x646464u);
+	usurf_fill(&screen, bar_pwr_tip_x,
+		   bar_pwr_tip_y + (int)bar_pwr_tip_h - 1,
+		   bar_pwr_tip_w, 1, 0x646464u);
+	usurf_fill(&screen, bar_pwr_tip_x, bar_pwr_tip_y,
+		   1, bar_pwr_tip_h, 0x646464u);
+	usurf_fill(&screen, bar_pwr_tip_x + (int)bar_pwr_tip_w - 1,
+		   bar_pwr_tip_y, 1, bar_pwr_tip_h, 0x646464u);
+	(void)pct_text(lb, bar_batt_pct);
+	lw = usurf_text_width(&screen, lb);
+	tx = bar_pwr_tip_x + ((int)bar_pwr_tip_w - (int)lw) / 2;
+	usurf_text(&screen, tx, bar_pwr_tip_y + 3, lb,
+		   batt_color(bar_batt_pct, bar_batt_charging, bar_ac_online),
+		   0, 0, fbw, fbh);
 }
 
-static unsigned int ac_color(int online)
+/* Publish the geometry computed by draw_bar() and redraw the tooltip. */
+static void bar_tooltip_commit(void)
 {
-	return online ? 0x55FF55u : 0xFFD250u;
+	if (bar_pwr_tip_want) {
+		bar_draw_tooltip();
+		bar_pwr_tip_on = 1;
+		bar_pwr_tip_on_x = bar_pwr_tip_x;
+		bar_pwr_tip_on_y = bar_pwr_tip_y;
+		bar_pwr_tip_on_w = bar_pwr_tip_w;
+		bar_pwr_tip_on_h = bar_pwr_tip_h;
+	} else {
+		bar_pwr_tip_on = 0;
+	}
 }
 
 static void draw_bar(void)
@@ -399,6 +451,9 @@ static void draw_bar(void)
 		bar_clock_hot = 0;
 		bar_net_x = -1;
 		bar_net_w = 0;
+		bar_pwr_x = -1;
+		bar_pwr_tip_x = -1;
+		bar_pwr_tip_want = 0;
 		n = 0;
 		while (msg[n])
 			dt[n] = msg[n], n++;
@@ -418,8 +473,51 @@ static void draw_bar(void)
 		bar_clock_w = 0;
 		bar_net_x = -1;
 		bar_net_w = 0;
-		/* The network status is the rightmost item, so it survives
-		 * narrow screens and a full temperature/battery cluster. */
+		bar_pwr_x = -1;
+		bar_pwr_tip_x = -1;
+		bar_pwr_tip_want = 0;
+		/* The AC/battery status icon is the rightmost item. */
+		if (bar_batt_pct >= 0 || bar_ac_online > 0) {
+			int px = right - BAR_PWR_W;
+
+			if (px >= min_x) {
+				if (bar_pwr_hot)
+					usurf_fill(&screen, px - 3, 2,
+						   BAR_PWR_W + 6,
+						   WM_BAR_H - 7, 0x3A3A55u);
+				if (bar_ac_online > 0)
+					bar_icon_plug(px, BAR_PWR_Y, 0x55FF55u);
+				else
+					bar_icon_battery(px, BAR_PWR_Y,
+							 bar_batt_pct,
+							 batt_color(bar_batt_pct,
+								    bar_batt_charging,
+								    bar_ac_online));
+				bar_pwr_x = px;
+				right = px - 8;
+				if (bar_pwr_hot && bar_batt_pct >= 0) {
+					char lb[8];
+					unsigned int lw, bw;
+					int bx;
+
+					(void)pct_text(lb, bar_batt_pct);
+					lw = usurf_text_width(&screen, lb);
+					bw = lw + 10;
+					bx = px + BAR_PWR_W - (int)bw;
+					if (bx < 4)
+						bx = 4;
+					if (bx + (int)bw > (int)fbw - 4)
+						bx = (int)fbw - 4 - (int)bw;
+					bar_pwr_tip_x = bx;
+					bar_pwr_tip_y = WM_BAR_H + 2;
+					bar_pwr_tip_w = bw;
+					bar_pwr_tip_h = BAR_TIP_H;
+					bar_pwr_tip_want = 1;
+				}
+			}
+		}
+		/* The network status sits to the left of the power icon, so it
+		 * survives narrow screens and a full temperature cluster. */
 		{
 			int nx = right - BAR_NET_W;
 
@@ -427,7 +525,7 @@ static void draw_bar(void)
 				if (bar_net_hot)
 					usurf_fill(&screen, nx - 3, 2,
 						   BAR_NET_W + 6,
-						   WM_BAR_H - 4, 0x3A3A55u);
+						   WM_BAR_H - 7, 0x3A3A55u);
 				bar_draw_net_icon(nx, BAR_NET_Y);
 				bar_net_x = nx;
 				bar_net_w = BAR_NET_W;
@@ -446,7 +544,7 @@ static void draw_bar(void)
 			if (bar_clock_hot)
 				usurf_fill(&screen, tx - 5, 2,
 					   (unsigned int)tw + 10,
-					   WM_BAR_H - 4, 0x3A3A55u);
+					   WM_BAR_H - 7, 0x3A3A55u);
 			usurf_text(&screen, tx, 5, dt, COL_BANNER, 0, 0,
 				   fbw, WM_BAR_H);
 			clock_chars = (unsigned int)tw;
@@ -467,36 +565,6 @@ static void draw_bar(void)
 				right = tx - 8;
 			}
 		}
-		if (bar_batt_pct >= 0) {
-			char bb[10];
-			int bx;
-
-			(void)batt_text(bb, bar_batt_pct);
-			bx = right - (int)usurf_text_width(&screen, bb);
-
-			if (bx >= min_x) {
-				usurf_text(&screen, bx, 5, bb,
-					   batt_color(bar_batt_pct,
-						      bar_batt_charging,
-						      bar_ac_online),
-					   0, 0, fbw, WM_BAR_H);
-				right = bx - 8;
-			}
-		}
-		if (bar_ac_online >= 0) {
-			char ab[8];
-			int ax;
-
-			(void)ac_text(ab, bar_ac_online);
-			ax = right - (int)usurf_text_width(&screen, ab);
-
-			if (ax >= min_x) {
-				usurf_text(&screen, ax, 5, ab,
-					   ac_color(bar_ac_online), 0, 0,
-					   fbw, WM_BAR_H);
-				right = ax - 8;
-			}
-		}
 	}
 }
 
@@ -794,6 +862,16 @@ static void add_rect(struct wm_present_info *p, int x, int y,
 	}
 }
 
+/* Redraw the power tooltip above whatever a render pass just painted. */
+static void bar_tooltip_overlay(struct wm_present_info *p)
+{
+	if (!bar_pwr_tip_on || !bar_pwr_tip_want)
+		return;
+	bar_draw_tooltip();
+	add_rect(p, bar_pwr_tip_on_x, bar_pwr_tip_on_y,
+		 bar_pwr_tip_on_w, bar_pwr_tip_on_h);
+}
+
 /* A focused window is topmost, so the shadow contains exactly its pixels in
  * the old rectangle.  Move that block and repaint only the old part the new
  * rectangle does not cover.  When either rectangle is partly off-screen the
@@ -833,6 +911,7 @@ static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
 	for (k = 0; k < np; k++)
 		add_rect(&present, pieces[k].x, pieces[k].y,
 			 pieces[k].w, pieces[k].h);
+	bar_tooltip_overlay(&present);
 	u_wm_present(&present);
 }
 
@@ -856,6 +935,7 @@ static void redraw_geom(struct uwin *u, int ox, int oy,
 		for (i = 0; i < present.count; i++)
 			draw_rect(present.rect[i].x, present.rect[i].y,
 				  present.rect[i].w, present.rect[i].h);
+		bar_tooltip_overlay(&present);
 		u_wm_present(&present);
 	}
 }
@@ -927,6 +1007,21 @@ static int bar_net_hit(unsigned int mx, unsigned int my)
 	       (int)mx < bar_net_x + (int)bar_net_w + 3;
 }
 
+/* The AC/battery icon has no click action, but hovering it reveals the
+ * percentage tooltip below it; the tooltip area keeps the hover alive. */
+static int bar_pwr_hit(unsigned int mx, unsigned int my)
+{
+	if (my >= WM_BAR_H)
+		return bar_pwr_tip_on &&
+		       (int)mx >= bar_pwr_tip_on_x &&
+		       (int)mx < bar_pwr_tip_on_x + (int)bar_pwr_tip_on_w &&
+		       (int)my >= bar_pwr_tip_on_y &&
+		       (int)my < bar_pwr_tip_on_y + (int)bar_pwr_tip_on_h;
+	return bar_pwr_x >= 0 &&
+	       (int)mx >= bar_pwr_x - 3 &&
+	       (int)mx < bar_pwr_x + BAR_PWR_W + 3;
+}
+
 static void do_update(struct wm_status *st)
 {
 	struct wm_present_info present;
@@ -984,6 +1079,14 @@ static void do_update(struct wm_status *st)
 			bar_dirty = 1;
 		}
 	}
+	{
+		int hot = bar_pwr_hit(st->mouse.x, st->mouse.y);
+
+		if (hot != bar_pwr_hot) {
+			bar_pwr_hot = hot;
+			bar_dirty = 1;
+		}
+	}
 
 	/* Refresh cached window state and mappings before opening a frame:
 	 * MAP may unmap/remap content. */
@@ -1129,6 +1232,7 @@ static void do_update(struct wm_status *st)
 		{
 			draw_rect(0, 0, fbw, fbh);
 			draw_bar();
+			bar_tooltip_commit();
 			present.count = 0;
 			add_rect(&present, 0, 0, fbw, fbh);
 			present.immediate = 0;
@@ -1169,6 +1273,15 @@ static void do_update(struct wm_status *st)
 		need = 1;
 	}
 
+	/* Repaint the previous tooltip area so hiding or moving it restores
+	 * the window/desktop underneath; the new one is drawn after the
+	 * windows below. */
+	if (bar_pwr_tip_on) {
+		need = 1;
+		add_rect(&present, bar_pwr_tip_on_x, bar_pwr_tip_on_y,
+			 bar_pwr_tip_on_w, bar_pwr_tip_on_h);
+	}
+
 	if (!need) {
 		/* Drag movement is handled below; a stationary mouse can be
 		 * left to the kernel's cursor overlay. */
@@ -1182,6 +1295,13 @@ static void do_update(struct wm_status *st)
 			  present.rect[i].w, present.rect[i].h);
 	if (bar_dirty)
 		draw_bar();
+	if (bar_pwr_tip_want) {
+		bar_tooltip_commit();
+		add_rect(&present, bar_pwr_tip_on_x, bar_pwr_tip_on_y,
+			 bar_pwr_tip_on_w, bar_pwr_tip_on_h);
+	} else {
+		bar_pwr_tip_on = 0;
+	}
 
 	for (i = 0; i < WM_MAX_WINDOWS; i++) {
 		struct uwin *u = &wins[i];
@@ -1433,6 +1553,7 @@ static void handle_mouse(struct wm_status *st)
 								  present.rect[i].y,
 								  present.rect[i].w,
 								  present.rect[i].h);
+							bar_tooltip_overlay(&present);
 							u_wm_present(&present);
 						}
 					}