Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting monitors in multiple screens on a Mac #647

Open
meneguzzi opened this issue Aug 25, 2022 · 8 comments · May be fixed by #701
Open

Selecting monitors in multiple screens on a Mac #647

meneguzzi opened this issue Aug 25, 2022 · 8 comments · May be fixed by #701
Milestone

Comments

@meneguzzi
Copy link

I'm not sure that this is actually a bug, or just me being too thick on using the software, but I work on a multi monitor set up with a MacBook Pro as the computer. Here, I seem to always have to move the desktops around to get the presenter's display and the presentation in the right monitors. When I have just two monitors this can be easily solved by the -s option, however, with three or more monitors, I expected to be able to control that with the options of -1 and -2. So, I assume than when I try to list the monitors, each monitor would have an index and some kind of name (since trying pdfpc -1 1 file.pdf yields a message of Monitor "1" not found, but what I get is just the indexes and (null) where I imagine the monitor name would appear.

Expected Behaviour

➜ pdfpc -M
Monitors: 3
 0: * somename 	[3840x2160+2160+280@0Hz 	scale=200%]
 1:   anothername 	[3024x1964+2160+2440@0Hz 	scale=200%]
 2:   yaname 	[1080x1920+0+0@0Hz 	scale=100%]

Actual Behaviour

➜ pdfpc -M
Monitors: 3
 0: * (null) 	[3840x2160+2160+280@0Hz 	scale=200%]
 1:   (null) 	[3024x1964+2160+2440@0Hz 	scale=200%]
 2:   (null) 	[1080x1920+0+0@0Hz 	scale=100%]

Steps to reproduce

  1. Set up a MacBook Pro with three or more monitors
  2. Run pdfpc -M
  3. Try to run pdfpc specifying the monitors

pdfpc version: 4.4.1
Used Distribution (GTK version, vala version): MacOS
Display Server (X/Wayland): X
HiDPI Setting (yes/no): no

@HermannDppes
Copy link

So, implemented behaviour relative to your expected pdfpc -M would be that pdfpc -1 anothername and pdfpc -1 yaname would select the monitors indexed 1 and 2. That is obviously not very helpful in the case that all your monitors report being the same model (which is the designation given to that column in the API).

I think the primary mode of selecting monitors should be via the index and if the argument to -[12] is not numerical, it should fall back to the current behaviour, selecting the least indexed monitor with matching model.

@meneguzzi
Copy link
Author

So, this is kind of a bug I guess, right? I wonder if anyone has seen this working in another computer. Might this be a MacOS specific problem?

@HermannDppes
Copy link

I wonder if anyone has seen this working in another computer.

Yep, it works perfectly fine for me. The command pdfpc -M lists somewhat sensible model names in the third column and I can use them to specify the monitors with -[12].

Might this be a MacOS specific problem?

Which problem? That all monitors being named the same leads to suboptimalities? I don't think that's platform specific. All monitors being reported as null (or possibly "(null)")? I only know that it happens to you and it does not happen to me and everything my web searches have turned up is this part of the documentation for Gdk.Monitor.get_model:

Gets the a string identifying the monitor model, if available.

No discussion what might be causing the monitor model to not be available and no reports of other people getting null on their invocation. I'm pretty sure these exist somewhere but the couple minutes of work I have put in so far have not turned them up yet.

@AndreasBilke
Copy link
Member

Just for the record, on my Linux distribution I get at least some names:

$ pdfpc -M
Monitors: 1
 0: * DP-2-1    [3840x2160+0+0@24Hz     scale=100%]

(that is the name also xrandr reports to me).

@meneguzzi
Copy link
Author

@HermannDppes , is your computer's OS a MacOS? I can try to investigate this myself when I have time, though I've never used Gtk so it might take me a while to understand in which bit of the code this gets to. If this is something that is x specific, perhaps there is some way in the command line to force this description to be included in XQuartz. At the moment, this is a minor annoyance to me, but nothing I can't sort out by just dragging the desktops around to put them where I want them. I just thought this would improve the software for Mac users.

@AndreasBilke , can you give me some tips on how to use xrandr to query/set stuff. I tried the following:

➜ xrandr --listmonitors
xrandr: Failed to get size of gamma for output default
Monitors: 1
 0: +default 2483/657x2080/550+0+0  default

Even with my 3 monitors, this lists only one. So this does seem to be some weird configuration of the XQuartz server in the Mac.

@AndreasBilke
Copy link
Member

@meneguzzi I did the same as you did. I also tried the command on FreeBSD which gave me also useful names.

Maybe the weird XQuartz is a part of the problem?

@meneguzzi
Copy link
Author

@AndreasBilke this certainly seems to be the case, as there is at least one issue in XQuartz relating to problems with multi monitor set ups
XQuartz/XQuartz#92

I'm going to close the issue, and only reopen it if I can be 100% sure there is a workaround on pdfpc side.

Thanks for engaging with me!

@fnevgeny
Copy link
Member

fnevgeny commented Sep 4, 2022

It indeed seems Monitor.get_model is non-functional under macOS. On the other hand, null is a valid return value (whatever the reason), so it makes sense to deal with it graciously, i.e., treat the -1/-2 arguments as the monitor index.

@fnevgeny fnevgeny reopened this Sep 4, 2022
@fnevgeny fnevgeny added this to the v4.7.0 milestone Apr 15, 2023
fnevgeny added a commit that referenced this issue Aug 6, 2023
@fnevgeny fnevgeny linked a pull request Aug 6, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants