From 9c6e1c1118f68debadb9507349da3f4f4538410b Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 15 Aug 2017 14:25:22 -0400 Subject: Get most of lumina-xconfig updated so screens can be moved around on a canvas, rather than forcing a horizontal arrangement. Not quite finished yet - almost though. --- .../core-utils/lumina-xconfig/ScreenSettings.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp') diff --git a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp index 91e1f498..6122c1a9 100644 --- a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp +++ b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp @@ -40,9 +40,9 @@ void RRSettings::ApplyPrevious(){ else{ avail << screens[i].ID; } //needed for some checks later - make it simple } //NOTE ABOUT orders: -1: check geom, -2: auto-add to end, -3: ignored - + //Quick checks for simple systems - just use current X config as-is - if(devs.isEmpty() && (avail.filter("LVDS").isEmpty() || screens.length()==1) ){ return; } + if(devs.isEmpty() && (avail.filter("LVDS").isEmpty() || screens.length()==1) ){ return; } //Typical ID's: LVDS-[], DVI-I-[], DP-[], HDMI-[], VGA-[] //"LVDS" is the built-in laptop display normally @@ -55,8 +55,8 @@ void RRSettings::ApplyPrevious(){ if(primary.isEmpty()){ primary = avail.first(); } } //Ensure only one monitor is primary, and reset a few flags - for(int i=0; i=0){ + if(next>=0){ cx+=screens[next].geom.width(); - screens[next].order = handled; handled++; + screens[next].order = handled; handled++; }else{ //Still missing monitors (vertical alignment?) qDebug() << "Unhandled Monitors:" << screens.length()-handled; @@ -106,10 +106,10 @@ QList RRSettings::CurrentScreens(){ for(int i=0; i screens){ } return true; } - + //Apply screen configuration void RRSettings::Apply(QList screens){ //Read all the settings and create the xrandr options to maintain these settings @@ -188,4 +188,5 @@ void RRSettings::Apply(QList screens){ } qDebug() << "Run command: xrandr" << opts; LUtils::runCmd("xrandr", opts); + //LUtils::runCmd("sleep 2; killall fluxbox"); //restart fluxbox as needed - it can't handle xrandr changes to the current session } -- cgit From 3b6e8b8ee6e05e3d05e3d69b64b2afe5bc8c0d22 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 15 Aug 2017 19:19:54 -0400 Subject: Get the lumina-xconfig monitor settings all up and working again. 1) Add 2D placement options for screens 2) Add Rotation options for screens 3) Add Fluxbox restart fix for session changes. --- src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp') diff --git a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp index 6122c1a9..13ed86f4 100644 --- a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp +++ b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp @@ -29,6 +29,7 @@ void RRSettings::ApplyPrevious(){ if(screens[i].isprimary){ primary = screens[i].ID; } screens[i].isactive = lastactive.contains(screens[i].ID); screens[i].order = (screens[i].isactive ? -1 : -3); //check/ignore + screens[i].rotation = set.value("rotation",0).toInt(); set.endGroup(); }else if(screens[i].isavailable){ screens[i].order = -2; //needs activation/placement @@ -116,6 +117,8 @@ QList RRSettings::CurrentScreens(){ QString devres = info[i].section(" ",2,2, QString::SectionSkipEmpty); if(!devres.contains("x")){ devres = info[i].section(" ",3,3,QString::SectionSkipEmpty); } if(!devres.contains("x")){ devres.clear(); } + //Pull the monitor rotation mode out as well (last word before the parenthesis) + QString devrotate = info[i].section("(",0,0).split(" ",QString::SkipEmptyParts).last(); qDebug() << " - ID:" < RRSettings::CurrentScreens(){ }else if( !devres.isEmpty() ){ cscreen.isprimary = info[i].contains(" primary "); //Device that is connected and attached (has a resolution) - qDebug() << "Create new Screen entry:" << dev << devres; + qDebug() << "Create new Screen entry:" << dev << devres << devrotate << info[i].section("(",0,0); cscreen.ID = dev; //Note: devres format: "x++" cscreen.geom.setRect( devres.section("+",-2,-2).toInt(), devres.section("+",-1,-1).toInt(), devres.section("x",0,0).toInt(), devres.section("+",0,0).section("x",1,1).toInt() ); cscreen.isavailable = true; cscreen.isactive = true; + if(devrotate=="left"){ cscreen.rotation = -90; } + else if(devrotate=="right"){ cscreen.rotation = 90; } + else if(devrotate=="inverted"){ cscreen.rotation = 180; } + else{ cscreen.rotation = 0; } }else if(info[i].contains(" connected")){ //Device that is connected, but not attached qDebug() << "Create new Screen entry:" << dev << "none"; @@ -164,6 +171,7 @@ bool RRSettings::SaveScreens(QList screens){ set.beginGroup(screens[i].ID); set.setValue("geometry", screens[i].geom); set.setValue("isprimary", screens[i].isprimary); + set.setValue("rotation", screens[i].rotation); set.endGroup(); } set.setValue("lastActive",active); @@ -178,15 +186,18 @@ bool RRSettings::SaveScreens(QList screens){ void RRSettings::Apply(QList screens){ //Read all the settings and create the xrandr options to maintain these settings QStringList opts; - qDebug() << "Apply:" << screens.length(); + //qDebug() << "Apply:" << screens.length(); for(int i=0; i Date: Wed, 16 Aug 2017 12:55:34 -0400 Subject: More updates for lumina-xconfig: 1) Unify the enable/disable routines. --- .../core-utils/lumina-xconfig/ScreenSettings.cpp | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp') diff --git a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp index 13ed86f4..9bad91db 100644 --- a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp +++ b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp @@ -21,34 +21,26 @@ void RRSettings::ApplyPrevious(){ QString primary; QStringList avail; for(int i=0; i=0){screens[i].order = -1; } //reset all screen orders (need to re-check all) if(devs.contains(screens[i].ID) && screens[i].isavailable){ //only load settings for monitors which are currently attached set.beginGroup(screens[i].ID); screens[i].geom = set.value("geometry", QRect()).toRect(); screens[i].isprimary = set.value("isprimary", false).toBool(); if(screens[i].isprimary){ primary = screens[i].ID; } - screens[i].isactive = lastactive.contains(screens[i].ID); - screens[i].order = (screens[i].isactive ? -1 : -3); //check/ignore + screens[i].applyChange = (screens[i].isactive && !lastactive.contains(screens[i].ID) ? 1 : 0); //disable/ignore screens[i].rotation = set.value("rotation",0).toInt(); set.endGroup(); - }else if(screens[i].isavailable){ - screens[i].order = -2; //needs activation/placement - }else{ - screens[i].order = -3; //ignored + }else if(screens[i].isactive){ + screens[i].applyChange = 1; //disable monitor - not enabled in the default settings } - //Now clean up the list as needed - if(screens[i].order < -2){ screens.removeAt(i); i--; } //just remove it (less to loop through later) - else{ avail << screens[i].ID; } //needed for some checks later - make it simple } - //NOTE ABOUT orders: -1: check geom, -2: auto-add to end, -3: ignored //Quick checks for simple systems - just use current X config as-is if(devs.isEmpty() && (avail.filter("LVDS").isEmpty() || screens.length()==1) ){ return; } //Typical ID's: LVDS-[], DVI-I-[], DP-[], HDMI-[], VGA-[] - //"LVDS" is the built-in laptop display normally + //"LVDS" or "eDP" is the built-in laptop display normally if(primary.isEmpty()){ - QStringList priority; priority << "LVDS" << "DP" << "HDMI" << "DVI" << "VGA"; + QStringList priority; priority << "LVDS" << "eDP" << "DP" << "HDMI" << "DVI" << "VGA"; for(int i=0; i RRSettings::CurrentScreens(){ //Device that is connected, but not attached qDebug() << "Create new Screen entry:" << dev << "none"; cscreen.ID = dev; - cscreen.order = -2; //flag this right now as a non-active screen + //cscreen.order = -2; //flag this right now as a non-active screen cscreen.isavailable = true; cscreen.isactive = false; } @@ -188,8 +180,9 @@ void RRSettings::Apply(QList screens){ QStringList opts; //qDebug() << "Apply:" << screens.length(); for(int i=0; i Date: Wed, 16 Aug 2017 15:23:22 -0400 Subject: Fix up a bit more of the new lumina-xconfig. --- .../core-utils/lumina-xconfig/ScreenSettings.cpp | 50 ++++------------------ 1 file changed, 8 insertions(+), 42 deletions(-) (limited to 'src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp') diff --git a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp index 9bad91db..99cfc918 100644 --- a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp +++ b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp @@ -50,43 +50,7 @@ void RRSettings::ApplyPrevious(){ //Ensure only one monitor is primary, and reset a few flags for(int i=0; i=0){ - cx+=screens[next].geom.width(); - screens[next].order = handled; handled++; - }else{ - //Still missing monitors (vertical alignment?) - qDebug() << "Unhandled Monitors:" << screens.length()-handled; - break; - } - }*/ //Now reset the display with xrandr RRSettings::Apply(screens); } @@ -111,7 +75,7 @@ QList RRSettings::CurrentScreens(){ if(!devres.contains("x")){ devres.clear(); } //Pull the monitor rotation mode out as well (last word before the parenthesis) QString devrotate = info[i].section("(",0,0).split(" ",QString::SkipEmptyParts).last(); - qDebug() << " - ID:" < RRSettings::CurrentScreens(){ }else if( !devres.isEmpty() ){ cscreen.isprimary = info[i].contains(" primary "); //Device that is connected and attached (has a resolution) - qDebug() << "Create new Screen entry:" << dev << devres << devrotate << info[i].section("(",0,0); + //qDebug() << "Create new Screen entry:" << dev << devres << devrotate << info[i].section("(",0,0); cscreen.ID = dev; //Note: devres format: "x++" cscreen.geom.setRect( devres.section("+",-2,-2).toInt(), devres.section("+",-1,-1).toInt(), devres.section("x",0,0).toInt(), devres.section("+",0,0).section("x",1,1).toInt() ); @@ -134,7 +98,7 @@ QList RRSettings::CurrentScreens(){ else{ cscreen.rotation = 0; } }else if(info[i].contains(" connected")){ //Device that is connected, but not attached - qDebug() << "Create new Screen entry:" << dev << "none"; + //qDebug() << "Create new Screen entry:" << dev << "none"; cscreen.ID = dev; //cscreen.order = -2; //flag this right now as a non-active screen cscreen.isavailable = true; @@ -181,9 +145,11 @@ void RRSettings::Apply(QList screens){ //qDebug() << "Apply:" << screens.length(); for(int i=0; i screens){ else{ opts << "--rotate" << "normal"; } if(screens[i].isprimary){ opts << "--primary"; } } - //qDebug() << "Run command: xrandr" << opts; + qDebug() << "Run command: xrandr" << opts; LUtils::runCmd("xrandr", opts); } -- cgit