Skip to content

Commit

Permalink
ephyr: Don't configure window while responding to configure events
Browse files Browse the repository at this point in the history
This leads to and endless sequence of window resizes.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
  • Loading branch information
keith-packard committed Jun 20, 2016
1 parent fb1edcc commit 235d216
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hw/kdrive/ephyr/ephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ ephyrResizeScreen (ScreenPtr pScreen,
size.width = newwidth;
size.height = newheight;

hostx_size_set_from_configure(TRUE);
ret = ephyrRandRSetConfig (pScreen, screen->randr, 0, &size);
hostx_size_set_from_configure(FALSE);
if (ret) {
RROutputPtr output;

Expand Down
8 changes: 8 additions & 0 deletions hw/kdrive/ephyr/hostx.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct EphyrHostXVars {
KdScreenInfo **screens;

long damage_debug_msec;
Bool size_set_from_configure;
};

/* memset ( missing> ) instead of below */
Expand Down Expand Up @@ -878,6 +879,7 @@ hostx_screen_init(KdScreenInfo *screen,
xallocarray(scrpriv->ximg->stride, buffer_height);
}

if (!HostX.size_set_from_configure)
{
uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
uint32_t values[2] = {width, height};
Expand Down Expand Up @@ -1213,6 +1215,12 @@ hostx_load_keymap(KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr controls)
return TRUE;
}

void
hostx_size_set_from_configure(Bool ss)
{
HostX.size_set_from_configure = ss;
}

xcb_connection_t *
hostx_get_xcbconn(void)
{
Expand Down
3 changes: 3 additions & 0 deletions hw/kdrive/ephyr/hostx.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ hostx_paint_rect(KdScreenInfo *screen,
Bool
hostx_load_keymap(KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr controls);

void
hostx_size_set_from_configure(Bool);

xcb_connection_t *
hostx_get_xcbconn(void);

Expand Down

0 comments on commit 235d216

Please sign in to comment.