[MPlayer-cvslog] r38164 - in trunk: Changelog gui/wm/ws.c

ib subversion at mplayerhq.hu
Fri Jan 31 14:27:09 EET 2020


Author: ib
Date: Fri Jan 31 14:27:09 2020
New Revision: 38164

Log:
Clear screen when switching to fullscreen mode using -vo x11.

The areas surrounding the XImage must be deleted if the window
is larger than the XImage.

Modified:
   trunk/Changelog
   trunk/gui/wm/ws.c

Modified: trunk/Changelog
==============================================================================
--- trunk/Changelog	Fri Jan 31 14:15:13 2020	(r38163)
+++ trunk/Changelog	Fri Jan 31 14:27:09 2020	(r38164)
@@ -6,6 +6,8 @@ MPlayer
 
     GUI:
     * Fix wrongly sized video window after leaving fullscreen mode
+    * Clear screen when switching to fullscreen mode using the x11
+      video output driver
 
   1.4: "SubCounter" April 18, 2019
 

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Fri Jan 31 14:15:13 2020	(r38163)
+++ trunk/gui/wm/ws.c	Fri Jan 31 14:27:09 2020	(r38164)
@@ -343,6 +343,25 @@ static int wsWindowListSearch(Window win
     return -1;
 }
 
+static void wsClearWindowParts(Display *display, wsWindow *win)
+{
+    int W_leftover, H_leftover;
+
+    if (win->Width <= win->xImage->width && win->Height <= win->xImage->height)
+        return;
+
+    W_leftover = (win->Width - win->xImage->width) / 2;
+    H_leftover = (win->Height - win->xImage->height) / 2;
+
+    XFillRectangle(display, win->WindowID, win->wGC, 0, 0, win->Width, H_leftover);
+    XFillRectangle(display, win->WindowID, win->wGC, 0, win->Height - H_leftover - 1, win->Width, H_leftover + 1);
+
+    if (win->Width > win->xImage->width) {
+        XFillRectangle(display, win->WindowID, win->wGC, 0, H_leftover, W_leftover, win->xImage->height);
+        XFillRectangle(display, win->WindowID, win->wGC, win->Width - W_leftover - 1, H_leftover, W_leftover + 1, win->xImage->height);
+    }
+}
+
 void wsEvent(XEvent *event)
 {
     unsigned long i = 0;
@@ -443,8 +462,10 @@ expose:
 
         wsWindowList[l]->State = wsWindowExpose;
 
-        if ((wsWindowList[l]->DrawHandler) && (!event->xexpose.count))
+        if ((wsWindowList[l]->DrawHandler) && (!event->xexpose.count)) {
+            wsClearWindowParts(wsDisplay, wsWindowList[l]);
             wsWindowList[l]->DrawHandler();
+        }
 
         break;
 


More information about the MPlayer-cvslog mailing list