Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/sddm/files/, x11-misc/sddm/
Date: Thu, 05 May 2016 17:08:00
Message-Id: 1462468062.e57438123e4153bcae1a1b05bdc0831a75812c35.kensington@gentoo
1 commit: e57438123e4153bcae1a1b05bdc0831a75812c35
2 Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 5 17:07:05 2016 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Thu May 5 17:07:42 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5743812
7
8 x11-misc/sddm: backport patch from upstream to ensure that the password field has focus
9
10 Gentoo-bug: 566082
11
12 Package-Manager: portage-2.2.28
13
14 .../sddm/files/sddm-0.13.0-password-focus.patch | 109 +++++++++++++++++++++
15 x11-misc/sddm/sddm-0.13.0-r4.ebuild | 81 +++++++++++++++
16 2 files changed, 190 insertions(+)
17
18 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
19 new file mode 100644
20 index 0000000..cc27669
21 --- /dev/null
22 +++ b/x11-misc/sddm/files/sddm-0.13.0-password-focus.patch
23 @@ -0,0 +1,109 @@
24 +From 6d5b36b28907b16280ff78995fef764bb0c573db Mon Sep 17 00:00:00 2001
25 +From: Pier Luigi Fiorini <pierluigi.fiorini@×××××.com>
26 +Date: Sat, 16 Jan 2016 19:52:09 +0100
27 +Subject: [PATCH] Activate window for the primary screen
28 +
29 +Request activation for the view on the primary screen
30 +otherwise text fields won't get focus.
31 +
32 +Closes #501
33 +
34 +[ChangeLog][Greeter] Fix text field focus (issue #501)
35 +---
36 + src/greeter/GreeterApp.cpp | 31 ++++++++++++++++++++++++++++++-
37 + src/greeter/GreeterApp.h | 4 +++-
38 + 2 files changed, 33 insertions(+), 2 deletions(-)
39 +
40 +diff --git a/src/greeter/GreeterApp.cpp b/src/greeter/GreeterApp.cpp
41 +index 06d13c5..8201a4e 100644
42 +--- a/src/greeter/GreeterApp.cpp
43 ++++ b/src/greeter/GreeterApp.cpp
44 +@@ -1,5 +1,5 @@
45 + /***************************************************************************
46 +-* Copyright (c) 2015 Pier Luigi Fiorini <pierluigi.fiorini@×××××.com>
47 ++* Copyright (c) 2015-2016 Pier Luigi Fiorini <pierluigi.fiorini@×××××.com>
48 + * Copyright (c) 2013 Abdurrahman AVCI <abdurrahmanavci@×××××.com>
49 + *
50 + * This program is free software; you can redistribute it and/or modify
51 +@@ -36,6 +36,7 @@
52 + #include <QQmlContext>
53 + #include <QQmlEngine>
54 + #include <QDebug>
55 ++#include <QTimer>
56 + #include <QTranslator>
57 +
58 + #include <iostream>
59 +@@ -135,6 +136,11 @@ namespace SDDM {
60 +
61 + // handle screens
62 + connect(this, &GreeterApp::screenAdded, this, &GreeterApp::addViewForScreen);
63 ++#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
64 ++ connect(this, &GreeterApp::primaryScreenChanged, this, [this](QScreen *) {
65 ++ activatePrimary();
66 ++ });
67 ++#endif
68 + }
69 +
70 + void GreeterApp::addViewForScreen(QScreen *screen) {
71 +@@ -144,6 +150,7 @@ namespace SDDM {
72 + view->setResizeMode(QQuickView::SizeRootObjectToView);
73 + //view->setGeometry(QRect(QPoint(0, 0), screen->geometry().size()));
74 + view->setGeometry(screen->geometry());
75 ++ m_views.append(view);
76 +
77 + // remove the view when the screen is removed, but we
78 + // need to be careful here since Qt will move the view to
79 +@@ -201,11 +208,33 @@ namespace SDDM {
80 + // show
81 + qDebug() << "Adding view for" << screen->name() << screen->geometry();
82 + view->show();
83 ++
84 ++ // activate windows for the primary screen to give focus to text fields
85 ++ if (QGuiApplication::primaryScreen() == screen)
86 ++ view->requestActivate();
87 + }
88 +
89 + void GreeterApp::removeViewForScreen(QQuickView *view) {
90 ++ // screen is gone, remove the window
91 + m_views.removeOne(view);
92 + view->deleteLater();
93 ++
94 ++#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
95 ++ // starting from Qt 5.6 we are notified when the primary screen is changed
96 ++ // and we request activation for the view when we get the signal, with
97 ++ // older version we iterate the views and request activation
98 ++ activatePrimary();
99 ++#endif
100 ++ }
101 ++
102 ++ void GreeterApp::activatePrimary() {
103 ++ // activate and give focus to the window assigned to the primary screen
104 ++ Q_FOREACH (QQuickView *view, m_views) {
105 ++ if (view->screen() == QGuiApplication::primaryScreen()) {
106 ++ view->requestActivate();
107 ++ break;
108 ++ }
109 ++ }
110 + }
111 + }
112 +
113 +diff --git a/src/greeter/GreeterApp.h b/src/greeter/GreeterApp.h
114 +index 91fc1a9..1ebd981 100644
115 +--- a/src/greeter/GreeterApp.h
116 ++++ b/src/greeter/GreeterApp.h
117 +@@ -1,5 +1,5 @@
118 + /***************************************************************************
119 +-* Copyright (c) 2015 Pier Luigi Fiorini <pierluigi.fiorini@×××××.com>
120 ++* Copyright (c) 2015-2016 Pier Luigi Fiorini <pierluigi.fiorini@×××××.com>
121 + * Copyright (c) 2013 Nikita Mikhaylov <nslqqq@×××××.com>
122 + *
123 + * This program is free software; you can redistribute it and/or modify
124 +@@ -65,6 +65,8 @@ namespace SDDM {
125 + UserModel *m_userModel { nullptr };
126 + GreeterProxy *m_proxy { nullptr };
127 + KeyboardModel *m_keyboard { nullptr };
128 ++
129 ++ void activatePrimary();
130 + };
131 + }
132 +
133
134 diff --git a/x11-misc/sddm/sddm-0.13.0-r4.ebuild b/x11-misc/sddm/sddm-0.13.0-r4.ebuild
135 new file mode 100644
136 index 0000000..b3f70b3
137 --- /dev/null
138 +++ b/x11-misc/sddm/sddm-0.13.0-r4.ebuild
139 @@ -0,0 +1,81 @@
140 +# Copyright 1999-2016 Gentoo Foundation
141 +# Distributed under the terms of the GNU General Public License v2
142 +# $Id$
143 +
144 +EAPI=6
145 +inherit cmake-utils user
146 +
147 +DESCRIPTION="Simple Desktop Display Manager"
148 +HOMEPAGE="https://github.com/sddm/sddm"
149 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
150 +KEYWORDS="~amd64 ~arm ~x86"
151 +
152 +LICENSE="GPL-2+ MIT CC-BY-3.0 CC-BY-SA-3.0 public-domain"
153 +SLOT="0"
154 +IUSE="consolekit +pam systemd"
155 +
156 +RDEPEND="dev-qt/qtcore:5
157 + dev-qt/qtdbus:5
158 + dev-qt/qtgui:5
159 + dev-qt/qtdeclarative:5
160 + dev-qt/qtnetwork:5
161 + >=x11-base/xorg-server-1.15.1
162 + x11-libs/libxcb[xkb(-)]
163 + consolekit? ( >=sys-auth/consolekit-0.9.4 )
164 + pam? ( sys-libs/pam )
165 + systemd? ( sys-apps/systemd:= )
166 + !systemd? ( || ( sys-power/upower sys-power/upower-pm-utils ) )"
167 +
168 +DEPEND="${RDEPEND}
169 + dev-python/docutils
170 + dev-qt/linguist-tools:5
171 + dev-qt/qttest:5
172 + virtual/pkgconfig"
173 +
174 +pkg_pretend() {
175 + if [[ ${MERGE_TYPE} != binary && $(tc-getCC) == *gcc* ]]; then
176 + if [[ $(gcc-major-version) -lt 4 || $(gcc-major-version) == 4 && $(gcc-minor-version) -lt 7 ]] ; then
177 + die 'The active compiler needs to be gcc 4.7 (or newer)'
178 + fi
179 + fi
180 +}
181 +
182 +src_prepare() {
183 + eapply "${FILESDIR}/${PN}-0.13.0-pam_kwallet.patch"
184 + # fix for flags handling and bug 563108
185 + eapply "${FILESDIR}/${PN}-0.12.0-respect-user-flags.patch"
186 + eapply "${FILESDIR}/${P}-password-focus.patch"
187 + use consolekit && eapply "${FILESDIR}/${PN}-0.11.0-consolekit.patch"
188 +
189 + cmake-utils_src_prepare
190 +}
191 +
192 +src_configure() {
193 + local mycmakeargs=(
194 + -DENABLE_PAM=$(usex pam)
195 + -DNO_SYSTEMD=$(usex '!systemd')
196 + -DBUILD_MAN_PAGES=ON
197 + -DDBUS_CONFIG_FILENAME="org.freedesktop.sddm.conf"
198 + )
199 +
200 + cmake-utils_src_configure
201 +}
202 +
203 +pkg_postinst() {
204 + enewgroup ${PN}
205 + enewuser ${PN} -1 -1 /var/lib/${PN} ${PN} video
206 +
207 + if use consolekit && use pam && [[ -e "${ROOT}"/etc/pam.d/system-login ]]; then
208 + local line=$(grep "pam_ck_connector.*nox11" "${ROOT}"/etc/pam.d/system-login)
209 + if [[ -z ${line} ]]; then
210 + ewarn
211 + ewarn "Erroneous /etc/pam.d/system-login settings detected!"
212 + ewarn "Please restore 'nox11' option in the line containing pam_ck_connector:"
213 + ewarn
214 + ewarn "session optional pam_ck_connector.so nox11"
215 + ewarn
216 + ewarn "or 'emerge -1 sys-auth/pambase' and run etc-update."
217 + ewarn
218 + fi
219 + fi
220 +}