From: Olaf Wintermann Date: Fri, 15 Apr 2022 08:03:18 +0000 (+0200) Subject: don't activate window drag in osd area X-Git-Url: https://develop.uap-core.de/gitweb/uwplayer.git/commitdiff_plain/18d1fe7ac177615f5f8c0b2b736e535c516e2aa1 don't activate window drag in osd area --- diff --git a/application/window.c b/application/window.c index b3f24d7..f2c8091 100644 --- a/application/window.c +++ b/application/window.c @@ -172,6 +172,7 @@ static void playerEH(Widget widget, XtPointer data, XEvent *event, Boolean *disp #define IGNORE_MOTION_THRESHOLD_MS 1000 #define MOTION_POS_THRESHOLD_PIX 5 +#define OSD_BOTTOM_THRESHOLD 0.09 #define DOUBLE_CLICK_TIME_MS 500 @@ -227,14 +228,20 @@ void WindowHandlePlayerEvent(MainWindow *win, XEvent *event) { } } else if(etype == ButtonPress) { Time t = event->xbutton.time; - if(t - win->button_press_time < DOUBLE_CLICK_TIME_MS) { - // double click - WindowFullscreen(main_window, !win->fullscreen); + + int yi = win->player_widget->core.height - event->xbutton.y; + if((float)yi/(float)win->player_widget->core.height < OSD_BOTTOM_THRESHOLD) { win->button_press_time = 0; } else { - win->button_press_time = t; + if(t - win->button_press_time < DOUBLE_CLICK_TIME_MS) { + // double click + WindowFullscreen(main_window, !win->fullscreen); + win->button_press_time = 0; + } else { + win->button_press_time = t; + } + win->pwbuttonpressed = 1; } - win->pwbuttonpressed = 1; } else if(etype == ButtonRelease) { win->player_event_time = event->xbutton.time; win->pwbuttonpressed = FALSE;