diff --git a/source/cl_main.c b/source/cl_main.c index ed9fcf3..a563778 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -466,7 +466,7 @@ void CL_Disconnect (void) connect_time = -1; - VID_SetCaption(PROGRAM ": disconnected"); + VID_SetCaption("disconnected"); // stop sounds (especially looping!) S_StopAllSounds (true); diff --git a/source/cl_pred.c b/source/cl_pred.c index ac8d588..5c1b551 100644 --- a/source/cl_pred.c +++ b/source/cl_pred.c @@ -167,12 +167,8 @@ void CL_PredictMove (void) // we can now render a frame if (cls.state == ca_onserver) { // first update is the final signon stage - - char text[1024]; - snprintf (text, sizeof(text), "%s: %s", PROGRAM, cls.servername); - VID_SetCaption(text); - - cls.state = ca_active; + VID_SetCaption(cls.servername); + cls.state = ca_active; } if (cl_nopred->value) diff --git a/source/context_x11.c b/source/context_x11.c index 97c9e54..e98cc21 100644 --- a/source/context_x11.c +++ b/source/context_x11.c @@ -322,7 +322,7 @@ x11_create_window(int width, int height) x_vis, mask, &attr); // Set window title - XStoreName (x_disp, x_win, va ("%s %s", PROGRAM, VERSION)); + x11_set_caption (va ("%s %s", PROGRAM, VERSION)); // Set icon name XSetIconName (x_disp, x_win, PROGRAM); diff --git a/source/vid_glx.c b/source/vid_glx.c index bc11928..1c7e4b3 100644 --- a/source/vid_glx.c +++ b/source/vid_glx.c @@ -609,5 +609,9 @@ VID_UnlockBuffer ( void ) void VID_SetCaption (char *text) { - x11_set_caption (text); + if (text && *text) { + x11_set_caption (va ("%s %s: %s", PROGRAM, VERSION, text)); + } else { + x11_set_caption (va ("%s %s", PROGRAM, VERSION)); + } } diff --git a/source/vid_mgl.c b/source/vid_mgl.c index f0d5b8e..c614692 100644 --- a/source/vid_mgl.c +++ b/source/vid_mgl.c @@ -3426,6 +3426,10 @@ void VID_MenuKey (int key) void VID_SetCaption (char *text) { - SetWindowText(mainwindow,(LPSTR) text); + if (text && *text) { + SetWindowText(mainwindow,(LPSTR) va ("%s %s: %s", PROGRAM, VERSION, text)); + } else { + SetWindowText(mainwindow,(LPSTR) va ("%s %s", PROGRAM, VERSION)); + } } diff --git a/source/vid_sdl.c b/source/vid_sdl.c index e5afe0d..550dd45 100644 --- a/source/vid_sdl.c +++ b/source/vid_sdl.c @@ -1,5 +1,5 @@ /* - vid_sdl.c + vid_sdl.c Video driver for Sam Lantinga's Simple DirectMedia Layer @@ -149,7 +149,7 @@ void VID_Init (unsigned char *palette) if (!(screen = SDL_SetVideoMode(vid.width, vid.height, 8, flags))) Sys_Error("VID: Couldn't set video mode: %s\n", SDL_GetError()); VID_SetPalette(palette); - VID_SetCaption("sdlquakeworld"); + VID_SetCaption(""); // now know everything we need to know about the buffer VGA_width = vid.conwidth = vid.width; @@ -524,6 +524,10 @@ VID_UnlockBuffer ( void ) void VID_SetCaption (char *text) { - SDL_WM_SetCaption(text, NULL); + if (text && *text) { + SDL_WM_SetCaption(va ("%s %s: %s", PROGRAM, VERSION, text), NULL); + } else { + SDL_WM_SetCaption(va ("%s %s", PROGRAM, VERSION), NULL); + } } diff --git a/source/vid_sgl.c b/source/vid_sgl.c index f946dae..d598c00 100644 --- a/source/vid_sgl.c +++ b/source/vid_sgl.c @@ -703,6 +703,10 @@ VID_UnlockBuffer ( void ) void VID_SetCaption (char *text) { - SDL_WM_SetCaption(text, NULL); + if (text && *text) { + SDL_WM_SetCaption(va ("%s %s: %s", PROGRAM, VERSION, text), NULL); + } else { + SDL_WM_SetCaption(va ("%s %s", PROGRAM, VERSION), NULL); + } } diff --git a/source/vid_wgl.c b/source/vid_wgl.c index 66c1a90..f6323f7 100644 --- a/source/vid_wgl.c +++ b/source/vid_wgl.c @@ -1939,5 +1939,9 @@ void VID_MenuKey (int key) void VID_SetCaption (char *text) { - SetWindowText(mainwindow,(LPSTR) text); + if (text && *text) { + SetWindowText(mainwindow,(LPSTR) va ("%s %s: %s", PROGRAM, VERSION, text)); + } else { + SetWindowText(mainwindow,(LPSTR) va ("%s %s", PROGRAM, VERSION)); + } } diff --git a/source/vid_x11.c b/source/vid_x11.c index f242e53..430dbc7 100644 --- a/source/vid_x11.c +++ b/source/vid_x11.c @@ -806,5 +806,9 @@ VID_UnlockBuffer ( void ) void VID_SetCaption (char *text) { - x11_set_caption (text); + if (text && *text) { + x11_set_caption (va ("%s %s: %s", PROGRAM, VERSION, text)); + } else { + x11_set_caption (va ("%s %s", PROGRAM, VERSION)); + } }