[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.5/kdebase/workspace/kcontrol/randr
From:       Gökcen Eraslan <gokcen () pardus ! org ! tr>
Date:       2010-12-13 7:11:42
Message-ID: 20101213071142.686BDAC8A7 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1206053 by gokcen:

Swap height and width when searching the right size in sizeCombo, if output is rotated.

If output is rotated, then 1080x1920 is searched in sizeCombo and since sizeCombo has 
1920x1080 only, it fails and rotated output is displayed as "Disabled". This commit fixes this issue.



 M  +11 -1     outputconfig.cpp  


--- branches/KDE/4.5/kdebase/workspace/kcontrol/randr/outputconfig.cpp #1206052:1206053
@@ -383,9 +383,19 @@
 		sizeCombo->addItem( sizeDesc, s );
 	}
 	
-	int index = sizeCombo->findData( m_output->rect().size() );
+	int index = -1;
+
+    // if output is rotated 90 or 270 degrees, swap width and height before searching in combobox data
+    // otherwise 90 or 270 degrees rotated outputs will be set as "Disabled" in GUI
+	if (m_output->rotation() == RandR::Rotate90 || m_output->rotation() == RandR::Rotate270)
+		index = sizeCombo->findData( QSize(m_output->rect().height(), m_output->rect().width()) );
+	else
+		index = sizeCombo->findData( m_output->rect().size() );
+
 	if (index != -1)
 		sizeCombo->setCurrentIndex( index );
+    else
+        kDebug() << "Output size cannot be matched!";
 
 	index = refreshCombo->findData(m_output->refreshRate());
 	if (index != -1)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic