Permalink
Browse files

xrandr: fix query for multiple screens

  • Loading branch information...
FernetMenta committed Nov 23, 2012
1 parent fa235e3 commit b5051134dd21bd5c2c680b66aeb770108f2bb776
Showing with 6 additions and 4 deletions.
  1. +6 −4 xbmc/windowing/X11/XRandR.cpp
@@ -57,20 +57,22 @@ bool CXRandR::Query(bool force)
m_outputs.clear();
// query all screens
+ // we are happy if at least one screen returns results
+ bool success = false;
for(unsigned int screennum=0; screennum<m_numScreens; ++screennum)
{
- if(!Query(force, screennum))
- return false;
+ if(Query(force, screennum))
+ success = true;
}
- return true;
+ return success;
}
bool CXRandR::Query(bool force, int screennum)
{
CStdString cmd;
cmd = getenv("XBMC_BIN_HOME");
cmd += "/xbmc-xrandr";
- cmd.append("-q --screen %d", screennum);
+ cmd.AppendFormat(" -q --screen %d", screennum);
FILE* file = popen(cmd.c_str(),"r");
if (!file)

0 comments on commit b505113

Please sign in to comment.