Zoom Pops Up a Window for ... RawTherapee?? (Shallow Thoughts)

Akkana's Musings on Open Source Computing and Technology, Science, and Nature.

Mon, 27 Mar 2023

Zoom Pops Up a Window for ... RawTherapee??

I've been annoyed for some time by the way that Zoom, when it finishes processing a recording after a meeting, pops up a ... Raw Therapee window??

RawTherapee is a program for handling RAW image files, the kind that many digital cameras can generate but that most image apps can't read. It's a fine program. But it's not a file manager, nor is it a video player. It makes absolutely no sense to pop it up to handle a video file. And it's very slow to start up, so I would leave a Zoom meeting, and then half a minute later this weird window would pop up for no apparent reason.

I've seen a few other programs, like wine, pop up these RawTherapee windows. I've been trying for many months to figure out why this happens, and I've finally found the answer, and a fix.

I'd been repeatedly trying sequences like

$ xdg-mime query filetype video1586974388.mp4
  (other stuff snipped)
video/mp4
$ xdg-mime query default video/mp4
mplayer.desktop
That showed that the handler for the MP4 video files Zoom produces is mplayer, a perfectly reasonable default for handling an MP4 video.

Today I found myself grepping for anything that might be pointing to rawtherapee. I tried grepping /etc/mailcap for anything that referenced rawtherapee. I saw some types that shouldn't be there, like image/jpeg, that would be much better handled by some other program. But I almost missed the key, the very last line:

inode/directory; rawtherapee %s; test=test -n "$DISPLAY"

inode/directory! The reason I hadn't been finding it with the xdg query tools is that it wasn't looking for a handler for the video file, it was looking for a handler for the directory containing it.

Reproducing the Problem

One reason it's taken me so long to solve this problem is that it's hard to reproduce, since I don't make Zoom recordings all that often, and creating a meeting, starting it, recording it, then quitting is a lot of hassle to go through every time. And I haven't figured out what combination of factors causes it from wine.

Once I realized it was requesting a handler for the directory, not the video file, I found an easy way to reproduce it:

xdg-open /tmp/
popped up a RawTherapee window every time. And xdg-mime query default inode/directory pointed to rawtherapee.desktop.

Removing It

Since I'd found the reference in /etc/mailcap, I first edited that file. I removed the offending inode/directory line, and I also removed rawtherapee from all the image types that are already handled perfectly well by simpler image editors: image/jpeg, image/png, image/tiff, image/x-jpg, image/x-tif.

But xdg-mime query default inode/directory still pointed to rawtherapee.desktop.

Next, I discovered that /usr/share/applications/rawtherapee.desktop contains MimeType=image/jpeg;image/png;image/tiff;image/x-adobe-dng;image/x-canon-cr2;image/x-canon-cr3;image/x-canon-crf;image/x-canon-crw;image/x-fuji-raf;image/x-hasselblad-3fr;image/x-hasselblad-fff;image/x-jpg;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-leaf-mos;image/x-leica-rwl;image/x-mamiya-mef;image/x-minolta-mrw;image/x-nikon-nef;image/x-nikon-nrw;image/x-olympus-orf;image/x-panasonic-raw;image/x-panasonic-rw2;image/x-pentax-pef;image/x-pentax-raw;image/x-phaseone-iiq;image/x-raw;image/x-rwz;image/x-samsung-srw;image/x-sigma-x3f;image/x-sony-arq;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-tif;inode/directory;

I removed the types that shouldn't be there, ending up with MimeType=image/jpeg;image/png;image/tiff;image/x-adobe-dng;image/x-canon-cr2;image/x-canon-cr3;image/x-canon-crf;image/x-canon-crw;image/x-fuji-raf;image/x-hasselblad-3fr;image/x-hasselblad-fff;image/x-jpg;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-leaf-mos;image/x-leica-rwl;image/x-mamiya-mef;image/x-minolta-mrw;image/x-nikon-nef;image/x-nikon-nrw;image/x-olympus-orf;image/x-panasonic-raw;image/x-panasonic-rw2;image/x-pentax-pef;image/x-pentax-raw;image/x-phaseone-iiq;image/x-raw;image/x-rwz;image/x-samsung-srw;image/x-sigma-x3f;image/x-sony-arq;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-tif;inode/directory;

But xdg-mime query default inode/directory still pointed to rawtherapee.desktop.

There's a clue in all the chatter xdg-mime prints on queries:

$  xdg-mime query default inode/directory
Checking /home/akkana/.config/mimeapps.list
Checking /home/akkana/.local/share/applications/defaults.list and /home/akkana/.local/share/applications/mimeinfo.cache
Checking /home/akkana/.local/share/applications/defaults.list and /home/akkana/.local/share/applications/mimeinfo.cache
Checking /var/lib/flatpak/exports/share/applications/defaults.list and /var/lib/flatpak/exports/share/applications/mimeinfo.cache
Checking /var/lib/flatpak/exports/share/applications/defaults.list and /var/lib/flatpak/exports/share/applications/mimeinfo.cache
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/share//applications/defaults.list and /usr/share//applications/mimeinfo.cache
rawtherapee.desktop

I looked through all those files (most of them don't exist), and it turned out /usr/share//applications/mimeinfo.cache (double slash courtesy of xdg-mime) had lots of rawtherapee references as well.

Presumably that's a generated file, but I haven't been able to find out how and when it's regenerated; some people on the net say it's regenerated at every boot, but that's clearly not true since the modified date on the file was five days old and I booted this morning.

Update: Grzegorz Szymaszek pointed me to update-desktop-database from package desktop-file-utils. It's run during apt upgrades, every time a package (un)installation modifies /usr/share/applications. Thanks, Grzegorz! I'll have a little more about update-desktop-database in part 2.

Okay, whatever. I edited /usr/share//applications/mimeinfo.cache and removed all the rawtherapee lines by hand. And that did it! Now xdg-open /tmp/ didn't find anything. Hurray!

I'm very happy not to have RawTherapee windows randomly popping up. But could I actually make the system do something useful, and show me where the file was stored without needing to run a GUI file manager?

The answer is yes, and I'll write that up and post it in a few days.

Update: you can read that here: A Fake File Manager.

Tags: , ,
[ 16:26 Mar 27, 2023    More linux | permalink to this entry | ]

Comments via Disqus:

blog comments powered by Disqus