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

Image viewer doesn't render to window border when not fullscreen. #26481

Closed
RokeJulianLockhart opened this issue Jul 5, 2023 · 21 comments
Closed

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Jul 5, 2023

https://bugs.telegram.org/c/29731

Steps to reproduce

  1. Click on image to enlarge it whilst using https://wikipedia.org/wiki/KWin

    image

  2. Press Alt+F3 and disable fullscreen

    image

Actual behaviour

image

Expected behaviour

The image, or at least the dark translucent border, should render to the edges of the window.

I believe that the best solution is to:

  1. Invoke the image not in fullscreen, but instead in a window that chooses a sane size depending upon the image resolution, since this is way too large by default for large and/or less-than-4K monitors, and thus
  2. Remove the black border padding, so that it renders to the window border, and
  3. Remove the translucent background and replace it with the regular window background

Operating system

Operating System: openSUSE Tumbleweed 20230703
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Kernel Version: 6.3.9-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon RX 5700

Version of Telegram Desktop

6.8.1

Installation source

https://software.opensuse.org/package/telegram-desktop

Crash ID

No response

Logs

No response

@ilya-fedin
Copy link
Contributor

That's weird, it's supposed to be frameless, the empty space should be transparent

@ilya-fedin
Copy link
Contributor

I seem to be unable to reproduce

2. Press F3 and disable fullscreen

This step does nothing on my machine

@RokeJulianLockhart
Copy link
Author

@ilya-fedin, are you using KWin and KDE Plasma?

@ilya-fedin
Copy link
Contributor

well, I'm trying using a VM with KDE Neon

@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Jul 5, 2023

Apologies, @ilya-fedin, I meant Alt+F3. (It's an out-of-the-box keybind.)

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Jul 5, 2023

Now I'm getting a maximized window after step 2, not what on your screenshot

@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Jul 5, 2023

Send me a screenshot, @ilya-fedin.

@ilya-fedin
Copy link
Contributor

That's what I get with your steps:
изображение
That's what I get if I unmaximize the window the normal way (via title controls):
изображение

@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Jul 5, 2023

Understood, @ilya-fedin. Thanks.

Ensure you're using X11. I know that the subsequent images state "Wayland" but that's for a debugging purpose irrelevant to this issue. Extract https://github.com/telegramdesktop/tdesktop/files/11962605/ForceEnableWindowTitleBarAndFrame.kwinrule.zip and import ForceEnableWindowTitleBarAndFrame.kwinrule into kcmshell5 kcm_kwinrules using its GUI

(there's a handy "Import" button)

image

It'll appear in the list.

image

Ensure it looks like

image

This will definitely let you see the issue.

@ilya-fedin
Copy link
Contributor

Broken UX after such rules is completely expected. You can't force application do what it's not designed to do and expect it will work as expected. You have voided your warranty.

@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Jul 5, 2023

@ilya-fedin, lots of Window Managers force SSD for a lot of reasons. For instance, Windows does it for accessibility purposes. I anecdotally know of two people who the same with KDE for that purpose. They introduced me to the functionality, although I only do it because the makes the system more intuitive. Some WMs don't even support removing the window border, although they're definitely the more obscure of the bunch.

@ilya-fedin
Copy link
Contributor

This window doesn't support server-side decorations, that's just not implemented by designer's request and it won't be. You have to accept that or create a fork.

@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Jul 5, 2023

Then I'll close this as not planned if so, but in the meantime please remove https://github.com/telegramdesktop/tdesktop/issues?q=label%3A%22cant+reproduce%22, @ilya-fedin.

This window doesn't support server-side decorations

It definitely does support SSD. Otherwise it wouldn't render with the native titlebar. It even includes an explicit option "Use system window frame":

image

@RokeJulianLockhart RokeJulianLockhart closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
@ilya-fedin
Copy link
Contributor

ilya-fedin commented Jul 5, 2023

It's another window. This one does support system window frame, yes. Media viewer, call windows do not.

@RokeJulianLockhart
Copy link
Author

Is allowing them to support it such an undesirable feature, @ilya-fedin?

@RokeJulianLockhart RokeJulianLockhart closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
@ilya-fedin
Copy link
Contributor

there's already a request for call windows. Although I don't think such requests will be ever implemented. It's way more likely that the main window would lose such ability than the other way around.

@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Jul 5, 2023

@ilya-fedin, do you have the link for that request? I'd like to subscribe.

@ilya-fedin
Copy link
Contributor

#10002

@RokeJulianLockhart
Copy link
Author

I've noticed something interesting about the behaviour when this (unsupported) window rule is enabled - the image viewer now renders at the size it was previously resized to rather than fullscreen, and thus necessitating resizing every time I view an image. I think this is great - it fixes my biggest gripe about the image viewer, it being that the images filled by screen, and provides a proper windowed integrated-into-telegram image viewer.

@ilya-fedin
Copy link
Contributor

I don't quite understand what you mean? The custom frame allows you to resize as well.

@RokeJulianLockhart
Copy link
Author

Oh, yeah. I never noticed those dimmed custom titlebar buttons, @ilya-fedin.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants