summaryrefslogtreecommitdiffstats
path: root/client/Wayland/wlfreerdp.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:11 +0000
commit941f9937e0744d18de4cc0afa71e0caa925d82ac (patch)
tree67872b86dbf72d73e91188bf8de12594668fe4aa /client/Wayland/wlfreerdp.c
parentAdding upstream version 3.3.0+dfsg1. (diff)
downloadfreerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.tar.xz
freerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.zip
Adding upstream version 3.5.0+dfsg1.upstream/3.5.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'client/Wayland/wlfreerdp.c')
-rw-r--r--client/Wayland/wlfreerdp.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/client/Wayland/wlfreerdp.c b/client/Wayland/wlfreerdp.c
index 037c999..3007d41 100644
--- a/client/Wayland/wlfreerdp.c
+++ b/client/Wayland/wlfreerdp.c
@@ -224,29 +224,29 @@ static BOOL wl_pre_connect(freerdp* instance)
static BOOL wl_post_connect(freerdp* instance)
{
- rdpGdi* gdi = NULL;
- UwacWindow* window = NULL;
- wlfContext* context = NULL;
- rdpSettings* settings = NULL;
- char* title = "FreeRDP";
- char* app_id = "wlfreerdp";
- UINT32 w = 0;
- UINT32 h = 0;
-
if (!instance || !instance->context)
return FALSE;
- context = (wlfContext*)instance->context;
- settings = instance->context->settings;
+ wlfContext* context = (wlfContext*)instance->context;
+ WINPR_ASSERT(context);
+ rdpSettings* settings = instance->context->settings;
+ WINPR_ASSERT(settings);
+
+ const char* title = "FreeRDP";
const char* wtitle = freerdp_settings_get_string(settings, FreeRDP_WindowTitle);
if (wtitle)
title = wtitle;
+ const char* app_id = "wlfreerdp";
+ const char* wmclass = freerdp_settings_get_string(settings, FreeRDP_WmClass);
+ if (wmclass)
+ app_id = wmclass;
+
if (!gdi_init(instance, PIXEL_FORMAT_BGRA32))
return FALSE;
- gdi = instance->context->gdi;
+ rdpGdi* gdi = instance->context->gdi;
if (!gdi || (gdi->width < 0) || (gdi->height < 0))
return FALSE;
@@ -254,8 +254,8 @@ static BOOL wl_post_connect(freerdp* instance)
if (!wlf_register_pointer(instance->context->graphics))
return FALSE;
- w = (UINT32)gdi->width;
- h = (UINT32)gdi->height;
+ UINT32 w = (UINT32)gdi->width;
+ UINT32 h = (UINT32)gdi->height;
if (freerdp_settings_get_bool(settings, FreeRDP_SmartSizing) && !context->fullscreen)
{
@@ -268,15 +268,16 @@ static BOOL wl_post_connect(freerdp* instance)
h = sh;
}
- context->window = window = UwacCreateWindowShm(context->display, w, h, WL_SHM_FORMAT_XRGB8888);
+ context->window = UwacCreateWindowShm(context->display, w, h, WL_SHM_FORMAT_XRGB8888);
- if (!window)
+ if (!context->window)
return FALSE;
UwacWindowSetFullscreenState(
- window, NULL, freerdp_settings_get_bool(instance->context->settings, FreeRDP_Fullscreen));
- UwacWindowSetTitle(window, title);
- UwacWindowSetAppId(window, app_id);
+ context->window, NULL,
+ freerdp_settings_get_bool(instance->context->settings, FreeRDP_Fullscreen));
+ UwacWindowSetTitle(context->window, title);
+ UwacWindowSetAppId(context->window, app_id);
UwacWindowSetOpaqueRegion(context->window, 0, 0, w, h);
instance->context->update->EndPaint = wl_end_paint;
instance->context->update->DesktopResize = wl_resize_display;