Setting the default location for opening windows in an Xvfb environment

一笑奈何 提交于 2019-12-24 09:26:09

问题


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.



来源:https://stackoverflow.com/questions/1848225/setting-the-default-location-for-opening-windows-in-an-xvfb-environment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!