[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread Huang-Huang Bao
https://bugs.kde.org/show_bug.cgi?id=475325

Huang-Huang Bao  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Latest Commit||https://invent.kde.org/plas
   ||ma/kwin/-/commit/3d4036210d
   ||85d59836d5f0471a95e863e0b72
   ||8c4
 Resolution|--- |FIXED

--- Comment #12 from Huang-Huang Bao  ---
Git commit 3d4036210d85d59836d5f0471a95e863e0b728c4 by Huang-Huang Bao.
Committed on 19/11/2023 at 23:14.
Pushed by zamundaaa into branch 'master'.

scene: use fractionalGeometry() as input of RenderViewport renderRect

Fixes mismatches between renderTarget.size() and deivce geometry calculated
using viewport.renderRect() * viewport.scale() .

M  +1-1src/scene/workspacescene.cpp

https://invent.kde.org/plasma/kwin/-/commit/3d4036210d85d59836d5f0471a95e863e0b728c4

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #11 from zvova7...@gmail.com ---
Well, yes, but Chrome's 1.49971 scale factor does not seem to be a 'normal'
scale when the system has 1.5

While Chrome has an incorrect scale, I believe it is providing an incorrect
viewporter destination size, while KWin is trying to render with the correct
size applying a 1.5 scale. From that perspective, the compositor must fit the
application surface to the render bounds. The OpenGL backend uses GL_LINEAR
texture filtering, which causes blurriness even with rounding issues within
1px. Maybe QPainter applies another scale method.
I have a patch for Chromium that fixes its internal scale, and in that case, it
becomes sharp and clean.

Anyway, it's just my guess. I haven't delved deeply into how it works to the
point where I can confidently say I totally understand how it must work.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=475325

Bug Janitor Service  changed:

   What|Removed |Added

 Status|CONFIRMED   |ASSIGNED

--- Comment #10 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/plasma/kwin/-/merge_requests/4665

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread Huang-Huang Bao
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #9 from Huang-Huang Bao  ---
(In reply to zvova7890 from comment #7)
> Chromium-based apps have incomplete fractional scale support. They calculate
> scale factor instead of obtaining one from the fractional-scale protocol.
> See: https://bugs.chromium.org/p/chromium/issues/detail?id=1474176
> 
> I think firefox also doing something wrong.

The fractional-scale-v1 spec does not force the client to use provided scale as
the event name "wp_fractional_scale_v1::preferred_scale" suggests.
> Notification of a new preferred scale for this surface that the compositor 
> suggests that the client should use.

So I would say it's a bug of the kwin's OpenGL backend to not respect client's
scale (client's buffer geometry / surface geometry).. And the QPainter backend
seems doing it fine.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #8 from zvova7...@gmail.com ---
Huang-Huang Bao,

I think your patch makes sense. Please create a MR:
https://invent.kde.org/plasma/kwin

It seems it was typo when they refactor this(and this is why kwin5 branch is
fine):

void WorkspaceScene::prePaint(SceneDelegate *delegate)
{
createStackingOrder();

m_paintedDelegate = delegate;
if (kwinApp()->operationMode() == Application::OperationModeX11) {
painted_screen = workspace()->outputs().constFirst();
m_renderer->setRenderTargetRect(geometry());
m_renderer->setRenderTargetScale(1);
} else {
painted_screen = m_paintedDelegate->output();
m_renderer->setRenderTargetRect(painted_screen->fractionalGeometry());
m_renderer->setRenderTargetScale(painted_screen->scale());
}

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #7 from zvova7...@gmail.com ---
Chromium-based apps have incomplete fractional scale support. They calculate
scale factor instead of obtaining one from the fractional-scale protocol.
See: https://bugs.chromium.org/p/chromium/issues/detail?id=1474176

I think firefox also doing something wrong.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread Huang-Huang Bao
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #6 from Huang-Huang Bao  ---
Created attachment 163296
  --> https://bugs.kde.org/attachment.cgi?id=163296=edit
KWIN_SCENE_VISUALIZE=fractional with "An insufficient fix/workaround for the
bug" patch applied

Firefox and VS Code both have fractional-scale integration enabled but are
still blurry in 3840x2160 / 1.8 scale.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread Huang-Huang Bao
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #5 from Huang-Huang Bao  ---
Created attachment 163295
  --> https://bugs.kde.org/attachment.cgi?id=163295=edit
KWIN_SCENE_VISUALIZE=fractional without the patch

Notice the very left column in workspace scene is not colored because the
fractional error is under 0.01.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread Huang-Huang Bao
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #4 from Huang-Huang Bao  ---
(In reply to Huang-Huang Bao from comment #3)
> Created attachment 163293 [details]
> An insufficient fix/workaround for the bug, only fix the blurriness of QT
> apps

Sorry, it fixes the blurriness of workspace scene, QT6 app itself is all fine
with fractional scale.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-19 Thread Huang-Huang Bao
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #3 from Huang-Huang Bao  ---
Created attachment 163293
  --> https://bugs.kde.org/attachment.cgi?id=163293=edit
An insufficient fix/workaround for the bug, only fix the blurriness of QT apps

After some digging on kwin and fractional debug shader pass [1], I have found
there are mismatches between renderTarget.size() and deivce geometry calculated
using viewport.renderRect() * viewport.scale() that cause the unalignment of
items. Fix it by supplying `fractionalGeometry()` of output instead of
`geometry()` into RenderViewport in WorkspaceScene.

However this fix/workaround is insufficient and does not fix the blurriness of
decoration title[2] and some non-QT apps like Firefox, Electron and VS Code
with fractional-scale-v1 integration enabled on fractional logical geometry. 

Surprisingly, the QPainter backend(KWIN_COMPOSE=Q) has no problem on all of
these case at all (without the mentioned patch of course), all components looks
sharp under any scales no matter it's QT6 apps or other
fractional-scale-v1apps.

So there is certainly some other alignment issues in OpenGL backend.

[1] https://invent.kde.org/plasma/kwin/-/merge_requests/3988
[2] https://bugs.kde.org/show_bug.cgi?id=475886

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-13 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=475325

--- Comment #2 from zvova7...@gmail.com ---
kwin have a nice feature to highlight surfaces that doesn't fit to dest size:

KWIN_SCENE_VISUALIZE=fractional kwin_wayland ...

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-13 Thread Huang-Huang Bao
https://bugs.kde.org/show_bug.cgi?id=475325

Huang-Huang Bao  changed:

   What|Removed |Added

Version|unspecified |5.27.80

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-11-13 Thread Huang-Huang Bao
https://bugs.kde.org/show_bug.cgi?id=475325

Huang-Huang Bao  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 CC||i...@eh5.me
 Status|REPORTED|CONFIRMED

--- Comment #1 from Huang-Huang Bao  ---
I also can confirm this on Plasma 6 Alpha.
I am on 3840x2160 resolution but for me the 1.5 scale does not blurry as
3280/1.5 = 2560, all other scales that cannot divide the resolution to integer
resulting blurry fonts.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-10-11 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=475325

Nate Graham  changed:

   What|Removed |Added

  Component|general |wayland-generic
 CC||n...@kde.org,
   ||xaver.h...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 475325] KDE 6 wayland fractional scale blurry when result of division W/scale or H/scale is not an integer

2023-10-07 Thread Nicolas Fella
https://bugs.kde.org/show_bug.cgi?id=475325

Nicolas Fella  changed:

   What|Removed |Added

 CC||nicolas.fe...@gmx.de
   Assignee|neon-b...@kde.org   |kwin-bugs-n...@kde.org
  Component|Packages Testing Edition|general
Product|neon|kwin

-- 
You are receiving this mail because:
You are watching all bug changes.