2013-03-15 25 views
0

對於工作,我正在開發一個非常專業化的軟件,它需要運行兩個全屏應用程序,每個顯示器上一個。爲了簡單起見,我目前使用的是具有AMD Radeon HD圖形卡的LUbuntu 64位(目前無法回憶當前的確切版本,但它相當新穎)。Linux強制應用到特定顯示器上的全屏

如果可能的話,我想堅持使用SDL2,但是如果我需要對它進行一些黑客行爲或移動到不同的庫,那麼我對此很滿意。

所以,我的問題是,是否有可能在Linux的不同顯示器上運行兩個全屏應用程序(如果需要,我需要採取什麼樣的設置步驟)?列舉顯示器以獲取其左上角的x/y位置是我最好的選擇,所以我可以告訴SDL將我的窗口移動到該顯示器上進行全屏顯示?

注意:我沒有發佈到askubuntu,因爲我不確定這個問題嚴格圍繞Ubuntu平臺。

更新:

下面是xrandr -q輸出:

Screen 0: minimum 320 x 200, current 3200 x 1080, maximum 3200 x 3200 
DFP1 disconnected (normal left inverted right x axis y axis) 
DFP2 disconnected (normal left inverted right x axis y axis) 
DFP3 disconnected (normal left inverted right x axis y axis) 
DFP4 disconnected (normal left inverted right x axis y axis) 
DFP5 disconnected (normal left inverted right x axis y axis) 
DFP6 disconnected (normal left inverted right x axis y axis) 
DFP7 disconnected (normal left inverted right x axis y axis) 
DFP8 disconnected (normal left inverted right x axis y axis) 
DFP9 connected 1920x1080+1280+0 (normal left inverted right x axis y axis) 533mm x 312mm 
    1280x1024  50.0 + 75.0  60.0  30.0  24.0 
    1920x1080  60.0 + 50.0* 59.9  30.0  25.0  30.0  24.0  30.0  30.0  24.0 
    1776x1000  50.0  59.9  25.0  24.0  30.0  30.0 
    1680x1050  50.0  60.0  30.0  24.0 
    1400x1050  50.0  60.0  30.0  24.0 
    1600x900  50.0  60.0  30.0  24.0 
    1440x900  50.0  59.9  30.0  24.0 
    1280x960  50.0  60.0  30.0  24.0 
    1280x800  50.0  59.8  30.0  24.0 
    1152x864  50.0  59.9  75.0  30.0  24.0 
    1280x768  50.0  59.8  30.0  24.0 
    1280x720  60.0  50.0  59.9  30.0  24.0 
    1024x768  50.0  75.0  70.1  30.0  24.0  60.0 
    1152x648  50.0  59.9 
    800x600  50.0  30.0  24.0  72.2  75.0  60.3  56.2 
    720x576  59.9  30.0  24.0  50.0 
    720x480  50.0  30.0  24.0  60.0  59.9 
    640x480  50.0  30.0  24.0  75.0  72.8  67.0  60.0  59.9 
DFP10 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 376mm x 301mm 
    1280x1024  60.0*+ 76.0  75.0  72.0 
    1280x960  76.0  75.0  72.0  60.0 
    1152x864  75.0  60.0 
    1280x768  76.0  75.0  72.0  60.0 
    1280x720  76.0  75.0  72.0  60.0 
    1024x768  75.0  70.1  60.0 
    800x600  72.2  75.0  60.3 
    640x480  75.0  72.8  67.0  59.9 
    640x350  60.0  70.1 
CRT1 disconnected (normal left inverted right x axis y axis) 

我試圖尋找一些論壇,如何處理這些信息做一個更好的解釋,看來我應該做的事情像:

xrandr --output DFP9 --auto --output DFP10 --auto

當我做T帽子,我仍然只有一個顯示(「:0」)。

回答

1

你的設置是什麼?你實際上是否有兩個獨立的X顯示器,或者你是否使用Xinerama來組合這兩個顯示器?

如果您使用2臺顯示器,則應該有自己的-display或DISPLAY env變量。你可以使用它來執行一個新的應用程序。

$ echo $DISPLAY 
:0.0 
$ xterm -display :0.0 

在另一個顯示器中打開一個shell來獲取其他顯示env變量。

還有-geometry,格式爲[問心無愧,高程+ X + Y]

$ xterm -geometry 132x80+500+0 

當Xinerama的啓用,你的其他顯示器通常是+ X + Y軸偏移。

當然,這確實需要應用程序來處理命令行參數。然後在初始化窗口時將它們傳遞給X.對於xterm,寬度和高度是文本字符的單位,其中X/Y是屏幕像素。

+0

我很遺憾對X11沒有很好的理解,所以我不知道我可以給你比我的雙顯示器設置使用AMD Catalyst Control Center工具配置更多的細節。我在兩個監視器的終端窗口中嘗試了'echo $ DISPLAY',它在兩個顯示器上輸出「:0」。 – OzBarry 2013-03-15 15:47:03

+0

您已啓用Xinerama的聲音行;一個邏輯顯示。這很容易。使用-geometry選項並嘗試使用xterm(或gnome-terminal,konsole,不管),並查看使用'xterm -geometry + x + y'彈出窗口的位置。如果你使用的是圖形API,它將允許你通過一些代碼來移動窗口,比如'window-> move(x,y)'。 – 2013-03-16 01:24:02

0

如果您可以控制X配置,並且其他應用程序不會顯示在生產工作站上,則可能需要禁用「Xinerama」功能並設置兩個屏幕。然後,您可以將您的應用程序連接到:0.0:0.1,並從中獲取屏幕大小。

相關問題