vcl/inc/salwtype.hxx | 9 ++++++++- vcl/source/window/winproc.cxx | 3 +++ vcl/win/source/window/salframe.cxx | 29 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-)
New commits: commit 04f7270236ddac1d02187d5a8c24ed70000c73a5 Author: Juergen Funk <juergen.funk...@cib.de> Date: Mon Dec 14 22:42:25 2015 +0100 tdf#96119 Cannot select item with mouse in any combobox / drop down menu this commit has make the problem, the removing of the SALEVENT_MOUSEACTIVATE commit dd351dd728687cffe432ce0ec9367ceb80e097fb Author: Noel Grandin <n...@peralex.com> Date: Tue Nov 24 08:50:39 2015 +0200 loplugin:unusedfields in vcl/ and remove the unused SALEVENT_MOUSEACTIVATE stuff Without of there, when click in the opened list-box it send first the "PreNotify" with "MouseNotifyEvent::LOSEFOCUS" and that close the listbox. After that, it send the mouse-event to a closed window, that is the reason why the Listbox not get the mouse-click. With this patch, first send the mouse-click and then the "PreNotify" Change-Id: I5a09b1524335434f043d22bc71f7e38559fb1c0b Reviewed-on: https://gerrit.libreoffice.org/20708 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/20734 Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx index da5126c..222c8c8 100644 --- a/vcl/inc/salwtype.hxx +++ b/vcl/inc/salwtype.hxx @@ -53,7 +53,7 @@ enum class InputContextFlags; #define SALEVENT_FONTCHANGED ((sal_uInt16)18) #define SALEVENT_WHEELMOUSE ((sal_uInt16)21) #define SALEVENT_USEREVENT ((sal_uInt16)22) -// unused +#define SALEVENT_MOUSEACTIVATE ((sal_uInt16)23) #define SALEVENT_EXTTEXTINPUT ((sal_uInt16)24) #define SALEVENT_ENDEXTTEXTINPUT ((sal_uInt16)25) #define SALEVENT_EXTTEXTINPUTPOS ((sal_uInt16)26) @@ -161,6 +161,13 @@ struct SalWheelMouseEvent {} }; +// MOUSEACTIVATE +struct SalMouseActivateEvent +{ + long mnX; // X-Position (Pixel, TopLeft-Output) + long mnY; // Y-Position (Pixel, TopLeft-Output) +}; + // EXTTEXTINPUT struct SalExtTextInputEvent { diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 6e9f5bb..ef4cb76 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -2437,6 +2437,9 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalFrame* /*pFrame*/, bRet = ImplHandleSalMouseButtonUp( pWindow, &aSalMouseEvent ); } break; + case SALEVENT_MOUSEACTIVATE: + bRet = false; + break; case SALEVENT_KEYINPUT: { SalKeyEvent const * pKeyEvt = static_cast<SalKeyEvent const *>(pEvent); diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 763d443..4b873a9 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -3183,6 +3183,24 @@ static long ImplHandleMouseMsg( HWND hWnd, UINT nMsg, return nRet; } +static long ImplHandleMouseActivateMsg( HWND hWnd ) +{ + WinSalFrame* pFrame = GetWindowPtr( hWnd ); + if ( !pFrame ) + return 0; + + if ( pFrame->mbFloatWin ) + return TRUE; + + SalMouseActivateEvent aMouseActivateEvt; + POINT aPt; + GetCursorPos( &aPt ); + ScreenToClient( hWnd, &aPt ); + aMouseActivateEvt.mnX = aPt.x; + aMouseActivateEvt.mnY = aPt.y; + return pFrame->CallCallback( SALEVENT_MOUSEACTIVATE, &aMouseActivateEvt ); +} + static long ImplHandleWheelMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam ) { DBG_ASSERT( nMsg == WM_MOUSEWHEEL || @@ -5515,6 +5533,17 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP break; case WM_MOUSEACTIVATE: + if ( LOWORD( lParam ) == HTCLIENT ) + { + ImplSalYieldMutexAcquireWithWait(); + nRet = ImplHandleMouseActivateMsg( hWnd ); + ImplSalYieldMutexRelease(); + if ( nRet ) + { + nRet = MA_NOACTIVATE; + rDef = FALSE; + } + } break; case WM_KEYDOWN: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits