-/*
- * honor_configreq: allow fussy windows to work in scrotwm
- *
- * XEmacs (and maybe other applications) expects ConfigureNotify
- * events that exactly match the ConfigureRequests that it generates.
- * Because Scrotwm specifies both the location *and* size of new
- * windows, these applications will not be satisfied and will repeat
- * the request forever. This bogs down the system and makes the
- * application unusable.
- *
- * To resolve this conflict, this function responds to ConfigureRequest
- * by sending a ConfigureNotify that contains the requested dimensions.
- * It then resizes the window to the dimensions computed by scrotwm.
- * And then it gets stranger still: after the initial response, the
- * height stored in window manager's dimensions needs to be different
- * than the value initially computed. If it's not, the window contents
- * aren't resized to fill the frame.
- *
- */
-void honor_configreq (
- struct ws_win* win,
- XConfigureRequestEvent* ev
- )
-{
- XConfigureEvent ce;
-
- ce.type = ConfigureNotify;
- ce.display = ev->display;
- ce.event = ev->window;
- ce.window = ev->window;
- ce.x = ev->x;
- ce.y = ev->y;
- ce.width = ev->width;
- ce.height = ev->height;
- ce.border_width = ev->border_width;
- ce.above = ev->above;
- ce.override_redirect = False;
-
- XSendEvent(ev->display, ev->window, False, StructureNotifyMask,
- (XEvent *)&ce);
-
- XResizeWindow(display, ev->window, win->g.w, win->g.h);
-
- if (win->init_configreq_tweak_done == 0) {
- win->init_configreq_tweak_done = 1;
- win->g.h--;
- }
-}
-