summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-19 15:17:08 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-19 15:17:08 +0000
commitc35734b2a6f9b028edacd5813ff271728ce2a9e3 (patch)
tree912fb17654bdcc79592e1462cd86139ce5e7a78a /sdl.c
parentdcfb90144bd83a13e24f214e0c4a1b0b55067289 (diff)
Add -name option, by Anthony Liguori.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2505 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sdl.c b/sdl.c
index 0cb22411d..aa5c66992 100644
--- a/sdl.c
+++ b/sdl.c
@@ -216,13 +216,18 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
static void sdl_update_caption(void)
{
char buf[1024];
- strcpy(buf, "QEMU");
- if (!vm_running) {
- strcat(buf, " [Stopped]");
- }
- if (gui_grab) {
- strcat(buf, " - Press Ctrl-Alt to exit grab");
- }
+ const char *status = "";
+
+ if (!vm_running)
+ status = " [Stopped]";
+ else if (gui_grab)
+ status = " - Press Ctrl-Alt to exit grab";
+
+ if (qemu_name)
+ snprintf(buf, sizeof(buf), "QEMU (%s)%s", qemu_name, status);
+ else
+ snprintf(buf, sizeof(buf), "QEMU%s", status);
+
SDL_WM_SetCaption(buf, "QEMU");
}