It's easy to maximise windows on a single monitor (press the maximise button, or drag the window titlebar to the top of the screen).
How can I maximise a window so that it takes up two screens?
4 Answers
This is possible by manually telling Compiz the screen output size, using the combined resolution of the two monitors. That's where the limitation kicks in: both displays need to have the same (vertical) resolution for this to make sense (else you'd end up with cut off content on the smaller screen or dead space on the bigger one).
For example, with two monitors with 1920x1080 resolution, you'd:
- Open the CompizConfig Settings Manager (if you haven't already, install the
compizconfig-settings-managerpackage) and go to the General Options plugin. - On the Display Settings tab, disable the Detect Outputs checkbox, select the 640x480+0+0 entry and click on Edit,
- Now change this to 3840x1080+0+0 and hit close.
Compiz should now treat your multi-monitor setup as one big output.
6Drag your window until it snaps to one edge of first monitor then resize it all the way to the other end of the secondary monitor. It is not real window maximization, but it displays window content wider or higher if monitors are positioned one above other.
3You could use xdotool and setup shortcuts/scripts.
I just did a quick test on a window and in my multi-monitor environment this made a window full screen across both monitors:
xdotool search --name "Untitled"
xdotool windowmove 96469240 -26 4
xdotool windowsize 96469240 110% 110%
I got the -26 4 starting coordinates by putting at top-left and xdotool getwindowgeometry 96469240
And not sure why 100% was not stretching to actually 100% of the monitors...
I wanted to elaborate on @codlord's great suggestion:
Mapping xdotool getactivewindow windowsize 110% 110% to a keyboard shortcut did exactly the trick (i.e., under Settings) - this should work regardless of the desktop manager (Gnome, Cinnamon, XFCE, etc.).
- You can quickly first test it out on a terminal window by entering the above command into that very terminal.
- Note that on Debian/Ubuntu systems you may first need to install
xdotoolvia:sudo apt install xdotool - The manpage
man xdotoolwas very helpful and contains a lot of other neat ideas.