telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.24k stars 5.21k forks source link

Focus doesn't return to textbox after quitting list of photos #28142

Closed Hi-Angel closed 3 months ago

Hi-Angel commented 3 months ago

Steps to reproduce

It's a usability concern, as it requires a user to make an unnecessary additional action of clicking the input field.

I've seen similar problem in different settings, not just quitting photos, but they may be caused by the same thing. This worked correctly on Linux/X11 till ≈5.1.7, but after update to 5.2.3 it's now broken on all platforms: Windows, Linux/X11, Linux/Wayland, presumably Mac as well.

  1. Open any dialog with photos
  2. On the panel click the button <number> photos

    image

  3. Click any photo from the appeared list
  4. Press Esc to quit looking photos
  5. Without clicking anything else, start typing the word test

Expected behaviour

test will get typed into the textbox for sending

Actual behaviour

Nothing. The textbox doesn't have the focus and everything you type will simply get lost.

Operating system

Archlinux

Version of Telegram Desktop

5.2.3

Installation source

Static binary from official website

ilya-fedin commented 3 months ago

There seem to be something wrong with reproduction steps.

2. On the panel on the right click button <number> photos

Right click does nothing for me here. If I assume that's a typo and you mean left click, then

4. Press Esc to quit looking photos

After this, I return to the list of photos and

5. Without clicking anything else, start typing the word test

It's expected and intended I can't enter like that.

Hi-Angel commented 3 months ago

There seem to be something wrong with reproduction steps.

  1. On the panel on the right click button <number> photos

Right click does nothing for me here. If I assume that's a typo and you mean left click, then

Sorry, you're right, I'll fix that in a sec. No idea why how in the world the word got there, I wasn't even meaning to write left-click but rather just click to imply the left one.

  1. Press Esc to quit looking photos

After this, I return to the list of photos and

  1. Without clicking anything else, start typing the word test

It's expected and intended I can't enter like that.

Why is it intended? Is it assumed a user should use some hotkey to start typing? I mean, having an additional move-and-click every time (there are other similar cases on Wayland) is clearly inconvenient, given wherever you go in Telegram (a dialog, a group…), the interface almost always comes down to you writing something in the exact textbox at the bottom.

Hi-Angel commented 3 months ago

Sorry, you're right, I'll fix that in a sec. No idea why how in the world the word got there, I wasn't even meaning to write left-click but rather just click to imply the left one.

offtopic: sorry, I figured out where this "right" came from. I was re-editing the text and the older sentence was "the panel on the right".

ilya-fedin commented 3 months ago

Why is it intended?

idk what to answer, I just don't see such a feature implemented. It behaves like that on all platforms, including X11 (thus I don't understand how switching to X11 helps).

ilya-fedin commented 3 months ago

Maybe you rather have some kind of bug on X11, e.g. your WM continues sending ESC to the main window despite you released it.

Hi-Angel commented 3 months ago

Why is it intended?

idk what to answer, I just don't see such a feature implemented. It behaves like that on all platforms, including X11 (thus I don't understand how switching to X11 helps).

Hmm… Did you test it on X11 or are you just assuming…? I'm asking because it has always behaved like that for me for as long as I can remember (i.e. that after leaving view of a photo I can just start typing and succeed at that). I usually used KDE + i3, but right now I'm trying out Gnome + System76's tiling extension and with QT_QPA_PLATFORM=xcb being set (which forces X11 Qt backend) it behaves same way. And I tested both the official static Telegram binary as well as the one provided with the distro — both behave same way in that context.

ilya-fedin commented 3 months ago

Did you test it on X11 or are you just assuming…?

I tested with Xwayland. I have just plasma, without i3 nor any other tiling things.

Hi-Angel commented 3 months ago

@ilya-fedin so, is this video different from what you see? (sorry for missing cursor, apparently it is a bug in Gnome that no one bother to fix. But rest assured, I do not click the input box before typing).

Screencast from 2024-07-08 00-48-59.webm

ilya-fedin commented 3 months ago

I was in two row mode so the dialog was modal for me

ilya-fedin commented 3 months ago

I'm not sure whether it's intended or not anymore but I lose the focus the moment I start to interact with the third row and it doesn't return with Xwayland nor Wayland. So, yeah, what I see is different from the video.

ilya-fedin commented 3 months ago

Do you report this as a regression or as something that always has been?

Hi-Angel commented 3 months ago

I'm not sure whether it's intended or not anymore but I lose the focus the moment I start to interact with the third row and it doesn't return with Xwayland nor Wayland. So, yeah, what I see is different from the video.

Okay, here's another, more realistic case:

  1. Go to a chat with a photo
  2. Click the photo to view it
  3. Press Esc to close the photo
  4. Start typing test

Expected: you'll get test typed into the textbox Actual: nothing happens as the textbox has no focus.

Do you report this as a regression or as something that always has been?

Idk if it's a regression because I'm just trying out Wayland (again, I always want to start using it, but I always get something in the way), and this is something I immediately noticed after having used it for a few days.

ilya-fedin commented 3 months ago

it doesn't return with Xwayland nor Wayland

It also doesn't return with Windows.

ilya-fedin commented 3 months ago

Okay, here's another, more realistic case:

With this case I can't reproduce the issue at all. Focus returns with both Wayland and Xwayland.

Hi-Angel commented 3 months ago

Okay, here's another, more realistic case:

With this case I can't reproduce the issue at all. Focus returns with both Wayland and Xwayland.

Hmm, yes, this one actually seems flaky… Sometimes it works, sometimes it doesn't…

ilya-fedin commented 3 months ago

If the initial case is a bug, it seem to be a cross-platform bug from what I see

ilya-fedin commented 3 months ago

@Hi-Angel please provide a screenshot with application version.

Hi-Angel commented 3 months ago

@Hi-Angel please provide a screenshot with application version.

image

FTR, the screenshot is from KDE + i3, I presume it doesn't matter. My yet another attempt of migrating to Wayland failed because the overall feeling of Gnome is it's too raw, so I'm back to X11 KDE.

ilya-fedin commented 3 months ago

I presume it doesn't matter.

I want to see it from where the video was recorded

Hi-Angel commented 3 months ago

I presume it doesn't matter.

I want to see it from where the video was recorded

Could you please clarify, I am not sure I understand what you want. Do you want me to run Gnome Wayland, then run Telegram with QT_QPA_PLATFORM=xcb, then make a shot of the version? Wouldn't it be exactly the same as the one I replied with above? I.e. because running Telegram with the env. variable set will be same as running it in KDE X11.

ilya-fedin commented 3 months ago

Do you want me to run Gnome Wayland, then run Telegram with QT_QPA_PLATFORM=xcb, then make a shot of the version?

Yes. I have a feel it's not actually 5.2.3. I checked an older version (5.1.7) and it does behave like you say. But with 5.2.3, X11 behaves like all other platforms. Which seem to point to the fact there was an X11-only bug which is fixed now.

Hi-Angel commented 3 months ago

Oh, okay, sure. It will require restarting the DE (plain log out AFAIR doesn't work well in KDE + i3wm combination), so I'll make a new recording a bit later.

I'm pretty sure I saw same behavior in both 5.1.7 and 5.2.3 (I have both at the same time).

ilya-fedin commented 3 months ago

plain log out AFAIR doesn't work well in KDE

 cat /etc/systemd/logind.conf 
[Login]
KillUserProcesses=yes
UserStopDelaySec=0

should help with that

Hi-Angel commented 3 months ago

Yes. I have a feel it's not actually 5.2.3. I checked an older version (5.1.7) and it does behave like you say. But with 5.2.3, X11 behaves like all other platforms. Which seem to point to the fact there was an X11-only bug which is fixed now.

Oh, sorry, you were right, this is all getting too complicated. I did/do see similar behavior on 5.2.3, but it only works if I click the picture without clicking the X pictures link. But following steps to reproduce exactly (which requires clicking X pictures), input indeed no longer returns back to 5.2.3.

ilya-fedin commented 3 months ago

I did/do see similar behavior on 5.2.3, but it only works if I click the picture without clicking the X pictures link.

I'm not sure how steps to reproduce could be done without doing this step?

Hi-Angel commented 3 months ago

I did/do see similar behavior on 5.2.3, but it only works if I click the picture without clicking the X pictures link.

I'm not sure how steps to reproduce could be done without doing this step?

Because while redoing them, I already have the list of pictures and just click the picture.

ilya-fedin commented 3 months ago

Because while redoing them, I already have the list of pictures and just click the picture.

Ok, please provide full steps to reproduce that really work

Hi-Angel commented 3 months ago

Because while redoing them, I already have the list of pictures and just click the picture.

Ok, please provide full steps to reproduce that really work

Well, we came to conclusion that the original steps did work on older version and then broke on newer version, and they also never worked on other platforms. This is a usability concern either way, so barring the fact that after update all platforms are "broken" (in quotes because now you may say it's a "feature", since it pertains to all platforms, but then a "feature" in quotes as well), it is a problem.

ilya-fedin commented 3 months ago

Well, the title and the issue contents claim it's a wayland only problem while it's not?

ilya-fedin commented 3 months ago

There's a misleading leftover:

This is inconvenient up to the point I had to force X11-version of Telegram with QT_QPA_PLATFORM=xcb variable.

It doesn't help now as far as I understand?

Hi-Angel commented 3 months ago

It doesn't help now as far as I understand?

Right, it no longer does

Well, the title and the issue contents claim it's a wayland only problem while it's not?

Good point, I now reworded both the title and description

Hi-Angel commented 3 months ago

There's a misleading leftover:

Ah, sorry, no, that wasn't a leftover 😊 I just didn't finish editing when you posted it 😊