Commit 71486c16 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜
Browse files

glib.recipe: Don't wait for Window Messages on UWP

This function is not available UWP, and WaitForMultipleObjects should
be used instead since Win32 Window Messages are not available on UWP.

This error was reported by the Windows Application Certification Kit
(WACK).

Part-of: <!545>
parent d0c23a4f
Pipeline #173730 passed with stages
in 62 minutes and 52 seconds
......@@ -137,6 +137,7 @@ class Recipe(recipe.Recipe):
self.patches += [
# Ready to upstream
'glib/uwp/0001-glib-Never-use-MessageBox-on-UWP-apps.patch',
'glib/uwp/0001-gpoll-UWP-does-not-need-to-poll-a-msg_fd.patch',
'glib/uwp/0001-gio-Remove-broken-support-for-XP.patch',
'glib/uwp/0002-win_iconv-Use-LoadPackagedLibrary-when-building-UWP-.patch',
'glib/uwp/0003-glib-getpid-is-available-on-Win32-but-not-WinRT.patch',
......
From 029fc2872786dba06ca5a85294419eb229e080e9 Mon Sep 17 00:00:00 2001
From: Nirbheek Chauhan <nirbheek@centricular.com>
Date: Thu, 9 Jul 2020 00:04:22 +0530
Subject: [PATCH] gpoll: UWP does not need to poll a msg_fd
msg_fd is only set when we need to handle win32 Window Messages, which
are not available when building with UWP.
---
glib/gpoll.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/glib/gpoll.c b/glib/gpoll.c
index 290c64c..524fd39 100644
--- a/glib/gpoll.c
+++ b/glib/gpoll.c
@@ -149,8 +149,15 @@ poll_rest (GPollFD *msg_fd,
if (_g_main_poll_debug)
g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout_ms);
+#ifdef G_WINAPI_ONLY_APP
+ /* msg_fd is only set when we need to handle win32 Window Messages, which
+ * are not available when building with UWP
+ */
+ g_assert_not_reached ();
+#else
ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout_ms,
QS_ALLINPUT, MWMO_ALERTABLE);
+#endif
if (ready == WAIT_FAILED)
{
@@ -447,8 +454,15 @@ g_poll (GPollFD *fds,
/* Wait for at least one thread to return */
if (msg_fd != NULL)
+#ifdef G_WINAPI_ONLY_APP
+ /* msg_fd is only set when we need to handle win32 Window Messages, which
+ * are not available when building with UWP
+ */
+ g_assert_not_reached ();
+#else
ready = MsgWaitForMultipleObjectsEx (nthreads, thread_handles, timeout,
QS_ALLINPUT, MWMO_ALERTABLE);
+#endif
else
ready = WaitForMultipleObjects (nthreads, thread_handles, timeout > 0, timeout);
--
2.27.0.windows.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment