[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Images disappear after Display Resolution Change
From: |
Fred Kiefer |
Subject: |
Re: Images disappear after Display Resolution Change |
Date: |
Sat, 6 Jan 2024 21:48:00 +0100 |
Let me try to explain roughly what happens when an image gets displayed. First
we try to find the best representation for this image. We may already have
different representations when loading an image from a file and we also regard
the created cached versions as representations (This might be wrong!). After
that we get the cached version for this representation (creating one if there
isn’t one). Now this cached version might be generated for a different
resolution or even for e different colour order. So we should compare the
device description for the cached versions with the current device description.
There is at the moment no code in place to store that.
And if I remember correctly things are even worse. The cached representations
is just drawn into a hidden window for the current display. That way a cached
representation is only suitable for the display it was created for. Decoupling
this should be the first step.
> Am 06.01.2024 um 11:02 schrieb Riccardo Mottola <riccardo.mottola@libero.it>:
>
> Fred Kiefer wrote:
>> This looks like a nice way to work around this issue. At the moment I am not
>> sure, whether it is such a good idea to have every image in an application
>> to watch out for a screen change notification. But from my side it would be
>> OK to enable this and see if we get negative results.
>> With the code itself I have a few minor white space issues. Feel free to
>> open a pull request and we can try to get it through before the year ends.
>
> if you like that approach for libs-gui, I wonder if something needs to be
> done in GWorkspace and what.. and furthermore if then potentially *any*
> application needs to be resolution-change aware.
>
> We could try to look at this in a next hacking session.
>
> Is there an easy way to cause a resolution change without things like putting
> a laptop to sleep or switching monitors? I'm thinking if perhaps issuing
> xrandr commands would be enough. We need this to be able to reproduce as well
> as test all applications that handle images.
>
> Riccardo
>