- Fix error message format when the given output is invalid.
- When -output option is provided, set HostX.use_fullscreen to TRUE
and call hostx_set_fullscreen_hint(), in order to mimic fullscreen
mode, and prevent Xephyr from registering additional modes.
Laércio de Sousa (1):
ephyr: set screen size & origin from host X server output's CRTC
geometry
Loic Grenie (1):
ephyr: allow starting window at other than 0,0 location (via kdrive
-origin option)
configure.ac | 2 +-
hw/kdrive/ephyr/ephyr.c | 8 ++-
hw/kdrive/ephyr/ephyr.h | 2 +
hw/kdrive/ephyr/ephyrinit.c | 21 +++++-
hw/kdrive/ephyr/hostx.c | 151 ++++++++++++++++++++++++++++++++++++++++++--
hw/kdrive/ephyr/hostx.h | 10 ++-
6 files changed, 181 insertions(+), 13 deletions(-)
--
1.8.4.5
_______________________________________________
xorg-...@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
The following patch sets the upper-left corner of the Xephyr window
to the coordinates specified with kdrive -origin option.
This option is overriden if Xephyr is started in a desktop environment
such as GNOME or KDE, but it does apply if Xephyr is started directly
from display manager, so it may be useful specially for single-card
multiseat setups.
This is based on original patch by Loic Grenie submitted to Debian
at August 06, 2008 (Debian bug #493963), and updated to current Xephyr
version by Laércio de Sousa.
Signed-off-by: Laércio de Sousa <lbso...@gmail.com>
---
hw/kdrive/ephyr/ephyr.c | 3 ++-
hw/kdrive/ephyr/hostx.c | 12 ++++++++----
hw/kdrive/ephyr/hostx.h | 1 +
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index def50d8..3e910ea 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -242,7 +242,8 @@ ephyrMapFramebuffer(KdScreenInfo * screen)
buffer_height = ephyrBufferHeight(screen);
priv->base =
- hostx_screen_init(screen, screen->width, screen->height, buffer_height,
+ hostx_screen_init(screen, screen->origin.x, screen->origin.y,
+ screen->width, screen->height, buffer_height,
&priv->bytes_per_line, &screen->fb.bitsPerPixel);
if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) {
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 435919e..5e79708 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -626,6 +626,7 @@ hostx_set_cmap_entry(unsigned char idx,
*/
void *
hostx_screen_init(KdScreenInfo *screen,
+ int x, int y,
int width, int height, int buffer_height,
int *bytes_per_line, int *bits_per_pixel)
{
@@ -637,8 +638,8 @@ hostx_screen_init(KdScreenInfo *screen,
exit(1);
}
- EPHYR_DBG("host_screen=%p wxh=%dx%d, buffer_height=%d",
- host_screen, width, height, buffer_height);
+ EPHYR_DBG("host_screen=%p x=%d, y=%d, wxh=%dx%d, buffer_height=%d",
+ host_screen, x, y, width, height, buffer_height);
if (scrpriv->ximg != NULL) {
/* Free up the image data if previously used
@@ -711,8 +712,11 @@ hostx_screen_init(KdScreenInfo *screen,
}
{
- uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
- uint32_t values[2] = {width, height};
+ uint32_t mask = XCB_CONFIG_WINDOW_X
+ | XCB_CONFIG_WINDOW_Y
+ | XCB_CONFIG_WINDOW_WIDTH
+ | XCB_CONFIG_WINDOW_HEIGHT;
+ uint32_t values[4] = {x, y, width, height};
xcb_configure_window(HostX.conn, scrpriv->win, mask, values);
}
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index e83323a..77b97ee 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -136,6 +136,7 @@ hostx_set_cmap_entry(unsigned char idx,
unsigned char r, unsigned char g, unsigned char b);
void *hostx_screen_init(KdScreenInfo *screen,
+ int x, int y,
int width, int height, int buffer_height,
int *bytes_per_line, int *bits_per_pixel);
Z
Em 30/04/2014 14:04, "Keith Packard" <kei...@keithp.com> escreveu:
>
> Laércio de Sousa <lbso...@gmail.com> writes:
>
> > From: Loic Grenie <loic....@gmail.com>
> >
> > The following patch sets the upper-left corner of the Xephyr window
> > to the coordinates specified with kdrive -origin option.
>
> The -origin option specifies where the screen appears in the cursor
> address space when running multiple kdrive screens in Xinerama mode. If
> you want an option to specify where the screen appears in the enclosing
> window system, you'll need a new option.
>
Some time ago I submitted another patch with the following approach: extend kdrive -screen option parsing to include strings like WxH+X+Y, and then place Xephyr window top-left corner at (X,Y). Do you think it's a good approach?
OK. One last question: for negative values, should it support WxH-X-Y syntax (harder to implement) or just WxH+-X+-Y syntax (easier to implement)?
Em 03/05/2014 14:02, "Keith Packard" <kei...@keithp.com> escreveu:
> You should use XParseGeometry or even XWMGeometry. If you want to avoid
> Xlib, you should hack those functions into something that could be
> included in an xcb utility library (probably util-wm).
>
> I couldn't find anything suitable in xcb yet, but I didn't do more than
> a few simple greps; maybe there's already something to do this?
Kdrive has its own "geometry" parsing algorithm, the function KdParseScreen() in file kdrive.c. I've extended it to include +X+Y parsing. See my previous patch at http://lists.x.org/archives/xorg-devel/2014-February/040606.html
This patch supports -X-Y syntax, but I could simplify it by supporting +-X+-Y only, so that the character + can be interpreted as the only delimiter for window placement.