Skip to content

frontend: Remove sender() usage from UI handlers#13500

Open
xakep8 wants to merge 2 commits into
obsproject:masterfrom
xakep8:fix/sender_refactor
Open

frontend: Remove sender() usage from UI handlers#13500
xakep8 wants to merge 2 commits into
obsproject:masterfrom
xakep8:fix/sender_refactor

Conversation

@xakep8

@xakep8 xakep8 commented May 30, 2026

Copy link
Copy Markdown

Description

Fixes #13444

Pass source and editor context explicitly instead of recovering it through QObject::sender().

Motivation and Context

QObject::sender() is fragile in its implementation as it relies on the runtime knowledge of the sender as well as dynamic properties rather than type-safe and explicit message flows. The calling sites know where the call is from since the connections were made, and thus this information can be passed directly.

How Has This Been Tested?

xcodebuild -configuration RelWithDebInfo -scheme obs-studio -parallelizeTargets -destination "generic/platform=macOS,name=Any Mac"

Types of changes

  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@xakep8 xakep8 marked this pull request as draft May 30, 2026 03:22
Comment thread frontend/widgets/OBSBasic.hpp Outdated
Comment thread frontend/components/VolumeControl.cpp Outdated
Comment thread frontend/widgets/OBSBasic_Clipboard.cpp Outdated
Comment thread frontend/widgets/OBSBasic_Clipboard.cpp Outdated
@xakep8 xakep8 force-pushed the fix/sender_refactor branch from 7185e23 to 722dd72 Compare May 30, 2026 04:23
@xakep8 xakep8 requested a review from Warchamp7 May 30, 2026 04:24
@xakep8 xakep8 force-pushed the fix/sender_refactor branch 2 times, most recently from 6149e43 to 0c113b2 Compare May 30, 2026 08:10
@xakep8 xakep8 marked this pull request as ready for review May 30, 2026 08:33
@xakep8 xakep8 force-pushed the fix/sender_refactor branch 5 times, most recently from b136dd1 to 43f4474 Compare June 9, 2026 03:44
@WizardCM WizardCM added the kind/cleanup Non-breaking change which makes code smaller or more readable label Jun 10, 2026
@xakep8 xakep8 force-pushed the fix/sender_refactor branch from 09af5d9 to 91c238c Compare June 10, 2026 15:53
@xakep8 xakep8 force-pushed the fix/sender_refactor branch from 91c238c to e8e6093 Compare June 13, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Non-breaking change which makes code smaller or more readable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor out usages of sender()

3 participants