@@ -95,36 +95,7 @@ int SystemProperties::getRefreshRate(int displayIndex)
9595 return monitorRefreshRates.value (displayIndex);
9696}
9797
98- class QuerySdlVideoThread : public QThread
99- {
100- public:
101- QuerySdlVideoThread (SystemProperties* me) :
102- QThread (nullptr ),
103- m_Me (me) {}
104-
105- void run () override
106- {
107- m_Me->querySdlVideoInfoInternal ();
108- }
109-
110- SystemProperties* m_Me;
111- };
112-
11398void SystemProperties::querySdlVideoInfo ()
114- {
115- if (WMUtils::isRunningX11 () || WMUtils::isRunningWayland ()) {
116- // Use a separate thread to temporarily initialize SDL
117- // video to avoid stomping on Qt's X11 and OGL state.
118- QuerySdlVideoThread thread (this );
119- thread.start ();
120- thread.wait ();
121- }
122- else {
123- querySdlVideoInfoInternal ();
124- }
125- }
126-
127- void SystemProperties::querySdlVideoInfoInternal ()
12899{
129100 hasHardwareAcceleration = false ;
130101
@@ -136,8 +107,7 @@ void SystemProperties::querySdlVideoInfoInternal()
136107 }
137108
138109 // Update display related attributes (max FPS, native resolution, etc).
139- // We call the internal variant because we're already in a safe thread context.
140- refreshDisplaysInternal ();
110+ refreshDisplays ();
141111
142112 SDL_Window* testWindow = SDL_CreateWindow (" " , 0 , 0 , 1280 , 720 ,
143113 SDL_WINDOW_HIDDEN | StreamUtils::getPlatformWindowFlags ());
@@ -163,36 +133,7 @@ void SystemProperties::querySdlVideoInfoInternal()
163133 SDL_QuitSubSystem (SDL_INIT_VIDEO );
164134}
165135
166- class RefreshDisplaysThread : public QThread
167- {
168- public:
169- RefreshDisplaysThread (SystemProperties* me) :
170- QThread (nullptr ),
171- m_Me (me) {}
172-
173- void run () override
174- {
175- m_Me->refreshDisplaysInternal ();
176- }
177-
178- SystemProperties* m_Me;
179- };
180-
181136void SystemProperties::refreshDisplays ()
182- {
183- if (WMUtils::isRunningX11 () || WMUtils::isRunningWayland ()) {
184- // Use a separate thread to temporarily initialize SDL
185- // video to avoid stomping on Qt's X11 and OGL state.
186- RefreshDisplaysThread thread (this );
187- thread.start ();
188- thread.wait ();
189- }
190- else {
191- refreshDisplaysInternal ();
192- }
193- }
194-
195- void SystemProperties::refreshDisplaysInternal ()
196137{
197138 if (SDL_InitSubSystem (SDL_INIT_VIDEO ) != 0 ) {
198139 SDL_LogError (SDL_LOG_CATEGORY_APPLICATION ,
0 commit comments