This commit is contained in:
Mathias Gumz 2010-05-01 14:29:41 +02:00
parent b3361eae02
commit 35f17d22b5

View file

@ -1961,6 +1961,7 @@ void BScreen::initXinerama() {
if (m_xinerama_headinfo) if (m_xinerama_headinfo)
delete [] m_xinerama_headinfo; delete [] m_xinerama_headinfo;
m_xinerama_headinfo = new XineramaHeadInfo[number]; m_xinerama_headinfo = new XineramaHeadInfo[number];
m_xinerama_num_heads = number; m_xinerama_num_heads = number;
for (int i=0; i < number; i++) { for (int i=0; i < number; i++) {
@ -1974,7 +1975,8 @@ void BScreen::initXinerama() {
fbdbg<<"BScreen::initXinerama(): number of heads ="<<number<<endl; fbdbg<<"BScreen::initXinerama(): number of heads ="<<number<<endl;
/* Reallocate to the new number of heads. */ /* Reallocate to the new number of heads. */
int ha_num = numHeads() ? numHeads() : 1, ha_oldnum = m_head_areas.size(); int ha_num = numHeads() ? numHeads() : 1;
int ha_oldnum = m_head_areas.size();
if (ha_num > ha_oldnum) { if (ha_num > ha_oldnum) {
m_head_areas.resize(ha_num); m_head_areas.resize(ha_num);
for (int i = ha_oldnum; i < ha_num; i++) for (int i = ha_oldnum; i < ha_num; i++)
@ -2012,9 +2014,9 @@ void BScreen::clearHeads() {
} }
int BScreen::getHead(int x, int y) const { int BScreen::getHead(int x, int y) const {
if (!hasXinerama()) return 0;
#ifdef XINERAMA
#ifdef XINERAMA
if (hasXinerama()) {
for (int i=0; i < m_xinerama_num_heads; i++) { for (int i=0; i < m_xinerama_num_heads; i++) {
if (x >= m_xinerama_headinfo[i].x && if (x >= m_xinerama_headinfo[i].x &&
x < (m_xinerama_headinfo[i].x + m_xinerama_headinfo[i].width) && x < (m_xinerama_headinfo[i].x + m_xinerama_headinfo[i].width) &&
@ -2023,7 +2025,7 @@ int BScreen::getHead(int x, int y) const {
return i+1; return i+1;
} }
} }
}
#endif // XINERAMA #endif // XINERAMA
return 0; return 0;
} }