1

What I'm trying to do should be relatively simple. I want to set a display consisting of two (or, optionally, three monitors). Two of them are supposed to display a Chromium browser window and the third one, if present, will display some unrelated stuff. All monitors are set to 1280x1024 resolution and the browser window is supposed to be stretched so that its total height is 2048 pixels (the top half drawn on the monitor above and the bottom half on the monitor below). I tried to set the correct window coordinates and size using a window manager called openbox. I put the following section in its config file rc.xml:

<applications>
   <application name="*">
    <decor>no</decor>
    <position>
       <x>0</x>
       <y>0</y>
    <monitor>...</monitor> //appropriate number
    </position>
    <size> 
       <width>1280</width>
       <height>2048</height>
    </size>
   </application>
</applications>

While the window position is correct (it starts at the top left corner of the top monitor) its size is not. For some reason the size of the browser window is set to 1280x1024 instead of 1280x2048 so that it completely fills only the top monitor while the bottom one remains empty. Here's the actual command line used to run Chromium:

chromium-browser --incognito --app=<MY URL>

As you can see, it lacks --window-position and --window-size arguments because openbox was supposed to set those two values for me which it did incorrectly for the latter. Basically, openbox seems unable to handle window heights greater than the height of a single monitor. As long as I set window height in rc.xml to any value less than or equal to 1024, everything is fine, but whenever I try a value greater than that, it gets scaled down to 1024 and the whole window occupies the top monitor, just as if openbox didn't understand it should draw the remaining part of the window on the monitor below. When I tried to run another GUI application (gedit) the effect was the same so it seems to be a general behaviour rather than a problem caused only by Chromium. The OS I tested it with was Ubuntu 14.04 64-bit and the browser was Chromium 41 if it matters. Any help will be aprreciated.

Peter
  • 313
  • 1
  • 3
  • 10
  • You can manually stretch the window to the size you want once it is running? – Etan Reisner Jun 01 '15 at 21:16
  • Unfortunately that's not an option. The end user isn't supposed to manipulate the window size manually. Once the application has started, its window must have the appropriate size without further adjustment. – Peter Jun 02 '15 at 06:15
  • That wasn't the point of my question. I was attempting to make sure that the outcome you desired was even possible (i.e. that X was set up correctly for that and that openbox supports it at all). – Etan Reisner Jun 02 '15 at 13:05
  • Yes, openbox is capable of doing that. I was able to define a key combination that, when pressed, causes the window to resize as expected. I did that using "keybind" option and predefined action called "MoveResizeTo" (no need to describe the exact syntax of a configuration file here). Still, this solution is unacceptable as it requires a user interaction. For some reason, openbox "knows better" what window size to choose at application startup and ignores requests to set a window height to a value greater than the height of a single monitor. – Peter Jun 02 '15 at 18:37
  • That's not entirely an unreasonable thing for openbox to prevent though that is certainly annoying in your case. You could see about scripting the call to that resize function in some openbox hook or some other way as a workaround. Beyond that I don't know. – Etan Reisner Jun 02 '15 at 18:41

1 Answers1

0

AFAIK, window size statements in the Openbox rc.xml have no effect. The rc.xml can be used to set a default window origin (upper left corner) position, and a variety of other things on a per ap basis, but window SIZE is NOT one of those things. Use wmctrl in your script to size the window the way you want it. If it needs to adapt to the monitor, look at xrandr to get numbers for the rez, manipulate them arithmetically as you wish, and then hit them with wmctrl. Not sure about spreading a window across more than one monitor, but this approach works with conventional hardware setups.