Force any ICC settings to override gamma sliders

Fix application of ICC settings from displayconfig module
Disallow dragging of primary monitor in displayconfig module


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1257648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent caa013c9b0
commit 1246e0a69e

@ -471,8 +471,12 @@ void KDisplayConfig::updateDraggableMonitorInformationInternal (int monitor_id,
if (::tqqt_cast<DraggableMonitor*>(TQT_TQWIDGET(monitors.at( i )))) {
DraggableMonitor *monitor = static_cast<DraggableMonitor*>(TQT_TQWIDGET(monitors.at( i )));
if (monitor->screen_id == j) {
monitor->is_primary = true; // Prevent dragging of the primary monitor
primary_monitor = monitor;
}
else {
monitor->is_primary = false;
}
}
}
}
@ -634,8 +638,13 @@ void KDisplayConfig::moveMonitor(DraggableMonitor* monitor, int realx, int realy
for ( i = 0; i < int(monitors.count()); ++i ) {
if (::tqqt_cast<DraggableMonitor*>(TQT_TQWIDGET(monitors.at( i )))) {
DraggableMonitor *monitor = static_cast<DraggableMonitor*>(TQT_TQWIDGET(monitors.at( i )));
if (monitor->screen_id == j)
if (monitor->screen_id == j) {
monitor->is_primary = true; // Prevent dragging of the primary monitor
primary_monitor = monitor;
}
else {
monitor->is_primary = false;
}
}
}
}
@ -728,7 +737,7 @@ void KDisplayConfig::setRealResolutionSliderValue(int index) {
/**** KDisplayConfig ****/
KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStringList &)
: KCModule(KDisplayCFactory::instance(), parent, name), m_randrsimple(0), m_gammaApplyTimer(0)
: KCModule(KDisplayCFactory::instance(), parent, name), iccTab(0), m_randrsimple(0), m_gammaApplyTimer(0)
{
m_randrsimple = new KRandrSimpleAPI();
@ -793,7 +802,7 @@ KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStrin
load();
addTab( "iccconfig", i18n( "Color Profiles" ) ); // [FIXME[ No way to save settings here yet
iccTab = addTab( "iccconfig", i18n( "Color Profiles" ) ); // [FIXME] No way to save settings here yet
processLockoutControls();
}
@ -1415,7 +1424,7 @@ void KDisplayConfig::processLockoutControls() {
base->loadExistingProfile->hide(); // Same as above
}
void KDisplayConfig::addTab( const TQString name, const TQString label )
KCModule* KDisplayConfig::addTab( const TQString name, const TQString label )
{
// [FIXME] This is incomplete...Apply may not work...
TQWidget *page = new TQWidget( base->mainTabContainerWidget, name.latin1() );
@ -1430,9 +1439,11 @@ void KDisplayConfig::addTab( const TQString name, const TQString label )
connect( kcm, TQT_SIGNAL( changed(bool) ), this, TQT_SLOT( changed() ) );
//m_modules.insert(kcm, false);
return kcm;
}
else {
delete page;
return NULL;
}
}
@ -1473,6 +1484,10 @@ void KDisplayConfig::save()
systemconfig->writeEntry("EnableDisplayControl", base->systemEnableSupport->isChecked());
systemconfig->sync();
if (iccTab) {
iccTab->save();
}
emit changed(false);
}

@ -69,6 +69,7 @@ k_dcop:
private:
KConfig *config;
KCModule *iccTab;
bool _ok;
Display *randr_display;
ScreenInfo *randr_screen_info;
@ -87,7 +88,7 @@ private:
TQPtrList<SingleScreenData> m_screenInfoArray;
int realResolutionSliderValue();
void setRealResolutionSliderValue(int index);
void addTab( const TQString name, const TQString label );
KCModule* addTab( const TQString name, const TQString label );
void moveMonitor(DraggableMonitor* monitor, int realx, int realy);
bool applyMonitorLayoutRules(void);
bool applyMonitorLayoutRules(DraggableMonitor* primary_monitor);

@ -584,7 +584,7 @@
<cstring>gammaTipText2</cstring>
</property>
<property name="text">
<string>Tip: Most computer software expects a gamma of 2.2.</string>
<string>Tip: Most computer software expects a gamma of 2.2.\nAdditionally, any ICC settings for the selected screen will override the gamma controls available on this tab.</string>
</property>
</widget>
<spacer row="4" column="0">

@ -122,7 +122,8 @@ void DraggableMonitor::mouseMoveEvent(TQMouseEvent *event)
if (moveToX > maxX) moveToX = maxX;
if (moveToY > maxY) moveToY = maxY;
move(moveToX, moveToY);
if (!is_primary)
move(moveToX, moveToY);
}
void DraggableMonitor::mouseReleaseEvent(TQMouseEvent *event)

@ -69,6 +69,7 @@ signals:
public:
int screen_id;
bool is_primary;
private:
TQPoint lastMousePosition;

Loading…
Cancel
Save