File tree Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Original file line number Diff line number Diff line change 2828
2929#include <dix-config.h>
3030
31+ #include <stdbool.h>
32+
3133#include "dix/screen_hooks_priv.h"
3234#include "dix/screenint_priv.h"
3335#include "miext/extinit_priv.h"
@@ -272,27 +274,30 @@ SRRNotifyEvent(xEvent *from, xEvent *to)
272274 }
273275}
274276
275- static x_server_generation_t RRGeneration ;
277+ static bool initialized = false ;
276278
277279Bool
278280RRInit (void )
279281{
280- if (RRGeneration != serverGeneration ) {
281- if (!RRModeInit ())
282- return FALSE;
283- if (!RRCrtcInit ())
284- return FALSE;
285- if (!RROutputInit ())
286- return FALSE;
287- if (!RRProviderInit ())
288- return FALSE;
289- if (!RRLeaseInit ())
290- return FALSE;
291- RRGeneration = serverGeneration ;
292- }
282+ /* prevent double init attempts */
283+ if (initialized )
284+ return TRUE;
285+
286+ if (!RRModeInit ())
287+ return FALSE;
288+ if (!RRCrtcInit ())
289+ return FALSE;
290+ if (!RROutputInit ())
291+ return FALSE;
292+ if (!RRProviderInit ())
293+ return FALSE;
294+ if (!RRLeaseInit ())
295+ return FALSE;
296+
293297 if (!dixRegisterPrivateKey (& rrPrivKeyRec , PRIVATE_SCREEN , 0 ))
294298 return FALSE;
295299
300+ initialized = true;
296301 return TRUE;
297302}
298303
You can’t perform that action at this time.
0 commit comments