don't activate window drag in osd area
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Fri, 15 Apr 2022 08:03:18 +0000 (10:03 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Fri, 15 Apr 2022 08:03:18 +0000 (10:03 +0200)
application/window.c

index b3f24d7..f2c8091 100644 (file)
@@ -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;