summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-06-10 12:05:09 -0400
committerAdam Jackson <ajax@redhat.com>2009-06-10 12:05:09 -0400
commite3c65cf1df9bbfb126f07b4b8e1254a855fb70c7 (patch)
tree6d28e8f76f8ae35a3f8acc77dfd80c6f06aee561
parent803522300344265f11ea9f869ee6747730413bae (diff)
xephyr: Add -title option.
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c14
-rw-r--r--hw/kdrive/ephyr/hostx.c32
-rw-r--r--hw/kdrive/ephyr/hostx.h3
3 files changed, 39 insertions, 10 deletions
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 3c573cdf4..22152ffe0 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -110,6 +110,7 @@ ddxUseMsg (void)
#endif
ErrorF("-noxv do not use XV\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");
exit(1);
@@ -242,6 +243,19 @@ ddxProcessArgument (int argc, char **argv, int i)
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] == ':')
{
hostx_set_display_name(argv[i]);
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index f69db2b18..46645d34e 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -122,6 +122,7 @@ extern int monitorResolution;
char *ephyrResName = NULL;
int ephyrResNameFromCmd = 0;
+char *ephyrTitle = NULL;
static void
hostx_set_fullscreen_hint(void);
@@ -222,20 +223,25 @@ hostx_set_screen_number(EphyrScreenInfo screen, int number)
void
hostx_set_win_title (EphyrScreenInfo screen, char *extra_text)
{
- struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen);
-#define BUF_LEN 256
- char buf[BUF_LEN+1];
+ struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen);
- if (!host_screen)
+ if (!host_screen)
return;
- memset (buf, 0, BUF_LEN+1) ;
- snprintf (buf, BUF_LEN, "Xephyr on %s.%d %s",
- HostX.server_dpy_name,
- host_screen->mynum,
- (extra_text != NULL) ? extra_text : "");
+ 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) ;
+ snprintf (buf, BUF_LEN, "Xephyr on %s.%d %s",
+ HostX.server_dpy_name,
+ host_screen->mynum,
+ (extra_text != NULL) ? extra_text : "");
- XStoreName (HostX.dpy, host_screen->win, buf);
+ XStoreName (HostX.dpy, host_screen->win, buf);
+ }
}
int
@@ -319,6 +325,12 @@ hostx_use_resname (char *name, int fromcmd)
ephyrResNameFromCmd = fromcmd;
}
+void
+hostx_set_title (char *title)
+{
+ ephyrTitle = title;
+}
+
int
hostx_init (void)
{
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index c1b1958de..e65e0c9bc 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -148,6 +148,9 @@ hostx_use_preexisting_window(unsigned long win_id);
void
hostx_use_resname (char *name, int fromcmd);
+void
+hostx_set_title(char *name);
+
void
hostx_handle_signal(int signum);