-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libreoffice-7.3.0-workaround-small-window.patch
29 lines (29 loc) · 1.83 KB
/
libreoffice-7.3.0-workaround-small-window.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
diff -up libreoffice-7.5.0.0/vcl/qt5/QtFrame.cxx.6~ libreoffice-7.5.0.0/vcl/qt5/QtFrame.cxx
--- libreoffice-7.5.0.0/vcl/qt5/QtFrame.cxx.6~ 2022-12-16 01:58:28.822558201 +0100
+++ libreoffice-7.5.0.0/vcl/qt5/QtFrame.cxx 2022-12-16 02:01:29.638344576 +0100
@@ -648,7 +648,11 @@ void QtFrame::SetWindowState(const vcl::
{
const qreal fRatio = devicePixelRatioF();
QWidget* const pChild = asChild();
- pChild->resize(ceil(pState->width() / fRatio), ceil(pState->height() / fRatio));
+ // Workaround for LO appearing way too small in some situations, e.g.
+ // https://github.com/QubesOS/qubes-issues/issues/3281
+ const int w = ceil(pState->width() / fRatio), h = ceil(pState->height() / fRatio);
+ if(w > 10 && h > 10 && w < 50000 && h < 50000)
+ pChild->resize(w, h);
pChild->move(ceil(pState->x() / fRatio), ceil(pState->y() / fRatio));
SetWindowStateImpl(Qt::WindowMaximized);
}
@@ -663,7 +667,10 @@ void QtFrame::SetWindowState(const vcl::
nPosSizeFlags |= SAL_FRAME_POSSIZE_WIDTH;
if (pState->mask() & vcl::WindowDataMask::Height)
nPosSizeFlags |= SAL_FRAME_POSSIZE_HEIGHT;
- SetPosSize(pState->x(), pState->y(), pState->width(), pState->height(), nPosSizeFlags);
+ // Workaround for LO appearing way too small in some situations, e.g.
+ // https://github.com/QubesOS/qubes-issues/issues/3281
+ if(pState->width() > 10 && pState->width() < 50000 && pState->height() > 10 && pState->height() < 50000)
+ SetPosSize(pState->x(), pState->y(), pState->width(), pState->height(), nPosSizeFlags);
}
else if (pState->mask() & vcl::WindowDataMask::State && !isChild())
{
diff -up libreoffice-7.5.0.0/vcl/unx/generic/window/salframe.cxx.6~ libreoffice-7.5.0.0/vcl/unx/generic/window/salframe.cxx