From 7bf4d963b490aa14e81958c952a189163cded5fc Mon Sep 17 00:00:00 2001 From: "Pierre-Loup A. Griffais" Date: Tue, 31 Dec 2019 17:21:54 +0900 Subject: [PATCH] x11: With great power comes great responsibility, I guess. The WL_SURFACE_ID messages force us to register SubstructureRedirectMask, which means we have to participate in a bunch more stuff before windows will resize and reconfigure properly. This fixes a bunch of problems with real games. --- src/steamcompmgr.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/steamcompmgr.c b/src/steamcompmgr.c index 7715aaf..a2faa15 100644 --- a/src/steamcompmgr.c +++ b/src/steamcompmgr.c @@ -1348,6 +1348,27 @@ static void map_request (Display *dpy, XMapRequestEvent *mapRequest) XMapWindow( dpy, mapRequest->window ); } +static void configure_request (Display *dpy, XConfigureRequestEvent *configureRequest) +{ + XWindowChanges changes = + { + .x = configureRequest->x, + .y = configureRequest->y, + .width = configureRequest->width, + .height = configureRequest->height, + .border_width = configureRequest->border_width, + .sibling = configureRequest->above, + .stack_mode = configureRequest->detail + }; + + XConfigureWindow( dpy, configureRequest->window, configureRequest->value_mask, &changes ); +} + +static void circulate_request ( Display *dpy, XCirculateRequestEvent *circulateRequest ) +{ + XCirculateSubwindows( dpy, circulateRequest->window, circulateRequest->place ); +} + static void finish_destroy_win (Display *dpy, Window id, Bool gone) { @@ -1839,10 +1860,16 @@ steamcompmgr_main (int argc, char **argv) } break; case CirculateNotify: - circulate_win (dpy, &ev.xcirculate); + circulate_win(dpy, &ev.xcirculate); break; case MapRequest: - map_request (dpy, &ev.xmaprequest); + map_request(dpy, &ev.xmaprequest); + break; + case ConfigureRequest: + configure_request(dpy, &ev.xconfigurerequest); + break; + case CirculateRequest: + circulate_request(dpy, &ev.xcirculaterequest); break; case Expose: break;