The problem is caused by bug https://invent.kde.org/sdk/kdiff3/-/merge_requests/8 which Canonical has not applied for Ubuntu 18.04 LTS because they seem to think that "stable release" only means fixing security bugs, not functional bugs.
The problem is caused by kdiff3
version distributed with Ubuntu 18.04 mixing the concepts of maximized vs fullscreen. If you maximize the kdiff3
window and exit the program, it will store the WindowStateMaximised=true
in the configuration file at ~/.kde/share/config/kdiff3rc
or ~/.config/kdiff3rc
modifying any existing value. If both exist, the first one will be used.
However, the setting WindowStateMaximised=true
is considered to mean WindowStateFullScreen=true
during the next start which causes the whole problem. To make things worse, this kdiff3
version doesn't seem to have any user accessible interface to switch out of fullscreen state either.
The workaround I'm using on Ubuntu 18.04 LTS is as follows:
Create file ~/bin/kdiff3 with following contents
#!/bin/dash
# workaround https://invent.kde.org/sdk/kdiff3/-/merge_requests/8
# see also: https://mcmap.net/q/1356358/-kdiff3-missing-window-controls-after-upgrade-to-ubuntu-18/334451
perl -i -npe 's/WindowStateMaximised=true/WindowStateMaximised=false/' ~/.kde/share/config/kdiff3rc ~/.config/kdiff3rc
exec /usr/bin/kdiff3 "$@"
The idea is to introduce a new kdiff3
command that first modifies the config file(s) to avoid this problem and then launches the real kdiff3
process with all the passed in command line parameters.
The perl
command modifies both the configuration files "in place" (-i
) meaning it directly modifies the contents of both config files.
The only real fix for this program is to use fixed version of kdiff3
. For Canonical supported versions this requires upgrading the whole operating system to Ubuntu 20.04 LTS or later.