Setting the default location for opening windows i

2019-07-25 13:52发布

问题:

This problem is driving me crazy. Maybe the experts at Stack Overflow can help.

I want to open an application in Xvfb and to have it always positioned at x,y=0,0 (Top left corner).

The application does not take any parameters, allowing it to reposition the opened window itself. Is there a way to set the default window position in a X-server? (Xvfb).

Best regards Gustaf

回答1:

I use Xvfb with twm (yum install twm). You need to create a ~/.twmrc file to indicate how windows are displayed.

I just use 'RandomPlacement' but in your case you might want to use 'UsePPosition' (check http://www.xfree86.org/4.4.0/twm.1.html) for more options.



回答2:

Are you running a window manager? It's up to the window manager to place windows, and it should default to (0,0) already when no window manager is running.



回答3:

Is there a way to set the default window position in a X-server? (Xvfb).

It's open source, so yes, you could hack it in. But it's normally the window manager's job, so find a light-weight wm that allows window-placement rules. Some can pattern-match on window name to select rules.



标签: linux window x11