summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-09-28 14:18:45 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-09-29 09:38:44 +1000
commit19be992d9dc542b61fa3f4fd32a09071c9e64880 (patch)
treeb6f7cde7e7c59eb0961e3f8b660c1605ed75db59
parentefacd7bfd08ffc0725de6f639c6afbf3b2f6c9fe (diff)
ephyr: if -parent is given, check for a trailing -screen. (#24144)
If -parent is given, don't open up a new window if -screen is given as well. The commandline option -screen allows to set the depth of the embedded Xephry instance, even though width and height are autoscaled on -parent. This patch checks for a -screen parameter after -parent and - if one is found - delays initializing the screen. The parent window id is stored temporarily but re-set after a -screen argument. The following command is thus valid: Xephyr -parent 1234 -screen 640x480@8 -screen 1024x768 It embeds the first 8-bit screen into window 1234 and opens up a new window for the second screen. Multiple parent arguments are possible, the screens are embedded in-order. X.Org Bug 24144 <http://bugs.freedesktop.org/show_bug.cgi?id=24144> Tested-by: Vic Lee Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/kdrive/ephyr/Xephyr.man.pre5
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c16
2 files changed, 20 insertions, 1 deletions
diff --git a/hw/kdrive/ephyr/Xephyr.man.pre b/hw/kdrive/ephyr/Xephyr.man.pre
index 008256914..eb80b96b0 100644
--- a/hw/kdrive/ephyr/Xephyr.man.pre
+++ b/hw/kdrive/ephyr/Xephyr.man.pre
@@ -46,6 +46,11 @@ sets the screen size.
.BI -parent " id"
uses exiting window
.I id .
+If a
+.BI -screen
+argument follows a
+.BI -parent
+argument, this screen is embedded into the given window.
.TP 8
.B -host-cursor
set 'cursor acceleration':
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 22152ffe0..eecad7e42 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -148,6 +148,7 @@ processScreenArg (char *screen_size, char *parent_id)
int
ddxProcessArgument (int argc, char **argv, int i)
{
+ static char* parent = NULL;
EPHYR_DBG("mark argv[%d]='%s'", i, argv[i] );
if (i == 1)
@@ -159,6 +160,18 @@ ddxProcessArgument (int argc, char **argv, int i)
{
if(i+1 < argc)
{
+ int j;
+ /* If parent is specified and a screen argument follows, don't do
+ * anything, let the -screen handling init the rest */
+ for (j = i; j < argc; j++)
+ {
+ if (!strcmp(argv[j], "-screen"))
+ {
+ parent = argv[i + 1];
+ return 2;
+ }
+ }
+
processScreenArg ("100x100", argv[i+1]);
return 2;
}
@@ -170,7 +183,8 @@ ddxProcessArgument (int argc, char **argv, int i)
{
if ((i+1) < argc)
{
- processScreenArg (argv[i+1], NULL);
+ processScreenArg (argv[i+1], parent);
+ parent = NULL;
return 2;
}