aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/ephyr/ephyrinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr/ephyrinit.c')
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrinit.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
index fc0001012..38acc52a6 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
@@ -47,6 +47,8 @@ extern KdPointerDriver LinuxEvdevMouseDriver;
extern KdKeyboardDriver LinuxEvdevKeyboardDriver;
#endif
+void processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id);
+void processOutputArg(const char *output, char *parent_id);
void processScreenArg(const char *screen_size, char *parent_id);
void
@@ -134,6 +136,7 @@ ddxUseMsg(void)
ErrorF("-parent <XID> Use existing window as Xephyr root win\n");
ErrorF("-sw-cursor Render cursors in software in Xephyr\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
+ ErrorF("-output <NAME> Attempt to run Xephyr fullscreen (restricted to given output geometry)\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
ErrorF("-resizeable Make Xephyr windows resizeable\n");
#ifdef GLAMOR
@@ -154,7 +157,7 @@ ddxUseMsg(void)
}
void
-processScreenArg(const char *screen_size, char *parent_id)
+processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id)
{
KdCardInfo *card;
@@ -164,6 +167,7 @@ processScreenArg(const char *screen_size, char *parent_id)
if (card) {
KdScreenInfo *screen;
unsigned long p_id = 0;
+ Bool use_geometry;
screen = KdScreenInfoAdd(card);
KdParseScreen(screen, screen_size);
@@ -174,14 +178,28 @@ processScreenArg(const char *screen_size, char *parent_id)
if (parent_id) {
p_id = strtol(parent_id, NULL, 0);
}
+
+ use_geometry = (strchr(screen_size, '+') != NULL);
EPHYR_DBG("screen number:%d\n", screen->mynum);
- hostx_add_screen(screen, p_id, screen->mynum);
+ hostx_add_screen(screen, p_id, screen->mynum, use_geometry, output);
}
else {
ErrorF("No matching card found!\n");
}
}
+void
+processScreenArg(const char *screen_size, char *parent_id)
+{
+ processScreenOrOutputArg(screen_size, NULL, parent_id);
+}
+
+void
+processOutputArg(const char *output, char *parent_id)
+{
+ processScreenOrOutputArg("100x100+0+0", output, parent_id);
+}
+
int
ddxProcessArgument(int argc, char **argv, int i)
{
@@ -223,6 +241,15 @@ ddxProcessArgument(int argc, char **argv, int i)
UseMsg();
exit(1);
}
+ else if (!strcmp(argv[i], "-output")) {
+ if (i + 1 < argc) {
+ processOutputArg(argv[i + 1], NULL);
+ return 2;
+ }
+
+ UseMsg();
+ exit(1);
+ }
else if (!strcmp(argv[i], "-sw-cursor")) {
hostx_use_sw_cursor();
return 1;