Bug 153869 - Under KDE, minimized windows are not de-minimized when selected in "Window" menu
Summary: Under KDE, minimized windows are not de-minimized when selected in "Window" menu
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:7.6.0 target:7.5.2
Keywords:
Depends on:
Blocks: KDE, KF5
  Show dependency treegraph
 
Reported: 2023-02-27 20:27 UTC by Rickard Westman
Modified: 2023-03-02 09:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rickard Westman 2023-02-27 20:27:38 UTC
Description:
I'm used to minimized windows being automatically de-minimized when selected from within applications.  I believe it used to work that way in LibreOffice on my old PC (running older versions of everything) but on my new one (running Kubuntu 22.04 with KDE Plasma 5.24.7), nothing happens when I select a minimized window in the Window menu.  If a window is not minimized, everything works smoothly: It is brought to the front, focused, and there is even an automatic switch to the correct virtual desktop if needed.  But none of that happens with minimized windows.  

It doesn't seem to be a fundamental limitation of the KDE window manager – Google Chrome manages to de-minimize windows when selected in its equivalent menu.

Steps to Reproduce:
1. Start LibreOffice Calc with a new document, "Untitled 1".  
2. Select "New / Spreadsheet" in the File menu, creating another window: "Untitled 2".
3. Minimize the "Untitled 2" window using the minimize icon in its title bar.
4. Go to the "Untitled 1" window and select "Untitled 2" in its Window menu.

Actual Results:
Nothing happens.

Expected Results:
The window "Untitled 2" should show up, meaning it has to be de-minimized first.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
My old PC (running Kubuntu 18.04 and the LibreOffice shipped with that) is dead, so I can't verify that this really worked as I wanted there (although I believe it did).  But I tried an even older computer with Ubuntu 16.04 and LibreOffice 6.2.8.2, and it worked fine there under both KDE and GNOME.  So I'm filing this as a bug rather than an enhancement request, since the functionality was evidently there and working at some point.
Comment 1 Rickard Westman 2023-02-28 05:27:24 UTC
Problem seems related to the kf5 (cairo+xcb) VCL backend, which is the default under Kubuntu.  If I override that by setting the environment variable SAL_USE_VCLPLUGIN=gen, the problem goes away at the expense of getting an antique-looking UI.
Comment 2 Rafael Lima 2023-02-28 11:43:53 UTC
Hi Richard, thanks for reporting.

I can reproduce this bug. If a window is minimized, switching to this window with the "Window" menu will not work.

I'm on KDE Plasma 5.27.1 (Kubuntu 22.10). System info:

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: 50(Build:3)
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.5.0~rc3-0ubuntu0.22.10.1~lo1
Calc: threaded
Comment 3 Rickard Westman 2023-02-28 15:46:44 UTC
Regarding comment #1: 

Setting SAL_USE_VCLPLUGIN=gtk3 also worked for me (after installing the package libreoffice-gtk3, which isn't installed by default on Kubuntu 22.04).  It makes the UI look a little different, but less drastically so than with SAL_USE_VCLPLUGIN=gen, so it seems like a reasonable workaround for me.  (Perhaps some aspect of KDE integration is negatively affected by this – haven't noticed anything yet but also haven't used it for long).

Trying the same thing with SAL_USE_VCLPLUGIN=qt5 and libreoffice-qt5 did *not* help, though, so perhaps the qt5 and kf5 VCL backends have a shared bug.
Comment 4 Michael Weghorn 2023-03-01 10:03:45 UTC
Pending Gerrit change:
https://gerrit.libreoffice.org/c/core/+/148036

(In reply to Rickard Westman from comment #3)
> Setting SAL_USE_VCLPLUGIN=gtk3 also worked for me (after installing the
> package libreoffice-gtk3, which isn't installed by default on Kubuntu
> 22.04).  It makes the UI look a little different, but less drastically so
> than with SAL_USE_VCLPLUGIN=gen, so it seems like a reasonable workaround
> for me.  (Perhaps some aspect of KDE integration is negatively affected by
> this – haven't noticed anything yet but also haven't used it for long).

One of the probably more obvious things is that the gtk file dialog will be used for opening or saving files etc instead of the KDE Plasma one.

> Trying the same thing with SAL_USE_VCLPLUGIN=qt5 and libreoffice-qt5 did
> *not* help, though, so perhaps the qt5 and kf5 VCL backends have a shared
> bug.

Yes, they share most of the code. The kf5 VCL plugin is basically qt5 + the KF5/KDE file dialog on top.
Comment 5 Commit Notification 2023-03-01 13:24:49 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/00a602ca8e75ab5cf050e092289ef7165b343165

tdf#153869 qt: Unminimize window when requested

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2023-03-02 09:16:46 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/feb965b13dd3d5c34b0aa62280b65f9d0bf78c23

tdf#153869 qt: Unminimize window when requested

It will be available in 7.5.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.