[education/rkward/kf5] rkward/windows: Fix another MacOS compile error
Thomas Friedrichsmeier
null at kde.org
Wed Apr 10 16:12:08 BST 2024
Git commit 10bbc1b30d80234e06c2b68d5edfeb2c13ce6070 by Thomas Friedrichsmeier.
Committed on 07/04/2024 at 15:26.
Pushed by tfry into branch 'kf5'.
Fix another MacOS compile error
M +10 -8 rkward/windows/rkwindowcatcher.cpp
https://invent.kde.org/education/rkward/-/commit/10bbc1b30d80234e06c2b68d5edfeb2c13ce6070
diff --git a/rkward/windows/rkwindowcatcher.cpp b/rkward/windows/rkwindowcatcher.cpp
index d99e1878f..cfc0b2817 100644
--- a/rkward/windows/rkwindowcatcher.cpp
+++ b/rkward/windows/rkwindowcatcher.cpp
@@ -245,7 +245,15 @@ RKCaughtX11Window::RKCaughtX11Window(QWindow* window_to_embed, int device_number
// So we need the RKWindowCatcher to help us.
RKWindowCatcher::instance ()->registerWatcher (embedded->winId (), this);
-#ifdef Q_OS_WIN
+#if __has_include(<KWindowInfo>)
+ KWindowInfo wininfo (embedded->winId (), NET::WMName | NET::WMGeometry);
+ RK_ASSERT (wininfo.valid ());
+
+ // set a fixed size until the window is shown
+ xembed_container->setFixedSize (wininfo.geometry ().width (), wininfo.geometry ().height ());
+ setGeometry (wininfo.geometry ()); // it's important to set a size, even while not visible. Else DetachedWindowContainer will assign a default size of 640*480, and then size upwards, if necessary.
+ setCaption (wininfo.name ());
+#elif defined(Q_OS_WIN)
WINDOWINFO wininfo;
wininfo.cbSize = sizeof (WINDOWINFO);
GetWindowInfo (reinterpret_cast<HWND> (embedded->winId ()), &wininfo);
@@ -258,13 +266,7 @@ RKCaughtX11Window::RKCaughtX11Window(QWindow* window_to_embed, int device_number
setGeometry (wininfo.rcClient.left, wininfo.rcClient.right, wininfo.rcClient.top, wininfo.rcClient.bottom); // see comment in X11 section
move (wininfo.rcClient.left, wininfo.rcClient.top); // else the window frame may be off scree on top/left.
#else
- KWindowInfo wininfo (embedded->winId (), NET::WMName | NET::WMGeometry);
- RK_ASSERT (wininfo.valid ());
-
- // set a fixed size until the window is shown
- xembed_container->setFixedSize (wininfo.geometry ().width (), wininfo.geometry ().height ());
- setGeometry (wininfo.geometry ()); // it's important to set a size, even while not visible. Else DetachedWindowContainer will assign a default size of 640*480, and then size upwards, if necessary.
- setCaption (wininfo.name ());
+ RK_ASSERT(false);
#endif
// We need to make sure that the R backend has had a chance to do event processing on the new device, or else embedding will fail (sometimes).
More information about the rkward-tracker
mailing list