summaryrefslogtreecommitdiff
path: root/vcl/unx/source
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2010-11-01 16:48:32 +0100
committerThorsten Behrens <tbehrens@novell.com>2010-11-01 16:50:25 +0100
commite5eab37d6fa6d49790d44e15b5908f0a735a629a (patch)
tree81a5735168bdb04dde1fd6187a14da72b25d3018 /vcl/unx/source
parent748df2ab7b9643df12bb656e01e4109b4dab6e14 (diff)
Make envvar SAL_NO_MOUSEGRABS avoid mouse grabs on X11
When debugging UI code, mouse grabs can really get in the way - so just set SAL_NO_MOUSEGRABS=1 and LibO will stop blocking your X11 session, when a gdb breakpoint hits.
Diffstat (limited to 'vcl/unx/source')
-rw-r--r--vcl/unx/source/app/saldisp.cxx36
1 files changed, 21 insertions, 15 deletions
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index 8a209d126a75..0fbfae40aeec 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -2218,10 +2218,13 @@ XLIB_Cursor SalDisplay::GetPointer( int ePointerStyle )
int SalDisplay::CaptureMouse( SalFrame *pCapture )
{
+ static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" );
+
if( !pCapture )
{
m_pCapture = NULL;
- XUngrabPointer( GetDisplay(), CurrentTime );
+ if( !pEnv || !*pEnv )
+ XUngrabPointer( GetDisplay(), CurrentTime );
XFlush( GetDisplay() );
return 0;
}
@@ -2230,20 +2233,23 @@ int SalDisplay::CaptureMouse( SalFrame *pCapture )
// FIXME: get rid of X11SalFrame
const SystemEnvData* pEnvData = pCapture->GetSystemData();
- int ret = XGrabPointer( GetDisplay(),
- (XLIB_Window)pEnvData->aWindow,
- False,
- PointerMotionMask| ButtonPressMask|ButtonReleaseMask,
- GrabModeAsync,
- GrabModeAsync,
- None,
- static_cast<X11SalFrame*>(pCapture)->GetCursor(),
- CurrentTime );
-
- if( ret != GrabSuccess )
- {
- DBG_ASSERT( 1, "SalDisplay::CaptureMouse could not grab pointer\n");
- return -1;
+ if( !pEnv || !*pEnv )
+ {
+ int ret = XGrabPointer( GetDisplay(),
+ (XLIB_Window)pEnvData->aWindow,
+ False,
+ PointerMotionMask| ButtonPressMask|ButtonReleaseMask,
+ GrabModeAsync,
+ GrabModeAsync,
+ None,
+ static_cast<X11SalFrame*>(pCapture)->GetCursor(),
+ CurrentTime );
+
+ if( ret != GrabSuccess )
+ {
+ DBG_ASSERT( 1, "SalDisplay::CaptureMouse could not grab pointer\n");
+ return -1;
+ }
}
m_pCapture = pCapture;