diff options
author | Michael Palimaka <kensington@gentoo.org> | 2016-05-06 03:07:05 +1000 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2016-05-06 03:07:42 +1000 |
commit | e57438123e4153bcae1a1b05bdc0831a75812c35 (patch) | |
tree | de6eb9acca0b0fd8806fcaee8869ca17de4ef22e /x11-misc | |
parent | dev-perl/Sys-CPU: Remove old (diff) | |
download | gentoo-e57438123e4153bcae1a1b05bdc0831a75812c35.tar.gz gentoo-e57438123e4153bcae1a1b05bdc0831a75812c35.tar.bz2 gentoo-e57438123e4153bcae1a1b05bdc0831a75812c35.zip |
x11-misc/sddm: backport patch from upstream to ensure that the password field has focus
Gentoo-bug: 566082
Package-Manager: portage-2.2.28
Diffstat (limited to 'x11-misc')
-rw-r--r-- | x11-misc/sddm/files/sddm-0.13.0-password-focus.patch | 109 | ||||
-rw-r--r-- | x11-misc/sddm/sddm-0.13.0-r4.ebuild | 81 |
2 files changed, 190 insertions, 0 deletions
diff --git a/x11-misc/sddm/files/sddm-0.13.0-password-focus.patch b/x11-misc/sddm/files/sddm-0.13.0-password-focus.patch new file mode 100644 index 000000000000..cc276692b2ac --- /dev/null +++ b/x11-misc/sddm/files/sddm-0.13.0-password-focus.patch @@ -0,0 +1,109 @@ +From 6d5b36b28907b16280ff78995fef764bb0c573db Mon Sep 17 00:00:00 2001 +From: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> +Date: Sat, 16 Jan 2016 19:52:09 +0100 +Subject: [PATCH] Activate window for the primary screen + +Request activation for the view on the primary screen +otherwise text fields won't get focus. + +Closes #501 + +[ChangeLog][Greeter] Fix text field focus (issue #501) +--- + src/greeter/GreeterApp.cpp | 31 ++++++++++++++++++++++++++++++- + src/greeter/GreeterApp.h | 4 +++- + 2 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/src/greeter/GreeterApp.cpp b/src/greeter/GreeterApp.cpp +index 06d13c5..8201a4e 100644 +--- a/src/greeter/GreeterApp.cpp ++++ b/src/greeter/GreeterApp.cpp +@@ -1,5 +1,5 @@ + /*************************************************************************** +-* Copyright (c) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> ++* Copyright (c) 2015-2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> + * Copyright (c) 2013 Abdurrahman AVCI <abdurrahmanavci@gmail.com> + * + * This program is free software; you can redistribute it and/or modify +@@ -36,6 +36,7 @@ + #include <QQmlContext> + #include <QQmlEngine> + #include <QDebug> ++#include <QTimer> + #include <QTranslator> + + #include <iostream> +@@ -135,6 +136,11 @@ namespace SDDM { + + // handle screens + connect(this, &GreeterApp::screenAdded, this, &GreeterApp::addViewForScreen); ++#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) ++ connect(this, &GreeterApp::primaryScreenChanged, this, [this](QScreen *) { ++ activatePrimary(); ++ }); ++#endif + } + + void GreeterApp::addViewForScreen(QScreen *screen) { +@@ -144,6 +150,7 @@ namespace SDDM { + view->setResizeMode(QQuickView::SizeRootObjectToView); + //view->setGeometry(QRect(QPoint(0, 0), screen->geometry().size())); + view->setGeometry(screen->geometry()); ++ m_views.append(view); + + // remove the view when the screen is removed, but we + // need to be careful here since Qt will move the view to +@@ -201,11 +208,33 @@ namespace SDDM { + // show + qDebug() << "Adding view for" << screen->name() << screen->geometry(); + view->show(); ++ ++ // activate windows for the primary screen to give focus to text fields ++ if (QGuiApplication::primaryScreen() == screen) ++ view->requestActivate(); + } + + void GreeterApp::removeViewForScreen(QQuickView *view) { ++ // screen is gone, remove the window + m_views.removeOne(view); + view->deleteLater(); ++ ++#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) ++ // starting from Qt 5.6 we are notified when the primary screen is changed ++ // and we request activation for the view when we get the signal, with ++ // older version we iterate the views and request activation ++ activatePrimary(); ++#endif ++ } ++ ++ void GreeterApp::activatePrimary() { ++ // activate and give focus to the window assigned to the primary screen ++ Q_FOREACH (QQuickView *view, m_views) { ++ if (view->screen() == QGuiApplication::primaryScreen()) { ++ view->requestActivate(); ++ break; ++ } ++ } + } + } + +diff --git a/src/greeter/GreeterApp.h b/src/greeter/GreeterApp.h +index 91fc1a9..1ebd981 100644 +--- a/src/greeter/GreeterApp.h ++++ b/src/greeter/GreeterApp.h +@@ -1,5 +1,5 @@ + /*************************************************************************** +-* Copyright (c) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> ++* Copyright (c) 2015-2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> + * Copyright (c) 2013 Nikita Mikhaylov <nslqqq@gmail.com> + * + * This program is free software; you can redistribute it and/or modify +@@ -65,6 +65,8 @@ namespace SDDM { + UserModel *m_userModel { nullptr }; + GreeterProxy *m_proxy { nullptr }; + KeyboardModel *m_keyboard { nullptr }; ++ ++ void activatePrimary(); + }; + } + diff --git a/x11-misc/sddm/sddm-0.13.0-r4.ebuild b/x11-misc/sddm/sddm-0.13.0-r4.ebuild new file mode 100644 index 000000000000..b3f70b3a0f4a --- /dev/null +++ b/x11-misc/sddm/sddm-0.13.0-r4.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 +inherit cmake-utils user + +DESCRIPTION="Simple Desktop Display Manager" +HOMEPAGE="https://github.com/sddm/sddm" +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz" +KEYWORDS="~amd64 ~arm ~x86" + +LICENSE="GPL-2+ MIT CC-BY-3.0 CC-BY-SA-3.0 public-domain" +SLOT="0" +IUSE="consolekit +pam systemd" + +RDEPEND="dev-qt/qtcore:5 + dev-qt/qtdbus:5 + dev-qt/qtgui:5 + dev-qt/qtdeclarative:5 + dev-qt/qtnetwork:5 + >=x11-base/xorg-server-1.15.1 + x11-libs/libxcb[xkb(-)] + consolekit? ( >=sys-auth/consolekit-0.9.4 ) + pam? ( sys-libs/pam ) + systemd? ( sys-apps/systemd:= ) + !systemd? ( || ( sys-power/upower sys-power/upower-pm-utils ) )" + +DEPEND="${RDEPEND} + dev-python/docutils + dev-qt/linguist-tools:5 + dev-qt/qttest:5 + virtual/pkgconfig" + +pkg_pretend() { + if [[ ${MERGE_TYPE} != binary && $(tc-getCC) == *gcc* ]]; then + if [[ $(gcc-major-version) -lt 4 || $(gcc-major-version) == 4 && $(gcc-minor-version) -lt 7 ]] ; then + die 'The active compiler needs to be gcc 4.7 (or newer)' + fi + fi +} + +src_prepare() { + eapply "${FILESDIR}/${PN}-0.13.0-pam_kwallet.patch" + # fix for flags handling and bug 563108 + eapply "${FILESDIR}/${PN}-0.12.0-respect-user-flags.patch" + eapply "${FILESDIR}/${P}-password-focus.patch" + use consolekit && eapply "${FILESDIR}/${PN}-0.11.0-consolekit.patch" + + cmake-utils_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DENABLE_PAM=$(usex pam) + -DNO_SYSTEMD=$(usex '!systemd') + -DBUILD_MAN_PAGES=ON + -DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf" + ) + + cmake-utils_src_configure +} + +pkg_postinst() { + enewgroup ${PN} + enewuser ${PN} -1 -1 /var/lib/${PN} ${PN} video + + if use consolekit && use pam && [[ -e "${ROOT}"/etc/pam.d/system-login ]]; then + local line=$(grep "pam_ck_connector.*nox11" "${ROOT}"/etc/pam.d/system-login) + if [[ -z ${line} ]]; then + ewarn + ewarn "Erroneous /etc/pam.d/system-login settings detected!" + ewarn "Please restore 'nox11' option in the line containing pam_ck_connector:" + ewarn + ewarn "session optional pam_ck_connector.so nox11" + ewarn + ewarn "or 'emerge -1 sys-auth/pambase' and run etc-update." + ewarn + fi + fi +} |