xephyr: Add -title option.
This commit is contained in:
parent
8035223003
commit
e3c65cf1df
|
@ -110,6 +110,7 @@ ddxUseMsg (void)
|
||||||
#endif
|
#endif
|
||||||
ErrorF("-noxv do not use XV\n");
|
ErrorF("-noxv do not use XV\n");
|
||||||
ErrorF("-name [name] define the name in the WM_CLASS property\n");
|
ErrorF("-name [name] define the name in the WM_CLASS property\n");
|
||||||
|
ErrorF("-title [title] set the window title in the WM_NAME property\n");
|
||||||
ErrorF("\n");
|
ErrorF("\n");
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -242,6 +243,19 @@ ddxProcessArgument (int argc, char **argv, int i)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!strcmp (argv[i], "-title"))
|
||||||
|
{
|
||||||
|
if (i+1 < argc && argv[i+1][0] != '-')
|
||||||
|
{
|
||||||
|
hostx_set_title(argv[i+1]);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UseMsg();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (argv[i][0] == ':')
|
else if (argv[i][0] == ':')
|
||||||
{
|
{
|
||||||
hostx_set_display_name(argv[i]);
|
hostx_set_display_name(argv[i]);
|
||||||
|
|
|
@ -122,6 +122,7 @@ extern int monitorResolution;
|
||||||
|
|
||||||
char *ephyrResName = NULL;
|
char *ephyrResName = NULL;
|
||||||
int ephyrResNameFromCmd = 0;
|
int ephyrResNameFromCmd = 0;
|
||||||
|
char *ephyrTitle = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
hostx_set_fullscreen_hint(void);
|
hostx_set_fullscreen_hint(void);
|
||||||
|
@ -223,12 +224,16 @@ void
|
||||||
hostx_set_win_title (EphyrScreenInfo screen, char *extra_text)
|
hostx_set_win_title (EphyrScreenInfo screen, char *extra_text)
|
||||||
{
|
{
|
||||||
struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen);
|
struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen);
|
||||||
#define BUF_LEN 256
|
|
||||||
char buf[BUF_LEN+1];
|
|
||||||
|
|
||||||
if (!host_screen)
|
if (!host_screen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (ephyrTitle) {
|
||||||
|
XStoreName(HostX.dpy, host_screen->win, ephyrTitle);
|
||||||
|
} else {
|
||||||
|
#define BUF_LEN 256
|
||||||
|
char buf[BUF_LEN+1];
|
||||||
|
|
||||||
memset (buf, 0, BUF_LEN+1) ;
|
memset (buf, 0, BUF_LEN+1) ;
|
||||||
snprintf (buf, BUF_LEN, "Xephyr on %s.%d %s",
|
snprintf (buf, BUF_LEN, "Xephyr on %s.%d %s",
|
||||||
HostX.server_dpy_name,
|
HostX.server_dpy_name,
|
||||||
|
@ -237,6 +242,7 @@ hostx_set_win_title (EphyrScreenInfo screen, char *extra_text)
|
||||||
|
|
||||||
XStoreName (HostX.dpy, host_screen->win, buf);
|
XStoreName (HostX.dpy, host_screen->win, buf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
hostx_want_host_cursor (void)
|
hostx_want_host_cursor (void)
|
||||||
|
@ -319,6 +325,12 @@ hostx_use_resname (char *name, int fromcmd)
|
||||||
ephyrResNameFromCmd = fromcmd;
|
ephyrResNameFromCmd = fromcmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hostx_set_title (char *title)
|
||||||
|
{
|
||||||
|
ephyrTitle = title;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
hostx_init (void)
|
hostx_init (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -148,6 +148,9 @@ hostx_use_preexisting_window(unsigned long win_id);
|
||||||
void
|
void
|
||||||
hostx_use_resname (char *name, int fromcmd);
|
hostx_use_resname (char *name, int fromcmd);
|
||||||
|
|
||||||
|
void
|
||||||
|
hostx_set_title(char *name);
|
||||||
|
|
||||||
void
|
void
|
||||||
hostx_handle_signal(int signum);
|
hostx_handle_signal(int signum);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue