gnu: texmacs: Support HiDPI displays on Wayland.

* gnu/packages/patches/texmacs-wayland-hidpi.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/text-editors.scm (texmacs)[source]: Use it.
(texmacs-guile3)[source]: Use it.
(mogan)[source]: Use it.

Change-Id: Ida737433957cb26695bf43538cff4d5d1c8a83c3
This commit is contained in:
Danny Milosavljevic 2024-12-11 18:36:17 +01:00
parent 96f0c5449a
commit ab110cae12
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5
3 changed files with 32 additions and 3 deletions

View file

@ -2249,6 +2249,7 @@ dist_patch_DATA = \
%D%/packages/patches/teuchos-remove-duplicate-using.patch \
%D%/packages/patches/texi2html-document-encoding.patch \
%D%/packages/patches/texi2html-i18n.patch \
%D%/packages/patches/texmacs-wayland-hidpi.patch \
%D%/packages/patches/thefuck-test-environ.patch \
%D%/packages/patches/tidy-CVE-2015-5522+5523.patch \
%D%/packages/patches/timewarrior-time-sensitive-tests.patch \

View file

@ -0,0 +1,22 @@
Author: Danny Milosavljevic <dannym@friendly-machines.com>
Date: 2024-12-11 18:30:00 CET 2024
License: gpl3+
diff -ru orig/qsbrdssq407hsajf74z60vp3rhgafjsl-mogan-1.1.1-checkout/src/Texmacs/Texmacs/texmacs.cpp qsbrdssq407hsajf74z60vp3rhgafjsl-mogan-1.1.1-checkout/src/Texmacs/Texmacs/texmacs.cpp
--- orig/qsbrdssq407hsajf74z60vp3rhgafjsl-mogan-1.1.1-checkout/src/Texmacs/Texmacs/texmacs.cpp 2024-05-10 01:51:55.312256939 +0200
+++ qsbrdssq407hsajf74z60vp3rhgafjsl-mogan-1.1.1-checkout/src/Texmacs/Texmacs/texmacs.cpp 2024-05-10 01:52:43.659909394 +0200
@@ -685,8 +685,12 @@
#ifndef OS_MINGW
set_env ("LC_NUMERIC", "POSIX");
#ifndef OS_MACOS
- set_env ("QT_QPA_PLATFORM", "xcb");
- set_env ("XDG_SESSION_TYPE", "x11");
+ if (get_env ("XDG_SESSION_TYPE") == "wayland") {
+ set_env ("QT_QPA_PLATFORM", "wayland"); QGuiApplication::setAttribute(Qt::AA_DisableHighDpiScaling); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+ } else {
+ set_env ("QT_QPA_PLATFORM", "xcb");
+ set_env ("XDG_SESSION_TYPE", "x11");
+ }
#endif
#endif
#ifdef MACOSX_EXTENSIONS

View file

@ -1083,7 +1083,9 @@ editors.")
(uri (string-append "https://www.texmacs.org/Download/ftp/tmftp/"
"source/TeXmacs-" version "-src.tar.gz"))
(sha256
(base32 "11l1q5lmsj9g7yil1dn7n1cgsr8iikx59kg9riahpb6xw0p959l7"))))
(base32 "11l1q5lmsj9g7yil1dn7n1cgsr8iikx59kg9riahpb6xw0p959l7"))
(patches
(search-patches "texmacs-wayland-hidpi.patch"))))
(build-system cmake-build-system)
(native-inputs
(list pkg-config xdg-utils)) ;for xdg-icon-resource
@ -1133,7 +1135,9 @@ Octave. TeXmacs is completely extensible via Guile.")
(url "https://github.com/texmacs/texmacs.git")
(commit "guile3_branch_2.1")))
(sha256
(base32 "0f7l1sfbii25gawqsg27m31myvixb3xdxnsg5njlrnmp8xh1rs3v"))))
(base32 "0f7l1sfbii25gawqsg27m31myvixb3xdxnsg5njlrnmp8xh1rs3v"))
(patches
(search-patches "texmacs-wayland-hidpi.patch"))))
(inputs
(list freetype
guile-3.0
@ -1159,7 +1163,9 @@ Octave. TeXmacs is completely extensible via Guile.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "04wz6xmimjv2l6baxgzm8vyq5grg102m3l4wq8i6bglv529yp4ff"))))
(base32 "04wz6xmimjv2l6baxgzm8vyq5grg102m3l4wq8i6bglv529yp4ff"))
(patches
(search-patches "texmacs-wayland-hidpi.patch"))))
(build-system qt-build-system)
(inputs
(modify-inputs (package-inputs texmacs)