aboutsummaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorDominic Evans <oldmanuk@gmail.com>2009-09-24 12:13:56 +0100
committerAurelien Jarno <aurelien@aurel32.net>2009-09-26 23:35:56 +0200
commitb4ed5d188f30c738035b50e7c865782f73f7171f (patch)
tree2f45bc819dc357e751d11733b5e7e5c3c60e6bd8 /sdl.c
parent1f5c1775cd3d413a41578bde1ba0202bf4c40c14 (diff)
Set SDL icon_title when using `-name XXX` for proper gnome-panel window list integration
qemu: improve sdl title information Include the `-name XXX` commandline param in the gnome-panel window list via icon_title. https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/423076 Signed-off-by: Dominic Evans <oldmanuk@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sdl.c b/sdl.c
index de63c7f36e..42b6f37e6f 100644
--- a/sdl.c
+++ b/sdl.c
@@ -407,7 +407,8 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
static void sdl_update_caption(void)
{
- char buf[1024];
+ char win_title[1024];
+ char icon_title[1024];
const char *status = "";
if (!vm_running)
@@ -419,12 +420,15 @@ static void sdl_update_caption(void)
status = " - Press Ctrl-Alt-Shift to exit grab";
}
- if (qemu_name)
- snprintf(buf, sizeof(buf), "QEMU (%s)%s", qemu_name, status);
- else
- snprintf(buf, sizeof(buf), "QEMU%s", status);
+ if (qemu_name) {
+ snprintf(win_title, sizeof(win_title), "QEMU (%s)%s", qemu_name, status);
+ snprintf(icon_title, sizeof(icon_title), "QEMU (%s)", qemu_name);
+ } else {
+ snprintf(win_title, sizeof(win_title), "QEMU%s", status);
+ snprintf(icon_title, sizeof(icon_title), "QEMU");
+ }
- SDL_WM_SetCaption(buf, "QEMU");
+ SDL_WM_SetCaption(win_title, icon_title);
}
static void sdl_hide_cursor(void)