Toshaan Bharvani
8 months ago
13 changed files with 684 additions and 34 deletions
Binary file not shown.
@ -0,0 +1,58 @@ |
|||||||
|
From 86abb6fd8a8f680f9fc5ff1db775845c9f4e254b Mon Sep 17 00:00:00 2001 |
||||||
|
From: Michael Weghorn <m.weghorn@posteo.de> |
||||||
|
Date: Wed, 13 Mar 2024 12:27:12 +0100 |
||||||
|
Subject: [PATCH] tdf#159915 qt: Force |
||||||
|
Qt::HighDpiScaleFactorRoundingPolicy::Round |
||||||
|
|
||||||
|
For now, force `Qt::HighDpiScaleFactorRoundingPolicy::Round` |
||||||
|
for the HighDPI-scale factor rounding policy [1], which is the default |
||||||
|
for Qt 5, while Qt 6 defaults to `Qt::HighDpiScaleFactorRoundingPolicy::PassThrough` |
||||||
|
(see [2]), which resulted in broken rendering (e.g. "Help" -> "About" |
||||||
|
dialog not showing the whole content) when fractional display scaling like 150 % |
||||||
|
is configured in the KDE Plasma display settings (in contrast to manually setting the |
||||||
|
`QT_SCALE_FACTOR=1.5` env variable to apply scaling, which was working |
||||||
|
fine). |
||||||
|
|
||||||
|
Quoting from [3]: |
||||||
|
|
||||||
|
> The two principal options are whether fractional scale factors should be |
||||||
|
> rounded to an integer or not. Keeping the scale factor as-is will make |
||||||
|
> the user interface size match the OS setting exactly, but may cause |
||||||
|
> painting errors, for example with the Windows style. |
||||||
|
|
||||||
|
Manually setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY="Round"` |
||||||
|
has the same effect (and can be used with LO versions not yet |
||||||
|
containing this fix). |
||||||
|
|
||||||
|
(There might be a way to adjust the way that scaling happens |
||||||
|
to make other policies work, but for now, just hard-code to |
||||||
|
the policy that is known to work.) |
||||||
|
|
||||||
|
[1] https://doc.qt.io/qt-6/qt.html#HighDpiScaleFactorRoundingPolicy-enum |
||||||
|
[2] https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference |
||||||
|
[3] https://doc.qt.io/qt-6/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy |
||||||
|
|
||||||
|
Change-Id: I8eb6911d4dd5faf00912b8f15a58e0bdace1995a |
||||||
|
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164768 |
||||||
|
Tested-by: Jenkins |
||||||
|
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> |
||||||
|
--- |
||||||
|
vcl/qt5/QtInstance.cxx | 5 +++++ |
||||||
|
1 file changed, 5 insertions(+) |
||||||
|
|
||||||
|
diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx |
||||||
|
index 6b3bd0cc301ae..2801601115ecd 100644 |
||||||
|
--- a/vcl/qt5/QtInstance.cxx |
||||||
|
+++ b/vcl/qt5/QtInstance.cxx |
||||||
|
@@ -740,6 +740,11 @@ std::unique_ptr<QApplication> QtInstance::CreateQApplication(int& nArgc, char** |
||||||
|
// for scaled icons in the native menus |
||||||
|
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); |
||||||
|
#endif |
||||||
|
+ // force Qt::HighDpiScaleFactorRoundingPolicy::Round, which is the Qt 5 default |
||||||
|
+ // policy and prevents incorrect rendering with the Qt 6 default policy |
||||||
|
+ // Qt::HighDpiScaleFactorRoundingPolicy::PassThrough (tdf#159915) |
||||||
|
+ QGuiApplication::setHighDpiScaleFactorRoundingPolicy( |
||||||
|
+ Qt::HighDpiScaleFactorRoundingPolicy::Round); |
||||||
|
|
||||||
|
FreeableCStr session_manager; |
||||||
|
if (getenv("SESSION_MANAGER") != nullptr) |
Binary file not shown.
@ -0,0 +1,218 @@ |
|||||||
|
https://bugs.gentoo.org/917618 |
||||||
|
https://bugs.documentfoundation.org/show_bug.cgi?id=158108 |
||||||
|
|
||||||
|
From bcd5d851ebe91fc22edd3ea92be4a674bd13acba Mon Sep 17 00:00:00 2001 |
||||||
|
From: Alfred Wingate <parona@protonmail.com> |
||||||
|
Date: Mon, 20 Nov 2023 14:47:28 +0200 |
||||||
|
Subject: [PATCH] Remove use of the now removed LBCMNoChain options |
||||||
|
|
||||||
|
* This change removes its use and explicitly prevents chaining where |
||||||
|
the rule would have applied. |
||||||
|
|
||||||
|
https://github.com/unicode-org/icu/commit/84e47620692be90950d090f2f4722494b020ad96 |
||||||
|
https://github.com/unicode-org/icu/commit/9d9256f3b792100cda697c7bcf52bacfbc3bca87 |
||||||
|
|
||||||
|
Signed-off-by: Alfred Wingate <parona@protonmail.com> |
||||||
|
--- a/i18npool/source/breakiterator/data/line.txt |
||||||
|
+++ b/i18npool/source/breakiterator/data/line.txt |
||||||
|
@@ -14,7 +14,6 @@ |
||||||
|
# |
||||||
|
|
||||||
|
!!chain; |
||||||
|
-!!LBCMNoChain; |
||||||
|
|
||||||
|
|
||||||
|
!!lookAheadHardBreak; |
||||||
|
@@ -206,13 +205,13 @@ $CR $LF {100}; |
||||||
|
# |
||||||
|
$LB4NonBreaks? $LB4Breaks {100}; # LB 5 do not break before hard breaks. |
||||||
|
$CAN_CM $CM* $LB4Breaks {100}; |
||||||
|
-$CM+ $LB4Breaks {100}; |
||||||
|
+^$CM+ $LB4Breaks {100}; |
||||||
|
|
||||||
|
# LB 7 x SP |
||||||
|
# x ZW |
||||||
|
$LB4NonBreaks [$SP $ZW]; |
||||||
|
$CAN_CM $CM* [$SP $ZW]; |
||||||
|
-$CM+ [$SP $ZW]; |
||||||
|
+^$CM+ [$SP $ZW]; |
||||||
|
|
||||||
|
# |
||||||
|
# LB 8 Break after zero width space |
||||||
|
@@ -226,14 +225,14 @@ $LB8NonBreaks = [[$LB4NonBreaks] - [$ZW]]; |
||||||
|
# See definition of $CAN_CM. |
||||||
|
|
||||||
|
$CAN_CM $CM+; # Stick together any combining sequences that don't match other rules. |
||||||
|
-$CM+; |
||||||
|
+^$CM+; |
||||||
|
|
||||||
|
# |
||||||
|
# LB 11 Do not break before or after WORD JOINER & related characters. |
||||||
|
# |
||||||
|
$CAN_CM $CM* $WJcm; |
||||||
|
$LB8NonBreaks $WJcm; |
||||||
|
-$CM+ $WJcm; |
||||||
|
+^$CM+ $WJcm; |
||||||
|
|
||||||
|
$WJcm [^$CAN_CM]; |
||||||
|
$WJcm $CAN_CM $CM*; |
||||||
|
@@ -243,7 +242,7 @@ $WJcm $CAN_CM $CM*; |
||||||
|
# |
||||||
|
# (!SP) x GL |
||||||
|
[$LB8NonBreaks-$SP] $CM* $GLcm; |
||||||
|
-$CM+ $GLcm; |
||||||
|
+^$CM+ $GLcm; |
||||||
|
|
||||||
|
# GL x |
||||||
|
$GLcm ($LB8Breaks | $SP); |
||||||
|
@@ -260,19 +259,19 @@ $GLcm [$LB8NonBreaks-$SP] $CM*; # Don't let a combining mark go onto $CR, $B |
||||||
|
# |
||||||
|
$LB8NonBreaks $CL; |
||||||
|
$CAN_CM $CM* $CL; |
||||||
|
-$CM+ $CL; # by rule 10, stand-alone CM behaves as AL |
||||||
|
+^$CM+ $CL; # by rule 10, stand-alone CM behaves as AL |
||||||
|
|
||||||
|
$LB8NonBreaks $EX; |
||||||
|
$CAN_CM $CM* $EX; |
||||||
|
-$CM+ $EX; # by rule 10, stand-alone CM behaves as AL |
||||||
|
+^$CM+ $EX; # by rule 10, stand-alone CM behaves as AL |
||||||
|
|
||||||
|
$LB8NonBreaks $IS; |
||||||
|
$CAN_CM $CM* $IS; |
||||||
|
-$CM+ $IS; # by rule 10, stand-alone CM behaves as AL |
||||||
|
+^$CM+ $IS; # by rule 10, stand-alone CM behaves as AL |
||||||
|
|
||||||
|
$LB8NonBreaks $SY; |
||||||
|
$CAN_CM $CM* $SY; |
||||||
|
-$CM+ $SY; # by rule 10, stand-alone CM behaves as AL |
||||||
|
+^$CM+ $SY; # by rule 10, stand-alone CM behaves as AL |
||||||
|
|
||||||
|
|
||||||
|
# |
||||||
|
@@ -302,7 +301,7 @@ $LB18Breaks = [$LB8Breaks $SP]; |
||||||
|
# LB 19 |
||||||
|
# x QU |
||||||
|
$LB18NonBreaks $CM* $QUcm; |
||||||
|
-$CM+ $QUcm; |
||||||
|
+^$CM+ $QUcm; |
||||||
|
|
||||||
|
# QU x |
||||||
|
$QUcm .?; |
||||||
|
@@ -331,7 +330,7 @@ $HLcm ($HYcm | $BAcm) [^$CB]?; |
||||||
|
|
||||||
|
# LB 22 |
||||||
|
($ALcm | $HLcm) $INcm; |
||||||
|
-$CM+ $INcm; # by rule 10, any otherwise unattached CM behaves as AL |
||||||
|
+^$CM+ $INcm; # by rule 10, any otherwise unattached CM behaves as AL |
||||||
|
$IDcm $INcm; |
||||||
|
$INcm $INcm; |
||||||
|
$NUcm $INcm; |
||||||
|
@@ -341,7 +340,7 @@ $NUcm $INcm; |
||||||
|
$IDcm $POcm; |
||||||
|
$ALcm $NUcm; # includes $LB19 |
||||||
|
$HLcm $NUcm; |
||||||
|
-$CM+ $NUcm; # Rule 10, any otherwise unattached CM behaves as AL |
||||||
|
+^$CM+ $NUcm; # Rule 10, any otherwise unattached CM behaves as AL |
||||||
|
$NUcm $ALcm; |
||||||
|
$NUcm $HLcm; |
||||||
|
|
||||||
|
@@ -373,7 +372,7 @@ $PRcm ($JLcm | $JVcm | $JTcm | $H2cm | $H3cm); |
||||||
|
# LB 28 Do not break between alphabetics |
||||||
|
# |
||||||
|
($ALcm | $HLcm) ($ALcm | $HLcm); |
||||||
|
-$CM+ ($ALcm | $HLcm); # The $CM+ is from rule 10, an unattached CM is treated as AL |
||||||
|
+^$CM+ ($ALcm | $HLcm); # The $CM+ is from rule 10, an unattached CM is treated as AL |
||||||
|
|
||||||
|
# LB 29 |
||||||
|
$IScm ($ALcm | $NUcm); |
||||||
|
@@ -383,7 +382,7 @@ $IScm ($ALcm | $NUcm); |
||||||
|
# and opening or closing punctuation |
||||||
|
# |
||||||
|
($ALcm | $HLcm | $NUcm) $OPcm; |
||||||
|
-$CM+ $OPcm; |
||||||
|
+^$CM+ $OPcm; |
||||||
|
$CLcm ($ALcm | $HLcm | $NUcm); |
||||||
|
|
||||||
|
# |
||||||
|
@@ -393,32 +392,32 @@ $CLcm ($ALcm | $HLcm | $NUcm); |
||||||
|
|
||||||
|
!!reverse; |
||||||
|
|
||||||
|
-$CM+ $ALPlus; |
||||||
|
-$CM+ $BA; |
||||||
|
-$CM+ $BB; |
||||||
|
-$CM+ $B2; |
||||||
|
-$CM+ $CL; |
||||||
|
-$CM+ $EX; |
||||||
|
-$CM+ $GL; |
||||||
|
-$CM+ $HL; |
||||||
|
-$CM+ $HY; |
||||||
|
-$CM+ $H2; |
||||||
|
-$CM+ $H3; |
||||||
|
-$CM+ $ID; |
||||||
|
-$CM+ $IN; |
||||||
|
-$CM+ $IS; |
||||||
|
-$CM+ $JL; |
||||||
|
-$CM+ $JV; |
||||||
|
-$CM+ $JT; |
||||||
|
-$CM+ $NS; |
||||||
|
-$CM+ $NU; |
||||||
|
-$CM+ $OP; |
||||||
|
-$CM+ $PO; |
||||||
|
-$CM+ $PR; |
||||||
|
-$CM+ $QU; |
||||||
|
-$CM+ $SY; |
||||||
|
-$CM+ $WJ; |
||||||
|
-$CM+; |
||||||
|
+^$CM+ $ALPlus; |
||||||
|
+^$CM+ $BA; |
||||||
|
+^$CM+ $BB; |
||||||
|
+^$CM+ $B2; |
||||||
|
+^$CM+ $CL; |
||||||
|
+^$CM+ $EX; |
||||||
|
+^$CM+ $GL; |
||||||
|
+^$CM+ $HL; |
||||||
|
+^$CM+ $HY; |
||||||
|
+^$CM+ $H2; |
||||||
|
+^$CM+ $H3; |
||||||
|
+^$CM+ $ID; |
||||||
|
+^$CM+ $IN; |
||||||
|
+^$CM+ $IS; |
||||||
|
+^$CM+ $JL; |
||||||
|
+^$CM+ $JV; |
||||||
|
+^$CM+ $JT; |
||||||
|
+^$CM+ $NS; |
||||||
|
+^$CM+ $NU; |
||||||
|
+^$CM+ $OP; |
||||||
|
+^$CM+ $PO; |
||||||
|
+^$CM+ $PR; |
||||||
|
+^$CM+ $QU; |
||||||
|
+^$CM+ $SY; |
||||||
|
+^$CM+ $WJ; |
||||||
|
+^$CM+; |
||||||
|
|
||||||
|
|
||||||
|
# |
||||||
|
@@ -468,7 +467,7 @@ $LF $CR; |
||||||
|
# X $CM needs to behave like X, where X is not $SP or controls. |
||||||
|
# $CM not covered by the above needs to behave like $AL |
||||||
|
# Stick together any combining sequences that don't match other rules. |
||||||
|
-$CM+ $CAN_CM; |
||||||
|
+^$CM+ $CAN_CM; |
||||||
|
|
||||||
|
|
||||||
|
# LB 11 |
||||||
|
@@ -606,8 +605,8 @@ $CM* ($ALPlus | $HL | $NU) $CM* ($CL | $SY)+ [^$SP]; |
||||||
|
!!safe_reverse; |
||||||
|
|
||||||
|
# LB 7 |
||||||
|
-$CM+ [^$CM $BK $CR $LF $NL $ZW $SP]; |
||||||
|
-$CM+ $SP / .; |
||||||
|
+^$CM+ [^$CM $BK $CR $LF $NL $ZW $SP]; |
||||||
|
+^$CM+ $SP / .; |
||||||
|
|
||||||
|
# LB 9 |
||||||
|
$SP+ $CM* $OP; |
||||||
|
-- |
||||||
|
2.42.1 |
||||||
|
|
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.4 KiB |
@ -0,0 +1,47 @@ |
|||||||
|
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx |
||||||
|
index 05a03fe72c4d..44fc885a3dc0 100644 |
||||||
|
--- a/pyuno/source/loader/pyuno_loader.cxx |
||||||
|
+++ b/pyuno/source/loader/pyuno_loader.cxx |
||||||
|
@@ -105,7 +105,7 @@ static PyRef getObjectFromLoaderModule( const char * func ) |
||||||
|
return object; |
||||||
|
} |
||||||
|
|
||||||
|
-static void setPythonHome ( const OUString & pythonHome ) |
||||||
|
+static void setPythonHome ( const OUString & pythonHome, PyConfig * config ) |
||||||
|
{ |
||||||
|
OUString systemPythonHome; |
||||||
|
osl_getSystemPathFromFileURL( pythonHome.pData, &(systemPythonHome.pData) ); |
||||||
|
@@ -129,9 +129,7 @@ static void setPythonHome ( const OUString & pythonHome ) |
||||||
|
PyErr_SetString(PyExc_SystemError, "python home path is too long"); |
||||||
|
return; |
||||||
|
} |
||||||
|
-SAL_WNODEPRECATED_DECLARATIONS_PUSH |
||||||
|
- Py_SetPythonHome(wide); // deprecated since python 3.11 |
||||||
|
-SAL_WNODEPRECATED_DECLARATIONS_POP |
||||||
|
+ config->home = wide; |
||||||
|
} |
||||||
|
|
||||||
|
static void prependPythonPath( std::u16string_view pythonPathBootstrap ) |
||||||
|
@@ -183,11 +181,13 @@ void pythonInit() { |
||||||
|
if ( Py_IsInitialized()) // may be inited by getComponentContext() already |
||||||
|
return; |
||||||
|
|
||||||
|
+ PyConfig config; |
||||||
|
OUString pythonPath; |
||||||
|
OUString pythonHome; |
||||||
|
OUString path( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("pythonloader.uno" )); |
||||||
|
rtl::Bootstrap::expandMacros(path); //TODO: detect failure |
||||||
|
rtl::Bootstrap bootstrap(path); |
||||||
|
+ PyConfig_InitPythonConfig( &config ); |
||||||
|
|
||||||
|
// look for pythonhome |
||||||
|
bootstrap.getFrom( "PYUNO_LOADER_PYTHONHOME", pythonHome ); |
||||||
|
@@ -196,7 +196,7 @@ void pythonInit() { |
||||||
|
// pythonhome+pythonpath must be set before Py_Initialize(), otherwise there appear warning on the console |
||||||
|
// sadly, there is no api for setting the pythonpath, we have to use the environment variable |
||||||
|
if( !pythonHome.isEmpty() ) |
||||||
|
- setPythonHome( pythonHome ); |
||||||
|
+ setPythonHome( pythonHome, &config ); |
||||||
|
|
||||||
|
if( !pythonPath.isEmpty() ) |
||||||
|
prependPythonPath( pythonPath ); |
Loading…
Reference in new issue