--- kicad/common/drawpanel.cpp 2010-08-13 15:15:02.000000000 +0200 +++ kicad_new/common/drawpanel.cpp 2010-08-13 15:04:14.000000000 +0200 @@ -27,7 +27,11 @@ #define DEBUG_SHOW_CLIP_RECT 0 // Set to 1 to draw clipping rectangle. #define DEBUG_DUMP_CLIP_COORDS 0 // Set to 1 to dump clipping rectangle coordinates. #define DEBUG_DUMP_SCROLL_SETTINGS 0 // Set to 1 to dump scroll settings. +#define DEBUG_BLOCKS 0 // Set to 1 to dump block information +/* Definitions for workarounds in drawpanel.cpp */ +#define FLUXBOX_WORKAROUND 1 // Set to 1 to enable group/block actions on fluxbox, windowmaker, fvwm and probably others + // with this, we ignore mouse entering events if the left button is pressed /* Used to inhibit a response to a mouse left button release, after a * double click (when releasing the left button at the end of the second @@ -1042,8 +1046,21 @@ void WinEDA_DrawPanel::OnMouseEvent( wxM * MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND in order to avoid spurious block * commands. */ static int MinDragEventCount; +#if DEBUG_BLOCKS + std::cout << "Left button pressed: " << event.LeftDown() << " Middle button pressed: " << event.MiddleDown() << std::endl + << "Left button down: " << event.LeftIsDown() << "Middle Button down: " << event.MiddleIsDown() << std::endl + << "event.Leaving: " << event.Leaving() << " event.Entering:" << event.Entering() << " Can start block: " << m_CanStartBlock << std::endl << std::endl; +#endif if( event.Leaving() || event.Entering() ) { +#if FLUXBOX_WORKAROUND + // when using fluxbox (and probably windowmaker, fwvm) we get two events on a mouse left click. Ignore the entering event in this case. + // (there won't be an event on entering until we release the left mouse button anyway) + if(event.LeftIsDown()) + { + return; + } +#endif m_CanStartBlock = -1; }