Skip to content

frontend: Replace add source dropdown with dialog#13136

Open
Warchamp7 wants to merge 3 commits intoobsproject:masterfrom
Warchamp7:add-source-redo
Open

frontend: Replace add source dropdown with dialog#13136
Warchamp7 wants to merge 3 commits intoobsproject:masterfrom
Warchamp7:add-source-redo

Conversation

@Warchamp7
Copy link
Member

@Warchamp7 Warchamp7 commented Feb 17, 2026

Description

Updated resubmission of #12067

This refactors a fair chunk of the ThumbnailManager, the SourceSelectButton and window. Thumbnails have a better lifetime hierarchy within the QObject and widget structure.

The SourceSelectButton is better implemented now as an actual button with a paintEvent instead of a QFrame. The buttons and window now have handling for source created/removed events. The window now keeps a list of uuids instead of hacky tracking and management of the button widgets themselves.

The ThumbnailManager changes introduces two new classes. ThumbnailItem and ThumbnailView. These changes are largely focused around improving the actual usage of thumbnails within QWidgets

ThumbnailManager maintains a list of ThumbnailItems mapped by source UUIDs and a cache of QPixmaps.

ThumbnailItems are responsible for the logic relating to generating and updating the thumbnail image data for a particular source. ThumbnailViews are QObject 'proxy' instances for delivering pixmap update signals.

Using a thumbnail somewhere such as in SourceSelectButton is done by calling ThumbnailManager->createView(parent, source). This will set up a ThumbnailItem for that source if one does not exist already and then return a ThumbnailView which then has signals to connect to for pixmap updates.

This means thumbnails are only generated once per source regardless of how many widgets might be showing a thumbnail for it.

ThumbnailViews can be marked as enabled/disabled such as when they're offscreen or otherwise not visible. ThumbnailItem will only update if at least one ThumbnailView for it is enabled. When all ThumbnailViews for a particular source are destroyed, the ThumbnailItem for that source is also destroyed and a pixmap is then stored in the ThumbnailManager cache. This cache is used when recreating ThumbnailItems to prepopulate the pixmap data allowing the most recent thumbnails to be immediately available.

Original description below:

Replaces the add source context menu with a brand new window.

  • Adds new FlowFrame and FlowLayout for automatic wrapping widget frame

    • Supports keyboard navigation of focusable widgets using arrow keys
  • Adds ThumbnailManager class

    • Keeps a cache of low resolution thumbnails of all visible sources
    • Periodically updates the oldest preview thumbnail among visible sources only
    • Utilizes ScreenshotObj which performs output over several render ticks
    • Throttled update loop
  • Adds new dialog for adding sources

    • Shows static previews of sources when possible
    • Supports selection of multiple existing sources in the list via Ctrl and/or Shift + clicking
    • Supports keyboard navigation of the existing source list
    • Supports drag and drop of individual sources onto the main window without closing the dialog

    Sources Dock Menu

image

New Window

image
obs64_E0SOtuhy93.mp4

Motivation and Context

The current process for adding a source is rather cumbersome, especially when adding a source that already exists. Ideally users should be re-using Sources whenever it makes sense, so one of the goals of this PR is exposing that better than the old radio button and list selection.

How Has This Been Tested?

Created a number of different sources. Added existing sources. Created/deleted sources while the window was open and the related sources were selected and not selected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

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

@Warchamp7 Warchamp7 added the New Feature New feature or plugin label Feb 17, 2026
@psyirius
Copy link
Contributor

psyirius commented Feb 18, 2026

Do we have a toggle to switch it back to dropdown mode?

We often add and sources on spot.
I feel opening and navigating a window would become a bit of hassle in emergency situations.

While I welcome this new dialog which is user friendly.
I prefer to have a option to act quickly.

Co-Authored-By: Lain <134130700+Lain-B@users.noreply.github.com>
@Warchamp7
Copy link
Member Author

Do we have a toggle to switch it back to dropdown mode?

We often add and sources on spot. I feel opening and navigating a window would become a bit of hassle in emergency situations.

While I welcome this new dialog which is user friendly. I prefer to have a option to act quickly.

There is no toggle. I made sure that this new dialog requires the same number of clicks or less compared to the old menu for all actions.

@psyirius
Copy link
Contributor

Do we have a toggle to switch it back to dropdown mode?
We often add and sources on spot. I feel opening and navigating a window would become a bit of hassle in emergency situations.
While I welcome this new dialog which is user friendly. I prefer to have a option to act quickly.

There is no toggle. I made sure that this new dialog requires the same number of clicks or less compared to the old menu for all actions.

🫡

@Warchamp7 Warchamp7 force-pushed the add-source-redo branch 2 times, most recently from ff302fe to 99692a0 Compare February 18, 2026 22:10
@Warchamp7 Warchamp7 force-pushed the add-source-redo branch 2 times, most recently from 6dd0cb5 to 3d8cc80 Compare February 18, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Feature New feature or plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments