Go to file
Gatis Paeglis fbb485d4f6 Prevent busy loop in glib event dispatcher
.. when running event loop with QEventLoop::ExcludeUserInputEvents.

In a properly functioning code, g_main_context_iteration is expected
to block until any event source becomes ready to dispatch an event
(or interrupt occurs). Qt provides several custom event sources to
the Glib event loop. The bug (busy loop) was caused by faulty event
source implementation when QEventLoop::ExcludeUserInputEvents is set.
As long as the window system's event queue was not empty, we signaled
to the event dispatcher that there is an event ready to be dispatched.
This results in the dispatcher calling the relevant dispatch function
(which does handle the ExcludeUserInputEvents flag correctly). As we
do not dispatch user events, the window system's event queue never
becomes empty and we enter a busy loop (CPU running at 100%) where we
signal that we have events to dispatch, but we actually do not dispatch
them and g_main_context_iteration never gets to block.

This busy loop can cause blocking GTK functions such as gtk_dialog_run()
never return.

Task-number: QTBUG-59760
Task-number: QTBUG-57101
Change-Id: I545b7951108eeaba019614ae8f5a1168c8b26c27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-04-24 18:11:13 +00:00
bin don't include injected headers into linker version script 2016-10-14 09:00:29 +00:00
config.tests Merge remote-tracking branch 'origin/5.8' into 5.9 2017-04-06 14:16:31 +02:00
dist Add changes file for 5.8.0 2017-01-02 06:50:47 +00:00
doc Split Q_COMPILER_UNICODE_STRINGS: add Q_STDLIB_UNICODE_STRINGS 2017-04-20 06:50:36 +00:00
examples Update rasterwindow example to not create() in the constructor 2017-04-21 15:12:55 +00:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
mkspecs Don't add Qt5::<ModuleName>Private in CMake < 3.0 2017-04-23 19:31:19 +00:00
qmake Fix precompiled headers on Apple platforms, with multiple architectures 2017-04-14 00:00:56 +00:00
src Prevent busy loop in glib event dispatcher 2017-04-24 18:11:13 +00:00
tests Rename macos blacklisting to osx 2017-04-24 07:24:08 +00:00
util Handle indirect sibling selector 2016-07-27 20:18:02 +00:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore Overhaul .gitignore 2017-02-16 15:11:05 +00:00
.qmake.conf Bump version 2017-01-03 13:25:46 +01:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
config_help.txt Merge remote-tracking branch 'origin/5.8' into 5.9 2017-02-24 20:01:42 +01:00
configure configure: balk at any of {{,X}QMAKESPEC,QMAKE{PATH,FEATURES}} being set 2017-04-21 09:22:27 +00:00
configure.bat configure: balk at any of {{,X}QMAKESPEC,QMAKE{PATH,FEATURES}} being set 2017-04-21 09:22:27 +00:00
configure.json Merge remote-tracking branch 'origin/5.8' into 5.9 2017-04-06 14:16:31 +02:00
configure.pri Make build ABI available as qmake variable 2017-03-28 06:51:42 +00:00
header.BSD Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.BSD-OLD Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.COMM Add header template for commercial only modules 2015-10-19 10:37:18 +00:00
header.FDL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.FDL-OLD Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.GPL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.GPL-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL3 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL3-COMM Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL21 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL-NOGPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL-ONLY Update copyright headers 2015-02-11 06:49:51 +00:00
INSTALL Doc: Update links in INSTALL file 2015-02-16 09:06:41 +00:00
LGPL_EXCEPTION.txt Update copyright headers 2015-02-11 06:49:51 +00:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPLv21 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.PREVIEW.COMMERCIAL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
qtbase.pro nuke configure -host-option 2016-12-13 18:55:59 +00:00
sync.profile Merge remote-tracking branch 'origin/5.8' into 5.9 2017-03-13 15:55:44 +01:00