X11 targets have runtime caption setting now.

This commit is contained in:
Jeff Teunissen 2000-10-03 07:10:48 +00:00
parent 85ddc29ac6
commit 85e0b2b6aa
4 changed files with 31 additions and 15 deletions

View file

@ -47,16 +47,17 @@ extern qboolean doShm;
extern int x_shmeventtype;
extern qboolean oktodraw;
qboolean x11_add_event( int event, void (*event_handler)(XEvent *));
qboolean x11_del_event( int event, void (*event_handler)(XEvent *));
void x11_process_event( void );
void x11_process_events( void );
void x11_open_display( void );
void x11_close_display( void );
void x11_create_null_cursor(void);
void x11_set_vidmode(int width, int height);
void x11_restore_vidmode(void);
void x11_create_window(int width, int height);
void x11_grab_keyboard(void);
qboolean x11_add_event (int event, void (*event_handler)(XEvent *));
qboolean x11_del_event (int event, void (*event_handler)(XEvent *));
void x11_process_event (void);
void x11_process_events (void);
void x11_open_display (void);
void x11_close_display (void);
void x11_create_null_cursor (void);
void x11_set_vidmode (int, int);
void x11_restore_vidmode (void);
void x11_create_window (int, int);
void x11_grab_keyboard (void);
void x11_set_caption (char *);
#endif // __CONTEXT_X11_H__

View file

@ -55,6 +55,7 @@
# include <X11/extensions/xf86vmode.h>
#endif
#include "commdef.h"
#include "context_x11.h"
#include "dga_check.h"
#include "qtypes.h"
@ -319,8 +320,11 @@ x11_create_window(int width, int height)
x_win = XCreateWindow(x_disp, x_root, 0, 0, width, height,
0, x_visinfo->depth, InputOutput,
x_vis, mask, &attr);
/* Give it a title */
XStoreName(x_disp, x_win, "XQuake");
// Set window title
XStoreName (x_disp, x_win, va ("%s %s", PROGRAM, VERSION));
// Set icon name
XSetIconName (x_disp, x_win, PROGRAM);
/* Make window respond to Delete events */
aWMDelete = XInternAtom(x_disp, "WM_DELETE_WINDOW", False);
@ -355,3 +359,10 @@ x11_grab_keyboard(void)
}
#endif
}
void
x11_set_caption (char *text)
{
if (x_disp && x_win && text)
XStoreName (x_disp, x_win, text);
}

View file

@ -606,6 +606,8 @@ VID_UnlockBuffer ( void )
{
}
void VID_SetCaption (char *text)
void
VID_SetCaption (char *text)
{
x11_set_caption (text);
}

View file

@ -803,6 +803,8 @@ VID_UnlockBuffer ( void )
{
}
void VID_SetCaption (char *text)
void
VID_SetCaption (char *text)
{
x11_set_caption (text);
}