Skip to content

macOS mouse on wrong monitor #5733

Description

@ReenigneArcher

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

Filing for @andygrundman

A ton of Mac code got removed in 687e12d in src/platform/macos/input.cpp and I guess it now lives in libvirtualhid. The issue I'm running into is that now there is no logging code for mouse events. Not sure if it's always been broken but the mouse doesn't play nice with additional displays. It looks like this lost the code that knows which display is being streamed or something, and I have no idea how that info is supposed to be handled now. I think this is the old code that worked it out, although looking at the output_name config won't work with SCK.

// Default to main display
macos_input->display = CGMainDisplayID();
auto output_name = display_device::map_output_name(config::video.output_name);
// If output_name is set, try to find the display with that display id
if (!output_name.empty()) {
const int MAX_DISPLAYS = 32;
uint32_t max_display = MAX_DISPLAYS;
uint32_t display_count;
CGDirectDisplayID displays[MAX_DISPLAYS];
if (CGGetActiveDisplayList(max_display, displays, &display_count) != kCGErrorSuccess) {
BOOST_LOG(error) << "Unable to get active display list , error: "sv << std::endl;
} else {
for (int i = 0; i < display_count; i++) {
CGDirectDisplayID display_id = displays[i];
if (display_id == std::atoi(output_name.c_str())) {
macos_input->display = display_id;
}
}
}
}

Expected Behavior

  • Add debug logging
  • Fix mouse input when using multiple displays

Additional Context

No response

Host Operating System

macOS

Operating System Version

27

Architecture

arm64/aarch64

Package

macOS - dmg

GPU Type

n/a

GPU Model

GPU Driver/Mesa Version

Capture Method

AVCaptureScreen (macOS)

Apps

Log output

Online logs

No response

Activity

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

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions