kiuliani / geoda

Automatically exported from code.google.com/p/geoda
GNU General Public License v3.0
0 stars 0 forks source link

OSX Popup menu focus problem #80

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In GeoDa 1.5.x (wxWidgets 3.0) on OSX 10.6 (but probably later as well), if two 
windows are open and the focus is in Window 1, if the user then right-clicks on 
Window 2, the correct popup command for Window 2 will appear, but the command 
will be ignored since Window 1 has the focus.

This is not an issue in Windows since right clicking immediately returns the 
focus to the window where the right click was done.

The workaround is to first click on Window 2, then right-click, but this is 
very counter-intuitive.  This was not a problem prior to wxWidgets 3.0/Cocao.

Original issue reported on code.google.com by mmcc...@gmail.com on 12 Feb 2014 at 11:01

GoogleCodeExporter commented 8 years ago
This is very specific to wxWidgets 3.0 and OSX.  Added the following workaround 
to all views that inherit from TemplateCanvas / TemplateFrame.  Works well on 
OSX, but more testing needed on other platforms. 

Fixed in GeoDa 1.5.26, SVN commit 3019

void ExampleCanvas::DisplayRightClickMenu(const wxPoint& pos)
{
    // Workaround for right-click not changing window focus in OSX / wxW 3.0
    wxActivateEvent ae(wxEVT_NULL, true, 0, wxActivateEvent::Reason_Mouse);
    ((ExampleFrame*) template_frame)->OnActivate(ae);
    // ...
}

Original comment by mmcc...@gmail.com on 12 Feb 2014 at 11:44