mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
269 stars 145 forks source link

Caja does not resize desktop area after automatic resolution change #1096

Closed jsane-h8ms closed 1 year ago

jsane-h8ms commented 5 years ago

Description

My setup: Laptop with 2880x1620 display Docking station with 1920x1080 (or 1200) monitor connected bug

When docked, both displays use 1920x1080, for a total usable desktop size of 3840x1080. The resolution of my laptop display is automatically adjusted when docking or undocking (as it should), but the usable desktop area does not change with the resolution.

When docking for example, the added screen area to the right is usable for applications, but the desktop wallpaper is not redrawn, causing visual artifacts and I can not place desktop items there or drag a selection box with my mouse. (See screenshot and illustration, blue criss-crossed area is broken) screen

The same happens when undocking, (if the session was started docked) the added desktop area below is not usable (green area in illustration; in this case, the visual artifacts do not happen most of the time).

Expected behaviour

Caja notices the new display resolution(s) and adjusts desktop area accordingly.

Actual behaviour

Caja only uses the smaller width or height of the previous resolution for the usable desktop area. Workaround is to kill Caja and let it restart.

Steps to reproduce the behaviour

  1. Get high-dpi laptop, dock and 1080p monitor
  2. Dock laptop
  3. Adjust laptop resolution to 1080p
  4. Undock laptop
  5. If neccessary, adjust laptop resolution back to native
  6. For good measure, reboot
  7. Dock laptop, wait for resolution change
  8. Observe artifacts

MATE general version

1.20.1

Package version

1.20.2-4ubuntu1

Linux Distribution

Linux Mint 19 / 19.1

This is a regression from Mint 18.1 (Mate 1.16.2 GTK2 build; I skipped Mate 1.18.x GTK 3 because of theming issues, so did not test).

Link to downstream report of your Distribution

https://github.com/linuxmint/mint-19.1-beta/issues/70

bcolloran commented 4 years ago

i have this issue as well. @hate-m-dollarsign, did you ever find a workaround?

enly1 commented 4 years ago

I have this every day and its very annoying - my solution was to go to wallpaper settings. As soon as the options are displayed, it recognises the new desktop size and operates correctly again.

jsane-h8ms commented 3 years ago

i have this issue as well. @hate-m-dollarsign, did you ever find a workaround?

Hi everyone! I just noticed your question, better late than never. As I mentioned in the description "Workaround is to kill Caja and let it restart."

I made a custom panel launcher with command "killall caja", and chose a fitting icon (hicolor/scalable/apps/mate-panel-force-quit.png). That is the most comfortable way I could think of. One click, takes less than a second for caja to restart automatically.

The wallpaper-settings trick is also good to know, but takes a very long time for me to load (Linux Mint has a lot of wallpapers to choose from and I suspect the algorithm mate uses to load them or the preview thumbnails is very inefficient).

loongson-zjl commented 3 years ago

I do this in mate-settings-daemon like this resize-backgroud-for-apply-new-config.txt I do not know if this is a good way,but it can work for me . thanks for all suggest .

Tom9729 commented 1 year ago

Seems like this might be related to #945 (which unfortunately is also unresolved).

Tom9729 commented 1 year ago

This is a terrible workaround but I wanted a way to fix this automatically without losing any open browsers so I came up with this. It watches the screen resolution and toggles "show-desktop-icons" (which forces Caja to reset without killing it) if the resolution changes. Save this in a script like /usr/bin/fix-caja and chmod +x it, then add it to your Mate startup applications.

#!/bin/bash
kill -9 $(pgrep -f ${BASH_SOURCE[0]} | grep -v $$) # kill previous instance of script
old=$(xrandr|sha1sum)
while true
do
    new=$(xrandr|sha1sum)
    if [ ! "$new" = "$old" ]
    then
        dconf write /org/mate/desktop/background/show-desktop-icons false
        dconf write /org/mate/desktop/background/show-desktop-icons true
        old="$new"
    fi
    sleep 5 # avoid spamming xrandr too much
done

Edit: Fixed duplicate instances of script if used as startup app.