[PATCH xserver 2/5] ephyr: Don't configure window while responding to configure events

Keith Packard keithp at keithp.com
Tue Jun 14 21:02:48 UTC 2016


This leads to and endless sequence of window resizes.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/kdrive/ephyr/ephyr.c | 2 ++
 hw/kdrive/ephyr/hostx.c | 8 ++++++++
 hw/kdrive/ephyr/hostx.h | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 2114c1c..2bc5ccc 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -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;
 
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index cdb12b0..d84c33b 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -79,6 +79,7 @@ struct EphyrHostXVars {
     KdScreenInfo **screens;
 
     long damage_debug_msec;
+    Bool size_set_from_configure;
 };
 
 /* memset ( missing> ) instead of below  */
@@ -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};
@@ -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)
 {
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index 96d7394..6e0b07b 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -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);
 
-- 
2.8.1



More information about the xorg-devel mailing list