Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1934275

Summary: LibreoOffice missing minimize. minimize and close buttons.
Product: Red Hat Enterprise Linux 8 Reporter: Bill Sanford <bsanford>
Component: libreoffice-flatpak-containerAssignee: Stephan Bergmann <sbergman>
Status: CLOSED ERRATA QA Contact: Bill Sanford <bsanford>
Severity: medium Docs Contact: Marek Suchánek <msuchane>
Priority: unspecified    
Version: 8.4CC: caolanm, coli, jadahl, jkoten, mboisver, mclasen, otaylor, tpelka, tpopela
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libreoffice-flatpak-container-flatpak-8040020210317074620.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-19 00:21:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bill Sanford 2021-03-02 20:18:46 UTC
Description of problem:
I have enabled the minimize, maximize and close buttons within dconf-editor. 

I have opened LO and the three buttons minimize, maximize and close are not there. In every other application they are there.


Version-Release number of selected component (if applicable):
RHEL-8.4.0-20210223.2/compose/BaseOS/x86_64/os/
flatpak info org.libreoffice.LibreOffice

LibreOffice - The LibreOffice productivity suite

          ID: org.libreoffice.LibreOffice
         Ref: app/org.libreoffice.LibreOffice/x86_64/stable
        Arch: x86_64
      Branch: stable
     License: MPL-2.0
      Origin: brew-8.4.0
  Collection: 
Installation: user
   Installed: 2.6 GB
     Runtime: com.redhat.Platform/x86_64/el8
         Sdk: com.redhat.Sdk/x86_64/el8

      Commit: 6999f858c0cb51475e8a077c5967ac77887dbc4d92042feb57dae84b5898e422
     Subject: Export org.libreoffice.LibreOffice
        Date: 2021-02-19 07:22:25 +0000
      Alt-id: 2b81cd70129797c36dbd5db914780337e892b3050929ff880e37e9be085b542c
[test@localhost ~]$ 


How reproducible:
100%

Steps to Reproduce:
1. In dconf-editor, change /org/gnome/desktop/wm/preferences/button-layout to not be the default and edit the value to "appmenu:minimize,maximize,close"
2. Launch the LibreOffice flatpak.
3.

Actual results:
The close button is the only button available.

Expected results:
The minimize, maximize and close buttons should be available

Additional info:

