Bug 479141 - Graphical glitches in presentation mode
Summary: Graphical glitches in presentation mode
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 24.01.85
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: qt6, wayland
: 481534 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-29 05:17 UTC by Doug
Modified: 2024-02-21 08:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Presentation Mode Screenshot (93.81 KB, image/png)
2023-12-29 05:17 UTC, Doug
Details
Screenshot showing my display settings (392.01 KB, image/png)
2023-12-30 04:27 UTC, Doug
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Doug 2023-12-29 05:17:01 UTC
Created attachment 164524 [details]
Presentation Mode Screenshot

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Open a pdf in Okular
2. Enter Presentation Mode (On application menu View>Presentation Mode or Ctrl+Shift+P)
3. 

OBSERVED RESULT
document takes up a portion of the screen, but the right and bottom of the screen show a variety of graphical glitches.

EXPECTED RESULT
Presentation should fill entire screen

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: KDE Neon Unstable
(available in About System)
KDE Plasma Version: 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1

ADDITIONAL INFORMATION
Comment 1 Laura David Hurka 2023-12-29 14:48:20 UTC
This reminds me of Bug 421634.

How many screens do you have? Does it happen on all screens? Can you give detailed information of your screen arrangement, e. g. with a screenshot of System Settings? If you can still remember, can you describe how you have set up this screen arrangement?

And maybe give the output of these commands:

echo $QT_SCREEN_SCALE_FACTORS
echo $QT_SCALE_FACTOR

If you can access the task panel during presentation mode, or via Alt+F3 (on KDE Plasma), you can experiment with the fullscreen setting of the presentation window. Possible that it gives a workaround.
Comment 2 Doug 2023-12-30 04:27:20 UTC
Created attachment 164551 [details]
Screenshot showing my display settings
Comment 3 Doug 2023-12-30 04:34:51 UTC
(In reply to David Hurka from comment #1)
> This reminds me of Bug 421634.
> 
> How many screens do you have? Does it happen on all screens? Can you give
> detailed information of your screen arrangement, e. g. with a screenshot of
> System Settings? If you can still remember, can you describe how you have
> set up this screen arrangement?
> 
> And maybe give the output of these commands:
> 
> echo $QT_SCREEN_SCALE_FACTORS
> echo $QT_SCALE_FACTOR
> 
> If you can access the task panel during presentation mode, or via Alt+F3 (on
> KDE Plasma), you can experiment with the fullscreen setting of the
> presentation window. Possible that it gives a workaround.

I have two screens- one built into my laptop, and an external monitor.  It happens on both screens, either when they are both in use or when I use either alone.  I get no output from either of the commands you gave me.  Is that exactly how I should enter them to get live output in the terminal?
Comment 4 Doug 2023-12-30 04:39:33 UTC
I think it may be a fractional scaling related issue- with scaling set to 175% or 125%, lots of glitching.  Set to 100% or 200%, no problem.
Comment 5 Laura David Hurka 2023-12-30 13:16:50 UTC
> I get no output from either of the commands you gave me.  Is that exactly how I should enter them to get live output in the terminal?

Interesting.
(Those are environment variables, which shall just be printed. They give no “live output.)
I thought that these control the screen scales, but apparently it happens in some other way.
https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference

I have another idea: Do “child widgets” of the presentation screen (the toolbar at the top and the circular page number indicator) work fine in the glitchy areas?
If not, it may be a problem in painting the contents of the presentation screen widget.
Comment 6 Laura David Hurka 2023-12-30 13:17:21 UTC
> If not, it may be a problem in painting the contents of the presentation screen widget.

* If yes, it may be...
Comment 7 Doug 2023-12-31 06:04:13 UTC
(In reply to David Hurka from comment #5)
> > I get no output from either of the commands you gave me.  Is that exactly how I should enter them to get live output in the terminal?
> 
> Interesting.
> (Those are environment variables, which shall just be printed. They give no
> “live output.)
> I thought that these control the screen scales, but apparently it happens in
> some other way.
> https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference
> 
> I have another idea: Do “child widgets” of the presentation screen (the
> toolbar at the top and the circular page number indicator) work fine in the
> glitchy areas?
> If not, it may be a problem in painting the contents of the presentation
> screen widget.

They appear to work fine, though I'm not sure what the color blocks are supposed to do.
Comment 8 Eric Armbruster 2024-02-10 13:07:56 UTC
I can confirm.

Operating System: Arch Linux 
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700U with Radeon Graphics
Memory: 38.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics

I have one screen. Normal laptop display. No scaling settings applied, nothing special. Normal HD resolution.
Comment 9 Albert Astals Cid 2024-02-10 16:58:25 UTC
Does the problem go away when not using wayland?
Comment 10 Doug 2024-02-17 03:06:42 UTC
(In reply to Albert Astals Cid from comment #9)
> Does the problem go away when not using wayland?

No, it is only a problem in Wayland.
Comment 11 Albert Astals Cid 2024-02-18 16:43:34 UTC
Just to confirm your answer is "yes, the problem goes away when not using wayland"?
Comment 12 Sune Vuorela 2024-02-19 08:41:16 UTC
*** Bug 481534 has been marked as a duplicate of this bug. ***
Comment 13 Bug Janitor Service 2024-02-19 12:22:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/927
Comment 14 Iyán Méndez Veiga 2024-02-19 13:42:16 UTC
The patch fixes the issue for me. Thanks!
Comment 15 Doug 2024-02-21 06:44:01 UTC
(In reply to Albert Astals Cid from comment #11)
> Just to confirm your answer is "yes, the problem goes away when not using
> wayland"?

Yes, that is correct.  The problem is Wayland only, X11 works fine.

I am still having the issue as of today, version 24.02.0.
Comment 16 Sune Vuorela 2024-02-21 08:28:41 UTC
Git commit 450744a37dbf8770b3282b47ab43a797ed8c347e by Sune Vuorela, on behalf of Kai Uwe Broulik.
Committed on 21/02/2024 at 08:11.
Pushed by sune into branch 'master'.

presentationwidget: Invalidate pixmaps on dpr change

Since the last rendered pixmap is usually reused, its device pixel ratio
can end up different from the `devicePixelRatioF()` of the widget which
is used for most size calculations which leads to an area that might be
unpainted causing visual artifacts.

M  +19   -10   part/presentationwidget.cpp
M  +1    -0    part/presentationwidget.h

https://invent.kde.org/graphics/okular/-/commit/450744a37dbf8770b3282b47ab43a797ed8c347e
Comment 17 Sune Vuorela 2024-02-21 08:29:50 UTC
Git commit aab13e3fe25e4964a9ebbbc11832db397d51453e by Sune Vuorela, on behalf of Kai Uwe Broulik.
Committed on 21/02/2024 at 08:29.
Pushed by sune into branch 'release/24.02'.

presentationwidget: Invalidate pixmaps on dpr change

Since the last rendered pixmap is usually reused, its device pixel ratio
can end up different from the `devicePixelRatioF()` of the widget which
is used for most size calculations which leads to an area that might be
unpainted causing visual artifacts.

M  +19   -10   part/presentationwidget.cpp
M  +1    -0    part/presentationwidget.h

https://invent.kde.org/graphics/okular/-/commit/aab13e3fe25e4964a9ebbbc11832db397d51453e