Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. Index: kcontrol/displayconfig/displayconfig.cpp
  2. ===================================================================
  3. --- kcontrol/displayconfig/displayconfig.cpp (revision 1251243)
  4. +++ kcontrol/displayconfig/displayconfig.cpp (working copy)
  5. @@ -614,14 +614,18 @@
  6. void KDisplayConfig::moveMonitor(DraggableMonitor* monitor, int realx, int realy) {
  7. int i;
  8. int j;
  9. + bool primary_found;
  10. DraggableMonitor *primary_monitor;
  11. SingleScreenData *screendata;
  12.  
  13. // Find the primary monitor
  14. + primary_found = false;
  15. for (i=0;i<numberOfScreens;i++) {
  16. screendata = m_screenInfoArray.at(i);
  17. - if (screendata->is_primary)
  18. + if (screendata->is_primary) {
  19. j=i;
  20. + primary_found = true;
  21. + }
  22. }
  23. TQObjectList monitors = base->monitorPhyArrange->childrenListObject();
  24. if ( monitors.count() ) {
  25. @@ -634,13 +638,15 @@
  26. }
  27. }
  28.  
  29. - int tx = realx * base->monitorPhyArrange->resize_factor;
  30. - int ty = realy * base->monitorPhyArrange->resize_factor;
  31. -
  32. - if (!monitor->isHidden())
  33. - monitor->move((base->monitorPhyArrange->width()/2)-(primary_monitor->width()/2)+tx,(base->monitorPhyArrange->height()/2)-(primary_monitor->height()/2)+ty);
  34. - else
  35. - monitor->move(base->monitorPhyArrange->width(), base->monitorPhyArrange->height());
  36. + if (primary_found && primary_monitor) {
  37. + int tx = realx * base->monitorPhyArrange->resize_factor;
  38. + int ty = realy * base->monitorPhyArrange->resize_factor;
  39. +
  40. + if (!monitor->isHidden())
  41. + monitor->move((base->monitorPhyArrange->width()/2)-(primary_monitor->width()/2)+tx,(base->monitorPhyArrange->height()/2)-(primary_monitor->height()/2)+ty);
  42. + else
  43. + monitor->move(base->monitorPhyArrange->width(), base->monitorPhyArrange->height());
  44. + }
  45. }
  46.  
  47. // int KDisplayConfig::realResolutionSliderValue() {
  48.  
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement