Use OBS canvas size as browser source default size #178

Closed
RytoEX wants to merge 1 commit from change-default-size into master
RytoEX commented 2019-10-09 22:44:23 -05:00 (Migrated from github.com)

Description

This is a minor QoL change to make browser sources default to be the same size as the user's OBS canvas. For users using overlays, this should reduce the work required to add a browser source for an overlay. For all other use cases, this should not create extra work.

If the canvas width and height are not defined (I don't know why this would happen), the width and height should fallback to 800x600. Feedback on this particular section of code would be appreciated.

This PR depends on https://github.com/obsproject/obs-studio/pull/2073/ to maintain backwards compatibility with previously created browser sources that did not have a width and height different from the default specified.

image

Motivation and Context

At TwitchCon, some users expressed that having browser sources default to the same size as the OBS canvas would save them time/work for setting up scenes using browser source based overlays.

How Has This Been Tested?

I compiled and tested this on Windows 10 Home 1903 (Build 18362.388) 64-bit.

  1. Open OBS.
  2. Add a new browser source.

Before this change, a new browser source defaults to width 800 and height 600.
After this change, a new browser source defaults to the width and height of the OBS canvas.

Types of changes

  • 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.
### Description This is a minor QoL change to make browser sources default to be the same size as the user's OBS canvas. For users using overlays, this should reduce the work required to add a browser source for an overlay. For all other use cases, this should not create extra work. If the canvas width and height are not defined (I don't know why this would happen), the width and height should fallback to 800x600. Feedback on this particular section of code would be appreciated. **This PR depends on https://github.com/obsproject/obs-studio/pull/2073/ to maintain backwards compatibility with previously created browser sources that did not have a width and height different from the default specified.** ![image](https://user-images.githubusercontent.com/624931/66537288-e31d2e80-eaed-11e9-8440-9b42cd7748a0.png) ### Motivation and Context At TwitchCon, some users expressed that having browser sources default to the same size as the OBS canvas would save them time/work for setting up scenes using browser source based overlays. ### How Has This Been Tested? I compiled and tested this on Windows 10 Home 1903 (Build 18362.388) 64-bit. 1. Open OBS. 2. Add a new browser source. Before this change, a new browser source defaults to width 800 and height 600. After this change, a new browser source defaults to the width and height of the OBS canvas. ### Types of changes - New feature (non-breaking change which adds functionality) ### Checklist: - [x] My code has been run through [clang-format](https://github.com/obsproject/obs-studio/blob/master/.clang-format). - [x] I have read the [**contributing** document](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst). - [x] My code is not on the master branch. - [x] The code has been tested. - [x] All commit messages are properly formatted and commits squashed where appropriate.
WizardCM commented 2019-10-09 22:45:59 -05:00 (Migrated from github.com)

Challenge: this migrates all browser sources where the user hasn't changed the size from their previous size of 800x600 to the new size based on their canvas.

Challenge: this migrates all browser sources where the user hasn't changed the size from their previous size of 800x600 to the new size based on their canvas.
WizardCM commented 2019-12-27 16:38:42 -06:00 (Migrated from github.com)

As the ticket that this PR is dependent on has been cancelled/put on hold, I'm considering closing this PR for now (and likely pinning an Issue for it instead). Thoughts @cg2121 @RytoEX?

As the ticket that this PR is dependent on has been cancelled/put on hold, I'm considering closing this PR for now (and likely pinning an Issue for it instead). Thoughts @cg2121 @RytoEX?
WizardCM commented 2020-03-01 15:28:24 -06:00 (Migrated from github.com)

Closing this in favour of #202

Closing this in favour of #202

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser!178
No description provided.