Use ECMGenerateExportHeader to manage deprecated API better
ClosedPublic

Authored by kossebau on Mon, Oct 7, 1:25 PM.

Details

Summary

Allows

  • projects linking to KWindowSystem to hide deprecated API up to a given version or silence deprecation warnings after a given version, using
    • -DKWINDOWSYSTEM_DISABLE_DEPRECATED_BEFORE_AND_AT
    • -DKWINDOWSYSTEM_NO_DEPRECATED
    • -DKWINDOWSYSTEM_DEPRECATED_WARNINGS_SINCE
    • -DKWINDOWSYSTEM_NO_DEPRECATED_WARNINGS

      or
    • -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT
    • -DKF_NO_DEPRECATED
    • -DKF_DEPRECATED_WARNINGS_SINCE
    • -DKF_NO_DEPRECATED_WARNINGS
  • to build KWindowSystem optionally with deprecated API excluded from the build, using "EXCLUDE_DEPRECATED_BEFORE_AND_AT" cmake argument.

Setting KWINDOWSYSTEM_NO_WIDGETS ensures EXCLUDE_DEPRECATED_BEFORE_AND_AT
is at least at the version where QWidgets API was deprecated.

Test Plan

Builds with EXCLUDE_DEPRECATED_BEFORE_AND_AT set to 0, 5.0.0, 5.18.0,
5.38.0, 5.62.0, CURRENT as well as KWINDOWSYSTEM_NO_WIDGETS ON/OFF

Diff Detail

Repository
R278 KWindowSystem
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Mon, Oct 7, 1:25 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMon, Oct 7, 1:25 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
kossebau requested review of this revision.Mon, Oct 7, 1:25 PM

If no-one objects, would be pushing on Monday evening, Oct. 14th.

zzag added inline comments.Thu, Oct 10, 9:35 PM
src/netwm_def.h
338–341

This one should be wrapped in #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0), right?

kossebau added inline comments.Thu, Oct 10, 9:48 PM
src/netwm_def.h
338–341

Hmm... I should have checked the patch after uploading. IIRC I initially had this guarded here, same with the OverrideMask, but then found that too much code seems to rely on this, so I reverted things and added a TODO: Seemingly not the state here, and sadly nothing found in my stash. Sorry, I will have to recheck this.

kossebau updated this revision to Diff 67718.Fri, Oct 11, 4:05 PM

fix incompleteness of patch WRT to NET::Override

While that flag is deprecated for clients, window managing code seems to
still need to handle that flag if set by old clients, so tagging it as
deprecated might result in premature removal of the support.
That needs a separate plan how to make sure it#s no longer used out in the
wild by clients. lxr.kde.org reports it still with some application code

zzag accepted this revision.Mon, Oct 14, 8:59 AM
This revision is now accepted and ready to land.Mon, Oct 14, 8:59 AM
This revision was automatically updated to reflect the committed changes.