Diffusion Krita 5aa7bd531ccd

Fix Screen Fetch Logic Crash in KoToolBox

Authored by eoinoneill on Jun 15 2020, 6:05 PM.

Description

Fix Screen Fetch Logic Crash in KoToolBox

There are certain system configurations (Vertical Monitor) where
QDesktop::screenNumber seems to return a an invalid screen index.
While there was a safe assert that protects release builds from crashing,
the logic before that point could probably have been more graceful about
handling missing screen fetches.

Now, if krita can't find a screen that contains a given widget, it will
instead use the primary screen index (0). If there's no primary screen,
then it will safe-assert to a default icon size. This should make the
debug builds error handle more gracefuly.

(cherry picked from commit 37778c1a3b70360d52e867f930a0d47c8ae4f43b)

Details