aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/ephyr/hostx.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-03-25 10:20:34 +0100
committermarha <marha@users.sourceforge.net>2013-04-11 11:13:37 +0200
commitdde22e946ccfb0bd937224daf42403b80528c2a6 (patch)
treec4235cb922c8cd854bc3ef2e670bb6802dc743de /xorg-server/hw/kdrive/ephyr/hostx.c
parentaccd8a3364ffd1e91a4ab52b06b5e3b9d250ae92 (diff)
downloadvcxsrv-dde22e946ccfb0bd937224daf42403b80528c2a6.tar.gz
vcxsrv-dde22e946ccfb0bd937224daf42403b80528c2a6.tar.bz2
vcxsrv-dde22e946ccfb0bd937224daf42403b80528c2a6.zip
fontconfig mesa pixman xserver git update 25 Mar 2013
xserver commit 2967391c6d35f03121afa8003e0fb94b62495129 pixman commit d8ac35af1208a4fa4d67f03fee10b5449fb8495a fontconfig commit b561ff2016ce84eef3c81f16dfb0481be6a13f9b mesa commit 92b8a37fdfff9e83f39b8885f51ed2f60326ab6a
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr/hostx.c')
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c43
1 files changed, 29 insertions, 14 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index 157ac36b2..f2b458d90 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -117,6 +117,8 @@ extern EphyrKeySyms ephyrKeySyms;
extern int monitorResolution;
+extern Bool EphyrWantResize;
+
char *ephyrResName = NULL;
int ephyrResNameFromCmd = 0;
char *ephyrTitle = NULL;
@@ -617,7 +619,8 @@ hostx_set_cmap_entry(unsigned char idx,
*/
void *
hostx_screen_init(EphyrScreenInfo screen,
- int width, int height, int buffer_height)
+ int width, int height, int buffer_height,
+ int *bytes_per_line, int *bits_per_pixel)
{
int bitmap_pad;
Bool shm_success = False;
@@ -694,10 +697,13 @@ hostx_screen_init(EphyrScreenInfo screen,
malloc(host_screen->ximg->bytes_per_line * buffer_height);
}
+ *bytes_per_line = host_screen->ximg->bytes_per_line;
+ *bits_per_pixel = host_screen->ximg->bits_per_pixel;
+
XResizeWindow(HostX.dpy, host_screen->win, width, height);
/* Ask the WM to keep our size static */
- if (host_screen->win_pre_existing == None) {
+ if (host_screen->win_pre_existing == None && !EphyrWantResize) {
size_hints = XAllocSizeHints();
size_hints->max_width = size_hints->min_width = width;
size_hints->max_height = size_hints->min_height = height;
@@ -858,7 +864,7 @@ hostx_load_keymap(void)
(max_keycode - min_keycode + 1) *
width);
if (!ephyrKeySyms.map)
- return;
+ goto out;
for (i = 0; i < (max_keycode - min_keycode + 1); i++)
for (j = 0; j < width; j++)
@@ -871,6 +877,7 @@ hostx_load_keymap(void)
ephyrKeySyms.maxKeyCode = max_keycode;
ephyrKeySyms.mapWidth = width;
+ out:
XFree(keymap);
}
@@ -1011,19 +1018,27 @@ hostx_get_event(EphyrHostXEvent * ev)
case ConfigureNotify:
{
- struct EphyrHostScreen *host_screen =
- host_screen_from_window(xev.xconfigure.window);
-
- if (host_screen && host_screen->win_pre_existing != None) {
- ev->type = EPHYR_EV_CONFIGURE;
- ev->data.configure.width = xev.xconfigure.width;
- ev->data.configure.height = xev.xconfigure.height;
- ev->data.configure.window = xev.xconfigure.window;
- ev->data.configure.screen = host_screen->mynum;
- return 1;
+ struct EphyrHostScreen *host_screen;
+
+ /* event compression as for Expose events, cause
+ * we don't want to resize the framebuffer for
+ * every single change */
+ while (XCheckTypedWindowEvent(HostX.dpy, xev.xconfigure.window,
+ ConfigureNotify, &xev));
+ host_screen = host_screen_from_window(xev.xconfigure.window);
+
+ if (!host_screen ||
+ (host_screen->win_pre_existing == None && !EphyrWantResize)) {
+ return 0;
}
- return 0;
+ ev->type = EPHYR_EV_CONFIGURE;
+ ev->data.configure.width = xev.xconfigure.width;
+ ev->data.configure.height = xev.xconfigure.height;
+ ev->data.configure.window = xev.xconfigure.window;
+ ev->data.configure.screen = host_screen->mynum;
+
+ return 1;
}
default:
break;