[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/07: grc: Move the XInitThreads to "As Ea
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/07: grc: Move the XInitThreads to "As Early As Possible" |
Date: |
Tue, 13 Jan 2015 21:52:40 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit b5299f0117671ea145203a49a5afcbdd3926897c
Author: Sylvain Munaut <address@hidden>
Date: Sun Jan 4 19:47:23 2015 +0100
grc: Move the XInitThreads to "As Early As Possible"
Seems some newer Qt do Xlib call right when doing the imports
which then means that doing it in the main() is too late.
Signed-off-by: Sylvain Munaut <address@hidden>
---
grc/python/flow_graph.tmpl | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index d66c258..26b1035 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -30,6 +30,19 @@ $DIVIDER
# Generated: $time.ctime()
$DIVIDER
+# Call XInitThreads as the _very_ first thing.
+# After some Qt import, it's too late
+#if $generate_options in ('wx_gui', 'qt_gui')
+import ctypes
+import sys
+if sys.platform.startswith('linux'):
+ try:
+ x11 = ctypes.cdll.LoadLibrary('libX11.so')
+ x11.XInitThreads()
+ except:
+ print "Warning: failed to XInitThreads()"
+#end if
+
########################################################
##Create Imports
########################################################
@@ -267,16 +280,6 @@ $short_id#slurp
#end def
#if $generate_options != 'hb'
if __name__ == '__main__':
- #if $generate_options in ('wx_gui', 'qt_gui')
- import ctypes
- import sys
- if sys.platform.startswith('linux'):
- try:
- x11 = ctypes.cdll.LoadLibrary('libX11.so')
- x11.XInitThreads()
- except:
- print "Warning: failed to XInitThreads()"
- #end if
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
#set $params_eq_list = list()
#for $param in $parameters
- [Commit-gnuradio] [gnuradio] branch master updated (885fd55 -> dfacb55), git, 2015/01/13
- [Commit-gnuradio] [gnuradio] 02/07: grc: Move the XInitThreads to "As Early As Possible",
git <=
- [Commit-gnuradio] [gnuradio] 04/07: modtool/rename: squashed commits for pull request. Added rename capability to gr_modtool, git, 2015/01/13
- [Commit-gnuradio] [gnuradio] 05/07: Merge remote-tracking branch 'donludovico/GRC_Dir_Orphans', git, 2015/01/13
- [Commit-gnuradio] [gnuradio] 01/07: grc,blocks,fft,filter: assigned categories to all blocks without any; further checked all other gr-* of gnuradio; solves issue from see http://lists.gnu.org/archive/html/discuss-gnuradio/2014-12/msg00133.html, git, 2015/01/13
- [Commit-gnuradio] [gnuradio] 03/07: spacing issues prettified, git, 2015/01/13
- [Commit-gnuradio] [gnuradio] 07/07: Merge remote-tracking branch 'jdemel/modtool/rename', git, 2015/01/13
- [Commit-gnuradio] [gnuradio] 06/07: Merge remote-tracking branch 'smunaut/grc-xinitthreads-fix', git, 2015/01/13