diff options
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr/hostx.c')
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/hostx.c | 43 |
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 be5ac6bd5..438c9f76f 100644 --- a/xorg-server/hw/kdrive/ephyr/hostx.c +++ b/xorg-server/hw/kdrive/ephyr/hostx.c @@ -119,6 +119,8 @@ extern EphyrKeySyms ephyrKeySyms; extern int monitorResolution; +extern Bool EphyrWantResize; + char *ephyrResName = NULL; int ephyrResNameFromCmd = 0; char *ephyrTitle = NULL; @@ -627,7 +629,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; @@ -713,10 +716,13 @@ __asm int 3; 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; @@ -885,7 +891,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++) @@ -898,6 +904,7 @@ hostx_load_keymap(void) ephyrKeySyms.maxKeyCode = max_keycode; ephyrKeySyms.mapWidth = width; + out: XFree(keymap); } @@ -1038,19 +1045,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; |