diff --git a/x11/lumina-core/Makefile b/x11/lumina-core/Makefile index 50e3c70b4bc8..642a3a84afe5 100644 --- a/x11/lumina-core/Makefile +++ b/x11/lumina-core/Makefile @@ -1,67 +1,67 @@ PORTNAME= lumina-core DISTVERSIONPREFIX= v DISTVERSION= 1.6.2 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= x11 MAINTAINER= jwb@FreeBSD.org COMMENT= Lumina Desktop Environment WWW= https://lumina-desktop.org/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/../../LICENSE RUN_DEPENDS= fluxbox>=0:x11-wm/fluxbox \ fluxbox-tenr-styles-pack>=0:x11-themes/fluxbox-tenr-styles-pack \ xbrightness>=0:x11/xbrightness \ compton>=0:x11-wm/compton \ xrandr>=0:x11/xrandr \ numlockx>=0:x11/numlockx \ ${LOCALBASE}/share/icons/La-Capitaine/index.theme:x11-themes/la-capitaine-icon-theme LIB_DEPENDS+= libxcb-ewmh.so:x11/xcb-util-wm \ libxcb-icccm.so:x11/xcb-util-wm \ libxcb-image.so:x11/xcb-util-image \ libxcb-util.so:x11/xcb-util \ libXcursor.so:x11/libXcursor USES= compiler:c++11-lang desktop-file-utils gl qmake qt:5 xorg USE_GL= gl USE_XORG= x11 xdamage xcb USE_LDCONFIG= yes USE_QT= buildtools:build concurrent core dbus declarative gui \ imageformats multimedia network svg widgets x11extras USE_GITHUB= yes GH_ACCOUNT= lumina-desktop GH_PROJECT= lumina QMAKE_ARGS= L_MANDIR=${PREFIX}/share/man OPTIONS_DEFINE= MULTIMEDIA TRUEOS NLS OPTIONS_DEFAULT= MULTIMEDIA OPTIONS_SUB= yes MULTIMEDIA_DESC= Install multimedia support backend (gstreamer) TRUEOS_DESC= Use the TrueOS system interface settings. TRUEOS_QMAKE_ON= DEFAULT_SETTINGS=TrueOS MULTIMEDIA_USES= gstreamer MULTIMEDIA_USE= GSTREAMER=core NLS_USE= QT=linguist:build NLS_QMAKE_ON= CONFIG+=WITH_I18N WRKSRC_SUBDIR= src-qt5/core CONFIGURE_ENV+= DESTDIR=${STAGEDIR} CONFLICTS_INSTALL= lumina-1.2.* post-extract: @${RM} ${WRKSRC}/lumina-desktop*/extrafiles/screensavers/Warp* @${RM} ${WRKSRC}/lumina-desktop*/extrafiles/screensavers/*/Warp* post-install: ${FIND} ${STAGEDIR}${PREFIX}/share -name "ecp.*" -delete .include diff --git a/x11/lumina-core/files/patch-core.pro b/x11/lumina-core/files/patch-core.pro index 8c3c237bb5bb..5e92cecb6e61 100644 --- a/x11/lumina-core/files/patch-core.pro +++ b/x11/lumina-core/files/patch-core.pro @@ -1,13 +1,21 @@ ---- core.pro.orig 2022-03-03 00:56:25 UTC +--- core.pro.orig 2021-12-26 02:33:45 UTC +++ core.pro -@@ -10,8 +10,8 @@ SUBDIRS+= lumina-desktop \ +@@ -4,14 +4,16 @@ include("../OS-detect.pri") + TEMPLATE = subdirs + CONFIG += recursive + ++# lumina-checkpass is needed for 1.6.2, since code replacing ++# xscreensaver is enabled + SUBDIRS+= lumina-desktop \ + lumina-session \ + lumina-open \ lumina-info \ lumina-pingcursor \ $${PWD}/../../icon-theme \ - lumina-theme-engine -# lumina-checkpass + lumina-theme-engine \ + lumina-checkpass # lumina-desktop-unified #Also install any special menu scripts diff --git a/x11/lumina-core/files/patch-libLumina_LuminaOS-FreeBSD.cpp b/x11/lumina-core/files/patch-libLumina_LuminaOS-FreeBSD.cpp index 9b27e4817de2..3c14fd95cf75 100644 --- a/x11/lumina-core/files/patch-libLumina_LuminaOS-FreeBSD.cpp +++ b/x11/lumina-core/files/patch-libLumina_LuminaOS-FreeBSD.cpp @@ -1,72 +1,188 @@ --- libLumina/LuminaOS-FreeBSD.cpp.orig 2021-12-26 02:33:45 UTC +++ libLumina/LuminaOS-FreeBSD.cpp -@@ -9,6 +9,7 @@ +@@ -9,6 +9,8 @@ #include #include #include ++#include // __FreeBSD_version +#include #include //can't read xbrightness settings - assume invalid until set -@@ -289,31 +290,53 @@ void LOS::systemSuspend(){ +@@ -171,10 +173,29 @@ int LOS::audioVolume(){ //Returns: audio volume as a p + audiovolume = out; + }else{ + //probe the system for the current volume (other utils could be changing it) ++ // mixer interface changed in FreeBSD 14 ++ // 13 and prior: mixer -S vol outputs ++ // vol:50:50 ++ // 14 and later, there is no -S flag, and vol is a fraction, not a % ++ // mixer -o vol outputs ++ // vol.volume=0.75:0.75 ++ // vol.mute=0 ++ // Might be better to use the mixer API instead ++#if __FreeBSD_version < 1400000 + QString info = LUtils::getCmdOutput("mixer -S vol").join(":").simplified(); //ignores any other lines + if(!info.isEmpty()){ + int L = info.section(":",1,1).toInt(); + int R = info.section(":",2,2).toInt(); ++#else ++ // Produce something like vol.volume=0.26:0.26=vol.mute=0= ++ // Multiple lines are joined, separated by '=' ++ QString info = LUtils::getCmdOutput("mixer -o vol").join("=").simplified(); ++ if(!info.isEmpty()){ ++ int L = info.section(QRegularExpression("[=:]"),1,1).toDouble() * 100.0; ++ int R = info.section(QRegularExpression("[=:]"),2,2).toDouble() * 100.0; ++#endif ++ ++ + if(L>R){ out = L; } + else{ out = R; } + if(out != audiovolume){ +@@ -195,10 +216,27 @@ void LOS::setAudioVolume(int percent){ + if(remoteSession){ + LUtils::runCmd(QString("pactl set-sink-volume @DEFAULT_SINK@ ")+QString::number(percent)+"%"); + }else{ +- QString info = LUtils::getCmdOutput("mixer -S vol").join(":").simplified(); //ignores any other lines +- if(!info.isEmpty()){ +- int L = info.section(":",1,1).toInt(); +- int R = info.section(":",2,2).toInt(); ++ // mixer interface changed in FreeBSD 14 ++ // 13 and prior: mixer -S vol outputs ++ // vol:50:50 ++ // 14 and later, there is no -S flag, and vol is a fraction, not a % ++ // mixer -o vol outputs ++ // vol.volume=0.75:0.75 ++ // vol.mute=0 ++ // Might be better to use the mixer API instead ++#if __FreeBSD_version < 1400000 ++ QString info = LUtils::getCmdOutput("mixer -S vol").join(":").simplified(); //ignores any other lines ++ if(!info.isEmpty()){ ++ int L = info.section(":",1,1).toInt(); ++ int R = info.section(":",2,2).toInt(); ++#else ++ // Produce something like vol.volume=0.26:0.26=vol.mute=0= ++ // Multiple lines are joined, separated by '=' ++ QString info = LUtils::getCmdOutput("mixer -o vol").join("=").simplified(); ++ if(!info.isEmpty()){ ++ int L = info.section(QRegularExpression("[=:]"),1,1).toDouble() * 100.0; ++ int R = info.section(QRegularExpression("[=:]"),2,2).toDouble() * 100.0; ++#endif + int diff = L-R; + if((percent == L) && (L==R)){ return; } //already set to that volume + if(diff<0){ R=percent; L=percent+diff; } //R Greater +@@ -207,7 +245,11 @@ void LOS::setAudioVolume(int percent){ + if(L<0){L=0;}else if(L>100){L=100;} + if(R<0){R=0;}else if(R>100){R=100;} + //Run Command ++#if __FreeBSD_version < 1400000 + LUtils::runCmd("mixer vol "+QString::number(L)+":"+QString::number(R)); ++#else ++ LUtils::runCmd("mixer vol="+QString::number(L/100.0)+":"+QString::number(R/100.0)); ++#endif + } + } + audiovolume = percent; //save for checking later +@@ -220,15 +262,36 @@ void LOS::changeAudioVolume(int percentdiff){ + if(remoteSession){ + LUtils::runCmd(QString("pactl set-sink-volume @DEFAULT_SINK@ ")+((percentdiff>0)?"+" : "") + QString::number(percentdiff)+"%"); + }else{ +- QString info = LUtils::getCmdOutput("mixer -S vol").join(":").simplified(); //ignores any other lines +- if(!info.isEmpty()){ +- int L = info.section(":",1,1).toInt() + percentdiff; +- int R = info.section(":",2,2).toInt() + percentdiff; ++ // mixer interface changed in FreeBSD 14 ++ // 13 and prior: mixer -S vol outputs ++ // vol:50:50 ++ // 14 and later, there is no -S flag, and vol is a fraction, not a % ++ // mixer -o vol outputs ++ // vol.volume=0.75:0.75 ++ // vol.mute=0 ++ // Might be better to use the mixer API instead ++#if __FreeBSD_version < 1400000 ++ QString info = LUtils::getCmdOutput("mixer -S vol").join(":").simplified(); //ignores any other lines ++ if(!info.isEmpty()){ ++ int L = info.section(":",1,1).toInt(); ++ int R = info.section(":",2,2).toInt(); ++#else ++ // Produce something like vol.volume=0.26:0.26=vol.mute=0= ++ // Multiple lines are joined, separated by '=' ++ QString info = LUtils::getCmdOutput("mixer -o vol").join("=").simplified(); ++ if(!info.isEmpty()){ ++ int L = info.section(QRegularExpression("[=:]"),1,1).toDouble() * 100.0; ++ int R = info.section(QRegularExpression("[=:]"),2,2).toDouble() * 100.0; ++#endif + //Check bounds + if(L<0){L=0;}else if(L>100){L=100;} + if(R<0){R=0;}else if(R>100){R=100;} + //Run Command ++#if __FreeBSD_version < 1400000 + LUtils::runCmd("mixer vol "+QString::number(L)+":"+QString::number(R)); ++#else ++ LUtils::runCmd("mixer vol="+QString::number(L/100.0)+":"+QString::number(R/100.0)); ++#endif + } + } + } +@@ -289,31 +352,53 @@ void LOS::systemSuspend(){ } //Battery Availability +// apm command is not available on powerpc or arm bool LOS::hasBattery(){ static int hasbat = -1; + int life; + size_t len = sizeof(life); if(hasbat < 0 ){ - int val = batteryCharge(); - if(val >= 0 && val <= 100){ hasbat = 1; } - else{ hasbat = 0; } + if ( sysctlbyname("hw.acpi.battery.life", &life, &len, NULL, 0) == 0 ) + hasbat = 1; + else + hasbat = 0; } return (hasbat==1); } //Battery Charge Level +// apm command is not available on powerpc or arm int LOS::batteryCharge(){ //Returns: percent charge (0-100), anything outside that range is counted as an error - int charge = LUtils::getCmdOutput("apm -l").join("").toInt(); - if(charge > 100){ charge = -1; } //invalid charge - return charge; + int life; // sysctl name + size_t len = sizeof(life); + if ( (sysctlbyname("hw.acpi.battery.life", &life, &len, NULL, 0) != 0) || + (life > 100) ) + life = -1; //invalid charge + return life; } //Battery Charging State +// apm command is not available on powerpc or arm bool LOS::batteryIsCharging(){ - return (LUtils::getCmdOutput("apm -a").join("").simplified() == "1"); + int state; + size_t len = sizeof(state); + if ( (sysctlbyname("hw.acpi.battery.state", &state, &len, NULL, 0) == 0) && + (state == ACPI_BATT_STAT_CHARGING) ) + return true; + else + return false; } //Battery Time Remaining +// apm command is not available on powerpc or arm int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining - return LUtils::getCmdOutput("apm -t").join("").toInt(); + int min; + size_t len = sizeof(min); + if ( LOS::batteryIsCharging() || + (sysctlbyname("hw.acpi.battery.time", &min, &len, NULL, 0) != 0) ) + return -1; + else + return min * 60; } //File Checksums diff --git a/x11/lumina-core/files/patch-lumina-desktop_LSession.cpp b/x11/lumina-core/files/patch-lumina-desktop_LSession.cpp index 36cdb7a67984..9756e078310a 100644 --- a/x11/lumina-core/files/patch-lumina-desktop_LSession.cpp +++ b/x11/lumina-core/files/patch-lumina-desktop_LSession.cpp @@ -1,130 +1,138 @@ --- lumina-desktop/LSession.cpp.orig 2021-12-26 02:33:45 UTC +++ lumina-desktop/LSession.cpp -@@ -97,46 +97,96 @@ LSession::~LSession(){ +@@ -97,46 +97,100 @@ LSession::~LSession(){ //Static function so everything can get the same icon name QString LSession::batteryIconName(int charge, bool charging){ int icon = -1; - if (charge > 90) { icon = 4; } - else if (charge > 70) { icon = 3; } - else if (charge > 20) { icon = 2; } - else if (charge > 5) { icon = 1; } - else if (charge > 0 ) { icon = 0; } - if(charging){ icon = icon+10; } + -+ // Add 5% in order to round to nearest 10% -+ // E.g. 85% to 94% will show 90% icon -+ icon = (charge + 5) / 10; -+ ++ // Old code with only a few different battery levels shown + //if (charge > 90) { icon = 4; } + //else if (charge > 70) { icon = 3; } + //else if (charge > 20) { icon = 2; } + //else if (charge > 5) { icon = 1; } + //else if (charge > 0 ) { icon = 0; } + ++ // New code with battery levels for every 10% difference shown ++ // Add 5% in order to round to nearest 10% ++ // E.g. 85% to 94% will show 90% icon ++ // Note: icon is an arbitrary integer used in a case statement later ++ // 0 - 10 are for discharging states, 11+ are for charging ++ icon = (charge + 5) / 10; ++ + if(charging){ icon += 11; } + + // Some icons may not be available for some themes, so build a list + // of alternatives QStringList iconList; switch (icon) { + + // Draining case 0: - iconList << "battery-20" << "battery-020" << "battery-empty" << "battery-caution"; + iconList << "battery-00" << "battery-000" << "battery-empty" << "battery-caution"; break; case 1: - iconList << "battery-40" << "battery-040" << "battery-low" << "battery-caution"; + iconList << "battery-10" << "battery-010" << "battery-low" << "battery-caution"; break; case 2: - iconList << "battery-60" << "battery-060" << "battery-good"; + iconList << "battery-20" << "battery-020" << "battery-low" << "battery-caution"; break; case 3: - iconList << "battery-80" << "battery-080" << "battery-good"; + iconList << "battery-30" << "battery-030" << "battery-low" << "battery-caution"; break; case 4: - iconList << "battery-100" << "battery-full"; + iconList << "battery-40" << "battery-040" << "battery-good"; break; + case 5: + iconList << "battery-50" << "battery-050" << "battery-good"; + break; + case 6: + iconList << "battery-60" << "battery-060" << "battery-good"; + break; + case 7: + iconList << "battery-70" << "battery-070" << "battery-good"; + break; + case 8: + iconList << "battery-80" << "battery-080" << "battery-good"; + break; + case 9: case 10: + iconList << "battery-100" << "battery-full"; + break; + + // Charging + case 11: + iconList << "battery-00-charging" << "battery-000-charging" << "battery-empty-charging" << "battery-caution-charging" + << "battery-charging-00" << "battery-charging-000" << "battery-charging-empty" << "battery-charging-caution"; + break; + case 12: + iconList << "battery-01-charging" << "battery-010-charging" << "battery-empty-charging" << "battery-caution-charging" + << "battery-charging-01" << "battery-charging-010" << "battery-charging-empty" << "battery-charging-caution"; + break; + case 13: iconList << "battery-20-charging" << "battery-020-charging" << "battery-empty-charging" << "battery-caution-charging" << "battery-charging-20" << "battery-charging-020" << "battery-charging-empty" << "battery-charging-caution"; break; - case 11: + case 14: + iconList << "battery-30-charging" << "battery-030-charging" << "battery-low-charging" << "battery-caution-charging" + << "battery-charging-30" << "battery-charging-030" << "battery-charging-low" << "battery-charging-caution"; + break; + case 15: iconList << "battery-40-charging" << "battery-040-charging" << "battery-low-charging" << "battery-caution-charging" << "battery-charging-40" << "battery-charging-040" << "battery-charging-low" << "battery-charging-caution"; break; - case 12: + case 16: + iconList << "battery-50-charging" << "battery-050-charging" << "battery-low-charging" << "battery-caution-charging" + << "battery-charging-50" << "battery-charging-050" << "battery-charging-low" << "battery-charging-caution"; + break; + case 17: iconList << "battery-60-charging" << "battery-060-charging" << "battery-good-charging" << "battery-charging-60" << "battery-charging-060" << "battery-charging-good"; break; - case 13: + case 18: + iconList << "battery-70-charging" << "battery-070-charging" << "battery-good-charging" + << "battery-charging-70" << "battery-charging-070" << "battery-charging-good"; + break; + case 19: iconList << "battery-80-charging" << "battery-080-charging" << "battery-good-charging" << "battery-charging-80" << "battery-charging-080" << "battery-charging-good"; break; - case 14: + case 20: + case 21: if(charge==100){ iconList << "battery-full-charged"; } iconList << "battery-100-charging" << "battery-full-charging" << "battery-charging-100" << "battery-charging-full"; -@@ -644,9 +694,12 @@ void LSession::adjustWindowGeom(WId win, bool maximize +@@ -644,11 +698,16 @@ void LSession::adjustWindowGeom(WId win, bool maximize if(DEBUG){ qDebug() << "Y-Diff:" << diff; } if(diff < 0){ diff = -diff; } //need a positive value if( (fgeom.height()+ diff)< desk.height()){ - //just move the window - there is room for it above - geom.setBottom(desk.bottom()-frame[1]); - fgeom.setBottom(desk.bottom()); + // Just move the window - there is room for it above + // FIXME: geom calculations appear to be off + // This creates a large gap between the bottom of the new window + // and the lower panel + geom.moveBottom(desk.bottom()-frame[1]); + fgeom.moveBottom(desk.bottom()); }else if(geom.height() > diff){ //window bigger than the difference //Need to resize the window - keeping the origin point the same ++ //This should only happen if the window is taller than the screen ++ //e.g. the screen size has shrunk geom.setHeight( geom.height()-diff-1 ); //shrink it by the difference (need an extra pixel somewhere) + fgeom.setHeight( fgeom.height()-diff ); + } diff --git a/x11/lumina-core/files/patch-lumina-desktop_src-screensaver_LLockScreen.cpp b/x11/lumina-core/files/patch-lumina-desktop_src-screensaver_LLockScreen.cpp index 238a58300a19..b5ac66749d8f 100644 --- a/x11/lumina-core/files/patch-lumina-desktop_src-screensaver_LLockScreen.cpp +++ b/x11/lumina-core/files/patch-lumina-desktop_src-screensaver_LLockScreen.cpp @@ -1,22 +1,23 @@ --- lumina-desktop/src-screensaver/LLockScreen.cpp.orig 2021-12-26 02:33:45 UTC +++ lumina-desktop/src-screensaver/LLockScreen.cpp @@ -79,7 +79,9 @@ void LLockScreen::TryUnlock(){ this->setEnabled(false); QString pass = ui->line_password->text(); ui->line_password->clear(); - //Create a temporary file for the password, then pass that file descriptor to lumina-checkpass + // Create a temporary file for the password, then pass that file descriptor + // to lumina-checkpass. Might seem wacky to shell this out, but we need + // SUID to authenticate the pw with PAM. QTemporaryFile *TF = new QTemporaryFile(".XXXXXXXXXX"); TF->setAutoRemove(true); bool ok = false; -@@ -90,7 +92,7 @@ void LLockScreen::TryUnlock(){ +@@ -90,7 +92,8 @@ void LLockScreen::TryUnlock(){ if(DEBUG){ qDebug() << "Trying to unlock session:" << getlogin(); } LUtils::runCommand(ok, "lumina-checkpass",QStringList() << "-f" << TF->fileName() ); if(DEBUG){ qDebug() << " - Success:" << ok; } - ok = true; //bypass for the moment + // ok = true; //bypass if lumina-checkpass is not working ++ //Results in any password being accepted to unlock } delete TF; //ensure the temporary file is removed **right now** for security purposes if(ok){