|
|
@ -465,13 +465,14 @@ void KDisplayConfig::updateDraggableMonitorInformationInternal (int monitor_id,
|
|
|
|
j=i;
|
|
|
|
j=i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
monitors = base->monitorPhyArrange->childrenListObject();
|
|
|
|
monitors = base->monitorPhyArrange->childrenListObject();
|
|
|
|
primary_monitor = 0;
|
|
|
|
primary_monitor = NULL;
|
|
|
|
if ( monitors.count() ) {
|
|
|
|
if ( monitors.count() ) {
|
|
|
|
for ( i = 0; i < int(monitors.count()); ++i ) {
|
|
|
|
for ( i = 0; i < int(monitors.count()); ++i ) {
|
|
|
|
if (::tqqt_cast<DraggableMonitor*>(TQT_TQWIDGET(monitors.at( i )))) {
|
|
|
|
if (::tqqt_cast<DraggableMonitor*>(TQT_TQWIDGET(monitors.at( i )))) {
|
|
|
|
DraggableMonitor *monitor = static_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) {
|
|
|
|
primary_monitor = monitor;
|
|
|
|
primary_monitor = monitor;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -614,16 +615,21 @@ bool KDisplayConfig::applyMonitorLayoutRules(DraggableMonitor* monitor_to_move)
|
|
|
|
void KDisplayConfig::moveMonitor(DraggableMonitor* monitor, int realx, int realy) {
|
|
|
|
void KDisplayConfig::moveMonitor(DraggableMonitor* monitor, int realx, int realy) {
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
int j;
|
|
|
|
int j;
|
|
|
|
|
|
|
|
bool primary_found;
|
|
|
|
DraggableMonitor *primary_monitor;
|
|
|
|
DraggableMonitor *primary_monitor;
|
|
|
|
SingleScreenData *screendata;
|
|
|
|
SingleScreenData *screendata;
|
|
|
|
|
|
|
|
|
|
|
|
// Find the primary monitor
|
|
|
|
// Find the primary monitor
|
|
|
|
|
|
|
|
primary_found = false;
|
|
|
|
for (i=0;i<numberOfScreens;i++) {
|
|
|
|
for (i=0;i<numberOfScreens;i++) {
|
|
|
|
screendata = m_screenInfoArray.at(i);
|
|
|
|
screendata = m_screenInfoArray.at(i);
|
|
|
|
if (screendata->is_primary)
|
|
|
|
if (screendata->is_primary) {
|
|
|
|
j=i;
|
|
|
|
j=i;
|
|
|
|
|
|
|
|
primary_found = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TQObjectList monitors = base->monitorPhyArrange->childrenListObject();
|
|
|
|
TQObjectList monitors = base->monitorPhyArrange->childrenListObject();
|
|
|
|
|
|
|
|
primary_monitor = NULL;
|
|
|
|
if ( monitors.count() ) {
|
|
|
|
if ( monitors.count() ) {
|
|
|
|
for ( i = 0; i < int(monitors.count()); ++i ) {
|
|
|
|
for ( i = 0; i < int(monitors.count()); ++i ) {
|
|
|
|
if (::tqqt_cast<DraggableMonitor*>(TQT_TQWIDGET(monitors.at( i )))) {
|
|
|
|
if (::tqqt_cast<DraggableMonitor*>(TQT_TQWIDGET(monitors.at( i )))) {
|
|
|
@ -634,13 +640,15 @@ void KDisplayConfig::moveMonitor(DraggableMonitor* monitor, int realx, int realy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int tx = realx * base->monitorPhyArrange->resize_factor;
|
|
|
|
if (primary_found && primary_monitor) {
|
|
|
|
int ty = realy * base->monitorPhyArrange->resize_factor;
|
|
|
|
int tx = realx * base->monitorPhyArrange->resize_factor;
|
|
|
|
|
|
|
|
int ty = realy * base->monitorPhyArrange->resize_factor;
|
|
|
|
|
|
|
|
|
|
|
|
if (!monitor->isHidden())
|
|
|
|
if (!monitor->isHidden())
|
|
|
|
monitor->move((base->monitorPhyArrange->width()/2)-(primary_monitor->width()/2)+tx,(base->monitorPhyArrange->height()/2)-(primary_monitor->height()/2)+ty);
|
|
|
|
monitor->move((base->monitorPhyArrange->width()/2)-(primary_monitor->width()/2)+tx,(base->monitorPhyArrange->height()/2)-(primary_monitor->height()/2)+ty);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
monitor->move(base->monitorPhyArrange->width(), base->monitorPhyArrange->height());
|
|
|
|
monitor->move(base->monitorPhyArrange->width(), base->monitorPhyArrange->height());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// int KDisplayConfig::realResolutionSliderValue() {
|
|
|
|
// int KDisplayConfig::realResolutionSliderValue() {
|
|
|
@ -1058,6 +1066,8 @@ void KDisplayConfig::updateDragDropDisplay() {
|
|
|
|
|
|
|
|
|
|
|
|
int currentScreenIndex = base->monitorDisplaySelectDD->currentItem();
|
|
|
|
int currentScreenIndex = base->monitorDisplaySelectDD->currentItem();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ensureMonitorDataConsistency();
|
|
|
|
|
|
|
|
|
|
|
|
// Add the screens to the workspace
|
|
|
|
// Add the screens to the workspace
|
|
|
|
// Set the scaling small to start with
|
|
|
|
// Set the scaling small to start with
|
|
|
|
base->monitorPhyArrange->resize_factor = 0.0625; // This always needs to divide by a multiple of 2
|
|
|
|
base->monitorPhyArrange->resize_factor = 0.0625; // This always needs to divide by a multiple of 2
|
|
|
|