Port appmenu support to Qt5 QPA

Bug #1157213 reported by Łukasz Zemczak
40
This bug affects 6 people
Affects Status Importance Assigned to Milestone
appmenu-qt
Won't Fix
High
Łukasz Zemczak
appmenu-qt5
Fix Released
High
Łukasz Zemczak
qtbase-opensource-src (Ubuntu)
Fix Released
High
Łukasz Zemczak

Bug Description

Please see the related blueprint for some of the plans related to the implementation. For now, the current one (which might change) is writing a custom QPlatformTheme plugin which will be loadable on any QPA possible.

---

Currently we have proposed Qt5 appmenu support downstream as patches basing on the previous Qt4 support code upstream. This is a sufficient solution for now, but Qt5 introduced something called QPA (Qt Platform Abstraction) that is supposed to resolve such things like custom-OS theming and features.

This would essentially require re-writing appmenu-qt to the QPA theme QPlatformMenuBar API and writing a custom Ubuntu/Linux theme loading appmenu-like plugins.

Qt 5.2 with appmenu patches included testable with:
sudo apt-add-repository ppa:canonical-qt5-edgers/qt5-beta2
sudo apt-get update
sudo apt-get dist-upgrade

To revert back to archive versions:

sudo ppa-purge ppa:canonical-qt5-edgers/qt5-beta2

Tags: patch qt5.2
Changed in appmenu-qt:
assignee: nobody → Łukasz Zemczak (sil2100)
Changed in qtbase-opensource-src (Ubuntu):
assignee: nobody → Łukasz Zemczak (sil2100)
Changed in qtbase-opensource-src (Ubuntu):
status: New → In Progress
Revision history for this message
Scott Kitterman (kitterman) wrote :

What changes in Qt5 are needed for this? The way the bug reads, this is adapting appmenu-qt to work with Qt5, not the other way around?

Changed in appmenu-qt:
status: New → In Progress
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

After the current stages of analysis, it seems that there might be no changes to Qt5 required at all. At the first stages, I thought we'll have to introduce some upstream modifications to Qt5 - but after discussing with some of the Qt5 developers, it seems we can make use of the QPlatformThemeFactory framework and build everything in the separate appmenu-qt5 package.

I'm working on a related blueprint, it's attached to this bug. Architectural plans will be mentioned there.
https://blueprints.launchpad.net/appmenu-qt/+spec/qt5-qpa-appmenu

Changed in appmenu-qt:
importance: Undecided → High
Revision history for this message
Florian Boucault (fboucault) wrote :

Don't forget Ubuntu already has a QPA plugin for Ubuntu Touch. https://launchpad.net/qtubuntu

Revision history for this message
Ted Gould (ted) wrote :

Seems to me like it should be the same QPA plugin. If the application requests a menu bar it should export via appmenu to the panel. For applications that are using the SDK that won't be the case, but others will have to be supported as part of the convergence story.

Revision history for this message
Ted Gould (ted) wrote :

Also, as part of this project can we make it not simply port the appmenu code, but also migrate it from DBusmenu to GMenu. That's a long term goal, and if someone has the code open would be nice. Perhaps it needs to be another work item, but we do need to do both.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1157213] Re: Port appmenu support to Qt5 QPA

On Tuesday, May 07, 2013 02:24:14 PM you wrote:
> Also, as part of this project can we make it not simply port the appmenu
> code, but also migrate it from DBusmenu to GMenu. That's a long term
> goal, and if someone has the code open would be nice. Perhaps it needs
> to be another work item, but we do need to do both.

Long term goal for who? DBusmenu is used upstream in KDE, so it's not just a
distribution issue.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Well, basically we could use the qtubuntu QPA plugin, but that's not required. Actually I've been thinking to do it as a separate package in fact. Might need to update the bug description, as my research changed the approach to the problem a bit. The attached blueprint has more info on that.

In a quick overview: we don't have to make it part of a QPA plugin. We can simply make a stand-alone QPlatformTheme plugin that will be loaded on any QPA that's currently used. So, this appmenu QPA QPlatformTheme plugin would be a generic unix theme with the appmenu-qt functionality. In my free work time I'm actually working around the strangeness of the platform menubars implementation to make it less code-duplicating. But we'll see how it goes.

For now I would simply stick to DBusmenu as this is what we have been using currently and then, if needed, open up a separate work item for that one.

description: updated
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

On Wed, May 8, 2013 at 6:12 PM, Łukasz Zemczak
<email address hidden> wrote:
> So, this appmenu QPA QPlatformTheme plugin would be a generic unix theme with the
> appmenu-qt functionality.

Do you mean that Qt will always use something based on
QGenericUnixTheme, and not on QGnomeTheme / QKdeTheme / etc?

tags: added: qt5.1
Changed in qtbase-opensource-src (Ubuntu):
importance: Undecided → High
description: updated
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

There is some progress related to this bug. I have a working QPA QPlatformThemePlugin approach, but it still needs some love. Will be pushing branches and updating soon.

tags: added: qt5.2
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

The currently attached branch is made to work with the older, 5.0.2 Qt5 version, but it can be easily ported to the upper one by redirecting to the newer branches and bumping plugin version.

I am also attaching the two required Qt5 patches that need to be in in order for things to work. One of the patches might require some discussion in case we can deal with this differently (the one with the plugin theme check order).

Revision history for this message
Łukasz Zemczak (sil2100) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch_5.2_make_qkdetheme_public.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in qtbase-opensource-src (Ubuntu):
status: In Progress → Fix Committed
Changed in appmenu-qt5:
assignee: nobody → Łukasz Zemczak (sil2100)
status: New → Fix Committed
Changed in appmenu-qt:
status: In Progress → Won't Fix
Changed in appmenu-qt5:
importance: Undecided → High
description: updated
tags: removed: qt5.1
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :
Revision history for this message
Scott Kitterman (kitterman) wrote :

Does that mean this is going to be able to land soon?

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (13.3 KiB)

This bug was fixed in the package qtbase-opensource-src - 5.2.1+dfsg-1ubuntu7

---------------
qtbase-opensource-src (5.2.1+dfsg-1ubuntu7) trusty; urgency=medium

  [ Colin Watson ]
  * Add arm64 to archs that don't use -m64

qtbase-opensource-src (5.2.1+dfsg-1ubuntu6) trusty; urgency=medium

  * Add Use-None-instead-of-GLX_NONE.patch:
    - Cherry-pick upstream patch (LP: #1288278)

qtbase-opensource-src (5.2.1+dfsg-1ubuntu5) trusty; urgency=medium

  * Only run tests on armhf, amd64 and i386.

qtbase-opensource-src (5.2.1+dfsg-1ubuntu4) trusty; urgency=medium

  [ Chris Gagnon ]
  * Enable unit tests

qtbase-opensource-src (5.2.1+dfsg-1ubuntu3) trusty; urgency=medium

  * Revert the transitional package change final landing.

qtbase-opensource-src (5.2.1+dfsg-1ubuntu2) trusty; urgency=medium

  * libqt5core5 transitional package to be able to run ABI related tests

qtbase-opensource-src (5.2.1+dfsg-1ubuntu1) trusty; urgency=low

  [ Dmitry Shachnev ]
  * Update watch file (taken from Debian).
  * Fix generating documentation by building qdoc before using it.
  * Remove qtcreator.qdoc from qtbase5-doc.install, as it is already in
    qtbase5-dev.install.
  * Merge with Debian up to 5.2.0~beta1+dfsg-3.
    - Fixes build failures on powerpc and armel.
  * Add debian/patches/fix_cppcodemarker_crash.patch to fix qdoc
    crash that caused ubuntu-ui-toolkit to FTBFS (LP: #1217331).

  [ Łukasz 'sil2100' Zemczak ]
  * Cherry-pick two submitted patches to support appmenu-qt: (LP: #1157213)
    - make_qkdetheme_constructor_public.diff
    - platformtheme_env.diff

  [ Timo Jyrinki ]
  * New upstream release 5.2.1 (LP: #1256341) (LP: #1223032) (LP: #1222988)
    (LP: #1223042) (LP: #1253120) (LP: #1251262)
  * Sync with Debian 5.2.0+dfsg-7, remaining changes:
    - Remove firebird and ibase dependencies
    - Maintainer fields and Vcs-Bzr
    - No gdb required on ppc64el
    - Provides: qt-default to qt5-default
    - Define explicit list on which archs openvg required
    - Additional patches:
      + disable_overlay_scrollbars.diff
      + load_testability_from_env_var.patch
      + make_qkdetheme_constructor_public.diff
      + platformtheme_env.diff
      + qdoc-Fix-crash-in-Generator-generateInnerNode.patch
      + 0001-Do-not-overwrite-basePixmap-of-QIconLoader-PixmapEnt.patch
    - Use our symbols files
    - Additional multi-arch packages (not correct policy-wise)
  * Drop upstream patches:
    - add_since_52_to_new_QColor_features.patch
    - fix_cppcodemarker_crash.patch
    - fix_usr-move_workaround_in_the_presence_of_multi-arch.patch
    - make_QColor_understand_AARRGGBB.patch
    - Add-workaround-for-GL-on-Android-emulator.patch
    - 0001-Do-not-overwrite-basePixmap-of-QIconLoader-PixmapEnt.patch
    - fix_destroy_qapp_segfault.diff
  * Remove Ubuntu patches:
    - enable_appmenu_support.diff (obsolete)
    - 0001-Implement-XEmbed-protocol.patch (submitted and merged upstream)
    - fix_maliit_activation.patch (not used anymore)
    - inputmethod_fix_focusout.patch (not used anymore)
    - fix_number_precision_qjsondocument.patch_8e8becdc.patch (upstream)
    - bug1227629.patch (merged upstream)
    - fix_rowinserted.patch (LP: #1242630...

Changed in qtbase-opensource-src (Ubuntu):
status: Fix Committed → Fix Released
Changed in appmenu-qt5:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.