I have dual display configuration, and want all new and old applications start on primary display, which is on the right. But some apps start on second screen, regardless where focus/mouse pointer is. I think this is because top:left corner 0:0 is on second monitor. And its bigger then primary, can this be a cause?
Secondary is a TV where I run kodi, which have a setting to choose display.
May be there are some app what remember for every app position and display, and also take care when second is turned off – mean remember position until monitor is on again. In earlier versions of ubuntu compiz do that, but no more.
Update: Changed DE to cinnamon
Best Answer
Be prepared to get your hands dirty
On the edge of what I feel we could ask users to do, but on the other hand, when instructions are clear, why not? So here we go...
Background process to set on which monitor new windows should appear
The Vala snippet
The Vala snippet needs to be compiled. To do so you need to install a few things:
Copy the snippet below, save it as
win_tomonitor.vala
Compile the snippet with the command:
(I know, the wnck argument is silly, but needed), an executable will be produced in the working directory.
xrandr
in terminal.Run the executable with the targeted monitor as argument, e.g.
New ("normal") windows will appear on 100px (x + y) from topleft of the targeted monitor.
N.B.
When adding this as a startup item, you might need to add a break of a few seconds before running it. If you run into issues on login/startup, please mention.
EDIT
Below an edited version (on request). Differences:
This version allows to set excluded
WM_CLASS
-es. To exclude one or more classes: add extra arguments after the targeted monitor- argument. An example:to exclude both Tilix and gedit windows from moving.
Setup is exactly the same as the first version. Have fun!
Find out a window's WM_CLASS
xprop
, Press ReturnWM_CLASS
appears in terminalThe code