summaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-08-20 16:56:04 -0400
committerAdam Jackson <ajax@redhat.com>2009-08-20 17:11:57 -0400
commit9d8fc33cae2fee7777edd20658dbf6a3ffb3d557 (patch)
tree558b030a1b3c8d102ccb4e61639bf1804c906b5f /composite
parentae68708ebe24c4cdf8c5265e206f6913d9298f37 (diff)
composite: Move screen init before extension registration.
Otherwise, you'd still advertise the extension even if no screens actually supported it, and the first Composite protocol request would probably crash.
Diffstat (limited to 'composite')
-rw-r--r--composite/compext.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/composite/compext.c b/composite/compext.c
index 608f29a8a..56b4f2784 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -569,9 +569,14 @@ CompositeExtensionInit (void)
if (!dixRequestPrivate(CompositeClientPrivateKey,
sizeof(CompositeClientRec)))
return;
+
if (!AddCallback (&ClientStateCallback, CompositeClientCallback, 0))
return;
+ for (s = 0; s < screenInfo.numScreens; s++)
+ if (!compScreenInit (screenInfo.screens[s]))
+ return;
+
extEntry = AddExtension (COMPOSITE_NAME, 0, 0,
ProcCompositeDispatch, SProcCompositeDispatch,
NULL, StandardMinorOpcode);
@@ -579,9 +584,6 @@ CompositeExtensionInit (void)
return;
CompositeReqCode = (CARD8) extEntry->base;
- for (s = 0; s < screenInfo.numScreens; s++)
- if (!compScreenInit (screenInfo.screens[s]))
- return;
miRegisterRedirectBorderClipProc (compSetRedirectBorderClip,
compGetRedirectBorderClip);