Comment 1 Stephan Bergmann 2021-03-11 13:38:41 UTC
(In reply to Bill Sanford from comment #0)
> I have opened LO and the three buttons minimize, maximize and close are not
> there. In every other application they are there.
[...]
> Actual results:
> The close button is the only button available.

So the close button is always there, and it is only the minimize and maximize buttons that are missing, right?  (Which would match my own observations.)

Strange.  This apparently only happens with the com.redhat.Platform//el8-based LO 6.4.7.2 RHEL flatpak.  It does not happen with any of the org.fedoraproject.Platform//f32-based LO 6.4.7.2 Fedora flatpak, the org.freedesktop.Platform//20.08-based LO 7.1.1.2 Flathub flatpak, or a local LO 6.4 non-flatpak build of mine.

Following a suggestion by Caolán, I locally reverted <https://git.libreoffice.org/core/+/2937661f0e9381f84067a025f76e5554b8a1a457%5E!/> "rhbz#1392145 ensure titlebar close button matches 'outside' direction" in the RHEL flatpak build, and, seeing that libreoffice.spec also carried <https://src.fedoraproject.org/rpms/libreoffice/c/10eb5e67e76c223a985b22ea59f64567de4722b4> "gdk_wayland_window_set_application_id has become available" touching similar code, also reverted that patch locally.  But none of that had any effect.

I have no idea how to debug this issue.  Maybe Owen happens to have an idea whether there is any difference beteween com.redhat.Platform and the other runtimes that could explain this issue.

Comment 2 Stephan Bergmann 2021-03-16 11:34:44 UTC
Bill, do you know whether this actually works with the normal non-flatpak LibreOffice in RHEL 8?

Comment 3 Stephan Bergmann 2021-04-13 12:38:34 UTC
(In reply to Stephan Bergmann from comment #2)
> Bill, do you know whether this actually works with the normal non-flatpak
> LibreOffice in RHEL 8?

works fine with LO 6.3 in RHEL 8.3

@Jonas, Matthias, maybe you have an idea where to start debugging this?  LO appears to not do anything special and rely on whatever underlying part of the stack to provide those buttons.

Comment 4 Matthias Clasen 2021-04-14 11:53:03 UTC
libreoffice is relying on gtk3 for this? In that case, I would start by verifying if the desktop settings make it to the gtk side, by opening the inspector, navigating to the GtkSettings object, and looking at the gtk-decoration-layout property.

Does it have the expected value ? If not, does setting it to menu:minimize,maximize,close have the desired effect?

Next I would check that the portal delivers the expected settings, by running


gdbus call --session --dest org.freedesktop.portal.Desktop --object-path /org/freedesktop/portal/desktop --method org.freedesktop.portal.Settings.Read "org.gnome.desktop.wm.preferences" "button-layout"

Comment 5 Stephan Bergmann 2021-04-14 12:23:29 UTC
(In reply to Matthias Clasen from comment #4)
> libreoffice is relying on gtk3 for this? In that case, I would start by
> verifying if the desktop settings make it to the gtk side, by opening the
> inspector, navigating to the GtkSettings object, and looking at the
> gtk-decoration-layout property.
> 
> Does it have the expected value ? If not, does setting it to
> menu:minimize,maximize,close have the desired effect?

(Running the LO flatpak with `--env=GTK_DEBUG=interactive`:)  Yes, original value is just "menu:close", changing it to "menu:minimize,maximize,close" makes the missing buttons appear.

> Next I would check that the portal delivers the expected settings, by running
> 
> 
> gdbus call --session --dest org.freedesktop.portal.Desktop --object-path
> /org/freedesktop/portal/desktop --method
> org.freedesktop.portal.Settings.Read "org.gnome.desktop.wm.preferences"
> "button-layout"

output is "(<<'appmenu:minimize,maximize,close'>>,)"

Comment 6 Stephan Bergmann 2021-04-14 13:07:13 UTC
(In reply to Stephan Bergmann from comment #1)
> Strange.  This apparently only happens with the
> com.redhat.Platform//el8-based LO 6.4.7.2 RHEL flatpak.  It does not happen
> with any of the org.fedoraproject.Platform//f32-based LO 6.4.7.2 Fedora
> flatpak, the org.freedesktop.Platform//20.08-based LO 7.1.1.2 Flathub
> flatpak, or a local LO 6.4 non-flatpak build of mine.

Nor does it happen with e.g. the org.gimp.GIMP RHEL flatpak, using the same com.redhat.Platform/x86_64/el8 runtime (which btw. uses GTK 3.22.30, according to the name of its /usr/lib64/libgtk-3.so.0.2200.30).

And I at least am on Fedora 33 GNOME/Wayland with all my experiments (though no idea about the original bug report).

Comment 7 Matthias Clasen 2021-04-14 18:47:42 UTC
Ok, I built gtk 3.22.30 locally to refresh my memory of what was going on back then.

It turns out the Wayland backend was reading settings directly from GSettings at that
time. Support for reading them from the settings portal was added two releases later,
in 3.24.2.

So, I think the recommendation for now has to be: use X11 backend.

I assume that is what the gimp flatpak does (would be good to double-check).

Comment 8 Stephan Bergmann 2021-04-15 06:51:16 UTC
(In reply to Matthias Clasen from comment #7)
> I assume that is what the gimp flatpak does (would be good to double-check).

Indeed, <http://pkgs.devel.redhat.com/cgit/containers/gimp/tree/container.yaml?h=rhel-8.3.1&id=fe4d7bc375116946bd23ab7d1d01bc66c72dbc1c> only contains --socket=x11 and no --socket=wayland.

And droping --socket=wayland from the libreoffice container.yaml fixes the issue.  Thanks for tracking it down!

Comment 13 Bill Sanford 2021-04-27 15:28:10 UTC
Verified with:

[test@localhost ~]$ flatpak info org.libreoffice.LibreOffice

LibreOffice - The LibreOffice productivity suite

          ID: org.libreoffice.LibreOffice
         Ref: app/org.libreoffice.LibreOffice/x86_64/stable
        Arch: x86_64
      Branch: stable
     License: MPL-2.0
      Origin: brew-8.4.0
  Collection: 
Installation: user
   Installed: 2.5 GB
     Runtime: com.redhat.Platform/x86_64/el8
         Sdk: com.redhat.Sdk/x86_64/el8

      Commit: 20879364762161aa7ef6db0ffa6ee0fd0069eb5a66dca1a001786e31dd9e4339
     Subject: Export org.libreoffice.LibreOffice
        Date: 2021-04-15 13:42:06 +0000
      Alt-id: f64c9a55a5f31dc04280bea44ca91282c40e524d4083c564ac20c7be0bfc0e86
[test@localhost ~]$

Comment 15 errata-xmlrpc 2021-05-19 00:21:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new LibreOffice Flatpak container image), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2018