diff --git a/overlay/rootfs/usr/bin/snake b/overlay/rootfs/usr/bin/snake index 3ac5d64..0ad1537 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 7a3ec41..77556a8 100755 Binary files a/overlay/rootfs/usr/bin/tetris and b/overlay/rootfs/usr/bin/tetris differ diff --git a/overlay/rootfs/usr/lib/dwm/plugins/dmenu.so b/overlay/rootfs/usr/lib/dwm/plugins/dmenu.so index 40f7bf8..32cb263 100755 Binary files a/overlay/rootfs/usr/lib/dwm/plugins/dmenu.so and b/overlay/rootfs/usr/lib/dwm/plugins/dmenu.so differ diff --git a/prebuilt/games/usr/bin/snake b/prebuilt/games/usr/bin/snake index 3ac5d64..0ad1537 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 7a3ec41..77556a8 100755 Binary files a/prebuilt/games/usr/bin/tetris and b/prebuilt/games/usr/bin/tetris differ diff --git a/prebuilt/sxmo-x11/usr/lib/dwm/plugins/dmenu.so b/prebuilt/sxmo-x11/usr/lib/dwm/plugins/dmenu.so index 40f7bf8..32cb263 100755 Binary files a/prebuilt/sxmo-x11/usr/lib/dwm/plugins/dmenu.so and b/prebuilt/sxmo-x11/usr/lib/dwm/plugins/dmenu.so differ diff --git a/src/games/snake.cpp b/src/games/snake.cpp index 0e59680..797f28c 100644 --- a/src/games/snake.cpp +++ b/src/games/snake.cpp @@ -22,8 +22,7 @@ #include #include -static const int WIN_W = 220; -static const int WIN_H = 268; +static const int TOPBAR = 24; static const int COLS = 24; static const int ROWS = 28; @@ -86,8 +85,8 @@ static Window win; static GC gc; static Pixmap back; static int screen; -static int winW = WIN_W, winH = WIN_H; static int cell, gx0, gy0, gw, gh; +static int winW = 240, winH = 296; // overridden at runtime from the actual screen // ---- colors (Nokia green monochrome) ---- static unsigned long C_BG, C_FG, C_HEAD, C_FOOD, C_DIM; @@ -215,9 +214,9 @@ static void render() { XFillRectangle(dpy, back, gc, 0, 0, winW, winH); // playfield border (single clean frame around the grid) + // border framing the whole window (adapts to the actual screen size) XSetForeground(dpy, gc, C_DIM); - XDrawRectangle(dpy, back, gc, gx0 - 1, gy0 - 1, gw + 2, gh + 2); - + XDrawRectangle(dpy, back, gc, 2, 2, winW - 4, winH - 4); // food if (foodx >= 0) { XSetForeground(dpy, gc, C_FOOD); @@ -286,6 +285,12 @@ static void setup_window() { dpy = XOpenDisplay(nullptr); if (!dpy) { fprintf(stderr, "snake: cannot open display\n"); exit(1); } 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 + if (winW < 96) winW = 96; + if (winH < 96) winH = 96; win = XCreateWindow(dpy, RootWindow(dpy, screen), 0, 0, winW, winH, 0, CopyFromParent, InputOutput, CopyFromParent, 0, nullptr); XStoreName(dpy, win, "Snake"); diff --git a/src/games/tetris.cpp b/src/games/tetris.cpp index 2c53c9a..5d71159 100644 --- a/src/games/tetris.cpp +++ b/src/games/tetris.cpp @@ -23,8 +23,7 @@ #include #include -static const int WIN_W = 224; -static const int WIN_H = 292; +static const int TOPBAR = 24; static const int PCOLS = 10; static const int PROWS = 20; static const int CELL = 14; @@ -87,7 +86,7 @@ static Window win; static GC gc; static Pixmap back; static int screen; -static int winW = WIN_W, winH = WIN_H; +static int winW = 240, winH = 296; // overridden at runtime from the actual screen static unsigned long C_BG, C_FG, C_HEAD, C_FOOD, C_DIM; // ---- tetromino definitions (state 0 within a 4x4 box) ---- @@ -328,6 +327,12 @@ static void setup_window() { dpy = XOpenDisplay(nullptr); if (!dpy) { fprintf(stderr, "tetris: cannot open display\n"); exit(1); } 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 + if (winW < 96) winW = 96; + if (winH < 96) winH = 96; win = XCreateWindow(dpy, RootWindow(dpy, screen), 0, 0, winW, winH, 0, CopyFromParent, InputOutput, CopyFromParent, 0, nullptr); XStoreName(dpy, win, "Tetris"); diff --git a/src/sxmo-dmenu/dmenu.c b/src/sxmo-dmenu/dmenu.c index 8119b58..c0b819f 100644 --- a/src/sxmo-dmenu/dmenu.c +++ b/src/sxmo-dmenu/dmenu.c @@ -1649,16 +1649,12 @@ open_builtin_menu(const char *menu_name, int keep_idx) if (!cls[0] || strcmp(cls, "sys") == 0) { menu_name = "sys"; } else if (strcmp(cls, "st") == 0 || strncmp(cls, "st-", 3) == 0) { - if (strstr(ttl, "nano")) - menu_name = "nano"; - else - menu_name = "st"; - } else { - hide_menu(); - menu_mode = MODE_NONE; - snprintf(cmd, sizeof(cmd), "sxmo_appmenu.sh --fallback '%s' '%s'", cls, ttl); - spawn_detached_sh(cmd); - return; + /* launched from a terminal: also show the exact same Sys menu */ + menu_name = "sys"; + } + else { + /* launched from an app: show the exact same Sys menu as the desktop */ + menu_name = "sys"; } }