47

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?

8128
  • 28,740

4 Answers4

29

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-manager package) 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.

enter image description here

Compiz should now treat your multi-monitor setup as one big output.

htorque
  • 64,798
5

Drag 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.

Ringtail
  • 16,127
  • 3
    If it doesn't have a keyboard shortcut, it won't be used. – Tomislav Nakic-Alfirevic Apr 26 '17 at 09:26
  • 1
    @TomislavNakic-Alfirevic, actually I use this method quite often when I'm coding and need to see several source codes at the same time. I don't care a few seconds needed to use this method, since I'm gonna work in that way for some hour. – Enlico Apr 19 '18 at 13:11
  • 4
    @EnricoMariaDeAngelis I could have made a fine point saying "most people won't use it without a shortcut" instead of flat out "won't be used", but my point was that when people manipulate windows hundreds of times a day, not having a keyboard shortcut for a particular kind of manipulation will limit the user base to a very small fraction of what it otherwise would have been because it's much less useful. Sure, I stretched windows across 2 screens, but I did it less than once a year. I would have done it more often if there was a shortcut and I believe many others would, too. – Tomislav Nakic-Alfirevic Apr 25 '18 at 09:12
4

You 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...

codlord
  • 2,506
4

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 xdotool via: sudo apt install xdotool
  • The manpage man xdotool was very helpful and contains a lot of other neat ideas.
Tymek
  • 160