46

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 4

29
+550

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.

7
  • 9
    That helps, thanks! However it changes the behavior of double click on any window. Ideally I would to be able to tell that this time I want a normal maximisation and this other time I prefer a double one. Apr 14, 2014 at 11:20
  • I'm wondering aobut that, too. Is it possible to have this on a per-window basis?
    – Ingo
    Apr 17, 2014 at 11:00
  • 4
    This just treats your monitors as a single display. How about the ability to keep independent displays, and span a window across them with a shortcut? Pretty much the same way win7 does.
    – nullsteph
    Jan 15, 2015 at 3:56
  • 1
    This also works for Chrome in kiosk mode, very nice.
    – Mateo
    Apr 7, 2017 at 17:05
  • 6
    Compiz/Unity will be soon deprecated. An answer for Gnome 3 is needed. Feb 13, 2018 at 8:38
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.

3
  • 3
    If it doesn't have a keyboard shortcut, it won't be used. Apr 26, 2017 at 9: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, 2018 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. Apr 25, 2018 at 9: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...

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.
1
  • This is brilliant.
    – fny
    Sep 13, 2022 at 19:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .