From 97144dd51c8cf19a26c4cadde15fe84606ed0674 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 17 May 2011 23:53:39 +0000 Subject: [PATCH] 2011-05-18 01:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/gtwvt/gtwvt.c ! fixed regression referred to in 2011-05-18 01:06 UTC+0200 Viktor Szakats I'm still not exactly sure what's happening (besides I'm tired as hell), but now it seems that it's not VK_RETURN override at fault, but composited mode on Vista/7 which I enabled recently. Actually copy worked only the selection was not visible. Now I turn off composited on mark and select and renable when finished. I imagine this is not proper solution though I don't have Bill Gates's number to make a support call ATM. + reenabled VK_RETURN * ChangeLog * edited prev entry --- harbour/ChangeLog | 22 +++++++++++++++++----- harbour/src/rtl/gtwvt/gtwvt.c | 25 +++++++++++++++++++------ 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 46506fc4dc..c307b9ceaa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,15 +16,27 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-18 01:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/gtwvt/gtwvt.c + ! fixed regression referred to in 2011-05-18 01:06 UTC+0200 Viktor Szakats + I'm still not exactly sure what's happening (besides I'm tired as hell), + but now it seems that it's not VK_RETURN override at fault, but composited mode + on Vista/7 which I enabled recently. Actually copy worked only + the selection was not visible. + Now I turn off composited on mark and select and renable when finished. + I imagine this is not proper solution though I don't have Bill Gates's number + to make a support call ATM. + + reenabled VK_RETURN + + * ChangeLog + * edited prev entry + 2011-05-18 01:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/gtwvt/gtwvt.c ! fixed regression in: - 2011-02-26 20:07 UTC+0100 Viktor Szakats / patch by Aleksander Czajczynski + 2011-02-26 20:07 UTC+0100 Viktor Szakats VK_RETURN event override caused 'Mark and Copy' menu functionality - to break, it's no longer possible to select an area. Aleksander, - I'd appreciate if you could check and fix this. - For now I commented the VK_RETURN override (it may break some - fullscreen features) + to break, it's no longer possible to select an area. 2011-05-17 22:27 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/xhb/xhb.hbc diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index a2c8d3a70d..4438e621c8 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -998,6 +998,19 @@ static void hb_gt_wvt_SetMousePos( PHB_GTWVT pWVT, int iRow, int iCol ) pWVT->MousePos.x = iCol; } +static void hb_gt_wvt_Composited( PHB_GTWVT pWVT, HB_BOOL fEnable ) +{ +#if ! defined( HB_OS_WIN_CE ) + if( hb_iswinvista() && ! GetSystemMetrics( SM_REMOTESESSION ) ) + { + if( fEnable ) + SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ) | WS_EX_COMPOSITED ); + else + SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ) & ~WS_EX_COMPOSITED ); + } +#endif +} + static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, LPARAM lParam ) { POINT xy, colrow; @@ -1040,6 +1053,8 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L pWVT->sRectOld.right = 0; pWVT->sRectOld.bottom = 0; + hb_gt_wvt_Composited( pWVT, HB_FALSE ); + return; } else @@ -1119,6 +1134,9 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L else hb_xfree( sBuffer ); } + + hb_gt_wvt_Composited( pWVT, HB_TRUE ); + return; } else @@ -1220,7 +1238,6 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, switch( wParam ) { -#if 0 /* TOFIX: it breaks Mark and Copy functionality. */ case VK_RETURN: /* in WM_CHAR i was unable to read Alt key state */ if( bAlt && pWVT->bAltEnter ) @@ -1229,7 +1246,6 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, pWVT->IgnoreWM_SYSCHAR = HB_TRUE; } break; -#endif case VK_LEFT: hb_gt_wvt_TranslateKey( pWVT, K_LEFT , K_SH_LEFT , K_ALT_LEFT , K_CTRL_LEFT ); break; @@ -1887,10 +1903,7 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) if( ! pWVT->hWnd ) hb_errInternal( 10001, "Failed to create WVT window", NULL, NULL ); -#if ! defined( HB_OS_WIN_CE ) - if( hb_iswinvista() && ! GetSystemMetrics( SM_REMOTESESSION ) ) - SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ) | WS_EX_COMPOSITED ); -#endif + hb_gt_wvt_Composited( pWVT, HB_TRUE ); /* Set icon */ if( pWVT->hIcon )