From 0e00daab15d8b871ec7f76c2713b75d5f3fb237d Mon Sep 17 00:00:00 2001 From: Good Guy Date: Fri, 2 Mar 2018 10:28:41 -0700 Subject: [PATCH] fix get_cursor_over_window for kde --- cinelerra-5.1/guicast/bcwindowbase.C | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 4b9f17d0..3823853a 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -3850,16 +3850,15 @@ int BC_WindowBase::get_cursor_over_window() if( ret && win != child_return ) ret = top_level->match_window(child_return); // query pointer can return a window manager window with this top_level as a child - if( !ret ) { - unsigned int nchildren_return = 0; - Window parent_return, *children_return = 0; - XQueryTree(top_level->display, child_return, &root_return, - &parent_return, &children_return, &nchildren_return); - if( children_return ) { - if( nchildren_return==1 && children_return[0]==top_level->win ) - ret = 1; - XFree(children_return); - } +// for kde this can be two levels deep + unsigned int nchildren_return = 0; + Window parent_return, *children_return = 0; + Window top_win = top_level->win; + while( !ret && top_win != top_level->rootwin && top_win != root_return && + XQueryTree(top_level->display, top_win, &root_return, + &parent_return, &children_return, &nchildren_return) ) { + if( children_return ) XFree(children_return); + if( (top_win=parent_return) == child_return ) ret = 1; } return ret; } -- 2.26.2