From 91c53b2cee4066e2f32fdd9293ed5d76b9ca41bc27294f815123f1824d77b2be Mon Sep 17 00:00:00 2001 From: Cor Blom Date: Sun, 3 Jan 2021 21:02:12 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Publishing/lyx?expand=0&rev=206 --- ...tly-the-window-position-with-Wayland.patch | 98 ------------------- 1 file changed, 98 deletions(-) delete mode 100644 0001-Store-correctly-the-window-position-with-Wayland.patch diff --git a/0001-Store-correctly-the-window-position-with-Wayland.patch b/0001-Store-correctly-the-window-position-with-Wayland.patch deleted file mode 100644 index b202561..0000000 --- a/0001-Store-correctly-the-window-position-with-Wayland.patch +++ /dev/null @@ -1,98 +0,0 @@ -Index: src/frontends/qt4/GuiApplication.cpp -=================================================================== ---- src/frontends/qt4/GuiApplication.cpp (revision dc5eda84b8bb4d4eed09047d1c55a33a8173e746) -+++ src/frontends/qt4/GuiApplication.cpp (revision d418b6f4c8207cc84c7a3b890de5aec2c837a672) -@@ -1112,4 +1112,27 @@ - - -+#if QT_VERSION < 0x050000 -+// Emulate platformName() for Qt4 -+ -+// FIXME: when ditching this method, remove all tests -+// platformName() == "qt4x11" -+// in the code -+QString GuiApplication::platformName() const -+{ -+# if defined(Q_WS_X11) -+ // Note that this one does not really exist -+ return "qt4x11"; -+# elif defined(Q_OS_MAC) -+ return "cocoa"; -+# elif defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN) -+ return "windows"; -+# else -+ LYXERR0("Unknown platform!"); -+ return "unknown"; -+# endif -+} -+#endif -+ -+ - double GuiApplication::pixelRatio() const - { -Index: src/frontends/qt4/GuiApplication.h -=================================================================== ---- src/frontends/qt4/GuiApplication.h (revision b9116e8b81f55ee795ea444ee02ff921bf82606a) -+++ src/frontends/qt4/GuiApplication.h (revision d418b6f4c8207cc84c7a3b890de5aec2c837a672) -@@ -155,4 +155,9 @@ - GuiView & view(int id) const; - -+#if (QT_VERSION < 0x050000) -+ /// Emulate platformName() for Qt4 -+ QString platformName() const; -+#endif -+ - /// Current ratio between physical pixels and device-independent pixels - double pixelRatio() const; -Index: src/frontends/qt4/GuiView.cpp -=================================================================== ---- src/frontends/qt4/GuiView.cpp (revision 1ae510b6287d5c96c3f106909c1cc8b0711b6d57) -+++ src/frontends/qt4/GuiView.cpp (revision d418b6f4c8207cc84c7a3b890de5aec2c837a672) -@@ -751,10 +751,9 @@ - settings.beginGroup("views"); - settings.beginGroup(QString::number(id_)); --#if defined(Q_WS_X11) || defined(QPA_XCB) -- settings.setValue("pos", pos()); -- settings.setValue("size", size()); --#else -- settings.setValue("geometry", saveGeometry()); --#endif -+ if (guiApp->platformName() == "qt4x11" || guiApp->platformName() == "xcb") { -+ settings.setValue("pos", pos()); -+ settings.setValue("size", size()); -+ } else -+ settings.setValue("geometry", saveGeometry()); - settings.setValue("layout", saveState(0)); - settings.setValue("icon_size", toqstr(d.iconSize(iconSize()))); -@@ -796,17 +795,18 @@ - setIconSize(d.iconSize(settings.value(icon_key).toString())); - --#if defined(Q_WS_X11) || defined(QPA_XCB) -- QPoint pos = settings.value("pos", QPoint(50, 50)).toPoint(); -- QSize size = settings.value("size", QSize(690, 510)).toSize(); -- resize(size); -- move(pos); --#else -- // Work-around for bug #6034: the window ends up in an undetermined -- // state when trying to restore a maximized window when it is -- // already maximized. -- if (!(windowState() & Qt::WindowMaximized)) -- if (!restoreGeometry(settings.value("geometry").toByteArray())) -- setGeometry(50, 50, 690, 510); --#endif -+ if (guiApp->platformName() == "qt4x11" || guiApp->platformName() == "xcb") { -+ QPoint pos = settings.value("pos", QPoint(50, 50)).toPoint(); -+ QSize size = settings.value("size", QSize(690, 510)).toSize(); -+ resize(size); -+ move(pos); -+ } else { -+ // Work-around for bug #6034: the window ends up in an undetermined -+ // state when trying to restore a maximized window when it is -+ // already maximized. -+ if (!(windowState() & Qt::WindowMaximized)) -+ if (!restoreGeometry(settings.value("geometry").toByteArray())) -+ setGeometry(50, 50, 690, 510); -+ } -+ - // Make sure layout is correctly oriented. - setLayoutDirection(qApp->layoutDirection());