diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index e8001df..215c8c8 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -436,7 +436,8 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) *rotations = RR_Rotate_All|RR_Reflect_All; if (!hostx_want_preexisting_window() - && !hostx_want_fullscreen()) /* only if no -parent switch */ + && !hostx_want_fullscreen() + && !hostx_want_user_geometry()) /* only if no -parent switch */ { while (sizes[n].width != 0 && sizes[n].height != 0) { diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index a76da03..23420c7 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -92,6 +92,7 @@ ddxUseMsg (void) ErrorF("\nXephyr Option Usage:\n"); ErrorF("-parent XID Use existing window as Xephyr root win\n"); ErrorF("-host-cursor Re-use exisiting X host server cursor\n"); + ErrorF("-geometry Set window geometry\n"); ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n"); ErrorF("-grayscale Simulate 8bit grayscale\n"); ErrorF("-fakexa Simulate acceleration using software rendering\n"); @@ -139,6 +140,14 @@ ddxProcessArgument (int argc, char **argv, int i) ephyrFuncs.finiAccel = ephyrDrawFini; return 1; } + else if (!strcmp (argv[i], "-geometry")) + { + if(i+1 < argc) + { + hostx_use_user_geometry (argv[i+1]); + return 2; + } + } 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 36d3cbd..60a91d0 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -59,9 +59,10 @@ struct EphyrHostXVars int depth; int server_depth; XImage *ximg; - int win_width, win_height; + int win_width, win_height, win_x, win_y; Bool use_host_cursor; Bool use_fullscreen; + Bool use_user_geometry; Bool have_shm; long damage_debug_msec; @@ -73,7 +74,7 @@ struct EphyrHostXVars }; /* memset ( missing> ) instead of below */ -static EphyrHostXVars HostX = { "?", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +static EphyrHostXVars HostX = { "?", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; static int HostXWantDamageDebug = 0; @@ -118,7 +119,8 @@ int hostx_want_screen_size(int *width, int *height) { if (HostX.win_pre_existing != None - || HostX.use_fullscreen == True) + || HostX.use_fullscreen == True + || HostX.use_user_geometry == True) { *width = HostX.win_width; *height = HostX.win_height; @@ -168,6 +170,21 @@ hostx_want_preexisting_window(void) } void +hostx_use_user_geometry(char *geometry) +{ + if (XParseGeometry (geometry, + &HostX.win_x, &HostX.win_y, + &HostX.win_width, &HostX.win_height)) + HostX.use_user_geometry = True; +} + +int +hostx_want_user_geometry(void) +{ + return HostX.use_user_geometry; +} + +void hostx_use_fullscreen(void) { HostX.use_fullscreen = True; @@ -450,6 +467,7 @@ hostx_screen_init (int width, int height, int buffer_height) int bitmap_pad; Bool shm_success = False; XSizeHints *size_hints; + XWindowChanges values; EPHYR_DBG("mark"); @@ -525,6 +543,13 @@ hostx_screen_init (int width, int height, int buffer_height) XResizeWindow(HostX.dpy, HostX.win, width, height); + if (HostX.use_user_geometry) + { + values.x = HostX.win_x; + values.y = HostX.win_y; + XConfigureWindow(HostX.dpy, HostX.win, CWX | CWY, &values); + } + /* Ask the WM to keep our size static */ size_hints = XAllocSizeHints(); size_hints->max_width = size_hints->min_width = width; diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h index 4d5f37f..9494a9e 100644 --- a/hw/kdrive/ephyr/hostx.h +++ b/hw/kdrive/ephyr/hostx.h @@ -100,6 +100,12 @@ hostx_want_host_cursor(void); void hostx_use_host_cursor(void); +int +hostx_want_user_geometry(void); + +void +hostx_use_user_geometry(char *); + void hostx_use_fullscreen(void);