From 4903e7c9c7158dd6aa559c58c4cf77ee61c1f087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Mon, 17 Oct 2022 19:41:55 +0200 Subject: [PATCH] 2022-10-17 19:41 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * include/hbvm.h * include/harbour.hbx * src/harbour.def * src/vm/hvm.c + added new C function: extern HB_EXPORT HB_BOOL hb_vmSetKeyPool( HB_BOOL fEnable ); It allows to disable keyboard pooling by GT driver in main HVM loop. It's important in programs which mix GT terminal with GUI library which use common event loop. Many GUI objects are not reentrant safe and activating event loop during big changes may cause crash. Such things can happen in applications which try to mix HBQT and GTQTC. To avoid such problems before PRG code is called it's enough to disable keyboard pooling in main HVM loop, eg. if( hb_vmRequestReenter() ) { HB_BOOL fKeyPool = hb_vmSetKeyPool( HB_FALSE ); hb_vmPushEvalSym(); hb_vmPush( pBlockItm ); hb_vmSend( 0 ); hb_vmSetKeyPool( fKeyPool ); hb_vmRequestRestore(); } + added new PRG function: __vmKeyPool( [] ) -> It's PRG interface to above C function. If application uses GT driver and GUI library using the same event loop and such GUI library does not disable keyboard pooling in main HVM loop before PRG code is activated then it's enough to call this function at the beginning of application, eg. PROCEDURE INIT Clip() __vmKeyPool( .f. ) RETURN With above peace of code you can mix HBQT or other QT wrapper with GTQTC. --- ChangeLog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index a5ea948ee5..988f1125be 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -414,7 +414,7 @@ 2016-07-04 19:01 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) https://github.com/harbour/core/commit/8465bce36bbfab6026673f1c597a91028f96079a -2022-10-17 19:17 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) +2022-10-17 19:41 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * include/hbvm.h * include/harbour.hbx * src/harbour.def