[MPlayer-cvslog] r35791 - in trunk/gui: interface.c ui/actions.c wm/ws.c wm/ws.h

ib subversion at mplayerhq.hu
Sat Jan 19 13:45:14 CET 2013


Author: ib
Date: Sat Jan 19 13:45:14 2013
New Revision: 35791

Log:
Remove redundant parameter from function.

This information is part of the wsWindow structure.

Modified:
   trunk/gui/interface.c
   trunk/gui/ui/actions.c
   trunk/gui/wm/ws.c
   trunk/gui/wm/ws.h

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Sat Jan 19 13:16:50 2013	(r35790)
+++ trunk/gui/interface.c	Sat Jan 19 13:45:14 2013	(r35791)
@@ -184,7 +184,7 @@ void guiInit(void)
 
 // i=wsHideFrame|wsMaxSize|wsHideWindow;
 // if ( guiApp.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
-    i = wsShowFrame | wsMinSize | wsMaxSize | wsHideWindow;
+    i = (guiApp.mainDecoration ? wsShowFrame : 0) | wsMinSize | wsMaxSize | wsHideWindow;
     wsWindowCreate(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, i, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, "MPlayer");
     wsWindowShape(&guiApp.mainWindow, guiApp.main.Mask.Image);
     wsXDNDMakeAwareness(&guiApp.mainWindow);
@@ -215,9 +215,6 @@ void guiInit(void)
     wsWindowIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon);
     wsWindowIcon(wsDisplay, guiApp.videoWindow.WindowID, &guiIcon);
 
-    if (!guiApp.mainDecoration)
-        wsWindowDecoration(&guiApp.mainWindow, False);
-
     wsWindowVisibility(&guiApp.mainWindow, wsShowWindow);
 
     if (gtkShowVideoWindow) {

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Sat Jan 19 13:16:50 2013	(r35790)
+++ trunk/gui/ui/actions.c	Sat Jan 19 13:45:14 2013	(r35791)
@@ -232,7 +232,7 @@ void uiChangeSkin(char *name)
 
     wsWindowDestroy(&guiApp.mainWindow);
 
-    wsWindowCreate(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, wsShowFrame | wsMinSize | wsMaxSize | wsHideWindow, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, "MPlayer");
+    wsWindowCreate(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, (guiApp.mainDecoration ? wsShowFrame : 0) | wsMinSize | wsMaxSize | wsHideWindow, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, "MPlayer");
     wsImageCreate(&guiApp.mainWindow, guiApp.main.Bitmap.Width, guiApp.main.Bitmap.Height);
     wsWindowShape(&guiApp.mainWindow, guiApp.main.Mask.Image);
     wsWindowIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon);
@@ -244,9 +244,6 @@ void uiChangeSkin(char *name)
 
     wsXDNDMakeAwareness(&guiApp.mainWindow);
 
-    if (!guiApp.mainDecoration)
-        wsWindowDecoration(&guiApp.mainWindow, False);
-
     wsWindowVisibility(&guiApp.mainWindow, wsShowWindow);
     mainVisible = True;
 

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Sat Jan 19 13:16:50 2013	(r35790)
+++ trunk/gui/wm/ws.c	Sat Jan 19 13:45:14 2013	(r35791)
@@ -828,8 +828,7 @@ void wsWindowCreate(wsWindow *win, int x
 
     win->Property = p;
 
-    if (p & wsShowFrame)
-        win->Decoration = True;
+    win->Decoration = ((p & wsShowFrame) != 0);
 
     wsWindowUpdatePosition(win, x, y, w, h);
 
@@ -916,7 +915,7 @@ void wsWindowCreate(wsWindow *win, int x
     win->WMHints.initial_state = NormalState;
     XSetWMHints(wsDisplay, win->WindowID, &win->WMHints);
 
-    wsWindowDecoration(win, win->Decoration);
+    wsWindowDecoration(win);
     XStoreName(wsDisplay, win->WindowID, label);
     XmbSetWMProperties(wsDisplay, win->WindowID, label, label, NULL, 0, NULL, NULL, NULL);
 
@@ -1002,7 +1001,7 @@ void wsWindowDestroy(wsWindow *win)
 #endif
 }
 
-void wsWindowDecoration(wsWindow *win, Bool decor)
+void wsWindowDecoration(wsWindow *win)
 {
     Atom wsMotifHints;
     struct {
@@ -1021,7 +1020,7 @@ void wsWindowDecoration(wsWindow *win, B
     memset(&wsMotifWmHints, 0, sizeof(wsMotifWmHints));
     wsMotifWmHints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
 
-    if (decor) {
+    if (win->Decoration) {
         wsMotifWmHints.functions = MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE;
 
         if (!(win->Property & wsMinSize) || !(win->Property & wsMaxSize))
@@ -1254,8 +1253,10 @@ void wsWindowFullscreen(wsWindow *win)
 
     /* restore window if window manager doesn't support EWMH */
     if (!(vo_fs_type & vo_wm_FULLSCREEN)) {
+        if (!win->isFullScreen)
+            wsWindowDecoration(win);
+
         wsSizeHint(win);
-        wsWindowDecoration(win, win->Decoration && !win->isFullScreen);
         wsWindowLayer(wsDisplay, win->WindowID, win->isFullScreen);
         XMoveResizeWindow(wsDisplay, win->WindowID, win->X, win->Y, win->Width, win->Height);
     }

Modified: trunk/gui/wm/ws.h
==============================================================================
--- trunk/gui/wm/ws.h	Sat Jan 19 13:16:50 2013	(r35790)
+++ trunk/gui/wm/ws.h	Sat Jan 19 13:45:14 2013	(r35791)
@@ -182,7 +182,7 @@ void wsWindowRaiseTop(Display *display, 
 void wsWindowBackground(wsWindow *win, int r, int g, int b);
 void wsWindowClear(wsWindow *win);
 void wsWindowVisibility(wsWindow *win, int vis);
-void wsWindowDecoration(wsWindow *win, Bool decor);
+void wsWindowDecoration(wsWindow *win);
 void wsWindowLayer(Display *display, Window Win, Bool fullscreen);
 void wsWindowFullscreen(wsWindow *win);
 void wsWindowRedraw(wsWindow *win);


More information about the MPlayer-cvslog mailing list