Around 17 o'clock on Jun 26, Soeren Sandmann wrote:
> The behaviour where the client stops drawing completely is not
> difficult to get with a moderately complex gtk+ 2.0 application and
> the X server running without -dumbScheduler.
Please give the enclosed patch a try -- it transfers scheduling credits
from the WM to the app on reconfigure. It works quite nicely in my tests,
making a marked improvement in mozilla resize behaviour.
-keith
Index: dispatch.c
===================================================================
RCS file: /home/x-cvs/xc/programs/Xserver/dix/dispatch.c,v
retrieving revision 3.27
diff -u -r3.27 dispatch.c
--- dispatch.c 19 Feb 2002 11:09:21 -0000 3.27
+++ dispatch.c 26 Jun 2002 17:01:47 -0000
@@ -344,6 +344,43 @@
}
return best;
}
+
+/*
+ * When a window manager manipulates a client window,
+ * swap scheduling priority between the two so that the
+ * client runs next.
+ */
+void
+SmartScheduleYield (ClientPtr current_client, XID next_rid)
+{
+ int next_index = CLIENT_ID (next_rid);
+ ClientPtr next_client;
+
+ if (next_index && (next_client = clients[next_index]) &&
+ next_client != current_client)
+ {
+ if (current_client->smart_priority > 0)
+ {
+ long bonus = current_client->smart_priority;
+ ErrorF ("0x%x/%d yielding to 0x%x/%d\n",
+ current_client->clientAsMask,
+ current_client->smart_priority,
+ next_client->clientAsMask,
+ next_client->smart_priority);
+ current_client->smart_priority = 0;
+ next_client->smart_priority += bonus;
+ if (next_client->smart_priority > SMART_MAX_PRIORITY)
+ next_client->smart_priority = SMART_MAX_PRIORITY;
+ }
+ }
+
+}
+#define CHECK_YIELDTO(c,id) (((c)->clientAsMask != ((id) & ~RESOURCE_ID_MASK))?\
+ SmartScheduleYield((c),(id)) : (void) 0)
+#endif
+
+#ifndef CHECK_YIELDTO
+#define CHECK_YIELDTO(c,id)
#endif
#define MAJOROP ((xReq *)client->requestBuffer)->reqType
@@ -686,6 +723,7 @@
if (!pWin)
return(BadWindow);
MapWindow(pWin, client);
+ CHECK_YIELDTO(client,stuff->id);
/* update cache to say it is mapped */
return(client->noClientException);
}
@@ -759,6 +797,7 @@
return BadLength;
result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1],
client);
+ CHECK_YIELDTO(client,stuff->window);
if (client->noClientException != Success)
return(client->noClientException);
else