This patch resolves the issue I was encountering.

Thanks for digging in on this, Philipp.

On Thu, Oct 24, 2013 at 1:24 PM, Philipp Kutin <> wrote:
Hi list,

The said bug (losing window frame focus on MS Windows) was introduced in r1525.

A look at the diff and consulting of the relevant MSDN page [1] show
why: the LSBit of GetAsyncKeyState() indicates whether "the key was
pressed after the previous call to GetAsyncKeyState". Moreover, it
recommends to "not rely on this (...) behavior", so it's best mask it
out unconditionally.

The attached patch fixes the window frame issue, but fg_main_mswin.c
contains a couple of other instances where that function's return
value is checked as-is -- apparently in the Shift/Alt/Menu handling
code. Personally, I'd AND with ~1 there, too, but it might be sensible
to produce a bug first.



On Wed, Sep 18, 2013 at 8:26 PM, Nigel Stewart <> wrote:
> It might be helpful to try a few of the more recent releases to narrow
> down if this
> is some kind of regression.
> - Nigel
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> _______________________________________________
> Freeglut-developer mailing list

October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
Freeglut-developer mailing list

Paul Martz
Skew Matrix Software LLC