discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Images disappear after Display Resolution Change


From: Ondrej Florian
Subject: Re: Images disappear after Display Resolution Change
Date: Sun, 31 Dec 2023 10:01:33 +0100
User-agent: GNUMail (Version 1.4.0)

Hmm, I did some more testing.
Although it does help in some situations, the problem still persists in other 
cases (e.g. NSButton + image)

Anyone has an idea where to look next?

On 2023-12-30 18:21:16 +0100 Tom Sheffler <tom.sheffler@gmail.com> wrote:

> That looks like a good approach.  FWIW - I have found that the 
> NSApplicationDidChangeScreenParametersNotification
> is also listened for in NSWindow which gets the window’s new NSScreen and 
> (i think) redraws the window.  But I
> couldn’t find anything in NSWindow.m that might trigger image caches being 
> emptied or recalculated.
> 
>> On Dec 30, 2023, at 8:23 AM, Ondrej Florian <onflapp@yahoo.com> wrote:
> 
>> I think I managed to fix the problem by clearing NSImage cache after 
>> receiving NSApplicationDidChangeScreenParametersNotification
> 
>> Please see:
>> https://github.com/onflapp/libs-gui/commit/2b6a26b2f013d79971165abf7b10a56b5e42c619
>> There is still problem with GWorkspace though.
>> Non-scaled icons works fine but scaled icons (e.g. list / browser view) do 
>> not.
> 
> 
>> On 2023-12-29 22:23:45 +0100 Gregory Casamento <greg.casamento@gmail.com> 
>> wrote:
> 
>>> Would it be possible for you to file a bug for this on GitHub?  The proper
>>> place is https://github.org/gnustep/libs-gui under the “Issues” tab.
> 
>>> Gregory Casamento
>>> GNUstep Lead Developer / OLC, Principal Consultant
>>> http://www.gnustep.org - http://heronsperch.blogspot.com
>>> https://www.patreon.com/bePatron?u=352392 - Become a Patron
>>> https://www.openhub.net/languages/objective_c - OpenHub standings
> 
> 
>>> On Fri, Dec 29, 2023 at 15:58 Paulo Delgado <paulo@paulodelgado.com> wrote:
> 
>>>> I noticed something similar happened to me on a clean Debian installation
>>>> whenever the computer came back from sleep. Images and icons were all 
>>>> gone,
>>>> also wallpaper (which gworkspace manages in my installation).
> 
> 
>>>> PD
> 
>>>>> On Dec 29, 2023, at 1:52 PM, Ondrej Florian <onflapp@yahoo.com> wrote:
> 
>>>>> This also happens (sometimes) when you attach external display..
>>>>> It is certainly related to change of display resolution and easily
>>>> reproducible by invoking xrandr.
> 
>>>>> I guess that GNUstep is caching some kind of data that needs to be
>>>> invalidated.
> 
> 
>>>>>> On 2023-12-28 14:25:21 +0100 Sebastian Reitenbach <
>>>> sebastia@l00-bugdead-prods.de> wrote:
> 
>>>>>> Hi,
> 
>>>>>> On Tuesday, December 26, 2023 19:52 CET, Tom Sheffler
>>>>>> <tom.sheffler@gmail.com> wrote:
> 
>>>>>>> I’ve recently installed gs-desktop (from
>>>> github.com/onflapp/gs-desktop/
>>>>>>> <http://github.com/onflapp/gs-desktop/>) on Debian 12 into a clean
>>>>>>> partition in a System76 laptop.  It all works very nicely as a desktop
>>>>>>> environment.
> 
>>>>>>> I have noticed an annoying problem when I change resolutions - I seem
>>>> to do
>>>>>>> this often: when I plug in an external monitor I size things one way,
>>>> and
>>>>>>> when not connected I size the display another way.  I’ve investigated
>>>> the
>>>>>>> problem, and do not have a good fix. I’m hoping that by sharing my
>>>>>>> experience here someone might be able to shed some light on the
>>>> subject.
> 
> 
>>>>>>> Upon resizing the main screen, icons and images disappear.  The
>>>> commands I
>>>>>>> use are
> 
>>>>>>>    - xrandr —output eDP-1 —mode 1400x1050
>>>>>>>    - xrandr —output eDP-1 —mode 1600x900
> 
>>>>>>> After changing resolutions, images and icons in the following apps have
>>>>>>> been seen to dissappear
>>>>>>>   - GWorkspace
>>>>>>>   - Gorm
>>>>>>>   - nextspace/Preferences
>>>>>>>   - gs-desktop/Applications/VolMon
>>>>>>>   - gs-desktop/Applications/MountUp
> 
>>>>>>> The picture below shows two versions of GWorkspace FileViewer.  The
>>>> one on
>>>>>>> top is GWorkspace installed “as-is” and shown after changing the
>>>>>>> resolution of the display.  The large icons and the small icons are all
>>>>>>> gone.  They do not reappear after any amount of fiddling with controls
>>>> or
>>>>>>> themes I attempt.
> 
>>>>>>> The bottom FileViewer is a modified copy of GWorkspace that has been
>>>>>>> changed to add a new menu item called “Redraw” that does a couple 
>>>>>>> of
>>>>>>> things.  It deletes image caches in various places and then calls
>>>> [NSApp
>>>>>>> updateWindows].  This does not immediately fix the images, but after
>>>>>>> scolling around the images get refreshed as the caches are rebuilt.
>>>>>>> The two “DIFF” files attached in this message show what code
>>>>>>> modifications I made to support the “Redraw” menu item.
> 
>>>>>>> While clearing the caches helps fix the problem, I don’t really 
>>>>>>> believe
>>>>>>> I’m on totally the right track for a permanent fix across 
>>>>>>> applications.
>>>>>>> So I’m looking for suggestions or other insights.  Or at least that
>>>> this
>>>>>>> info helps someone else one day.
> 
>>>>>>> ===
> 
>>>>>>> I”ve also investigated an entirely different track, changing the
>>>>>>> following line in NSImage.m
>>>>>>>     _cacheMode = NSImageCacheDefault;
>>>>>>> to
>>>>>>>     _cacheMode = NSImageCacheNever;
> 
>>>>>>> and rebuilding.  In GWorkspace, this fixes the Large icons, but breaks
>>>> the
>>>>>>> Small icons.  It does, however, also fix the module images in the
>>>>>>> Nextspace/Preferences app so that they do not disappear upon resolution
>>>>>>> changes.
> 
>>>>>>> Thanks,
>>>>>>> T
> 
>>>>>> just recently, a few weeks ago, I exchanged my desktops Nvidia card,
>>>> with 2
>>>>>> monitors (2xHD), with a AMD based graphics car, and a single monitor
>>>> UWQHD.
>>>>>> I'm on OpenBSD, using latest gnustep releases, and after suspend/resume
>>>>>> cycle, I see the same.
>>>>>> Haven't had time to dig into it, thought might be because of graphics
>>>> GPU
>>>>>> driver change, or resolution change etc.
>>>>>> But it's only GNUstep applications that loose the images, most notably
>>>>>> GWorkspace.
> 
>>>>>> Sebastian
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]