psifidotos / applet-window-buttons

Plasma 5 applet in order to show window buttons in your panels
GNU General Public License v2.0
404 stars 55 forks source link

Scaling with PLASMA_USE_QT_SCALING=1 #157

Closed gondsman closed 2 years ago

gondsman commented 2 years ago

I have the applet show the buttons only for maximized windows. This works fine normally with any screen scaling by default. If I try to set PLASMA_USE_QT_SCALING=1 in order to solve a lot of minor scaling issues with Plasma the applet stops being able to recognize if a window is maximized. In fact, if I set it up to show if "active window is present" it only detects the window if it's placed in the top left part of the screen (a quarter of the screen if the scaling factor is 200%). I believe this is an issue with plasma and not with this applet, as the pager has the same issue: https://bugs.kde.org/show_bug.cgi?id=446627

I know this is a long shot and I perfectly understand if it gets closed as WONTFIX, since this configuration is not officially supported and the bug is probably not even in this applet, but I felt like you might want to know of the bug anyway, especially because you already fixed similar issued in latte-dock. Maybe there's another simple way to tell if a window is maximized that works around this issue. Thanks anyway!

psifidotos commented 2 years ago

Are you using the applet inside a plasma panel?

gondsman commented 2 years ago

No, it's in a latte panel. I do have another standard plasma panel, but it's not the one hosting the applet.

psifidotos commented 2 years ago

What is you Latte version?

psifidotos commented 2 years ago

https://psifidotos.blogspot.com/2021/10/latte-dock-v0103-bug-fix-release.html it requires 0.10.3 in order for PLASMA_USE_QT_SCALING to work correctly.

gondsman commented 2 years ago

Latte-dock version: 0.10.6 window-buttons applet version: 0.10.1 Plasma version: 5.23.4

I can attach some screenshots to try to explain better, because the behaviour is even stranger than I initially thought.

The latte panel is set up to get colors from "any touching window", the buttons applet to show if "active window is present".

If the window is in the top left corner (even when not touching the latte panel) the buttons are shown and the panel gets the color from the window: latte_scaling_bug_1

If I move the window down, the buttons disappear but the latte panel still gets the color from the window: latte_scaling_bug_2 This case is also the behaviour when the window is maximized.

If I move the window further down, the panel stops getting the color from it: latte_scaling_bug_3

I don't know if you need a log or a setting file. This is with a 3840x2400 screen set up with 200% scaling.

psifidotos commented 2 years ago

My guess is that Latte ignores the window if it is too far down because the center of the window is out of the screen geometry. Hmmm... probably a latte issue.

Are you in multi-screen environment?

gondsman commented 2 years ago

This is with a single screen.

By the way, even the second screen is wrong because the panel should be colored only if the window is touching it, shouldn't it?

gondsman commented 2 years ago

Also I should add that without the PLASMA_USE_QT_SCALING=1 everything works exactly as expected, both for the buttons and for the panel color.

psifidotos commented 2 years ago

@gondsman the issue you have discovered is really important and points to Latte.

  1. For you coloring my guess is that at Latte Behavior advanced settings you have chosen Colors->From Window->Current Active Window, you can adjust it to From Window-> Any Touching Window
  2. The fact when moving the window center under the screen geometry creates this issue is really important... I think the best approach to fix this in Latte is to check the entire window geometry if intersects with the screen geometry...
psifidotos commented 2 years ago

should be fixed in upcoming Latte v0.10.7 https://invent.kde.org/plasma/latte-dock/-/commit/abcacface8a2bc82c02a14910f0ddcb97354d326

gondsman commented 2 years ago
  1. For you coloring my guess is that at Latte Behavior advanced settings you have chosen Colors->From Window->Current Active Window, you can adjust it to From Window-> Any Touching Window

It is already set to "any touching window". in fact I don't see any difference between the two options (again, this works fine without the PLASMA_USE_QT_SCALING variable).

psifidotos commented 2 years ago

For the main issue you should wait 0.10.7

For the coloring issue you should report to Latte bug tracker with proper information and steps to reproduce. https://bugs.kde.org/enter_bug.cgi?product=lattedock

psifidotos commented 2 years ago

And add up on the discussion, are you using x11 or wayland?

gondsman commented 2 years ago

This is on X11, on an intel iGPU.

gondsman commented 2 years ago

I updated to latte 10.7 but the issue is still not solved. Now the position for which it works is bigger as the window just needs to intersect with the top-right quarter of the screen rather than its center be there, but the underlying issue is still there. On the other hand, I've just read that the PLASMA_USE_QT_SCALING effort was given up on (https://bugs.kde.org/show_bug.cgi?id=356446), so I don't even know if it's worth investigating this more.