mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
treewide: use inline helper for accessing first screen
Instead of everybody directly accessing the (internal) screenInfo struct, let those consumers only interested in first screen use a little helper. Also caching the value if it's needed several times. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
d0a155c824
commit
6bc438ab5a
@@ -35,6 +35,7 @@
|
||||
#include <xwin-config.h>
|
||||
#endif
|
||||
|
||||
#include "dix/screenint_priv.h"
|
||||
#include "mi/mi_priv.h"
|
||||
|
||||
#include "win.h"
|
||||
@@ -256,8 +257,8 @@ winRestoreModeKeyStates(void)
|
||||
|
||||
/* Only process events if the rootwindow is mapped. The keyboard events
|
||||
* will cause segfaults otherwise */
|
||||
if (screenInfo.screens[0]->root &&
|
||||
screenInfo.screens[0]->root->mapped == FALSE)
|
||||
ScreenPtr firstScreen = dixGetFirstScreenPtr();
|
||||
if (firstScreen->root && firstScreen->root->mapped == FALSE)
|
||||
processEvents = FALSE;
|
||||
|
||||
/* Force to process all pending events in the mi event queue */
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include <xwin-config.h>
|
||||
#endif
|
||||
|
||||
#include "dix/screenint_priv.h"
|
||||
|
||||
#include "win.h"
|
||||
|
||||
/*
|
||||
@@ -56,7 +58,7 @@ winMsgWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
has set the DE_TERMINATE flag so exits the msg dispatch loop.
|
||||
*/
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[0];
|
||||
ScreenPtr pScreen = dixGetFirstScreenPtr();
|
||||
|
||||
winScreenPriv(pScreen);
|
||||
PostMessage(pScreenPriv->hwndScreen, WM_GIVEUP, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user