diff --git a/overlay/rootfs/usr/bin/snake b/overlay/rootfs/usr/bin/snake index 0ad1537..6b11ff9 100755 Binary files a/overlay/rootfs/usr/bin/snake and b/overlay/rootfs/usr/bin/snake differ diff --git a/overlay/rootfs/usr/bin/tetris b/overlay/rootfs/usr/bin/tetris index 77556a8..10d3044 100755 Binary files a/overlay/rootfs/usr/bin/tetris and b/overlay/rootfs/usr/bin/tetris differ diff --git a/prebuilt/games/usr/bin/snake b/prebuilt/games/usr/bin/snake index 0ad1537..6b11ff9 100755 Binary files a/prebuilt/games/usr/bin/snake and b/prebuilt/games/usr/bin/snake differ diff --git a/prebuilt/games/usr/bin/tetris b/prebuilt/games/usr/bin/tetris index 77556a8..10d3044 100755 Binary files a/prebuilt/games/usr/bin/tetris and b/prebuilt/games/usr/bin/tetris differ diff --git a/src/games/snake.cpp b/src/games/snake.cpp index 797f28c..e4fa960 100644 --- a/src/games/snake.cpp +++ b/src/games/snake.cpp @@ -287,11 +287,16 @@ static void setup_window() { screen = DefaultScreen(dpy); int sw = DisplayWidth(dpy, screen); int scrH = DisplayHeight(dpy, screen); - winW = sw; - winH = scrH - TOPBAR; // fill the area below the status bar + // dwm draws a `borderpx` border around every client (src/sxmo-dwm/config.h). + // Size/position the window so that, once dwm adds its border back on each + // side, the framed window exactly meets the screen edges and the native + // border stays fully visible instead of being clipped off the right/bottom. + int bw = 1; // must match dwm borderpx + winW = sw - 3 * bw; + winH = (scrH - TOPBAR) - 3 * bw; // room for the status bar + border if (winW < 96) winW = 96; if (winH < 96) winH = 96; - win = XCreateWindow(dpy, RootWindow(dpy, screen), 0, 0, winW, winH, 0, + win = XCreateWindow(dpy, RootWindow(dpy, screen), bw, TOPBAR + bw, winW, winH, 0, CopyFromParent, InputOutput, CopyFromParent, 0, nullptr); XStoreName(dpy, win, "Snake"); XClassHint* ch = XAllocClassHint(); diff --git a/src/games/tetris.cpp b/src/games/tetris.cpp index 5d71159..1a6e8e7 100644 --- a/src/games/tetris.cpp +++ b/src/games/tetris.cpp @@ -329,11 +329,16 @@ static void setup_window() { screen = DefaultScreen(dpy); int sw = DisplayWidth(dpy, screen); int scrH = DisplayHeight(dpy, screen); - winW = sw; - winH = scrH - TOPBAR; // fill the area below the status bar + // dwm draws a `borderpx` border around every client (src/sxmo-dwm/config.h). + // Size/position the window so that, once dwm adds its border back on each + // side, the framed window exactly meets the screen edges and the native + // border stays fully visible instead of being clipped off the right/bottom. + int bw = 1; // must match dwm borderpx + winW = sw - 3 * bw; + winH = (scrH - TOPBAR) - 3 * bw; // room for the status bar + border if (winW < 96) winW = 96; if (winH < 96) winH = 96; - win = XCreateWindow(dpy, RootWindow(dpy, screen), 0, 0, winW, winH, 0, + win = XCreateWindow(dpy, RootWindow(dpy, screen), bw, TOPBAR + bw, winW, winH, 0, CopyFromParent, InputOutput, CopyFromParent, 0, nullptr); XStoreName(dpy, win, "Tetris"); XClassHint* ch = XAllocClassHint();