From ffb9d96c00a3a7a944d5600e7cb9fa11d9c9bfc8 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 8 Nov 2016 12:18:37 -0800 Subject: [PATCH] backport PR #735 to fix RHBZ #1392654 --- 735.patch | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ sddm.spec | 8 ++++++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 735.patch diff --git a/735.patch b/735.patch new file mode 100644 index 0000000..6ea5e2c --- /dev/null +++ b/735.patch @@ -0,0 +1,66 @@ +From e128a1b4ea74f02bc4a9047ea0e95e7563e6d3ac Mon Sep 17 00:00:00 2001 +From: Martin Briza +Date: Wed, 2 Nov 2016 17:13:40 +0100 +Subject: [PATCH] Switch to another managed VT when the current one quits + +--- + src/daemon/Seat.cpp | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +diff --git a/src/daemon/Seat.cpp b/src/daemon/Seat.cpp +index 3ef1b2f..966d445 100644 +--- a/src/daemon/Seat.cpp ++++ b/src/daemon/Seat.cpp +@@ -30,6 +30,12 @@ + + #include + ++#include ++#include ++#include ++#include ++#include ++ + namespace SDDM { + int findUnused(int minimum, std::function used) { + // initialize with minimum +@@ -84,7 +90,6 @@ namespace SDDM { + void Seat::removeDisplay(Display* display) { + qDebug() << "Removing display" << display->displayId() << "..."; + +- + // remove display from list + m_displays.removeAll(display); + +@@ -102,12 +107,30 @@ namespace SDDM { + + void Seat::displayStopped() { + Display *display = qobject_cast(sender()); ++ int oldVT = display->terminalId(); + + // remove display + removeDisplay(display); + ++ // try switching to some other active VT ++ bool success = false; ++ char path[33] = { 0 }; ++ snprintf(path, 32, "/dev/tty%d", oldVT); ++ int ttyfd = open(path, O_RDONLY); ++ ++ if (ttyfd >= 0) { ++ for (int newVT : m_terminalIds) { ++ int result = ioctl(ttyfd, VT_ACTIVATE, newVT); ++ if (result == 0) { ++ success = true; ++ break; ++ } ++ } ++ close(ttyfd); ++ } ++ + // restart otherwise +- if (m_displays.isEmpty()) ++ if (!success) + createDisplay(); + } + } diff --git a/sddm.spec b/sddm.spec index b3a9308..396c342 100644 --- a/sddm.spec +++ b/sddm.spec @@ -2,7 +2,7 @@ Name: sddm Version: 0.14.0 -Release: 5%{?dist} +Release: 6%{?dist} # code GPLv2+, fedora theme CC-BY-SA License: GPLv2+ and CC-BY-SA Summary: QML based X11 desktop manager @@ -15,6 +15,8 @@ Source0: https://github.com/sddm/sddm/archive/v%{version}.tar.gz Patch1: 0001-Fix-display-of-user-avatars.-684.patch Patch2: 0002-Remove-quotes-from-ServerArguments-696.patch Patch3: 0003-Add-a-config-option-to-enable-high-DPI-scaling-701.patch +# Fixes RHBZ #1392654 +Patch4: https://github.com/sddm/sddm/pull/735.patch ## downstream patches Patch101: sddm-0.14.0-fedora_config.patch @@ -90,6 +92,7 @@ A collection of sddm themes, including: circles, elarun, maldives, maui. %patch1 -p1 -b .0001 %patch2 -p1 -b .0002 %patch3 -p1 -b .0003 +%patch4 -p1 -b .0004 %patch101 -p1 -b .fedora_config @@ -214,6 +217,9 @@ exit 0 %changelog +* Tue Nov 08 2016 Adam Williamson - 0.14.0-6 +- backport PR #735 to fix RHBZ #1392654 + * Wed Nov 02 2016 Rex Dieter - 0.14.0-5 - pull in upstream fixes