-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images disappear after Display Resolution Change #235
Comments
Some more information. In NSImage.m, by setting the default cache mode for all images
many images are "fixed" as screens and resolutions are changed. However, there are some that are not. One kind in particular are the Button images in apps like gs-desktop/Applications/VolMon Through a process of trial and error and print statements, I determined that these images are loaded through the last part of initWithCoder - these images have "reps" that are loaded from a Gorm project.
Images loaded this way do not receive the "CacheNever" flag treatment. Adding this line "fixed" the problem for VolMon and a few other things.
Perhaps this sheds some more light on the underlying problem. Setting CacheNever is a workaround that I think is masking something deeper. FYI - using VolMon as a test case was good for tracing through the image handling because it only loads 4 images this way. |
I did the two changes @sheffler suggested in NSImage.m, changing the _cacheMode, and adding the _cacheMode line. Before the change, on initial startup and login, all images were there, now some are missing, i.e. the small icons in the File Viewer, and some app icons in the dock. See screenshot. However, those that are there, incl. my desktop background, now survive a suspend/resume cycle. For those in the dock, I first thought it might have something to do with filetype, but that doesn't seem to be the case. |
I’ve recently installed gs-desktop (from 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
After changing resolutions, images and icons in the following apps have been seen to dissappear
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.
========================
========================
The text was updated successfully, but these errors were encountered: