Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2318fec

Browse files
authored
rdp-backend: maintain wl-seat even RDP is disconnected (#158)
* RDP-Backend: Persistent wl_seat across RDP disconnect/reconnect* persistent seat for only RAIL mode* apply to only rail mode* release weston_seat at backend destruction
1 parentf227edd commit2318fec

File tree

4 files changed

+38
-8
lines changed

4 files changed

+38
-8
lines changed

‎compositor/main.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,7 @@ weston_rdp_backend_config_init(struct weston_rdp_backend_config *config)
27052705
config->no_clients_resize=0;
27062706
config->force_no_compression=0;
27072707
config->redirect_clipboard= false;
2708+
config->enable_persistent_rail_seat= false;
27082709
config->audio_in_setup=NULL;
27092710
config->audio_in_teardown=NULL;
27102711
config->audio_out_setup=NULL;
@@ -2829,6 +2830,8 @@ load_rdp_backend(struct weston_compositor *c,
28292830
/* certain configurations are read from environment variables */
28302831
config.redirect_clipboard=read_rdp_config_bool("WESTON_RDP_CLIPBOARD", true);
28312832

2833+
config.enable_persistent_rail_seat=read_rdp_config_bool("WESTON_RDP_PERSISTENT_RAIL_SEAT", true);
2834+
28322835
audio_tmp=read_rdp_config_bool("WESTON_RDP_AUDIO_PLAYBACK", true);
28332836
if (audio_tmp) {
28342837
config.audio_out_setup=rdp_audio_out_init;

‎include/libweston/backend-rdp.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ struct weston_rdp_backend_config {
283283
intno_clients_resize;
284284
intforce_no_compression;
285285
boolredirect_clipboard;
286+
boolenable_persistent_rail_seat;
286287
rdp_audio_in_setupaudio_in_setup;
287288
rdp_audio_in_teardownaudio_in_teardown;
288289
rdp_audio_out_setupaudio_out_setup;

‎libweston/backend-rdp/rdp.c‎

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -664,13 +664,17 @@ rdp_destroy(struct weston_compositor *ec)
664664
b->debug=NULL;
665665
}
666666

667+
if (b->persistent_rail_seat)
668+
weston_seat_release(b->persistent_rail_seat);
669+
667670
weston_compositor_shutdown(ec);
668671

669672
wl_list_for_each_safe(base,next,&ec->head_list,compositor_link)
670673
rdp_head_destroy(ec,to_rdp_head(base));
671674

672675
freerdp_listener_free(b->listener);
673676

677+
free(b->persistent_rail_seat);
674678
free(b->server_cert);
675679
free(b->server_key);
676680
free(b->rdp_key);
@@ -759,12 +763,14 @@ static void
759763
rdp_peer_context_free(freerdp_peer*client,RdpPeerContext*context)
760764
{
761765
structrdp_backend*b;
766+
rdpSettings*settings;
762767
unsignedi;
763768

764769
if (!context)
765770
return;
766771

767772
b=context->rdpBackend;
773+
settings=client->context->settings;
768774

769775
/* While RDP client is disconnected, keep compositor sleep state */
770776
weston_compositor_sleep(b->compositor);
@@ -800,8 +806,15 @@ rdp_peer_context_free(freerdp_peer* client, RdpPeerContext* context)
800806
if (context->item.flags&RDP_PEER_ACTIVATED) {
801807
weston_seat_release_keyboard(context->item.seat);
802808
weston_seat_release_pointer(context->item.seat);
803-
weston_seat_release(context->item.seat);
804-
free(context->item.seat);
809+
/* save current seat for future use only when it's not saved yet */
810+
if (settings->RemoteApplicationMode&&
811+
b->enable_persistent_rail_seat) {
812+
assert(!b->persistent_rail_seat);
813+
b->persistent_rail_seat=context->item.seat;
814+
}else {
815+
weston_seat_release(context->item.seat);
816+
free(context->item.seat);
817+
}
805818
context->item.seat=NULL;
806819
context->item.flags &= ~RDP_PEER_ACTIVATED;
807820
}
@@ -1188,19 +1201,28 @@ xf_peer_activate(freerdp_peer* client)
11881201
&xkbRuleNames,0);
11891202
}
11901203

1204+
if (settings->RemoteApplicationMode)
1205+
snprintf(seat_name,sizeof(seat_name),"RDP Remote Application Client");
11911206
if (settings->ClientHostname)
11921207
snprintf(seat_name,sizeof(seat_name),"RDP %s",settings->ClientHostname);
11931208
else
11941209
snprintf(seat_name,sizeof(seat_name),"RDP peer @%s",settings->ClientAddress);
11951210

1196-
peersItem->seat=zalloc(sizeof(*peersItem->seat));
1197-
if (!peersItem->seat) {
1198-
xkb_keymap_unref(keymap);
1199-
rdp_debug_error(b,"unable to create a weston_seat\n");
1200-
gotoerror_exit;
1211+
if (settings->RemoteApplicationMode&&
1212+
b->persistent_rail_seat) {
1213+
/* reuse persistent seat for RAIL connection */
1214+
peersItem->seat=b->persistent_rail_seat;
1215+
b->persistent_rail_seat=NULL;
1216+
}else {
1217+
peersItem->seat=zalloc(sizeof(*peersItem->seat));
1218+
if (!peersItem->seat) {
1219+
xkb_keymap_unref(keymap);
1220+
rdp_debug_error(b,"unable to create a weston_seat\n");
1221+
gotoerror_exit;
1222+
}
1223+
weston_seat_init(peersItem->seat,b->compositor,seat_name);
12011224
}
12021225

1203-
weston_seat_init(peersItem->seat,b->compositor,seat_name);
12041226
weston_seat_init_keyboard(peersItem->seat,keymap);
12051227
xkb_keymap_unref(keymap);
12061228
weston_seat_init_pointer(peersItem->seat);
@@ -2111,6 +2133,7 @@ rdp_backend_create(struct weston_compositor *compositor,
21112133
b->no_clients_resize=config->no_clients_resize;
21122134
b->force_no_compression=config->force_no_compression;
21132135
b->redirect_clipboard=config->redirect_clipboard;
2136+
b->enable_persistent_rail_seat=config->enable_persistent_rail_seat;
21142137
b->rdp_monitor_refresh_rate=config->rdp_monitor_refresh_rate*1000;
21152138
b->audio_in_setup=config->audio_in_setup;
21162139
b->audio_in_teardown=config->audio_in_teardown;
@@ -2298,6 +2321,7 @@ config_init_to_defaults(struct weston_rdp_backend_config *config)
22982321
config->no_clients_resize=0;
22992322
config->force_no_compression=0;
23002323
config->redirect_clipboard= false;
2324+
config->enable_persistent_rail_seat= false;
23012325
config->rdp_monitor_refresh_rate=WESTON_RDP_MODE_FREQ;
23022326
config->rail_config.use_rdpapplist= false;
23032327
config->rail_config.use_shared_memory= false;

‎libweston/backend-rdp/rdp.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ struct rdp_backend {
107107
intno_clients_resize;
108108
intforce_no_compression;
109109
boolredirect_clipboard;
110+
boolenable_persistent_rail_seat;
110111
rdp_audio_in_setupaudio_in_setup;
111112
rdp_audio_in_teardownaudio_in_teardown;
112113
rdp_audio_out_setupaudio_out_setup;
@@ -119,6 +120,7 @@ struct rdp_backend {
119120
boolenable_distro_name_title;
120121

121122
freerdp_peer*rdp_peer;// this points a single instance of RAIL RDP peer.
123+
structweston_seat*persistent_rail_seat;// Saved for persistent seat
122124
pid_tcompositor_tid;
123125

124126
structweston_binding*debug_binding_M;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp