[client,x11] fix rail checks

rail might be deactivated during connect, so ensure that the default
session rendering path properly checks the window pointer
This commit is contained in:
Armin Novak
2023-01-09 08:33:05 +01:00
committed by akallabeth
parent 15ebdd750f
commit d978a0dbdb
3 changed files with 11 additions and 5 deletions

View File

@@ -295,7 +295,13 @@ void xf_draw_screen_(xfContext* xfc, int x, int y, int w, int h, const char* fkt
if (w == 0 || h == 0)
{
WLog_WARN(TAG, "invalid width and/or height specified: w=%d h=%d", w, h);
WLog_WARN(TAG, "[%s] invalid width and/or height specified: w=%d h=%d", __FUNCTION__, w, h);
return;
}
if (!xfc->window)
{
WLog_WARN(TAG, "[%s] invalid xfc->window=%p", __FUNCTION__, xfc->window);
return;
}

View File

@@ -638,7 +638,7 @@ static BOOL xf_event_FocusIn(xfContext* xfc, const XFocusInEvent* event, BOOL ap
/* Release all keys, should already be done at FocusOut but might be missed
* if the WM decided to use an alternate event order */
if (!xfc->remote_app)
if (!app)
xf_keyboard_release_all_keypress(xfc);
xf_pointer_update_scale(xfc);
@@ -878,7 +878,7 @@ static BOOL xf_event_UnmapNotify(xfContext* xfc, const XUnmapEvent* event, BOOL
WINPR_ASSERT(xfc);
WINPR_ASSERT(event);
if (!xfc->remote_app)
if (!app)
xf_keyboard_release_all_keypress(xfc);
if (!app)

View File

@@ -319,7 +319,7 @@ int xf_keyboard_read_keyboard_state(xfContext* xfc)
Window wdummy;
UINT32 state = 0;
if (!xfc->remote_app)
if (!xfc->remote_app && xfc->window)
{
XQueryPointer(xfc->display, xfc->window->handle, &wdummy, &wdummy, &dummy, &dummy, &dummy,
&dummy, &state);
@@ -448,7 +448,7 @@ void xf_keyboard_focus_in(xfContext* xfc)
/* finish with a mouse pointer position like mstsc.exe if required */
if (xfc->remote_app)
if (xfc->remote_app || !xfc->window)
return;
if (XQueryPointer(xfc->display, xfc->window->handle, &w, &w, &d, &d, &x, &y, &state))