[client,x11] log XFlush

This commit is contained in:
akallabeth
2025-05-22 19:47:41 +02:00
parent 03f20da4e6
commit 1b1a7d35ec
6 changed files with 35 additions and 11 deletions

View File

@@ -471,7 +471,7 @@ static BOOL xf_end_paint(rdpContext* context)
return FALSE;
}
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
xf_unlock_x11(xfc);
}
@@ -716,7 +716,7 @@ BOOL xf_create_window(xfContext* xfc)
XFillRectangle(xfc->display, xfc->primary, xfc->gc, 0, 0,
freerdp_settings_get_uint32(settings, FreeRDP_DesktopWidth),
freerdp_settings_get_uint32(settings, FreeRDP_DesktopHeight));
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
return TRUE;
}

View File

@@ -1645,7 +1645,7 @@ static BOOL xf_cliprdr_process_selection_request(xfClipboard* clipboard,
conv.sev = respond;
LogDynAndXSendEvent(xfc->log, xfc->display, xevent->requestor, 0, 0, conv.ev);
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
free(respond);
}
@@ -1954,7 +1954,7 @@ static void xf_cliprdr_prepare_to_set_selection_owner(xfContext* xfc, xfClipboar
LogTagAndXChangeProperty(TAG, xfc->display, xfc->drawable, clipboard->timestamp_property_atom,
XA_ATOM, 32, PropModeReplace, (const BYTE*)&value, 1);
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
}
static void xf_cliprdr_set_selection_owner(xfContext* xfc, xfClipboard* clipboard, Time timestamp)
@@ -1968,7 +1968,7 @@ static void xf_cliprdr_set_selection_owner(xfContext* xfc, xfClipboard* clipboar
clipboard->selection_ownership_timestamp = timestamp;
XSetSelectionOwner(xfc->display, clipboard->clipboard_atom, xfc->drawable, timestamp);
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
}
/**
@@ -2143,7 +2143,7 @@ xf_cliprdr_server_format_data_request(CliprdrClientContext* context,
format->localFormat, format->formatName);
LogTagAndXConvertSelection(TAG, xfc->display, clipboard->clipboard_atom, format->atom,
clipboard->property_atom, xfc->drawable, CurrentTime);
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
/* After this point, we expect a SelectionNotify event from the clipboard owner. */
return CHANNEL_RC_OK;
}
@@ -2370,7 +2370,7 @@ xf_cliprdr_server_format_data_response(CliprdrClientContext* context,
conv.sev = clipboard->respond;
LogDynAndXSendEvent(xfc->log, xfc->display, clipboard->respond->requestor, 0, 0, conv.ev);
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
}
free(clipboard->respond);
clipboard->respond = NULL;

View File

@@ -759,7 +759,7 @@ static void xf_rail_set_window_icon(xfContext* xfc, xfAppWindow* railWindow, xfR
LogTagAndXChangeProperty(TAG, xfc->display, railWindow->handle, xfc->NET_WM_ICON, XA_CARDINAL,
32, replace ? PropModeReplace : PropModeAppend,
(unsigned char*)icon->data, icon->length);
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
}
static BOOL xf_rail_window_icon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo,

View File

@@ -396,3 +396,22 @@ int LogDynAndXSendEvent_ex(wLog* log, const char* file, const char* fkt, size_t
}
return rc;
}
int LogDynAndXFlush_ex(wLog* log, const char* file, const char* fkt, size_t line, Display* display)
{
if (WLog_IsLevelActive(log, log_level))
{
write_log(log, log_level, file, fkt, line, "XFlush(%p)", display);
}
const int rc = XFlush(display);
if (rc < 0)
{
char buffer[128] = { 0 };
const DWORD lvl = WLOG_WARN;
WLog_Print(log, lvl, "XFlush returned %s",
error_to_string(display, rc, buffer, sizeof(buffer)));
}
return rc;
}

View File

@@ -127,4 +127,9 @@ extern Status LogDynAndXSendEvent_ex(wLog* log, const char* file, const char* fk
Display* display, Window w, Bool propagate, long event_mask,
XEvent* event_send);
#define LogDynAndXFlush(log, display) \
LogDynAndXFlush_ex(log, __FILE__, __func__, __LINE__, (display))
extern Status LogDynAndXFlush_ex(wLog* log, const char* file, const char* fkt, size_t line,
Display* display);
BOOL IsGnome(void);

View File

@@ -1273,7 +1273,7 @@ void xf_ShowWindow(xfContext* xfc, xfAppWindow* appWindow, BYTE state)
/* Save the current rail state of this window */
appWindow->rail_state = state;
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
}
void xf_SetWindowRects(xfContext* xfc, xfAppWindow* appWindow, RECTANGLE_16* rects, int nrects)
@@ -1365,7 +1365,7 @@ void xf_UpdateWindowArea(xfContext* xfc, xfAppWindow* appWindow, int x, int y, i
LogDynAndXCopyArea(xfc->log, xfc->display, appWindow->pixmap, appWindow->handle, appWindow->gc,
x, y, WINPR_ASSERTING_INT_CAST(uint32_t, width),
WINPR_ASSERTING_INT_CAST(uint32_t, height), x, y);
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
xf_unlock_x11(xfc);
}
@@ -1524,7 +1524,7 @@ UINT xf_AppUpdateWindowFromSurface(xfContext* xfc, gdiGfxSurface* surface)
rc = CHANNEL_RC_OK;
fail:
XFlush(xfc->display);
LogDynAndXFlush(xfc->log, xfc->display);
xf_unlock_x11(xfc);
return rc;
}