Skip to content

bug: frontend: in studio mode the program view keeps its old size after the window moves to a screen with another pixel ratio #4010

Closed

Description

@vpacher

Location

frontend/widgets/OBSQTDisplay.cpp.hpp:49-54: on QWindow::screenChanged the display resizes its obs_display but does not emit DisplayResized:

auto screenChanged = [this](QScreen *) {
	CreateDisplay();

	QSize size = GetPixelSize(this);
	obs_display_resize(display, static_cast<uint32_t>(size.width()), static_cast<uint32_t>(size.height()));
};

frontend/widgets/OBSBasic_StudioMode.cpp.hpp:37: the program view recomputes its scale and position (ResizeProgram) only on DisplayResized. The preview does not have this problem: OBSBasic also connects the window's screenChanged to ResizePreview (frontend/widgets/OBSBasic.cpp.hpp:253).

Class

Logic error (layout not recomputed).

How it is reached

macOS 27.2, obs-rust 1.0.1-beta.20261107 (arm64), a Retina display (pixel ratio 2) and a 2560x1440 display (pixel ratio 1). In studio mode, drag the OBS window from one display to the other. The window keeps its size in points, so Qt sends no resize event, but the pixel size of each display changes. The preview is drawn at the new size; the program view keeps the scale and position of the old pixel ratio until the window is resized by hand.

The code is inherited from upstream OBS without change, so upstream likely has the same bug (not checked there).

Proposed fix and failing test

Fix: emit DisplayResized() at the end of the screenChanged handler in OBSQTDisplay, so every display that lays out on that signal (program view, projectors, the properties preview) follows a pixel ratio change.

Test: a Qt test that creates a studio-mode program display, records ResizeProgram's result, changes the window's screen or device pixel ratio without resizing it, and checks that the program scale changed. It fails now because ResizeProgram is not called.

Activity

  1. added
    bug
    on Nov 8, 2026
  2. vpacher commented on Nov 8, 2026

    @vpacher
    MemberAuthor

    Claiming: #4010

    1. One PR. RED: a Qt test on the offscreen platform with two screens (pixel ratio 1 and 2) moves an OBSQTDisplay to the other screen without a resize and expects DisplayResized. Today the signal does not come. GREEN: OBSQTDisplay's screenChanged handler emits DisplayResized(), so the studio-mode program view (and every other display that lays out on that signal) follows the new pixel ratio. I will check the result by hand on macOS with a Retina and a non-Retina display. First PR today or tomorrow.
  3. added
    ready
    on Nov 8, 2026
  4. vpacher commented on Nov 8, 2026

    @vpacher
    MemberAuthor

    Checked by hand on macOS 27.2 (Apple silicon) with a build of master at 9a95b46, which has #4052.

    1. Studio Mode on, with a Retina display (pixel ratio 2) and an external display with pixel ratio 1.
    2. Moved the OBS window from the Retina display to the external display, and back.
    3. Each time, the Program view kept the correct scale and position at once. It needed no manual window resize, and the relayout was not visible.

    Fixed by #4052: OBSQTDisplay now emits DisplayResized when its screen changes. The Qt test test_display_screen_change covers it on the offscreen platform. Nothing is left on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions