Make program always use one display in dual monitor setup

Questions about Wine on Linux
Locked
isaiah36
Level 1
Level 1
Posts: 5
Joined: Mon Apr 10, 2017 6:53 pm

Make program always use one display in dual monitor setup

Post by isaiah36 »

Hello,

Foobar2000 has been working fine in Ubuntu 16.04 (64bit) and updated wine. For some reason it now opens in the other display instead of the usual one. I cannot move the window. Even when un-maximized the window borders cannot be dragged.

No changes have been made to wine config. Any ideas, anyone? Can I add something to the launch command to dictate which display is to be used?

Thanks in advance.
isaiah36
Level 1
Level 1
Posts: 5
Joined: Mon Apr 10, 2017 6:53 pm

Re: Make program always use one display in dual monitor setu

Post by isaiah36 »

Ok, so if anyone else has this problem, here is a work around that I figured out. I opened up 'Configure Wine' and went to the 'Graphics' tab, then unchecked the box for 'Allow the window manager to control the windows'. Now I can move the Foobar window around again, as well as resize it. The Mate desktop's window switcher does not create a button for it in the panel.

If I maximize it however it jumps back into the laptop's display, instead of filling the external monitor. If I minimize it then it creates a little icon, which can be moved around and placed anywhere I like on the desktop. Clicking the icon brings up the window controls menu, like 'Restore', 'Move', etc.

I have to keep it minimized because when it is up it displays on all 4 work spaces I have. It does not stay in the space it was launched in. This is annoying, but I can live with it.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Make program always use one display in dual monitor setu

Post by lahmbi5678 »

I'm not sure, if this will work, but you could try e.g.

Code: Select all

DISPLAY=:0.0 wine foobar2000.exe
DISPLAY=:0.1 wine foobar2000.exe 
which should explicitly choose the first or second monitor, the numbering may depend on what your Ubuntu considers the first or second display.
hverbeet
Level 1
Level 1
Posts: 8
Joined: Fri Apr 14, 2017 6:41 am

Re: Make program always use one display in dual monitor setu

Post by hverbeet »

What monitor an application opens on is largely controlled by your window manager, Wine has only limited control over that. So in the first place I'd look into what possibilities your window manager has for controlling window placement policy.

One thing that will make a difference for Wine though is which monitor is considered the "primary". For example, full-screen applications will go full-screen on the primary monitor and change the display mode of the monitor, etc. You can change the primary with "--primary" option to xrandr, or with the "Primary" option in xorg.conf.
isaiah36
Level 1
Level 1
Posts: 5
Joined: Mon Apr 10, 2017 6:53 pm

Re: Make program always use one display in dual monitor setu

Post by isaiah36 »

Thanks for the replies.

The DISPLAY edit of the command did not work. The command became unusable.

I am not a big fan of tinkering around with conf file. The external monitor has been set as primary using the Mate desktop's applet for display control.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Make program always use one display in dual monitor setu

Post by lahmbi5678 »

What was the exact error message, when you tried the "DISPLAY" approach? Of course I assumed, that you were in the directory where foobar2000 was installed, and that the .exe's name actually was foobar2000.exe, including capitalization. Googling I found reports of people who had to adjust their xorg.conf to be able to use DISPLAY variable. This is sad, because the DISPLAY approach is imo the simplest way to select the display to be used.

Regarding the question of primary/secondary display, if you have installed AMD or Nvidia proprietary drivers, then you will be able to set primary/secondary display in their (multi head) utility, too.
isaiah36
Level 1
Level 1
Posts: 5
Joined: Mon Apr 10, 2017 6:53 pm

Re: Make program always use one display in dual monitor setu

Post by isaiah36 »

I edited the working desktop shortcut that I had created manually. After edit the shortcut did nothing on click. I don't recall an error message.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Make program always use one display in dual monitor setu

Post by Bob Wya »

lahmbi5678 wrote:I'm not sure, if this will work, but you could try e.g.

Code: Select all

DISPLAY=:0.0 wine foobar2000.exe
DISPLAY=:0.1 wine foobar2000.exe 
which should explicitly choose the first or second monitor, the numbering may depend on what your Ubuntu considers the first or second display.
That's not going to work - unless Op has a Multihead X session.
See Arch Wiki: Multihead ...

Bob
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Make program always use one display in dual monitor setu

Post by lahmbi5678 »

Bob, I may be completely wrong at this point, but wouldn't you automatically have a multihead session, if you've configured e.g two displays under Ubuntu/Nvidia settings? Maybe I'm missing the point.

@isaiah36, if you edited desktop shortcuts, you'd just put e.g. DISPLAY=:0.0 in front of the command to be executed, did you try this, or did you change/remove whole paths?
isaiah36
Level 1
Level 1
Posts: 5
Joined: Mon Apr 10, 2017 6:53 pm

Re: Make program always use one display in dual monitor setu

Post by isaiah36 »

lahmbi5678 wrote:Bob, I may be completely wrong at this point, but wouldn't you automatically have a multihead session, if you've configured e.g two displays under Ubuntu/Nvidia settings? Maybe I'm missing the point.

@isaiah36, if you edited desktop shortcuts, you'd just put e.g. DISPLAY=:0.0 in front of the command to be executed, did you try this, or did you change/remove whole paths?
That is exactly what I did: put that in front of the command. Then changed the wine config to use the window manager.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Make program always use one display in dual monitor setu

Post by Bob Wya »

lahmbi5678 wrote:Bob, I may be completely wrong at this point, but wouldn't you automatically have a multihead session, if you've configured e.g two displays under Ubuntu/Nvidia settings? Maybe I'm missing the point.
Nvidia has made TwinView=1 the default for many years. You have to manually enable dual-head in:

Code: Select all

/etc/X11/xorg.conf.d/*
See: Bob
Locked