Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seflerz unicode #2

Merged
merged 5 commits into from
May 1, 2024
Merged

Conversation

matt335672
Copy link

Hi @seflerZ

As promised, I've looked into not starting the input method if we don't need to.

I've added a couple of other small changes too. Happy to discuss if you don't like them.

I've not fully tested this, as I was having trouble getting iBus working with XFCE. I'll try to get to the bottom of that so I can do some more thorough testing later on when we're getting ready to merge.

Main changes:-

  • xrdp is not now built with XRDP_IBUS to allow other input methods to be more easily supported.
  • chansrv is only aked to start an input method if the client supports it.
  • chansrv sends a status report back to xrdp when asked to start an input method.
  • ./configure without --enable-ibus now works.

Also support for --enable-ibus is added to the CI scripts.

- xrdp is not now built with XRDP_IBUS to allow other input
  methods to be more easily supported.
- chansrv is only aked to start an input method if the client
  supports it.
- chansrv sends a status report back to xrdp when asked to start
  and input method.
- ./configure without --enable-ibus now works.
xrdp/xrdp_wm.c Outdated
self->client_info->unicode_input_support == UIS_ACTIVE &&
self->mm->chan_trans->status == TRANS_STATUS_UP)
{
xrdp_mm_send_unicode_to_chansrv(self->mm,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no return status for "xrdp_mm_send_unicode_to_chansrv" to tell unicode processing failure here for the fall back in line 1746. Therefore it's possible that the fall back not working. For example, the unicode character is fail to process in the unicode thread but it does exist in the keymap.

My suggestion is to put the unicode procedure in the end of the function. You know, the result is the same if the character is existing in keymap, but it's more stable in the old way, I think.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with that. I'll change it back.

xrdp/xrdp_mm.c Outdated
LOG(LOG_LEVEL_INFO, "Chansrv does not support Unicode input");
break;

default:
Copy link
Owner

@seflerZ seflerZ Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better specify 2 as init failure as it does in line "chansrc:893" here. Using default is unclear. Also, I think we should do a LOG_ERROR for that case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do this if you are short on time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on it right now...

@matt335672
Copy link
Author

Changes implemented as discussed.

I had a thought about this conversation above:-

[seflerZ] There is no return status for "xrdp_mm_send_unicode_to_chansrv" to tell unicode processing failure here for the fall back in line 1746. Therefore it's possible that the fall back not working. For example, the unicode character is fail to process in the unicode thread but it does exist in the keymap.

[seflerZ] My suggestion is to put the unicode procedure in the end of the function. You know, the result is the same if the character is existing in keymap, but it's more stable in the old way, I think.

[matt335672] I'm fine with that. I'll change it back.

I'm still a bit bothered about one thing; if we receive a stream of Unicode characters and some are in the keymap and some aren't, the characters will take different routes to get to the session and so they might end up in a different order.

We can leave it for now, and if it does turn out to be a problem we at least know what's happening.

@seflerZ
Copy link
Owner

seflerZ commented May 1, 2024

Changes implemented as discussed.

I had a thought about this conversation above:-

[seflerZ] There is no return status for "xrdp_mm_send_unicode_to_chansrv" to tell unicode processing failure here for the fall back in line 1746. Therefore it's possible that the fall back not working. For example, the unicode character is fail to process in the unicode thread but it does exist in the keymap.

[seflerZ] My suggestion is to put the unicode procedure in the end of the function. You know, the result is the same if the character is existing in keymap, but it's more stable in the old way, I think.

[matt335672] I'm fine with that. I'll change it back.

I'm still a bit bothered about one thing; if we receive a stream of Unicode characters and some are in the keymap and some aren't, the characters will take different routes to get to the session and so they might end up in a different order.

We can leave it for now, and if it does turn out to be a problem we at least know what's happening.

Got it.

Copy link
Owner

@seflerZ seflerZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, ready to merge.

@seflerZ seflerZ merged commit 0982221 into seflerZ:unicode_contr May 1, 2024
12 checks passed
@matt335672 matt335672 deleted the seflerz_unicode branch May 1, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants