[PATCH v2 1/2] ephyr: allow starting window at other than 0, 0 location (via kdrive -origin option)
Laércio de Sousa
lbsousajr at gmail.com
Wed Apr 30 06:36:07 PDT 2014
From: Loic Grenie <loic.grenie at gmail.com>
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 <lbsousajr at 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);
--
1.8.4.5
More information about the xorg-devel
mailing list