mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[client,x11] fix rails/desktop switch
* Add TODO log entries for (non)monitored desktop messages * Enable/disable RAILS mode according to these messages
This commit is contained in:
@@ -780,14 +780,15 @@ static BOOL xf_rail_window_icon(rdpContext* context, const WINDOW_ORDER_INFO* or
|
||||
|
||||
if (!icon)
|
||||
{
|
||||
WLog_WARN(TAG, "failed to get icon from cache %02X:%04X", windowIcon->iconInfo->cacheId,
|
||||
windowIcon->iconInfo->cacheEntry);
|
||||
WLog_Print(xfc->log, WLOG_WARN, "failed to get icon from cache %02X:%04X",
|
||||
windowIcon->iconInfo->cacheId, windowIcon->iconInfo->cacheEntry);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!convert_rail_icon(windowIcon->iconInfo, icon))
|
||||
{
|
||||
WLog_WARN(TAG, "failed to convert icon for window %08X", orderInfo->windowId);
|
||||
WLog_Print(xfc->log, WLOG_WARN, "failed to convert icon for window %08X",
|
||||
orderInfo->windowId);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -816,8 +817,8 @@ static BOOL xf_rail_window_cached_icon(rdpContext* context, const WINDOW_ORDER_I
|
||||
|
||||
if (!icon)
|
||||
{
|
||||
WLog_WARN(TAG, "failed to get icon from cache %02X:%04X",
|
||||
windowCachedIcon->cachedIcon.cacheId, windowCachedIcon->cachedIcon.cacheEntry);
|
||||
WLog_Print(xfc->log, WLOG_WARN, "failed to get icon from cache %02X:%04X",
|
||||
windowCachedIcon->cachedIcon.cacheId, windowCachedIcon->cachedIcon.cacheEntry);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -883,7 +884,50 @@ xf_rail_monitored_desktop(WINPR_ATTR_UNUSED rdpContext* context,
|
||||
WINPR_ATTR_UNUSED const WINDOW_ORDER_INFO* orderInfo,
|
||||
WINPR_ATTR_UNUSED const MONITORED_DESKTOP_ORDER* monitoredDesktop)
|
||||
{
|
||||
WLog_ERR("TODO", "TODO: implement");
|
||||
const UINT32 mask = WINDOW_ORDER_TYPE_DESKTOP | WINDOW_ORDER_FIELD_DESKTOP_HOOKED |
|
||||
WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN |
|
||||
WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED |
|
||||
WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND | WINDOW_ORDER_FIELD_DESKTOP_ZORDER;
|
||||
xfContext* xfc = (xfContext*)context;
|
||||
|
||||
if (!context || !orderInfo || !monitoredDesktop)
|
||||
return FALSE;
|
||||
|
||||
if ((orderInfo->fieldFlags & WINDOW_ORDER_TYPE_DESKTOP) == 0)
|
||||
{
|
||||
WLog_Print(xfc->log, WLOG_WARN, "WINDOW_ORDER_TYPE_DESKTOP flag missing!");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN) &&
|
||||
(orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_HOOKED))
|
||||
{
|
||||
// discard all windows/notify icons
|
||||
WLog_Print(xfc->log, WLOG_WARN,
|
||||
"TODO: implement WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN && "
|
||||
"WINDOW_ORDER_FIELD_DESKTOP_HOOKED");
|
||||
}
|
||||
else if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_HOOKED)
|
||||
{
|
||||
WLog_Print(xfc->log, WLOG_WARN, "TODO: implement WINDOW_ORDER_FIELD_DESKTOP_HOOKED");
|
||||
}
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED)
|
||||
{
|
||||
WLog_DBG(TAG, "WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED -> switch to RAILS mode");
|
||||
xf_rail_enable_remoteapp_mode(xfc);
|
||||
}
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND)
|
||||
{
|
||||
WLog_Print(xfc->log, WLOG_WARN, "TODO: implement WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND");
|
||||
}
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER)
|
||||
{
|
||||
WLog_Print(xfc->log, WLOG_WARN, "TODO: implement WINDOW_ORDER_FIELD_DESKTOP_ZORDER");
|
||||
}
|
||||
if (orderInfo->fieldFlags & ~mask)
|
||||
{
|
||||
WLog_Print(xfc->log, WLOG_WARN, "unknown flags 0x%08" PRIx32 "!", orderInfo->fieldFlags);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -891,6 +935,25 @@ static BOOL xf_rail_non_monitored_desktop(rdpContext* context,
|
||||
WINPR_ATTR_UNUSED const WINDOW_ORDER_INFO* orderInfo)
|
||||
{
|
||||
xfContext* xfc = (xfContext*)context;
|
||||
const UINT32 mask = WINDOW_ORDER_TYPE_DESKTOP | WINDOW_ORDER_FIELD_DESKTOP_NONE;
|
||||
|
||||
if (!context || !orderInfo)
|
||||
return FALSE;
|
||||
|
||||
if ((orderInfo->fieldFlags & WINDOW_ORDER_TYPE_DESKTOP) == 0)
|
||||
{
|
||||
WLog_Print(xfc->log, WLOG_WARN, "TODO: implement WINDOW_ORDER_TYPE_DESKTOP");
|
||||
return FALSE;
|
||||
}
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_NONE)
|
||||
{
|
||||
WLog_Print(xfc->log, WLOG_WARN, "TODO: implement WINDOW_ORDER_FIELD_DESKTOP_NONE");
|
||||
}
|
||||
if (orderInfo->fieldFlags & ~mask)
|
||||
{
|
||||
WLog_Print(xfc->log, WLOG_WARN, "unknown flags 0x%08" PRIx32 "!", orderInfo->fieldFlags);
|
||||
}
|
||||
|
||||
xf_rail_disable_remoteapp_mode(xfc);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -936,10 +999,6 @@ static UINT xf_rail_server_execute_result(RailClientContext* context,
|
||||
error_code_names[execResult->execResult], execResult->rawResult);
|
||||
freerdp_abort_connect_context(&xfc->common.context);
|
||||
}
|
||||
else
|
||||
{
|
||||
xf_rail_enable_remoteapp_mode(xfc);
|
||||
}
|
||||
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
@@ -752,3 +752,16 @@ char* getConfigOption(BOOL system, const char* option)
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
int LogDynAndXRestackWindows_ex(wLog* log, const char* file, const char* fkt, size_t line,
|
||||
Display* display, Window* windows, int nwindows)
|
||||
{
|
||||
if (WLog_IsLevelActive(log, log_level))
|
||||
{
|
||||
write_log(log, log_level, file, fkt, line, "XRestackWindows(%p, %p, %d)", (void*)display,
|
||||
windows, nwindows);
|
||||
}
|
||||
const int rc = XRestackWindows(display, windows, nwindows);
|
||||
return write_result_log_expect_one(log, WLOG_WARN, file, fkt, line, display, "XRestackWindows",
|
||||
rc);
|
||||
}
|
||||
|
||||
@@ -288,6 +288,11 @@ extern int LogDynAndXFillRectangle_ex(wLog* log, const char* file, const char* f
|
||||
extern int LogDynAndXSetFunction_ex(wLog* log, const char* file, const char* fkt, size_t line,
|
||||
Display* display, GC gc, int function);
|
||||
|
||||
#define LogDynAndXRestackWindows(log, display, windows, count) \
|
||||
LogDynAndXRestackWindows_ex(log, __FILE__, __func__, __LINE__, (display), (windows), (count))
|
||||
extern int LogDynAndXRestackWindows_ex(wLog* log, const char* file, const char* fkt, size_t line,
|
||||
Display* display, Window* windows, int nwindows);
|
||||
|
||||
BOOL IsGnome(void);
|
||||
|
||||
char* getConfigOption(BOOL system, const char* option);
|
||||
|
||||
Reference in New Issue
Block a user