]> git.tdb.fi Git - libs/gltk.git/commitdiff
Adjust a pointer check in Container
authorMikko Rasa <tdb@tdb.fi>
Mon, 23 Sep 2019 18:26:00 +0000 (21:26 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 23 Sep 2019 18:26:00 +0000 (21:26 +0300)
This is semantically equivalent but more intuitive and more tolerant to
mistakes.

source/container.cpp

index 53eeaa7e440b7f6489bf507d59cbb08681bb218b..e99d9939aefdf0b951feba1572804d95e38bd5cf 100644 (file)
@@ -224,7 +224,7 @@ void Container::pointer_motion(int x, int y)
 {
        Widget *child = get_pointer_target(x, y, false);
        if(!pointer_grabbed)
-               set_pointer_focus((!click_focus || child->get_geometry().is_inside(x, y)) ? child : 0);
+               set_pointer_focus((child && child->get_geometry().is_inside(x, y)) ? child : 0);
 
        if(child)
        {