已关闭
update to 1.28.0 #31
pengmeng-123创建于 7月1日关闭于 11 天前
update to 1.28.0 #31
已关闭
从已删除 :openEuler-24.03-LTS-SP1合入到src-openeuler/mate-screensaveropenEuler-24.03-LTS-SP1
共 10 个文件变更+719-574
| @@ -1,60 +1,46 @@ | |||
| 1 | -# Conditional for release and snapshot builds. Uncomment for release-builds. | ||
| 2 | -%global rel_build 1 | ||
| 3 | - | ||
| 4 | -# This is needed, because src-url contains branched part of versioning-scheme. | ||
| 5 | -%global branch 1.24 | ||
| 6 | - | ||
| 7 | -# Settings used for build from snapshots. | ||
| 8 | -%{!?rel_build:%global commit d5b35083e4de1d7457ebd937172bb0054e1fa089} | ||
| 9 | -%{!?rel_build:%global commit_date 20140125} | ||
| 10 | -%{!?rel_build:%global shortcommit %(c=%{commit};echo ${c:0:7})} | ||
| 11 | -%{!?rel_build:%global git_ver git%{commit_date}-%{shortcommit}} | ||
| 12 | -%{!?rel_build:%global git_rel .git%{commit_date}.%{shortcommit}} | ||
| 13 | -%{!?rel_build:%global git_tar %{name}-%{version}-%{git_ver}.tar.xz} | ||
| 14 | - | ||
| 15 | Name: mate-screensaver | 1 | Name: mate-screensaver |
| 16 | -Version: %{branch}.0 | 2 | +Version: 1.28.0 |
| 17 | -%if 0%{?rel_build} | 3 | +Release: 3 |
| 18 | -Release: 5 | ||
| 19 | -%else | ||
| 20 | -Release: 0.13%{?git_rel} | ||
| 21 | -%endif | ||
| 22 | Summary: MATE Screensaver | 4 | Summary: MATE Screensaver |
| 23 | -License: GPLv2+ and LGPLv2+ | 5 | +License: GPL-2.0-or-later AND LGPL-2.0-or-later |
| 24 | URL: http://pub.mate-desktop.org | 6 | URL: http://pub.mate-desktop.org |
| 7 | +%global branch 1.28 | ||
| 25 | 8 | ||
| 26 | # for downloading the tarball use 'spectool -g -R mate-screensaver.spec' | 9 | # for downloading the tarball use 'spectool -g -R mate-screensaver.spec' |
| 27 | # Source for release-builds. | 10 | # Source for release-builds. |
| 28 | -%{?rel_build:Source0: http://pub.mate-desktop.org/releases/%{branch}/%{name}-%{version}.tar.xz} | 11 | +Source0: http://pub.mate-desktop.org/releases/%{branch}/%{name}-%{version}.tar.xz |
| 29 | -# Source for snapshot-builds. | ||
| 30 | -%{!?rel_build:Source0: http://git.mate-desktop.org/%{name}/snapshot/%{name}-%{commit}.tar.xz#/%{git_tar}} | ||
| 31 | 12 | ||
| 32 | -# https://github.com/mate-desktop/mate-screensaver/pull/224 | 13 | +Patch1: mate-screensaver_0001-add-the-number-of-minutes-for-GUI-settings-to-lock-t.patch |
| 33 | -Patch1: mate-screensaver_0001-Custom-background-image-for-lock-screen.patch | 14 | +Patch2: mate-screensaver_0002-mate-screensaver-preferences-Add-mnemonic-for-backgr.patch |
| 15 | +Patch3: mate-screensaver_0003-mate-screensaver-preferences-Cleanup-UI-file-after-l.patch | ||
| 16 | +Patch4: mate-screensaver_0004-mate-screensaver-preferences-Add-missing-mnemonic.patch | ||
| 17 | +Patch5: mate-screensaver_0005-mate-screensaver-preferences-Add-tooltip-for-lock-de.patch | ||
| 18 | +Patch6: mate-screensaver_0006-mate-screensaver-preferences-Improve-and-cleanup-tim.patch | ||
| 34 | 19 | ||
| 35 | -Requires: openEuler-menus | 20 | +Requires: %{_vendor}-menus |
| 36 | -Requires: system-logos | 21 | +Requires: system-logos |
| 37 | -Requires: gnome-keyring-pam | 22 | +Requires: gnome-keyring-pam |
| 38 | 23 | ||
| 39 | -BuildRequires: dbus-glib-devel | 24 | +BuildRequires: dbus-glib-devel |
| 40 | -BuildRequires: desktop-file-utils | 25 | +BuildRequires: desktop-file-utils |
| 41 | -BuildRequires: gtk3-devel | 26 | +BuildRequires: gtk3-devel |
| 42 | -BuildRequires: libX11-devel | 27 | +BuildRequires: libX11-devel |
| 43 | -BuildRequires: libXScrnSaver-devel | 28 | +BuildRequires: libXScrnSaver-devel |
| 44 | -BuildRequires: libXinerama-devel | 29 | +BuildRequires: libXinerama-devel |
| 45 | -BuildRequires: libXmu-devel | 30 | +BuildRequires: libXmu-devel |
| 46 | -BuildRequires: libXtst-devel | 31 | +BuildRequires: libXtst-devel |
| 47 | -BuildRequires: libXxf86vm-devel | 32 | +BuildRequires: libXxf86vm-devel |
| 48 | -BuildRequires: libmatekbd-devel | 33 | +BuildRequires: libmatekbd-devel |
| 49 | -BuildRequires: libnotify-devel | 34 | +BuildRequires: libnotify-devel |
| 50 | -BuildRequires: mate-common | 35 | +BuildRequires: make |
| 51 | -BuildRequires: mate-desktop-devel | 36 | +BuildRequires: mate-common |
| 52 | -BuildRequires: mate-menus-devel | 37 | +BuildRequires: mate-desktop-devel |
| 53 | -BuildRequires: mesa-libGL-devel | 38 | +BuildRequires: mate-menus-devel |
| 54 | -BuildRequires: pam-devel | 39 | +BuildRequires: mesa-libGL-devel |
| 55 | -BuildRequires: systemd-devel | 40 | +BuildRequires: pam-devel |
| 56 | -BuildRequires: xorg-x11-proto-devel | 41 | +BuildRequires: systemd-devel |
| 57 | -BuildRequires: xmlto | 42 | +BuildRequires: xorg-x11-proto-devel |
| 43 | +BuildRequires: xmlto | ||
| 58 | 44 | ||
| 59 | %description | 45 | %description |
| 60 | mate-screensaver is a screen saver and locker that aims to have | 46 | mate-screensaver is a screen saver and locker that aims to have |
| @@ -70,19 +56,9 @@ Development files for mate-screensaver | |||
| 70 | 56 | ||
| 71 | 57 | ||
| 72 | %prep | 58 | %prep |
| 73 | -%if 0%{?rel_build} | ||
| 74 | %autosetup -p1 | 59 | %autosetup -p1 |
| 75 | -%else | ||
| 76 | -%autosetup -n %{name}-%{commit} -p1 | ||
| 77 | -%endif | ||
| 78 | 60 | ||
| 79 | -%if 0%{?rel_build} | ||
| 80 | -#NOCONFIGURE=1 ./autogen.sh | ||
| 81 | -%else # 0%{?rel_build} | ||
| 82 | -# for snapshots | ||
| 83 | -# needed for git snapshots | ||
| 84 | NOCONFIGURE=1 ./autogen.sh | 61 | NOCONFIGURE=1 ./autogen.sh |
| 85 | -%endif # 0%{?rel_build} | ||
| 86 | 62 | ||
| 87 | %build | 63 | %build |
| 88 | %configure \ | 64 | %configure \ |
| @@ -114,10 +90,8 @@ desktop-file-install \ | |||
| 114 | %{buildroot}%{_datadir}/applications/screensavers/*.desktop | 90 | %{buildroot}%{_datadir}/applications/screensavers/*.desktop |
| 115 | 91 | ||
| 116 | # fix versioned doc dir | 92 | # fix versioned doc dir |
| 117 | -%if 0%{?fedora} > 19 || 0%{?rhel} > 7 || 0%{?openEuler} | 93 | +mkdir -p %{buildroot}%{_docdir}/mate-screensaver |
| 118 | -mkdir -p %{buildroot}%{_datadir}/doc/mate-screensaver | 94 | +mv %{buildroot}%{_docdir}/mate-screensaver-%{version}/mate-screensaver.html %{buildroot}%{_docdir}/mate-screensaver/mate-screensaver.html |
| 119 | -mv %{buildroot}%{_datadir}/doc/mate-screensaver-%{version}/mate-screensaver.html %{buildroot}%{_datadir}/doc/mate-screensaver/mate-screensaver.html | ||
| 120 | -%endif | ||
| 121 | 95 | ||
| 122 | %find_lang %{name} --with-gnome --all-name | 96 | %find_lang %{name} --with-gnome --all-name |
| 123 | 97 | ||
| @@ -140,9 +114,7 @@ mv %{buildroot}%{_datadir}/doc/mate-screensaver-%{version}/mate-screensaver.html | |||
| 140 | %{_datadir}/glib-2.0/schemas/org.mate.screensaver.gschema.xml | 114 | %{_datadir}/glib-2.0/schemas/org.mate.screensaver.gschema.xml |
| 141 | %{_datadir}/mate-background-properties/cosmos.xml | 115 | %{_datadir}/mate-background-properties/cosmos.xml |
| 142 | %{_datadir}/dbus-1/services/org.mate.ScreenSaver.service | 116 | %{_datadir}/dbus-1/services/org.mate.ScreenSaver.service |
| 143 | -%if 0%{?fedora} > 19 || 0%{?rhel} > 7 || 0%{?openEuler} | ||
| 144 | %{_docdir}/mate-screensaver/mate-screensaver.html | 117 | %{_docdir}/mate-screensaver/mate-screensaver.html |
| 145 | -%endif | ||
| 146 | %{_mandir}/man1/* | 118 | %{_mandir}/man1/* |
| 147 | 119 | ||
| 148 | %files devel | 120 | %files devel |
| @@ -150,259 +122,12 @@ mv %{buildroot}%{_datadir}/doc/mate-screensaver-%{version}/mate-screensaver.html | |||
| 150 | 122 | ||
| 151 | 123 | ||
| 152 | %changelog | 124 | %changelog |
| 153 | -* Wed Jul 27 2022 longcheng <longcheng@kylinos.com.cn> - 1.24.0-5 | 125 | +* Tue Oct 14 2025 yueyaoqiang <yueyaoqiang@kylinos.cn> - 1.28.0-3 |
| 154 | -- fix build error in openeuler | 126 | +- convert license to SPDX |
| 155 | 127 | ||
| 156 | -* Thu Jul 14 2022 longcheng <longcheng@kylinos.com.cn> - 1.24.0-4 | 128 | +* Mon Sep 01 2025 yueyaoqiang <yueyaoqiang@kylinos.cn> - 1.28.0-2 |
| 157 | -- Modify the require redhats-menus to openEuler-menus | 129 | +- add some upstream commits |
| 158 | -- delete %{?dist} | ||
| 159 | 130 | ||
| 160 | -* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.24.0-3 | 131 | +* Mon Feb 17 2025 yuanxing <yuanxing@kylinsec.com.cn> - 1.28.0-1 |
| 161 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild | ||
| 162 | - | ||
| 163 | -* Fri Mar 27 2020 Wolfgang Ulbrich <fedora@raveit.de> - 1.24.0-2 | ||
| 164 | -- update UI to add a custom background-image for the lock-screen | ||
| 165 | - | ||
| 166 | -* Mon Feb 10 2020 Wolfgang Ulbrich <fedora@raveit.de> - 1.24.0-1 | ||
| 167 | -- update to 1.24.0 | ||
| 168 | - | ||
| 169 | -* Mon Feb 03 2020 Wolfgang Ulbrich <fedora@raveit.de> - 1.23.1-1 | ||
| 170 | -- update to 1.23.1 | ||
| 171 | - | ||
| 172 | -* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.2-2 | ||
| 173 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild | ||
| 174 | - | ||
| 175 | -* Sat Sep 21 2019 Wolfgang Ulbrich <fedora@raveit.de> - 1.22.2-1 | ||
| 176 | -- update to 1.22.2 | ||
| 177 | - | ||
| 178 | -* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.1-3 | ||
| 179 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild | ||
| 180 | - | ||
| 181 | -* Thu Jun 20 2019 Adam Jackson <ajax@redhat.com> - 1.22.1-2 | ||
| 182 | -- Drop BuildRequires: libXxf86misc-devel, X servers haven't implemented that | ||
| 183 | - extension in 10+ years. | ||
| 184 | - | ||
| 185 | -* Thu Apr 25 2019 Wolfgang Ulbrich <fedora@raveit.de> - 1.22.1-1 | ||
| 186 | -- update to 1.22.1 | ||
| 187 | - | ||
| 188 | -* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.3-2 | ||
| 189 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild | ||
| 190 | - | ||
| 191 | -* Sat Dec 22 2018 Wolfgang Ulbrich <fedora@raveit.de> - 1.20.3-1 | ||
| 192 | -- update to 1.20.3 | ||
| 193 | - | ||
| 194 | -* Sun Sep 09 2018 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.20.2-2 | ||
| 195 | -- update to 1.20.2 | ||
| 196 | - | ||
| 197 | -* Sat Aug 25 2018 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.20.1-3 | ||
| 198 | -- fix rhbz (#1566571, #1397900, #1474046) | ||
| 199 | - | ||
| 200 | -* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.1-2 | ||
| 201 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild | ||
| 202 | - | ||
| 203 | -* Sat Jun 16 2018 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.20.1-1 | ||
| 204 | -- update to 1.20.1 release | ||
| 205 | - | ||
| 206 | -* Sun Feb 11 2018 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.20.0-1 | ||
| 207 | -- update to 1.20.0 release | ||
| 208 | -- drop GSettings Schema rpm scriplet | ||
| 209 | -- switch to using autosetup | ||
| 210 | - | ||
| 211 | -* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.19.1-3 | ||
| 212 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild | ||
| 213 | - | ||
| 214 | -* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 1.19.1-2 | ||
| 215 | -- Rebuilt for switch to libxcrypt | ||
| 216 | - | ||
| 217 | -* Mon Jan 01 2018 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.19.1-1 | ||
| 218 | -- update to 1.19.1 | ||
| 219 | - | ||
| 220 | -* Sun Sep 10 2017 Wolfgang Ulbrich <fedora@raveit.de> - 1.19.0-1 | ||
| 221 | -- update to 1.19.0 | ||
| 222 | - | ||
| 223 | -* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.1-3 | ||
| 224 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild | ||
| 225 | - | ||
| 226 | -* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.1-2 | ||
| 227 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild | ||
| 228 | - | ||
| 229 | -* Sun Apr 16 2017 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.18.1-1 | ||
| 230 | -- update to 1.18.1 release | ||
| 231 | - | ||
| 232 | -* Tue Mar 14 2017 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.18.0-1 | ||
| 233 | -- update to 1.18.0 release | ||
| 234 | - | ||
| 235 | -* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.17.1-2 | ||
| 236 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild | ||
| 237 | - | ||
| 238 | -* Thu Jan 19 2017 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.17.1-1 | ||
| 239 | -- update to 1.17.1 release | ||
| 240 | - | ||
| 241 | -* Sat Dec 03 2016 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.17.0-1 | ||
| 242 | -- update to 1.17.0 release | ||
| 243 | - | ||
| 244 | -* Wed Sep 21 2016 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.16.0-1 | ||
| 245 | -- update to 1.16.0 release | ||
| 246 | - | ||
| 247 | -* Thu Jun 09 2016 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.15.0-1 | ||
| 248 | -- update to 1.15.0 release | ||
| 249 | -- switch to gtk+3 | ||
| 250 | - | ||
| 251 | -* Sat May 21 2016 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.14.1-1 | ||
| 252 | -- update to 1.14.1 release | ||
| 253 | - | ||
| 254 | -* Wed Apr 06 2016 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.14.0-1 | ||
| 255 | -- update to 1.14.0 release | ||
| 256 | - | ||
| 257 | -* Sun Feb 07 2016 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.13.0-1 | ||
| 258 | -- update to 1.13.0 release | ||
| 259 | - | ||
| 260 | -* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-2 | ||
| 261 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild | ||
| 262 | - | ||
| 263 | -* Fri Nov 06 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.12.0-1 | ||
| 264 | -- update to 1.12.0 release | ||
| 265 | - | ||
| 266 | -* Wed Oct 21 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.11.1-1 | ||
| 267 | -- update to 1.11.0 release | ||
| 268 | - | ||
| 269 | -* Fri Oct 16 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.10.2-3 | ||
| 270 | -- revert 'Lock the screen on systemd sleep under systemd' | ||
| 271 | - | ||
| 272 | -* Thu Sep 24 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.10.2-2 | ||
| 273 | -- improve systemd-login support | ||
| 274 | - | ||
| 275 | -* Mon Jul 13 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.10.2-1 | ||
| 276 | -- update to 1.10.2 release | ||
| 277 | - | ||
| 278 | -* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.1-2 | ||
| 279 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild | ||
| 280 | - | ||
| 281 | -* Fri Jun 12 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.10.1.1 | ||
| 282 | -- update to 1.10.1 release | ||
| 283 | -- removed upstreamed patches | ||
| 284 | - | ||
| 285 | -* Tue May 05 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.10.0-1 | ||
| 286 | -- update to 1.10.0-1 release | ||
| 287 | - | ||
| 288 | -* Sat Apr 04 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.9.90-1 | ||
| 289 | -- update to 1.9.90 release | ||
| 290 | - | ||
| 291 | -* Wed Apr 01 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.9.2-3 | ||
| 292 | -- fix user switching if more than 2 desktop managers are installed | ||
| 293 | -- remove conditions for f19 | ||
| 294 | - | ||
| 295 | -* Fri Feb 20 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.9.2-2 | ||
| 296 | -- use gdm as last condition for user switching | ||
| 297 | - | ||
| 298 | -* Tue Jan 20 2015 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.9.2-1 | ||
| 299 | -- update to 1.9.2 release | ||
| 300 | - | ||
| 301 | -* Thu Nov 20 2014 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.9.1-1 | ||
| 302 | -- update to 1.9.1 release | ||
| 303 | - | ||
| 304 | -* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-3 | ||
| 305 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild | ||
| 306 | - | ||
| 307 | -* Sun Jul 20 2014 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.9.0.2 | ||
| 308 | -- fix 'has_separator'_deprecation | ||
| 309 | - | ||
| 310 | -* Sat Jul 12 2014 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.9.0-1 | ||
| 311 | -- update to 1.9.0 release | ||
| 312 | - | ||
| 313 | -* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.0-2 | ||
| 314 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild | ||
| 315 | - | ||
| 316 | -* Wed Mar 05 2014 Dan Mashal <dan.mashal@fedoraproject.org> - 1.8.0-1 | ||
| 317 | -- Update to 1.8.0 | ||
| 318 | - | ||
| 319 | -* Wed Feb 19 2014 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.7.90-1 | ||
| 320 | -- update to 1.7.90 | ||
| 321 | - | ||
| 322 | -* Tue Feb 11 2014 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.7.1-1 | ||
| 323 | -- update to 1.7.1 release | ||
| 324 | - | ||
| 325 | -* Sun Jan 26 2014 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.7.1-0.1.git20140125.d5b3508 | ||
| 326 | -- update to git snapshot from 2014.01.25 | ||
| 327 | -- fix rhbz (#1057402) and (#1056591) | ||
| 328 | -- make Maintainers life easier and use better git snapshot usage | ||
| 329 | - | ||
| 330 | -* Tue Jan 14 2014 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.7.0-1 | ||
| 331 | -- update to 1.7.0 release | ||
| 332 | -- add --with-gnome --all-name for find language | ||
| 333 | -- removed upstreamed systemd-login patch | ||
| 334 | -- removed --with-console-kit configure flag | ||
| 335 | -- use modern 'make install' macro | ||
| 336 | -- add BR xmlto | ||
| 337 | -- reworked configure flags, use --with-gtk=2.0, --disable-schemas-compile | ||
| 338 | -- --enable-docbook-docs | ||
| 339 | -- fixed versioned doc dir | ||
| 340 | -- use one style for ownning directories | ||
| 341 | - | ||
| 342 | -* Fri Dec 06 2013 Dan Mashal <dan.mashal@fedoraproject.org> 1.7.0-1.1.git0460034 | ||
| 343 | -- Update to 1.7.0 | ||
| 344 | - | ||
| 345 | -* Sat Oct 19 2013 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.6.1-4 | ||
| 346 | -- switch to gnome-keyring for > f19 | ||
| 347 | - | ||
| 348 | -* Sat Oct 12 2013 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.6.1-3 | ||
| 349 | -- improve systemd-login support | ||
| 350 | - | ||
| 351 | -* Fri Aug 02 2013 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.6.1-2 | ||
| 352 | -- bump version to 1.6.1-2 | ||
| 353 | - | ||
| 354 | -* Fri Aug 02 2013 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.6.1-1 | ||
| 355 | -- Update to 1.6.1 | ||
| 356 | -- Drop patches | ||
| 357 | -- move doc dir for > f19 | ||
| 358 | - | ||
| 359 | -* Wed Jul 17 2013 Wolfgang Ulbrich <chat-to-me@raveit.de> - 1.6.0-2 | ||
| 360 | -- add upstream patch to fix idle activation time | ||
| 361 | -- remove unrecognized configure options --with-libgl | ||
| 362 | -- clean up runtime requires | ||
| 363 | -- add pam and systemd configure flags | ||
| 364 | -- remove gsettings convert file | ||
| 365 | - | ||
| 366 | -* Wed Apr 03 2013 Dan Mashal <dan.mashal@fedoraproject.org> - 1.6.0-1 | ||
| 367 | -- Update to latest 1.6.0 stable release. | ||
| 368 | - | ||
| 369 | -* Tue Mar 26 2013 Dan Mashal <dan.mashal@fedoraproject.org> - 1.5.2-1 | ||
| 370 | -- Update to latest upstream release | ||
| 371 | -- Redo configure flags | ||
| 372 | -- Update configure flags | ||
| 373 | -- Own dirs we are supposed to own | ||
| 374 | - | ||
| 375 | -* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-3 | ||
| 376 | -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild | ||
| 377 | - | ||
| 378 | -* Fri Dec 21 2012 Nelson Marques <nmo.marques@gmail.com> - 1.5.1-3 | ||
| 379 | -- Add missing dependencies for proper build and conditionals for | ||
| 380 | - using systemd or CK dependending on version. | ||
| 381 | -- Rework %%configure | ||
| 382 | - | ||
| 383 | -* Wed Dec 05 2012 Nelson Marques <nmo.marques@gmail.com> - 1.5.1-2 | ||
| 384 | -* add mate-screensaver-1.5.1-only_allow_one_instance.patch: fix double | ||
| 385 | - password prompt when returning from hibernate/suspend. Only allow one | ||
| 386 | - instance per user. | ||
| 387 | - | ||
| 388 | -* Fri Nov 23 2012 Leigh Scott <leigh123linux@googlemail.com> - 1.5.1-1 | ||
| 389 | -- update to 1.5.1 release | ||
| 390 | -- drop upstream commits patch | ||
| 391 | - | ||
| 392 | -* Mon Nov 12 2012 Leigh Scott <leigh123linux@googlemail.com> - 1.5.0-3 | ||
| 393 | -- clean up commits patch | ||
| 394 | - | ||
| 395 | -* Mon Nov 12 2012 Leigh Scott <leigh123linux@googlemail.com> - 1.5.0-2 | ||
| 396 | -- add upstream commits patch | ||
| 397 | -- add buildrequires systemd-devel | ||
| 398 | - | ||
| 399 | -* Thu Nov 08 2012 Leigh Scott <leigh123linux@googlemail.com> - 1.5.0-1 | ||
| 400 | -- update to 1.5.0 release | ||
| 401 | - | ||
| 402 | -* Tue Oct 23 2012 Leigh Scott <leigh123linux@googlemail.com> - 1.4.0-2 | ||
| 403 | -- add V=1 to make | ||
| 404 | -- use autogen instead of autoreconf | ||
| 405 | - | ||
| 406 | -* Fri Oct 19 2012 Leigh Scott <leigh123linux@googlemail.com> - 1.4.0-1 | ||
| 407 | - Initial build | 132 | - Initial build |
| 408 | 133 | ||
| @@ -0,0 +1,4 @@ | |||
| 1 | +version_control: github | ||
| 2 | +src_repo: mate-desktop/mate-screensaver | ||
| 3 | +tag_prefix: ^v | ||
| 4 | +seperator: . | ||
| @@ -1,258 +0,0 @@ | |||
| 1 | -From 0978e25db8d8032347df820a25f2ea18159e258c Mon Sep 17 00:00:00 2001 | ||
| 2 | -From: rbuj <robert.buj@gmail.com> | ||
| 3 | -Date: Sun, 15 Mar 2020 22:36:39 +0100 | ||
| 4 | -Subject: [PATCH] Custom background image for lock screen | ||
| 5 | - | ||
| 6 | ---- | ||
| 7 | - configure.ac | 1 - | ||
| 8 | - data/Makefile.am | 3 ++ | ||
| 9 | - data/mate-screensaver-preferences.ui | 61 +++++++++++++++++++++++- | ||
| 10 | - data/org.mate.screensaver.gschema.xml.in | 7 ++- | ||
| 11 | - src/gs-manager.c | 20 +++++++- | ||
| 12 | - src/mate-screensaver-preferences.c | 15 ++++++ | ||
| 13 | - 6 files changed, 102 insertions(+), 5 deletions(-) | ||
| 14 | - | ||
| 15 | -diff --git a/configure.ac b/configure.ac | ||
| 16 | -index e6b1b4f..6a30794 100644 | ||
| 17 | ---- a/configure.ac | ||
| 18 | -+++ b/configure.ac | ||
| 19 | -@@ -1112,7 +1112,6 @@ data/Makefile | ||
| 20 | - data/mate-screensavers.menu | ||
| 21 | - data/mate-screensaver.pc | ||
| 22 | - data/org.mate.ScreenSaver.service | ||
| 23 | --data/org.mate.screensaver.gschema.xml | ||
| 24 | - data/images/Makefile | ||
| 25 | - data/images/cosmos/Makefile | ||
| 26 | - savers/Makefile | ||
| 27 | -diff --git a/data/Makefile.am b/data/Makefile.am | ||
| 28 | -index 942fd55..f842873 100644 | ||
| 29 | ---- a/data/Makefile.am | ||
| 30 | -+++ b/data/Makefile.am | ||
| 31 | -@@ -46,6 +46,9 @@ dbussessionservice_DATA = org.mate.ScreenSaver.service | ||
| 32 | - gsettingsschema_in_files = org.mate.screensaver.gschema.xml.in | ||
| 33 | - gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml) | ||
| 34 | - | ||
| 35 | -+org.mate.screensaver.gschema.xml: org.mate.screensaver.gschema.xml.in | ||
| 36 | -+ $(AM_V_GEN) sed -e 's|@datadir[@]|$(datadir)|g' $< > $@ | ||
| 37 | -+ | ||
| 38 | - EXTRA_DIST = \ | ||
| 39 | - $(gsettingsschema_in_files) \ | ||
| 40 | - $(desktop_in_files) \ | ||
| 41 | -diff --git a/data/mate-screensaver-preferences.ui b/data/mate-screensaver-preferences.ui | ||
| 42 | -index cd3855b..0311064 100644 | ||
| 43 | ---- a/data/mate-screensaver-preferences.ui | ||
| 44 | -+++ b/data/mate-screensaver-preferences.ui | ||
| 45 | -@@ -1,5 +1,5 @@ | ||
| 46 | - <?xml version="1.0" encoding="UTF-8"?> | ||
| 47 | --<!-- Generated with glade 3.20.0 --> | ||
| 48 | -+<!-- Generated with glade 3.22.2 --> | ||
| 49 | - <interface> | ||
| 50 | - <requires lib="gtk+" version="3.14"/> | ||
| 51 | - <!-- interface-license-type gplv2 --> | ||
| 52 | -@@ -24,6 +24,9 @@ | ||
| 53 | - <property name="skip_taskbar_hint">True</property> | ||
| 54 | - <property name="skip_pager_hint">True</property> | ||
| 55 | - <property name="decorated">False</property> | ||
| 56 | -+ <child type="titlebar"> | ||
| 57 | -+ <placeholder/> | ||
| 58 | -+ </child> | ||
| 59 | - <child> | ||
| 60 | - <object class="GtkBox" id="vbox10"> | ||
| 61 | - <property name="visible">True</property> | ||
| 62 | -@@ -149,6 +152,7 @@ | ||
| 63 | - </object> | ||
| 64 | - </child> | ||
| 65 | - </object> | ||
| 66 | -+ <object class="GtkFileFilter" id="picture_filefilter"/> | ||
| 67 | - <object class="GtkImage" id="power_image"> | ||
| 68 | - <property name="can_focus">False</property> | ||
| 69 | - <property name="stock">gtk-jump-to</property> | ||
| 70 | -@@ -165,6 +169,9 @@ | ||
| 71 | - <property name="default_width">600</property> | ||
| 72 | - <property name="default_height">400</property> | ||
| 73 | - <property name="type_hint">dialog</property> | ||
| 74 | -+ <child type="titlebar"> | ||
| 75 | -+ <placeholder/> | ||
| 76 | -+ </child> | ||
| 77 | - <child internal-child="vbox"> | ||
| 78 | - <object class="GtkBox" id="dialog-vbox1"> | ||
| 79 | - <property name="visible">True</property> | ||
| 80 | -@@ -458,6 +465,56 @@ | ||
| 81 | - <property name="position">2</property> | ||
| 82 | - </packing> | ||
| 83 | - </child> | ||
| 84 | -+ <child> | ||
| 85 | -+ <object class="GtkBox" id="activate_delay_hbox1"> | ||
| 86 | -+ <property name="visible">True</property> | ||
| 87 | -+ <property name="can_focus">False</property> | ||
| 88 | -+ <property name="spacing">12</property> | ||
| 89 | -+ <child> | ||
| 90 | -+ <object class="GtkLabel"> | ||
| 91 | -+ <property name="visible">True</property> | ||
| 92 | -+ <property name="can_focus">False</property> | ||
| 93 | -+ <property name="label" translatable="yes">Background picture for lock screen:</property> | ||
| 94 | -+ </object> | ||
| 95 | -+ <packing> | ||
| 96 | -+ <property name="expand">False</property> | ||
| 97 | -+ <property name="fill">True</property> | ||
| 98 | -+ <property name="position">0</property> | ||
| 99 | -+ </packing> | ||
| 100 | -+ </child> | ||
| 101 | -+ <child> | ||
| 102 | -+ <object class="GtkBox" id="hbox5"> | ||
| 103 | -+ <property name="visible">True</property> | ||
| 104 | -+ <property name="can_focus">False</property> | ||
| 105 | -+ <property name="spacing">6</property> | ||
| 106 | -+ <child> | ||
| 107 | -+ <object class="GtkFileChooserButton" id="picture_filename"> | ||
| 108 | -+ <property name="visible">True</property> | ||
| 109 | -+ <property name="can_focus">False</property> | ||
| 110 | -+ <property name="create_folders">False</property> | ||
| 111 | -+ <property name="filter">picture_filefilter</property> | ||
| 112 | -+ <property name="title" translatable="yes">Select Background Image</property> | ||
| 113 | -+ </object> | ||
| 114 | -+ <packing> | ||
| 115 | -+ <property name="expand">True</property> | ||
| 116 | -+ <property name="fill">True</property> | ||
| 117 | -+ <property name="position">0</property> | ||
| 118 | -+ </packing> | ||
| 119 | -+ </child> | ||
| 120 | -+ </object> | ||
| 121 | -+ <packing> | ||
| 122 | -+ <property name="expand">True</property> | ||
| 123 | -+ <property name="fill">True</property> | ||
| 124 | -+ <property name="position">1</property> | ||
| 125 | -+ </packing> | ||
| 126 | -+ </child> | ||
| 127 | -+ </object> | ||
| 128 | -+ <packing> | ||
| 129 | -+ <property name="expand">False</property> | ||
| 130 | -+ <property name="fill">True</property> | ||
| 131 | -+ <property name="position">3</property> | ||
| 132 | -+ </packing> | ||
| 133 | -+ </child> | ||
| 134 | - <child> | ||
| 135 | - <object class="GtkLabel" id="root_warning_label"> | ||
| 136 | - <property name="can_focus">False</property> | ||
| 137 | -@@ -469,7 +526,7 @@ | ||
| 138 | - <packing> | ||
| 139 | - <property name="expand">False</property> | ||
| 140 | - <property name="fill">False</property> | ||
| 141 | -- <property name="position">3</property> | ||
| 142 | -+ <property name="position">4</property> | ||
| 143 | - </packing> | ||
| 144 | - </child> | ||
| 145 | - </object> | ||
| 146 | -diff --git a/data/org.mate.screensaver.gschema.xml.in b/data/org.mate.screensaver.gschema.xml.in | ||
| 147 | -index 7671144..5e2cf06 100644 | ||
| 148 | ---- a/data/org.mate.screensaver.gschema.xml.in | ||
| 149 | -+++ b/data/org.mate.screensaver.gschema.xml.in | ||
| 150 | -@@ -1,4 +1,4 @@ | ||
| 151 | --<schemalist gettext-domain="@GETTEXT_PACKAGE@"> | ||
| 152 | -+<schemalist gettext-domain="mate-screensaver"> | ||
| 153 | - <enum id="org.mate.screensaver.Mode"> | ||
| 154 | - <value nick="blank-only" value="0"/> | ||
| 155 | - <value nick="random" value="1"/> | ||
| 156 | -@@ -80,5 +80,10 @@ | ||
| 157 | - <summary>Allow the session status message to be displayed</summary> | ||
| 158 | - <description>Allow the session status message to be displayed when the screen is locked.</description> | ||
| 159 | - </key> | ||
| 160 | -+ <key name="picture-filename" type="s"> | ||
| 161 | -+ <default>'@datadir@/backgrounds/mate/desktop/Stripes.png'</default> | ||
| 162 | -+ <summary>Picture Filename</summary> | ||
| 163 | -+ <description>File to use for the background image.</description> | ||
| 164 | -+ </key> | ||
| 165 | - </schema> | ||
| 166 | - </schemalist> | ||
| 167 | -diff --git a/src/gs-manager.c b/src/gs-manager.c | ||
| 168 | -index cca90d8..139a305 100644 | ||
| 169 | ---- a/src/gs-manager.c | ||
| 170 | -+++ b/src/gs-manager.c | ||
| 171 | -@@ -1048,6 +1048,13 @@ gs_manager_init (GSManager *manager) | ||
| 172 | - manager); | ||
| 173 | - | ||
| 174 | - mate_bg_load_from_preferences (manager->priv->bg); | ||
| 175 | -+ GSettings *settings = g_settings_new ("org.mate.screensaver"); | ||
| 176 | -+ char *filename= g_settings_get_string (settings, "picture-filename"); | ||
| 177 | -+ if (g_file_test (filename, G_FILE_TEST_EXISTS)) { | ||
| 178 | -+ mate_bg_set_filename (manager->priv->bg, filename); | ||
| 179 | -+ } | ||
| 180 | -+ g_free (filename); | ||
| 181 | -+ g_object_unref (settings); | ||
| 182 | - } | ||
| 183 | - | ||
| 184 | - static void | ||
| 185 | -@@ -1260,11 +1267,22 @@ static void | ||
| 186 | - apply_background_to_window (GSManager *manager, | ||
| 187 | - GSWindow *window) | ||
| 188 | - { | ||
| 189 | -+ GSettings *settings; | ||
| 190 | -+ char *filename; | ||
| 191 | - cairo_surface_t *surface; | ||
| 192 | - int width; | ||
| 193 | - int height; | ||
| 194 | - | ||
| 195 | -- mate_bg_load_from_preferences (manager->priv->bg); | ||
| 196 | -+ mate_bg_load_from_preferences(manager->priv->bg); | ||
| 197 | -+ | ||
| 198 | -+ settings = g_settings_new ("org.mate.screensaver"); | ||
| 199 | -+ filename = g_settings_get_string (settings, "picture-filename"); | ||
| 200 | -+ | ||
| 201 | -+ if (g_file_test (filename, G_FILE_TEST_EXISTS)) { | ||
| 202 | -+ mate_bg_set_filename (manager->priv->bg, filename); | ||
| 203 | -+ } | ||
| 204 | -+ g_free (filename); | ||
| 205 | -+ g_object_unref (settings); | ||
| 206 | - | ||
| 207 | - if (manager->priv->bg == NULL) | ||
| 208 | - { | ||
| 209 | -diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c | ||
| 210 | -index 4ead5ed..8efb25a 100644 | ||
| 211 | ---- a/src/mate-screensaver-preferences.c | ||
| 212 | -+++ b/src/mate-screensaver-preferences.c | ||
| 213 | -@@ -1085,6 +1085,12 @@ enabled_checkbox_toggled (GtkToggleButton *button, gpointer user_data) | ||
| 214 | - config_set_enabled (gtk_toggle_button_get_active (button)); | ||
| 215 | - } | ||
| 216 | - | ||
| 217 | -+static void | ||
| 218 | -+picture_filename_changed (GtkFileChooserButton *button, gpointer user_data) | ||
| 219 | -+{ | ||
| 220 | -+ g_settings_set_string (screensaver_settings, "picture-filename", gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (button))); | ||
| 221 | -+} | ||
| 222 | -+ | ||
| 223 | - static void | ||
| 224 | - ui_disable_lock (gboolean disable) | ||
| 225 | - { | ||
| 226 | -@@ -1533,6 +1539,7 @@ init_capplet (void) | ||
| 227 | - GtkWidget *fullscreen_preview_previous; | ||
| 228 | - GtkWidget *fullscreen_preview_next; | ||
| 229 | - GtkWidget *fullscreen_preview_close; | ||
| 230 | -+ GtkWidget *picture_filename; | ||
| 231 | - gdouble activate_delay; | ||
| 232 | - gboolean enabled; | ||
| 233 | - gboolean is_writable; | ||
| 234 | -@@ -1579,6 +1586,7 @@ init_capplet (void) | ||
| 235 | - fullscreen_preview_close = GTK_WIDGET (gtk_builder_get_object (builder, "fullscreen_preview_close")); | ||
| 236 | - fullscreen_preview_previous = GTK_WIDGET (gtk_builder_get_object (builder, "fullscreen_preview_previous_button")); | ||
| 237 | - fullscreen_preview_next = GTK_WIDGET (gtk_builder_get_object (builder, "fullscreen_preview_next_button")); | ||
| 238 | -+ picture_filename = GTK_WIDGET (gtk_builder_get_object (builder, "picture_filename")); | ||
| 239 | - | ||
| 240 | - label = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_label")); | ||
| 241 | - gtk_label_set_mnemonic_widget (GTK_LABEL (label), activate_delay_hscale); | ||
| 242 | -@@ -1629,6 +1637,13 @@ init_capplet (void) | ||
| 243 | - g_signal_connect (lock_checkbox, "toggled", | ||
| 244 | - G_CALLBACK (lock_checkbox_toggled), NULL); | ||
| 245 | - | ||
| 246 | -+ char *path = g_settings_get_string (screensaver_settings, "picture-filename"); | ||
| 247 | -+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (gtk_builder_get_object (builder, "picture_filename")), path); | ||
| 248 | -+ gtk_file_filter_add_pixbuf_formats (GTK_FILE_FILTER (gtk_builder_get_object (builder, "picture_filefilter"))); | ||
| 249 | -+ g_free (path); | ||
| 250 | -+ g_signal_connect (picture_filename, "selection-changed", | ||
| 251 | -+ G_CALLBACK (picture_filename_changed), NULL); | ||
| 252 | -+ | ||
| 253 | - enabled = config_get_enabled (&is_writable); | ||
| 254 | - ui_set_enabled (enabled); | ||
| 255 | - if (! is_writable) | ||
| 256 | --- | ||
| 257 | -2.21.1 | ||
| 258 | - | ||
| @@ -0,0 +1,304 @@ | |||
| 1 | +From 7d0057888746e40c1af9989c41a192353ded0cab Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: mouse <15132211195@163.com> | ||
| 3 | +Date: Thu, 16 May 2024 16:28:29 +0800 | ||
| 4 | +Subject: [PATCH 1/6] add the number of minutes for GUI settings to lock the | ||
| 5 | + screen after activating the screen saver (#293) | ||
| 6 | + | ||
| 7 | +--- | ||
| 8 | + data/mate-screensaver-preferences.ui | 88 +++++++++++++++++++--------- | ||
| 9 | + src/mate-screensaver-preferences.c | 73 ++++++++++++++++++++--- | ||
| 10 | + 2 files changed, 125 insertions(+), 36 deletions(-) | ||
| 11 | + | ||
| 12 | +diff --git a/data/mate-screensaver-preferences.ui b/data/mate-screensaver-preferences.ui | ||
| 13 | +index 0311064..c49b04c 100644 | ||
| 14 | +--- a/data/mate-screensaver-preferences.ui | ||
| 15 | ++++ b/data/mate-screensaver-preferences.ui | ||
| 16 | +@@ -14,6 +14,13 @@ | ||
| 17 | + <property name="step_increment">1</property> | ||
| 18 | + <property name="page_increment">10</property> | ||
| 19 | + </object> | ||
| 20 | ++ <object class="GtkAdjustment" id="adjustment2"> | ||
| 21 | ++ <property name="lower">0</property> | ||
| 22 | ++ <property name="upper">120</property> | ||
| 23 | ++ <property name="value">10</property> | ||
| 24 | ++ <property name="step_increment">1</property> | ||
| 25 | ++ <property name="page_increment">10</property> | ||
| 26 | ++ </object> | ||
| 27 | + <object class="GtkWindow" id="fullscreen_preview_window"> | ||
| 28 | + <property name="can_focus">True</property> | ||
| 29 | + <property name="has_focus">True</property> | ||
| 30 | +@@ -387,27 +394,30 @@ | ||
| 31 | + <property name="spacing">6</property> | ||
| 32 | + <child> | ||
| 33 | + <object class="GtkBox" id="activate_delay_hbox"> | ||
| 34 | +- <property name="visible">True</property> | ||
| 35 | +- <property name="can_focus">False</property> | ||
| 36 | +- <property name="spacing">12</property> | ||
| 37 | +- <child> | ||
| 38 | +- <object class="GtkLabel" id="activate_delay_label"> | ||
| 39 | +- <property name="visible">True</property> | ||
| 40 | +- <property name="can_focus">False</property> | ||
| 41 | +- <property name="label" translatable="yes">Regard the computer as _idle after:</property> | ||
| 42 | +- <property name="use_underline">True</property> | ||
| 43 | +- </object> | ||
| 44 | +- <packing> | ||
| 45 | +- <property name="expand">False</property> | ||
| 46 | +- <property name="fill">False</property> | ||
| 47 | +- <property name="position">0</property> | ||
| 48 | +- </packing> | ||
| 49 | +- </child> | ||
| 50 | ++- <property name="visible">True</property> | ||
| 51 | ++- <property name="can_focus">False</property> | ||
| 52 | ++- <property name="spacing">12</property> | ||
| 53 | + <child> | ||
| 54 | +- <object class="GtkBox" id="hbox4"> | ||
| 55 | ++ <object class="GtkGrid" id="time_grid"> | ||
| 56 | + <property name="visible">True</property> | ||
| 57 | + <property name="can_focus">False</property> | ||
| 58 | +- <property name="spacing">6</property> | ||
| 59 | ++ <property name="hexpand">True</property> | ||
| 60 | ++ <property name="column-homogeneous">True</property> | ||
| 61 | ++ <property name="column_spacing">6</property> | ||
| 62 | ++ <child> | ||
| 63 | ++ <object class="GtkLabel" id="activate_delay_label"> | ||
| 64 | ++ <property name="visible">True</property> | ||
| 65 | ++ <property name="can_focus">False</property> | ||
| 66 | ++ <property name="label" translatable="yes">Regard the computer as _idle after:</property> | ||
| 67 | ++ <property name="use_underline">True</property> | ||
| 68 | ++ </object> | ||
| 69 | ++ <packing> | ||
| 70 | ++ <property name="left_attach">0</property> | ||
| 71 | ++ <property name="top_attach">0</property> | ||
| 72 | ++ <property name="width">1</property> | ||
| 73 | ++ <property name="height">1</property> | ||
| 74 | ++ </packing> | ||
| 75 | ++ </child> | ||
| 76 | + <child> | ||
| 77 | + <object class="GtkScale" id="activate_delay_hscale"> | ||
| 78 | + <property name="visible">True</property> | ||
| 79 | +@@ -416,24 +426,48 @@ | ||
| 80 | + <property name="digits">0</property> | ||
| 81 | + </object> | ||
| 82 | + <packing> | ||
| 83 | +- <property name="expand">True</property> | ||
| 84 | +- <property name="fill">True</property> | ||
| 85 | +- <property name="position">0</property> | ||
| 86 | ++ <property name="left_attach">1</property> | ||
| 87 | ++ <property name="top_attach">0</property> | ||
| 88 | ++ <property name="width">3</property> | ||
| 89 | ++ <property name="height">1</property> | ||
| 90 | ++ </packing> | ||
| 91 | ++ </child> | ||
| 92 | ++ <child> | ||
| 93 | ++ <object class="GtkLabel" id="lock_delay_label"> | ||
| 94 | ++ <property name="visible">True</property> | ||
| 95 | ++ <property name="can_focus">False</property> | ||
| 96 | ++ <property name="label" translatable="yes">Time before locking:</property> | ||
| 97 | ++ <property name="use_underline">True</property> | ||
| 98 | ++ </object> | ||
| 99 | ++ <packing> | ||
| 100 | ++ <property name="left_attach">0</property> | ||
| 101 | ++ <property name="top_attach">1</property> | ||
| 102 | ++ <property name="width">1</property> | ||
| 103 | ++ <property name="height">1</property> | ||
| 104 | ++ </packing> | ||
| 105 | ++ </child> | ||
| 106 | ++ <child> | ||
| 107 | ++ <object class="GtkScale" id="lock_delay_hscale"> | ||
| 108 | ++ <property name="visible">True</property> | ||
| 109 | ++ <property name="can_focus">True</property> | ||
| 110 | ++ <property name="adjustment">adjustment2</property> | ||
| 111 | ++ <property name="digits">0</property> | ||
| 112 | ++ </object> | ||
| 113 | ++ <packing> | ||
| 114 | ++ <property name="left_attach">1</property> | ||
| 115 | ++ <property name="top_attach">1</property> | ||
| 116 | ++ <property name="width">3</property> | ||
| 117 | ++ <property name="height">1</property> | ||
| 118 | + </packing> | ||
| 119 | + </child> | ||
| 120 | + </object> | ||
| 121 | + <packing> | ||
| 122 | + <property name="expand">True</property> | ||
| 123 | + <property name="fill">True</property> | ||
| 124 | +- <property name="position">1</property> | ||
| 125 | ++ <property name="position">0</property> | ||
| 126 | + </packing> | ||
| 127 | + </child> | ||
| 128 | + </object> | ||
| 129 | +- <packing> | ||
| 130 | +- <property name="expand">False</property> | ||
| 131 | +- <property name="fill">True</property> | ||
| 132 | +- <property name="position">0</property> | ||
| 133 | +- </packing> | ||
| 134 | + </child> | ||
| 135 | + <child> | ||
| 136 | + <object class="GtkCheckButton" id="enable_checkbox"> | ||
| 137 | +diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c | ||
| 138 | +index 105380c..d20c364 100644 | ||
| 139 | +--- a/src/mate-screensaver-preferences.c | ||
| 140 | ++++ b/src/mate-screensaver-preferences.c | ||
| 141 | +@@ -118,6 +118,31 @@ config_set_activate_delay (gint32 timeout) | ||
| 142 | + g_settings_set_int (session_settings, KEY_IDLE_DELAY, timeout); | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | ++static gdouble | ||
| 146 | ++config_get_lock_delay (gboolean *is_writable) | ||
| 147 | ++{ | ||
| 148 | ++ gint delay; | ||
| 149 | ++ | ||
| 150 | ++ if (is_writable) | ||
| 151 | ++ { | ||
| 152 | ++ *is_writable = g_settings_is_writable (screensaver_settings, | ||
| 153 | ++ KEY_LOCK_DELAY); | ||
| 154 | ++ } | ||
| 155 | ++ | ||
| 156 | ++ if ((delay = g_settings_get_int (screensaver_settings, KEY_LOCK_DELAY)) < 1) | ||
| 157 | ++ { | ||
| 158 | ++ return 0.0; | ||
| 159 | ++ } | ||
| 160 | ++ | ||
| 161 | ++ return (gdouble) delay; | ||
| 162 | ++} | ||
| 163 | ++ | ||
| 164 | ++static void | ||
| 165 | ++config_set_lock_delay (gint32 timeout) | ||
| 166 | ++{ | ||
| 167 | ++ g_settings_set_int (screensaver_settings, KEY_LOCK_DELAY, timeout); | ||
| 168 | ++} | ||
| 169 | ++ | ||
| 170 | + static int | ||
| 171 | + config_get_mode (gboolean *is_writable) | ||
| 172 | + { | ||
| 173 | +@@ -576,6 +601,16 @@ activate_delay_value_changed_cb (GtkRange *range, | ||
| 174 | + config_set_activate_delay ((gint32)value); | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | ++static void | ||
| 178 | ++lock_delay_value_changed_cb (GtkRange *range, | ||
| 179 | ++ gpointer user_data) | ||
| 180 | ++{ | ||
| 181 | ++ gdouble value; | ||
| 182 | ++ | ||
| 183 | ++ value = gtk_range_get_value (range); | ||
| 184 | ++ config_set_lock_delay ((gint32)value); | ||
| 185 | ++} | ||
| 186 | ++ | ||
| 187 | + static int | ||
| 188 | + compare_theme_names (char *name_a, | ||
| 189 | + char *name_b, | ||
| 190 | +@@ -1028,7 +1063,6 @@ time_to_string_text (long time) | ||
| 191 | + size_t max_len; | ||
| 192 | + | ||
| 193 | + string = g_strdup_printf (_("%s"), mins); | ||
| 194 | +- | ||
| 195 | + if (min == 1) | ||
| 196 | + max_len = (size_t) (len_minutes + inc_len + 3); | ||
| 197 | + else if (min < 10) | ||
| 198 | +@@ -1067,8 +1101,9 @@ static char * | ||
| 199 | + format_value_callback_time (GtkScale *scale, | ||
| 200 | + gdouble value) | ||
| 201 | + { | ||
| 202 | ++ /*You need to make up for 27 characters in length, otherwise the display will split into different lines*/ | ||
| 203 | + if (value == 0) | ||
| 204 | +- return g_strdup_printf (_("Never")); | ||
| 205 | ++ return g_strdup_printf (_("Never ")); | ||
| 206 | + | ||
| 207 | + return time_to_string_text ((long) (value * 60.0)); | ||
| 208 | + } | ||
| 209 | +@@ -1152,11 +1187,11 @@ ui_set_enabled (gboolean enabled) | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + static void | ||
| 213 | +-ui_set_delay (gdouble delay) | ||
| 214 | ++ui_set_delay (const char *name, gdouble delay) | ||
| 215 | + { | ||
| 216 | + GtkWidget *widget; | ||
| 217 | + | ||
| 218 | +- widget = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_hscale")); | ||
| 219 | ++ widget = GTK_WIDGET (gtk_builder_get_object (builder, name)); | ||
| 220 | + gtk_range_set_value (GTK_RANGE (widget), delay); | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | +@@ -1199,8 +1234,14 @@ key_changed_cb (GSettings *settings, const gchar *key, gpointer data) | ||
| 224 | + int delay; | ||
| 225 | + | ||
| 226 | + delay = g_settings_get_int (settings, key); | ||
| 227 | +- ui_set_delay ((gdouble) delay); | ||
| 228 | ++ ui_set_delay ("activate_delay_hscale", (gdouble) delay); | ||
| 229 | ++ } | ||
| 230 | ++ else if (strcmp (key, KEY_LOCK_DELAY) == 0) | ||
| 231 | ++ { | ||
| 232 | ++ int delay; | ||
| 233 | + | ||
| 234 | ++ delay = g_settings_get_int (settings, key); | ||
| 235 | ++ ui_set_delay ("lock_delay_hscale", (gdouble) delay); | ||
| 236 | + } | ||
| 237 | + else | ||
| 238 | + { | ||
| 239 | +@@ -1596,7 +1637,7 @@ init_capplet (void) | ||
| 240 | + GtkWidget *treeview; | ||
| 241 | + GtkWidget *list_scroller; | ||
| 242 | + GtkWidget *activate_delay_hscale; | ||
| 243 | +- GtkWidget *activate_delay_hbox; | ||
| 244 | ++ GtkWidget *lock_delay_hscale; | ||
| 245 | + GtkWidget *label; | ||
| 246 | + GtkWidget *enabled_checkbox; | ||
| 247 | + GtkWidget *lock_checkbox; | ||
| 248 | +@@ -1645,7 +1686,7 @@ init_capplet (void) | ||
| 249 | + treeview = GTK_WIDGET (gtk_builder_get_object (builder, "savers_treeview")); | ||
| 250 | + list_scroller = GTK_WIDGET (gtk_builder_get_object (builder, "themes_scrolled_window")); | ||
| 251 | + activate_delay_hscale = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_hscale")); | ||
| 252 | +- activate_delay_hbox = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_hbox")); | ||
| 253 | ++ lock_delay_hscale = GTK_WIDGET (gtk_builder_get_object (builder, "lock_delay_hscale")); | ||
| 254 | + enabled_checkbox = GTK_WIDGET (gtk_builder_get_object (builder, "enable_checkbox")); | ||
| 255 | + lock_checkbox = GTK_WIDGET (gtk_builder_get_object (builder, "lock_checkbox")); | ||
| 256 | + root_warning_label = GTK_WIDGET (gtk_builder_get_object (builder, "root_warning_label")); | ||
| 257 | +@@ -1660,6 +1701,8 @@ init_capplet (void) | ||
| 258 | + | ||
| 259 | + label = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_label")); | ||
| 260 | + gtk_label_set_mnemonic_widget (GTK_LABEL (label), activate_delay_hscale); | ||
| 261 | ++ label = GTK_WIDGET (gtk_builder_get_object (builder, "lock_delay_label")); | ||
| 262 | ++ gtk_label_set_mnemonic_widget (GTK_LABEL (label), lock_delay_hscale); | ||
| 263 | + label = GTK_WIDGET (gtk_builder_get_object (builder, "savers_label")); | ||
| 264 | + gtk_label_set_mnemonic_widget (GTK_LABEL (label), treeview); | ||
| 265 | + | ||
| 266 | +@@ -1691,14 +1734,23 @@ init_capplet (void) | ||
| 267 | + NULL); | ||
| 268 | + | ||
| 269 | + activate_delay = config_get_activate_delay (&is_writable); | ||
| 270 | +- ui_set_delay (activate_delay); | ||
| 271 | ++ ui_set_delay ("activate_delay_hscale", activate_delay); | ||
| 272 | + if (! is_writable) | ||
| 273 | + { | ||
| 274 | +- gtk_widget_set_sensitive (activate_delay_hbox, FALSE); | ||
| 275 | ++ gtk_widget_set_sensitive (activate_delay_hscale, FALSE); | ||
| 276 | + } | ||
| 277 | + g_signal_connect (activate_delay_hscale, "format-value", | ||
| 278 | + G_CALLBACK (format_value_callback_time), NULL); | ||
| 279 | + | ||
| 280 | ++ activate_delay = config_get_lock_delay (&is_writable); | ||
| 281 | ++ ui_set_delay ("lock_delay_hscale", activate_delay); | ||
| 282 | ++ if (! is_writable) | ||
| 283 | ++ { | ||
| 284 | ++ gtk_widget_set_sensitive (lock_delay_hscale, FALSE); | ||
| 285 | ++ } | ||
| 286 | ++ g_signal_connect (lock_delay_hscale, "format-value", | ||
| 287 | ++ G_CALLBACK (format_value_callback_time), NULL); | ||
| 288 | ++ | ||
| 289 | + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lock_checkbox), config_get_lock (&is_writable)); | ||
| 290 | + if (! is_writable) | ||
| 291 | + { | ||
| 292 | +@@ -1770,6 +1822,9 @@ init_capplet (void) | ||
| 293 | + g_signal_connect (activate_delay_hscale, "value-changed", | ||
| 294 | + G_CALLBACK (activate_delay_value_changed_cb), NULL); | ||
| 295 | + | ||
| 296 | ++ g_signal_connect (lock_delay_hscale, "value-changed", | ||
| 297 | ++ G_CALLBACK (lock_delay_value_changed_cb), NULL); | ||
| 298 | ++ | ||
| 299 | + g_signal_connect (dialog, "response", | ||
| 300 | + G_CALLBACK (response_cb), NULL); | ||
| 301 | + | ||
| 302 | +-- | ||
| 303 | +2.49.0 | ||
| 304 | + | ||
| @@ -0,0 +1,28 @@ | |||
| 1 | +From 243d9338b49269bde2cd655c213b44a2b89495b5 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Colomban Wendling <cwendling@hypra.fr> | ||
| 3 | +Date: Wed, 15 May 2024 22:03:38 +0200 | ||
| 4 | +Subject: [PATCH 2/6] mate-screensaver-preferences: Add mnemonic for | ||
| 5 | + background-picture | ||
| 6 | + | ||
| 7 | +--- | ||
| 8 | + data/mate-screensaver-preferences.ui | 4 +++- | ||
| 9 | + 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 10 | + | ||
| 11 | +diff --git a/data/mate-screensaver-preferences.ui b/data/mate-screensaver-preferences.ui | ||
| 12 | +index c49b04c..7ae6f51 100644 | ||
| 13 | +--- a/data/mate-screensaver-preferences.ui | ||
| 14 | ++++ b/data/mate-screensaver-preferences.ui | ||
| 15 | +@@ -508,7 +508,9 @@ | ||
| 16 | + <object class="GtkLabel"> | ||
| 17 | + <property name="visible">True</property> | ||
| 18 | + <property name="can_focus">False</property> | ||
| 19 | +- <property name="label" translatable="yes">Background picture for lock screen:</property> | ||
| 20 | ++ <property name="label" translatable="yes">_Background picture for lock screen:</property> | ||
| 21 | ++ <property name="use-underline">True</property> | ||
| 22 | ++ <property name="mnemonic-widget">picture_filename</property> | ||
| 23 | + </object> | ||
| 24 | + <packing> | ||
| 25 | + <property name="expand">False</property> | ||
| 26 | +-- | ||
| 27 | +2.49.0 | ||
| 28 | + | ||
| @@ -0,0 +1,84 @@ | |||
| 1 | +From 4aaa2300e7960c17a989296945b042ab4bdd42c2 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Colomban Wendling <cwendling@hypra.fr> | ||
| 3 | +Date: Wed, 15 May 2024 15:52:39 +0200 | ||
| 4 | +Subject: [PATCH 3/6] mate-screensaver-preferences: Cleanup UI file after | ||
| 5 | + lock-delay changes | ||
| 6 | + | ||
| 7 | +--- | ||
| 8 | + data/mate-screensaver-preferences.ui | 17 +++++++++++------ | ||
| 9 | + 1 file changed, 11 insertions(+), 6 deletions(-) | ||
| 10 | + | ||
| 11 | +diff --git a/data/mate-screensaver-preferences.ui b/data/mate-screensaver-preferences.ui | ||
| 12 | +index 7ae6f51..62a4baf 100644 | ||
| 13 | +--- a/data/mate-screensaver-preferences.ui | ||
| 14 | ++++ b/data/mate-screensaver-preferences.ui | ||
| 15 | +@@ -394,20 +394,21 @@ | ||
| 16 | + <property name="spacing">6</property> | ||
| 17 | + <child> | ||
| 18 | + <object class="GtkBox" id="activate_delay_hbox"> | ||
| 19 | +-- <property name="visible">True</property> | ||
| 20 | +-- <property name="can_focus">False</property> | ||
| 21 | +-- <property name="spacing">12</property> | ||
| 22 | ++ <property name="visible">True</property> | ||
| 23 | ++ <property name="can_focus">False</property> | ||
| 24 | ++ <property name="spacing">12</property> | ||
| 25 | + <child> | ||
| 26 | + <object class="GtkGrid" id="time_grid"> | ||
| 27 | + <property name="visible">True</property> | ||
| 28 | + <property name="can_focus">False</property> | ||
| 29 | + <property name="hexpand">True</property> | ||
| 30 | +- <property name="column-homogeneous">True</property> | ||
| 31 | + <property name="column_spacing">6</property> | ||
| 32 | + <child> | ||
| 33 | + <object class="GtkLabel" id="activate_delay_label"> | ||
| 34 | + <property name="visible">True</property> | ||
| 35 | + <property name="can_focus">False</property> | ||
| 36 | ++ <property name="halign">start</property> | ||
| 37 | ++ <property name="hexpand">False</property> | ||
| 38 | + <property name="label" translatable="yes">Regard the computer as _idle after:</property> | ||
| 39 | + <property name="use_underline">True</property> | ||
| 40 | + </object> | ||
| 41 | +@@ -422,13 +423,14 @@ | ||
| 42 | + <object class="GtkScale" id="activate_delay_hscale"> | ||
| 43 | + <property name="visible">True</property> | ||
| 44 | + <property name="can_focus">True</property> | ||
| 45 | ++ <property name="hexpand">True</property> | ||
| 46 | + <property name="adjustment">adjustment1</property> | ||
| 47 | + <property name="digits">0</property> | ||
| 48 | + </object> | ||
| 49 | + <packing> | ||
| 50 | + <property name="left_attach">1</property> | ||
| 51 | + <property name="top_attach">0</property> | ||
| 52 | +- <property name="width">3</property> | ||
| 53 | ++ <property name="width">1</property> | ||
| 54 | + <property name="height">1</property> | ||
| 55 | + </packing> | ||
| 56 | + </child> | ||
| 57 | +@@ -436,6 +438,8 @@ | ||
| 58 | + <object class="GtkLabel" id="lock_delay_label"> | ||
| 59 | + <property name="visible">True</property> | ||
| 60 | + <property name="can_focus">False</property> | ||
| 61 | ++ <property name="halign">start</property> | ||
| 62 | ++ <property name="hexpand">False</property> | ||
| 63 | + <property name="label" translatable="yes">Time before locking:</property> | ||
| 64 | + <property name="use_underline">True</property> | ||
| 65 | + </object> | ||
| 66 | +@@ -450,13 +454,14 @@ | ||
| 67 | + <object class="GtkScale" id="lock_delay_hscale"> | ||
| 68 | + <property name="visible">True</property> | ||
| 69 | + <property name="can_focus">True</property> | ||
| 70 | ++ <property name="hexpand">True</property> | ||
| 71 | + <property name="adjustment">adjustment2</property> | ||
| 72 | + <property name="digits">0</property> | ||
| 73 | + </object> | ||
| 74 | + <packing> | ||
| 75 | + <property name="left_attach">1</property> | ||
| 76 | + <property name="top_attach">1</property> | ||
| 77 | +- <property name="width">3</property> | ||
| 78 | ++ <property name="width">1</property> | ||
| 79 | + <property name="height">1</property> | ||
| 80 | + </packing> | ||
| 81 | + </child> | ||
| 82 | +-- | ||
| 83 | +2.49.0 | ||
| 84 | + | ||
| @@ -0,0 +1,25 @@ | |||
| 1 | +From 925348c120b0d33854886610cbb4154770905210 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Colomban Wendling <cwendling@hypra.fr> | ||
| 3 | +Date: Wed, 15 May 2024 21:57:27 +0200 | ||
| 4 | +Subject: [PATCH 4/6] mate-screensaver-preferences: Add missing mnemonic | ||
| 5 | + | ||
| 6 | +--- | ||
| 7 | + data/mate-screensaver-preferences.ui | 2 +- | ||
| 8 | + 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 9 | + | ||
| 10 | +diff --git a/data/mate-screensaver-preferences.ui b/data/mate-screensaver-preferences.ui | ||
| 11 | +index 62a4baf..a6918a8 100644 | ||
| 12 | +--- a/data/mate-screensaver-preferences.ui | ||
| 13 | ++++ b/data/mate-screensaver-preferences.ui | ||
| 14 | +@@ -440,7 +440,7 @@ | ||
| 15 | + <property name="can_focus">False</property> | ||
| 16 | + <property name="halign">start</property> | ||
| 17 | + <property name="hexpand">False</property> | ||
| 18 | +- <property name="label" translatable="yes">Time before locking:</property> | ||
| 19 | ++ <property name="label" translatable="yes">Time before l_ocking:</property> | ||
| 20 | + <property name="use_underline">True</property> | ||
| 21 | + </object> | ||
| 22 | + <packing> | ||
| 23 | +-- | ||
| 24 | +2.49.0 | ||
| 25 | + | ||
| @@ -0,0 +1,24 @@ | |||
| 1 | +From 72827148e15294308c20c06d3a5b9654d8b24a7f Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Colomban Wendling <cwendling@hypra.fr> | ||
| 3 | +Date: Wed, 15 May 2024 22:03:06 +0200 | ||
| 4 | +Subject: [PATCH 5/6] mate-screensaver-preferences: Add tooltip for lock-delay | ||
| 5 | + | ||
| 6 | +--- | ||
| 7 | + data/mate-screensaver-preferences.ui | 1 + | ||
| 8 | + 1 file changed, 1 insertion(+) | ||
| 9 | + | ||
| 10 | +diff --git a/data/mate-screensaver-preferences.ui b/data/mate-screensaver-preferences.ui | ||
| 11 | +index a6918a8..e5ef573 100644 | ||
| 12 | +--- a/data/mate-screensaver-preferences.ui | ||
| 13 | ++++ b/data/mate-screensaver-preferences.ui | ||
| 14 | +@@ -441,6 +441,7 @@ | ||
| 15 | + <property name="halign">start</property> | ||
| 16 | + <property name="hexpand">False</property> | ||
| 17 | + <property name="label" translatable="yes">Time before l_ocking:</property> | ||
| 18 | ++ <property name="tooltip-text" translatable="yes">Delay before locking the screen after the screensaver activated</property> | ||
| 19 | + <property name="use_underline">True</property> | ||
| 20 | + </object> | ||
| 21 | + <packing> | ||
| 22 | +-- | ||
| 23 | +2.49.0 | ||
| 24 | + | ||
| @@ -0,0 +1,209 @@ | |||
| 1 | +From a3def4737c267b649194fd8c2f37cc8fa0f2bc0d Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Colomban Wendling <cwendling@hypra.fr> | ||
| 3 | +Date: Tue, 21 May 2024 10:51:37 +0200 | ||
| 4 | +Subject: [PATCH 6/6] mate-screensaver-preferences: Improve and cleanup time | ||
| 5 | + scale formatting (#295) | ||
| 6 | + | ||
| 7 | +Formatting the value of a GtkScale is actually pretty tricky, because | ||
| 8 | +the lower and upper values representations are used to compute the size | ||
| 9 | +required do draw *all* values. This means the representations for the | ||
| 10 | +lower and upper bounds have to be at least as big as any other possible | ||
| 11 | +value, failing that leads to wrapping and overflowing of the value | ||
| 12 | +representation. | ||
| 13 | + | ||
| 14 | +This was previously partially done in `time_to_string_text()`, but not | ||
| 15 | +only wasn't it comprehensive (it only did so for whole minutes < 59), | ||
| 16 | +but it also meant that if one of the bounds wasn't a whole minute it | ||
| 17 | +didn't have the desired effect. | ||
| 18 | + | ||
| 19 | +Fix this by extracting the code for padding the string outside of the | ||
| 20 | +time formatting, and pad the resulting format string whatever it is. | ||
| 21 | + | ||
| 22 | +Also improve the padding to try and be less visible, by padding to the | ||
| 23 | +side where we don't want the value to align (e.g. pad on the right if | ||
| 24 | +we want the value left-aligned). | ||
| 25 | + | ||
| 26 | +This is still basically a sad hack, but there doesn't seem to be a | ||
| 27 | +better way to do this when neither the lower nor upper bound is | ||
| 28 | +necessarily the largest value. | ||
| 29 | +--- | ||
| 30 | + src/mate-screensaver-preferences.c | 138 +++++++++++++---------------- | ||
| 31 | + 1 file changed, 62 insertions(+), 76 deletions(-) | ||
| 32 | + | ||
| 33 | +diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c | ||
| 34 | +index d20c364..1bcdcaf 100644 | ||
| 35 | +--- a/src/mate-screensaver-preferences.c | ||
| 36 | ++++ b/src/mate-screensaver-preferences.c | ||
| 37 | +@@ -969,13 +969,7 @@ static char * | ||
| 38 | + time_to_string_text (long time) | ||
| 39 | + { | ||
| 40 | + char *secs, *mins, *hours, *string; | ||
| 41 | +- char *chk_hour_str, *chk_minute_str, *chk_hour_minute_str; | ||
| 42 | +- char *chk_ascii_str; | ||
| 43 | + int sec, min, hour; | ||
| 44 | +- size_t chk_ascii_len; | ||
| 45 | +- int len_minutes; | ||
| 46 | +- int n, inc_len; | ||
| 47 | +- int diff; | ||
| 48 | + | ||
| 49 | + sec = time % 60; | ||
| 50 | + time = time - sec; | ||
| 51 | +@@ -992,52 +986,6 @@ time_to_string_text (long time) | ||
| 52 | + secs = g_strdup_printf (ngettext ("%d second", | ||
| 53 | + "%d seconds", sec), sec); | ||
| 54 | + | ||
| 55 | +- /* inc_len = it's the lenght of the string "1 hour 59 minutes" */ | ||
| 56 | +- chk_hour_str = g_strdup_printf (ngettext ("%d hour", | ||
| 57 | +- "%d hours", 1), 1); | ||
| 58 | +- chk_minute_str = g_strdup_printf (ngettext ("%d minute", | ||
| 59 | +- "%d minutes", 59), 59); | ||
| 60 | +- chk_hour_minute_str = g_strdup_printf (_("%s %s"), | ||
| 61 | +- chk_hour_str, chk_minute_str); | ||
| 62 | +- inc_len = strlen (chk_hour_minute_str) - 1; | ||
| 63 | +- g_free (chk_hour_str); | ||
| 64 | +- g_free (chk_minute_str); | ||
| 65 | +- g_free (chk_hour_minute_str); | ||
| 66 | +- | ||
| 67 | +- len_minutes = 0; | ||
| 68 | +- for (n = 2; n < 60; n++) | ||
| 69 | +- { | ||
| 70 | +- char *minute_str = g_strdup_printf (ngettext ("%d minute", | ||
| 71 | +- "%d minutes", n), n); | ||
| 72 | +- char *ascii_str = g_str_to_ascii (minute_str, NULL); | ||
| 73 | +- size_t ascii_str_len = strlen (ascii_str); | ||
| 74 | +- size_t extra_length = (n < 10) ? 2 : 3; | ||
| 75 | +- | ||
| 76 | +- diff = (int) (ascii_str_len - extra_length); | ||
| 77 | +- if (diff > len_minutes) | ||
| 78 | +- len_minutes = diff; | ||
| 79 | +- | ||
| 80 | +- g_free (minute_str); | ||
| 81 | +- g_free (ascii_str); | ||
| 82 | +- } | ||
| 83 | +- | ||
| 84 | +- /* check the lenght of the string "1 minute" */ | ||
| 85 | +- chk_minute_str = g_strdup_printf (ngettext ("%d minute", | ||
| 86 | +- "%d minutes", 1), 1); | ||
| 87 | +- chk_ascii_str = g_str_to_ascii (chk_minute_str, NULL); | ||
| 88 | +- chk_ascii_len = strlen (chk_ascii_str); | ||
| 89 | +- diff = (int) (chk_ascii_len - 2); | ||
| 90 | +- | ||
| 91 | +- if (diff > len_minutes) | ||
| 92 | +- len_minutes = diff; | ||
| 93 | +- | ||
| 94 | +- g_free (chk_minute_str); | ||
| 95 | +- g_free (chk_ascii_str); | ||
| 96 | +- | ||
| 97 | +- /* len_minutes = MAX (1, len_minutes) */ | ||
| 98 | +- if (len_minutes < 1) | ||
| 99 | +- len_minutes = 1; | ||
| 100 | +- | ||
| 101 | + if (hour > 0) | ||
| 102 | + { | ||
| 103 | + if (sec > 0) | ||
| 104 | +@@ -1060,28 +1008,7 @@ time_to_string_text (long time) | ||
| 105 | + else | ||
| 106 | + { | ||
| 107 | + /* minutes */ | ||
| 108 | +- size_t max_len; | ||
| 109 | +- | ||
| 110 | + string = g_strdup_printf (_("%s"), mins); | ||
| 111 | +- if (min == 1) | ||
| 112 | +- max_len = (size_t) (len_minutes + inc_len + 3); | ||
| 113 | +- else if (min < 10) | ||
| 114 | +- max_len = (size_t) (len_minutes + inc_len); | ||
| 115 | +- else | ||
| 116 | +- max_len = (size_t) (len_minutes + inc_len - 1); | ||
| 117 | +- | ||
| 118 | +- while (strlen (string) != max_len) | ||
| 119 | +- { | ||
| 120 | +- char *string_aux; | ||
| 121 | +- | ||
| 122 | +- if (strlen (string) % 2 == 0) | ||
| 123 | +- string_aux = g_strconcat (string, " ", NULL); | ||
| 124 | +- else | ||
| 125 | +- string_aux = g_strconcat (" " , string, NULL); | ||
| 126 | +- | ||
| 127 | +- g_free (string); | ||
| 128 | +- string = string_aux; | ||
| 129 | +- } | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + else | ||
| 133 | +@@ -1101,11 +1028,70 @@ static char * | ||
| 134 | + format_value_callback_time (GtkScale *scale, | ||
| 135 | + gdouble value) | ||
| 136 | + { | ||
| 137 | +- /*You need to make up for 27 characters in length, otherwise the display will split into different lines*/ | ||
| 138 | ++ gchar *time_str, *big_time_str; | ||
| 139 | ++ GtkAdjustment *adj; | ||
| 140 | ++ gdouble lower, range, delta; | ||
| 141 | ++ gint pad_size; | ||
| 142 | ++ | ||
| 143 | ++ /* get the value representation as a string */ | ||
| 144 | + if (value == 0) | ||
| 145 | +- return g_strdup_printf (_("Never ")); | ||
| 146 | ++ time_str = g_strdup (_("Never")); | ||
| 147 | ++ else | ||
| 148 | ++ time_str = time_to_string_text ((long) (value * 60.0)); | ||
| 149 | ++ | ||
| 150 | ++ /* Now, adjust the string so the representation for the bounds are the | ||
| 151 | ++ * longest ones, and try and adjust the length as smoothly as possible. | ||
| 152 | ++ * The issue here is that GTK is using the lower and upper value | ||
| 153 | ++ * representations to compute the largest expected value's bounding box, | ||
| 154 | ++ * so those need to be bigger than anything else we might represent, | ||
| 155 | ++ * otherwise layout gets messed up (wraps and overflows). To achieve this, | ||
| 156 | ++ * we pad the values near each bound so its length is at least the same as | ||
| 157 | ++ * the biggest actual value. We cannot really do anything perfect here | ||
| 158 | ++ * because what matters is the pango layout size for the largest value, but | ||
| 159 | ++ * we don't have access to enough information to create one matching what | ||
| 160 | ++ * GTK will actually use, and even so it'd be trial-and-error until the | ||
| 161 | ++ * layout is big enough. So the silly assumptions below are probably good | ||
| 162 | ++ * enough. */ | ||
| 163 | ++ adj = gtk_range_get_adjustment (GTK_RANGE (scale)); | ||
| 164 | ++ lower = gtk_adjustment_get_lower (adj); | ||
| 165 | ++ range = gtk_adjustment_get_upper (adj) - lower; | ||
| 166 | ++ delta = range / 2 - (value - lower); | ||
| 167 | ++ /* the largest (character-wise) time string we expect */ | ||
| 168 | ++ big_time_str = time_to_string_text (7199 /* 1:59:59 */); | ||
| 169 | ++ pad_size = ((g_utf8_strlen (big_time_str, -1) * (ABS (delta) / range)) - | ||
| 170 | ++ g_utf8_strlen (time_str, -1)); | ||
| 171 | ++ g_free (big_time_str); | ||
| 172 | ++ if (pad_size > 0) | ||
| 173 | ++ { | ||
| 174 | ++ /* pad string with EM SPACE (U+2003) */ | ||
| 175 | ++ GString *padded = g_string_new (NULL); | ||
| 176 | ++ | ||
| 177 | ++ /* adjust pad side in RTL locales that aren't actually translated, as | ||
| 178 | ++ * a properly translated one would have text drawn RTL already */ | ||
| 179 | ++ if (gtk_widget_get_direction (GTK_WIDGET (scale)) == GTK_TEXT_DIR_RTL) | ||
| 180 | ++ { | ||
| 181 | ++ const gchar *msg_plural = "%d minutes"; | ||
| 182 | ++ if (ngettext ("%d minute", msg_plural, 2) == msg_plural) | ||
| 183 | ++ delta *= -1; | ||
| 184 | ++ } | ||
| 185 | ++ | ||
| 186 | ++ if (delta < 0) | ||
| 187 | ++ { | ||
| 188 | ++ for (gint i = 0; i < pad_size; i++) | ||
| 189 | ++ g_string_append_unichar (padded, 0x2003); | ||
| 190 | ++ g_string_append (padded, time_str); | ||
| 191 | ++ } | ||
| 192 | ++ else | ||
| 193 | ++ { | ||
| 194 | ++ g_string_append (padded, time_str); | ||
| 195 | ++ for (gint i = 0; i < pad_size; i++) | ||
| 196 | ++ g_string_append_unichar (padded, 0x2003); | ||
| 197 | ++ } | ||
| 198 | ++ g_free (time_str); | ||
| 199 | ++ time_str = g_string_free (padded, FALSE); | ||
| 200 | ++ } | ||
| 201 | + | ||
| 202 | +- return time_to_string_text ((long) (value * 60.0)); | ||
| 203 | ++ return time_str; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + static void | ||
| 207 | +-- | ||
| 208 | +2.49.0 | ||
| 209 | + | ||