backport PR #735 to fix RHBZ #1392654

epel9
Adam Williamson 8 years ago
parent fa263e6139
commit ffb9d96c00

@ -0,0 +1,66 @@
From e128a1b4ea74f02bc4a9047ea0e95e7563e6d3ac Mon Sep 17 00:00:00 2001
From: Martin Briza <mbriza@redhat.com>
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 <functional>
+#include <linux/vt.h>
+#include <linux/kd.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+
namespace SDDM {
int findUnused(int minimum, std::function<bool(const int)> 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<Display *>(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();
}
}

@ -2,7 +2,7 @@
Name: sddm Name: sddm
Version: 0.14.0 Version: 0.14.0
Release: 5%{?dist} Release: 6%{?dist}
# code GPLv2+, fedora theme CC-BY-SA # code GPLv2+, fedora theme CC-BY-SA
License: GPLv2+ and CC-BY-SA License: GPLv2+ and CC-BY-SA
Summary: QML based X11 desktop manager 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 Patch1: 0001-Fix-display-of-user-avatars.-684.patch
Patch2: 0002-Remove-quotes-from-ServerArguments-696.patch Patch2: 0002-Remove-quotes-from-ServerArguments-696.patch
Patch3: 0003-Add-a-config-option-to-enable-high-DPI-scaling-701.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 ## downstream patches
Patch101: sddm-0.14.0-fedora_config.patch 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 %patch1 -p1 -b .0001
%patch2 -p1 -b .0002 %patch2 -p1 -b .0002
%patch3 -p1 -b .0003 %patch3 -p1 -b .0003
%patch4 -p1 -b .0004
%patch101 -p1 -b .fedora_config %patch101 -p1 -b .fedora_config
@ -214,6 +217,9 @@ exit 0
%changelog %changelog
* Tue Nov 08 2016 Adam Williamson <awilliam@redhat.com> - 0.14.0-6
- backport PR #735 to fix RHBZ #1392654
* Wed Nov 02 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.14.0-5 * Wed Nov 02 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.14.0-5
- pull in upstream fixes - pull in upstream fixes

Loading…
Cancel
Save