[XRDP] Keyboard Input Language switch is ignored. Always prints in English

I connected to the AlmaLinux 9.1 using XRDP (Remote Desktop)
I added additional input language in Gnome Settings - Keyboard - Input Sources - + - Russian
I switched to “ru” language using language indicator in the top bar and typed some text - the text is still typed in English
So, the language switching is ignored in xrdp session

Smth wrong in XRDP keyboard layout settings or xrdp integration with AlmaLinux.
Other distributions works fine - switching language in xrdp session works - I tried RHEL9, Rocky 9, Fedora 36.

AMI: ami-038f82869d88a1a4a
or Virtual Box + Minimal Iso + Bridged Network Adapter
Installed software:

sudo dnf install yum-utils
sudo dnf config-manager --set-enabled crb
sudo dnf install epel-release
sudo dnf upgrade

sudo dnf group install Workstation
sudo systemctl set-default graphical
sudo reboot

sudo dnf install xrdp
sudo systemctl start xrdp
sudo systemctl enable xrdp

sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo firewall-cmd --permanent --zone=public --add-service=rdp
sudo systemctl restart firewalld

Steps to Reproduce:

Connect to the box using Remote Desktop
Add additional input language in Gnome Settings - Keyboard - Input Sources - + - Russian
Switch to “ru”
Try to type smth in some field - it will type in English instead of Rus

We can also use VirtualBox to reproduce the issue.
Use Minimal ISO to install AlmaLinux 9.1.
Use bridged Network Adapter (not NAT) because we will use RDP connection from host to the VM. Install additional software as described above
What is interesting - Input language switch works fine in normal VirtualBox VM graphical session. But if we logout and connect to Virtual Box VM using Remote Desktop then Input language switch is ignored

Debug outputs

# normal VirtualBox Graphical session - input switch works fine
$ setxkbmap -v 10 -print

Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};
# XRPD session - input switch is ignored
$ setxkbmap -v 10 -print

Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us,ru,us
variant:    ,,
options:    lv3:ralt_switch
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+ru:2+us:3+inet(evdev)+level3(ralt_switch)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+ru:2+us:3+inet(evdev)+level3(ralt_switch)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

Related links

Yes, we have a solution!!!

We need to uncomment [Xorg] block in xrdp.ini.

Step by Step instructions:

## install xorgxrdp
sudo dnf install xorgxrdp

## edit /etc/xrdp/xrdp.ini
sudo vi /etc/xrdp/xrdp.ini

## Uncomment [Xorg] block to Enable it.

[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
code=20


## We can keep [Xvnc] block enabled.


# Save the file and Restart xrdp service
sudo systemctl restart xrdp

Done!
When you connect to the server in Remote Desktop it will ask for login/password.
Make sure Xorg session is selected - it should be the first in the list.
Do NOT select Xvnc!

Now the Input Language switch works correctly in Remote Desktop / Xorg / GNOME session!

Tested on Fedora 36, AlmaLinux 9, CentOS Stream 9, CentOS 7

The solution was found by ZOTOVP on Mar 2023 - the article

Related discussion on Fedora forum

Yes, we have a solution!!!

We need to uncomment [Xorg] block in xrdp.ini.

Step by Step instructions:

## install xorgxrdp
sudo dnf install xorgxrdp

## edit /etc/xrdp/xrdp.ini
sudo vi /etc/xrdp/xrdp.ini

## Uncomment [Xorg] block to Enable it.

[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
code=20


## We can keep [Xvnc] block enabled.


# Save the file and Restart xrdp service
sudo systemctl restart xrdp

Done!
When you connect to the server in Remote Desktop it will ask for login/password.
Make sure Xorg session is selected - it should be the first in the list.
Do NOT select Xvnc!

Now the Input Language switch works correctly in Remote Desktop / Xorg / GNOME session!

Tested on Fedora 36, AlmaLinux 9, CentOS Stream 9, CentOS 7

The solution was found by ZOTOVP on Mar 2023 - the article

Related discussion on Fedora forum