Linux - Fullscreen strecthing across both monitors

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
swiftoid Offline
Junior Member
Posts: 25
Joined: Oct 2011
Reputation: 0
Post: #1
Hi everyone. I wonder if you can help. I running XBMC on ubuntu 12.04 with gnome-panel. When I open up xbmc in windowed mode everything works fine, brilliantly in fact, except the panel and title bar is still visible at the top which is a little distracting.

So I thought I'd switch to fullscreen mode. The problem is, I have two monitors (one 16:9 and a 4:3) and when XBMC displays in fullscreen it spans the output across the two monitors. So half appears on one monitor, and the other half appears on the other. It's been like this as long as I can remember testing XBMC on ubuntu. Is there any way to make it just appear on my right hand 16:9 monitor?

Any help would me much appreciated.
find quote
swiftoid Offline
Junior Member
Posts: 25
Joined: Oct 2011
Reputation: 0
Post: #2
Update: If I disable my second monitor before opening XBMC it works ok. But it's a pain to have to do it every time, their must be another way.
find quote
swiftoid Offline
Junior Member
Posts: 25
Joined: Oct 2011
Reputation: 0
Post: #3
Any ideas?
find quote
rocker2344 Offline
Junior Member
Posts: 8
Joined: May 2011
Reputation: 0
Post: #4
i had this same issue aswell and i have an nvidia card
run
Code:
sudo apt-get install wmctrl
and open a new file and name it xbmc.sh (or what ever)
and in it put
Code:
#!/bin/bash

move_and_fullscreen(){
  NAME='XBMC Media Center'

  while [ -z "`wmctrl -l | grep \"$NAME\"`" ]
  do
      sleep 1
  done

  wmctrl -r "$NAME" -e '0,1280,-1,-1,-1'
  wmctrl -r "$NAME" -b toggle,fullscreen
}

move_and_fullscreen &
__GL_SYNC_TO_VBLANK=1 __GL_SYNC_DISPLAY_DEVICE=DFP-0 SDL_VIDEO_ALLOW_SCREENSAVER=0 exec xbmc
allow it to run as a program
and run xbmc.sh (click twice)
use your "\" to switch between 2 monitor full screen/left monitor windowed/left monitor full screen/right monitor windowed/right monitor fullscreen


all credit goes to this man
http://wojnickitech.blogspot.com/2011/01...nview.html
find quote
swiftoid Offline
Junior Member
Posts: 25
Joined: Oct 2011
Reputation: 0
Post: #5
Amazing! Thank you so much! Worked first time.
find quote
rocker2344 Offline
Junior Member
Posts: 8
Joined: May 2011
Reputation: 0
Post: #6
no prob
find quote
swiftoid Offline
Junior Member
Posts: 25
Joined: Oct 2011
Reputation: 0
Post: #7
Another question, how put that script in my main menu, to replace the normal xbmc icon?
find quote
rocker2344 Offline
Junior Member
Posts: 8
Joined: May 2011
Reputation: 0
Post: #8
in termnial
Code:
sudo mv /usr/share/applications/xbmc.desktop ~/.local/share/applications/
sudo chown <username>:<username> xbmc.desktop
mv xbmc.sh ~/.local/share/bin/xbmc.sh
gedit xbmc.desktop
in the text editer change
Exec=xbmc to
Code:
Exec=/home/<user>/.local/share/bin/xbmc.sh
save
now you have an icon (this icon will only show in your side)

if you want for all users (do as sudo) place xbmc.sh into
NOTE=>Name it diffrent from xbmc (maybe xbmc_dual_screen_fix or something JUST NOT PLAIN XBMC)
Code:
/usr/share/bin
and edit xbmc.desktop from
Code:
/usr/share/applications
and edit like above, but you only have to change the "Exec" from "xbmc" to "xbmc_dual_screen_fix"
find quote
swiftoid Offline
Junior Member
Posts: 25
Joined: Oct 2011
Reputation: 0
Post: #9
Thanks again. I don't have a /usr/share/bin so I put it in /usr/bin (duno if that's strictly linux fs safe or not), and I had to change exec to xmbc_dual_screen_fix.sh (notice the .sh), but it all works. Thanks so much.

I do wish that xbmc did this on it's own mind you, instead of having to hack it like this.
find quote
bastafidli Offline
Junior Member
Posts: 2
Joined: Oct 2012
Reputation: 0
Lightbulb  RE: Fullscreen strecthing across both monitors
Post: #10
Hi,

I had the same exact problem on my system with ATI Radeon/AMD Radeon and fglrx/Catalyst driver on CentOS 6.3. I have primary 4:3 monitor running 1280x1024 and secondary 16:9 TV runnin 1920x1080. I am spanning these using Xinerama. With or without Xinerama XBMC detected always only 1 screen and the only options I had were Full Screen #1 (no #2 was available ever) and Windowed. When running in full screen mode the XBMC always opened only on the 4:3 display. When running in windowed mode, I was able to maximize the window on the secondary screen but it had title bar. With the help of this thread and some others I was able to come up with script which moves XBMC on the secondary screen and disables/hides the titlebar. I wasn't able to use wmctrl toggle fullscreen since every time I did that, XBMC moved to my primary 4:3 screen.

The solution is actually two scripts.

The first script is to turn on and off the title bar for the active window

File window-toggle-decorations.py

Code:
#! /usr/bin/python2
import gtk.gdk
w = gtk.gdk.window_foreign_new( gtk.gdk.get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0] )
w.set_decorations( (w.get_decorations()+1)%2 ) # toggle between 0 and 1
gtk.gdk.window_process_all_updates()
gtk.gdk.flush()

The second script is to launch XBMC, position it on secondary screen and toggle the title bar. You have to toggle the decoration twice to actually turn it off. I had to also call the window positioning multiple times, since it doesn't always succeeds on the first or second try.

File xbmcfull.sh

Code:
#!/bin/bash

move_and_fullscreen(){
  NAME='XBMC Media Center'

  while [ -z "`wmctrl -l | grep \"$NAME\"`" ]
  do
      sleep 1
  done

  ./window-toggle-decorations.py
  ./window-toggle-decorations.py
  sleep 3
  wmctrl -r "$NAME" -e '0,1280,0,1920,1080'
  sleep 3
  wmctrl -r "$NAME" -e '0,1280,0,1920,1080'
  sleep 3
  wmctrl -r "$NAME" -e '0,1280,0,1920,1080'
  sleep 3
  wmctrl -r "$NAME" -e '0,1280,0,1920,1080'
  sleep 3
  wmctrl -r "$NAME" -e '0,1280,0,1920,1080'
}

killall xbmc
killall xbmc.bin
__GL_SYNC_TO_VBLANK=1 __GL_SYNC_DISPLAY_DEVICE=DFP-0 SDL_VIDEO_ALLOW_SCREENSAVER=0 exec xbmc &
move_and_fullscreen

Hope this helps somebody.
(This post was last modified: 2012-10-03 16:49 by bastafidli.)
find quote
tripppy Offline
Junior Member
Posts: 1
Joined: Oct 2013
Reputation: 0
Post: #11
thanks SO much, rocker2344, been using xbmc since its inception on the original XBOX.
Now building the ultimate media center the script above worked. Thanks! Smile

Ubuntu 12.04.3 LTS 64bit
Using ATI card with experimental drivers
XBMC running full screen on my plasma
While still using small display for browsing/etc.
Both screens set at 1920x1080
Xinerama and tear free enabled in AMD CCC (admin)
find quote
jakerock Offline
Junior Member
Posts: 1
Joined: Oct 2013
Reputation: 0
Post: #12
Hi,
I tried the wmctrl script, xbmc full screen still tries to pan across both the screens Sad Mine is a nvidia graphics card as well. There is no "full screen #2" in xbmc settings. I'm using a laptop as the primary screen and a HDMI over to the TV as a extended second.
find quote
Eklar Offline
Member
Posts: 87
Joined: Oct 2010
Reputation: 0
Post: #13
I know this is an older thread, but I'm having same issue as the OP.

(2012-04-27 20:16)rocker2344 Wrote:  allow it to run as a program

How do I get the xbmc.sh to run as a program? When I double-click on it, it just opens it text editor. I'm new to Linux (obviously).
find quote
tylerr Offline
Junior Member
Posts: 5
Joined: Apr 2012
Reputation: 0
Post: #14
Is there an equivalent (for fullscreen strecthing across both monitors) for Windows 7/8?

I have dual mon, but haven't been able to make XBMC detect the new to monitor spanning desktop resolution. Sad

Thanks!
find quote