obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

OBS selects wrong source when clicked.

Open ryantheleach opened this issue 2 years ago • 6 comments

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

29.0.0

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/4dkaFS9BdoVOmNUJ

OBS Studio Crash Log URL

No response

Expected Behavior

When a larger, further in the background source is selected, clicking a foreground source will select the foreground source.

Current Behavior

It selects a source that is behind the current source.

Steps to Reproduce

https://user-images.githubusercontent.com/141554/216172934-226a487b-2f14-4c62-a2cc-dd2a1f7b73c3.mp4

See video.

Click background canvas, (note that it's 2nd in the list) click the smaller white square, (note that red is instead selected)

Anything else we should know?

No response

ryantheleach avatar Feb 01 '23 22:02 ryantheleach

As an aside, I understand that the purpose of this is to select a background source, because otherwise it's impossible, but in this specific instance (that crops up surprisingly often) it's incredibly unintuitive.

The solution would be to only 'click-through' if the result would be the selected source, or previously ignored sources in the stack.

ryantheleach avatar Feb 01 '23 22:02 ryantheleach

As an additional note, this only happens with sources that have a bounding box applied. I cannot replicate if all sources are set to default transform (click the source, press ctrl+r to reset transform). But if I apply a bounding box (easily by click the source and pressing ctrl+f to fit to screen), then the behavior described here is shown. This is more or less intentional, however, as clicking is cycling through sources that are on top of each other, but I do agree it's unintuitive that it works sometimes, but not others.

Fenrirthviti avatar Feb 01 '23 23:02 Fenrirthviti

@Fenrirthviti For what it's worth, my example did not have bounding boxes set (to my knowledge) and I've just reset them just in case as you describe, and was still able to replicate.

ryantheleach avatar Feb 01 '23 23:02 ryantheleach

I've done further testing and was able to reproduce now without bounding boxes. The behavior is definitely odd, but at least seems consistent. It does seem slightly different when sources are set with a bounding box, but I might need further testing to see exactly why that might be.

Fenrirthviti avatar Feb 01 '23 23:02 Fenrirthviti

void OBSBasicPreview::DoSelect(const vec2 &pos)
{
	OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());

	OBSScene scene = main->GetCurrentScene();
	OBSSceneItem item = GetItemAtPos(pos, true);

	obs_scene_enum_items(scene, select_one, (obs_sceneitem_t *)item);
}

OBSSceneItem OBSBasicPreview::GetItemAtPos(const vec2 &pos, bool selectBelow)

It seems by designed, not a bug? Just SelectBelow.

Append: Why your red canvas is ahead of your gray one? It's that apply some settings(transform or filter etc)? @ryantheleach

tuduweb avatar Feb 02 '23 04:02 tuduweb

I applied a blending mode for sake of demonstration.

ryantheleach avatar Feb 02 '23 05:02 ryantheleach