Follow up to #7832: Add NULL checks

This commit is contained in:
akallabeth 2022-04-27 21:44:40 +02:00 committed by akallabeth
parent a005472337
commit d3e1810473
2 changed files with 17 additions and 6 deletions

View File

@ -910,22 +910,27 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, const XPropertyEvent* event,
if (status)
{
appWindow->maxVert = FALSE;
appWindow->maxHorz = FALSE;
if (appWindow)
{
appWindow->maxVert = FALSE;
appWindow->maxHorz = FALSE;
}
for (i = 0; i < nitems; i++)
{
if ((Atom)((UINT16**)prop)[i] ==
XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_VERT", False))
{
maxVert = TRUE;
appWindow->maxVert = TRUE;
if (appWindow)
appWindow->maxVert = TRUE;
}
if ((Atom)((UINT16**)prop)[i] ==
XInternAtom(xfc->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False))
{
maxHorz = TRUE;
appWindow->maxHorz = TRUE;
if (appWindow)
appWindow->maxHorz = TRUE;
}
}
@ -944,12 +949,14 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, const XPropertyEvent* event,
if (((UINT32)*prop == 3))
{
minimized = TRUE;
appWindow->minimized = TRUE;
if (appWindow)
appWindow->minimized = TRUE;
}
else
{
minimized = FALSE;
appWindow->minimized = FALSE;
if (appWindow)
appWindow->minimized = FALSE;
}
minimizedChanged = TRUE;
@ -959,6 +966,7 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, const XPropertyEvent* event,
if (app)
{
WINPR_ASSERT(appWindow);
if (appWindow->maxVert && appWindow->maxHorz && !appWindow->minimized)
{
if(appWindow->rail_state != WINDOW_SHOW_MAXIMIZED)

View File

@ -965,6 +965,9 @@ void xf_MoveWindow(xfContext* xfc, xfAppWindow* appWindow, int x, int y, int wid
void xf_ShowWindow(xfContext* xfc, xfAppWindow* appWindow, BYTE state)
{
WINPR_ASSERT(xfc);
WINPR_ASSERT(appWindow);
switch (state)
{
case WINDOW_HIDE: