Opened 10 years ago

Last modified 11 months ago

#46607 new enhancement

qt4-mac +KDE variant.

Reported by: RJVB (René Bertin) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: michaelld (Michael Dickens), mkae (Marko Käning), barracuda156
Port: qt4-mac

Description

This one has (also) already been presented (because included) in my qt4-mac concurrent ticket, but a bit of independent exposure might be good.

KDE4 applications expose a certain number of issues within Qt4 that are not or much less troublesome with "pure Qt" applications. I've created patches for them, which I propose to make available through a KDE variant:

    variant KDE description {Include patches for use with KDE} {
        patchfiles-append  qt4-correct-systraymenu-iconhandling.patch \
                           qt4-deactivate-menurole-heuristics.patch \
                           prevent_addTitleRelated_crash.patch \
                           debug-negative-qtimerint.patch \
                           silence-qfilesystemwatcher.patch \
                           patch-QAction_isEnabled.diff \
                           qt4-prevent-mousevent-for-deleted-object.diff
    }

In the post-destroot:

post-destroot {
    ...
        if {[variant_isset KDE]} {
            # expose KDE4 styles to Qt4:
            ln -s ${prefix}/lib/kde4/plugins/styles ${destroot}${qt_plugins_dir}/
        }
    ...
}
  • qt4-correct-systraymenu-iconhandling.patch : makes Qt respect the "icons in menus" setting in the systray menu (dropdown "menu-extra" menu under an icon installed alongside the wifi, FUS, sound volume, TimeMachine etc. icons). This issue should be patched in Qt 4.8.7 if and when it is released.
  • qt4-deactivate-menurole-heuristics.patch : this prevents Qt from making a text-heuristics based guess which menu actions should be installed as the About and Preferences menu items of the Application menu; applications should use QAction::setMenuRole or KAction::setMenuRole explicitly. Failing that, these menu items will appear where the application expects to put them, for instance in (respectively the Help and Settings menus for KDE apps. This is the only patch of the set that could have an unexpected impact on pure Qt applications.
  • prevent_addTitleRelated_crash.patch : does what it says. It prevents a crash when applications use a certain KDE function.
  • debug-negative-qtimerint.patch : adds some information to the warning Qt print when you attempt to start a QTimer with a negative interval.
  • silence-qfilesystemwatcher.patch : removes the debug output from QFileSystemWatcher when (and after) the max. number of files to watch is reached, thus reducing noise (and log pollution when apps are started through LaunchServices)
  • patch-QAction_isEnabled.diff : symptom workaround that avoids a (rare but reproducible) crash caused by accessing an object after it's deleted
  • qt4-prevent-mousevent-for-deleted-object.diff : a (still tentative) fix for a not-so-rare but "randomly reproducable" crash when closing a complex user interface could lead to pending events being delivered to already deleted objects. This is not a workaround, it changes a single line to what the preceding comments say it should be in my understanding.

Attachments (7)

qt4-correct-systraymenu-iconhandling.patch (927 bytes) - added by RJVB (René Bertin) 10 years ago.
qt4-deactivate-menurole-heuristics.patch (1.8 KB) - added by RJVB (René Bertin) 10 years ago.
prevent_addTitleRelated_crash.patch (425 bytes) - added by RJVB (René Bertin) 10 years ago.
debug-negative-qtimerint.patch (3.0 KB) - added by RJVB (René Bertin) 10 years ago.
silence-qfilesystemwatcher.patch (576 bytes) - added by RJVB (René Bertin) 10 years ago.
patch-QAction_isEnabled.diff (292 bytes) - added by RJVB (René Bertin) 10 years ago.
qt4-prevent-mousevent-for-deleted-object.diff (898 bytes) - added by RJVB (René Bertin) 10 years ago.

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by RJVB (René Bertin)

Changed 10 years ago by RJVB (René Bertin)

Changed 10 years ago by RJVB (René Bertin)

Changed 10 years ago by RJVB (René Bertin)

Changed 10 years ago by RJVB (René Bertin)

Changed 10 years ago by RJVB (René Bertin)

Changed 10 years ago by RJVB (René Bertin)

comment:1 Changed 10 years ago by RJVB (René Bertin)

Re: patch-QAction_isEnabled.diff : the stale pointer access prevented by this patch is most likely also due to a pending event being delivered to an already deleted object. It's not a proper fix (unless you believe in defensive programming). If my assessment is correct, the real bug is in client code that does delete object instead of object->deleteLater() (which is comparable to ObjC's [obj release]). The problem is that it is neigh impossible to determine which object that is; the address stored in the stale pointer corresponds to a (member of a ) member variable of that object, and the crash occurs at some undeterminate moment after that object was deleted.

comment:2 Changed 10 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:3 Changed 11 months ago by barracuda156

Cc: barracuda156 added
Note: See TracTickets for help on using tickets.