[MPlayer-cvslog] r35754 - in trunk/gui/wm: ws.c ws.h

ib subversion at mplayerhq.hu
Tue Jan 15 19:51:31 CET 2013


Author: ib
Date: Tue Jan 15 19:51:30 2013
New Revision: 35754

Log:
Remove member SizeHint from wsWindow structure.

There is no need to store this for a window.
Use a local variable instead.

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

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Tue Jan 15 19:27:22 2013	(r35753)
+++ trunk/gui/wm/ws.c	Tue Jan 15 19:51:30 2013	(r35754)
@@ -443,50 +443,52 @@ static void wsWindowPosition(wsWindow *w
  */
 static void wsSizeHint(wsWindow *win)
 {
-    win->SizeHint.flags = 0;
+    XSizeHints size;
+
+    size.flags = 0;
 
     /* obsolete, solely for compatibility reasons */
-    win->SizeHint.flags |= PPosition;
-    win->SizeHint.x      = win->X;
-    win->SizeHint.y      = win->Y;
+    size.flags |= PPosition;
+    size.x      = win->X;
+    size.y      = win->Y;
 
     /* obsolete, solely for compatibility reasons */
-    win->SizeHint.flags |= PSize;
-    win->SizeHint.width  = win->Width;
-    win->SizeHint.height = win->Height;
+    size.flags |= PSize;
+    size.width  = win->Width;
+    size.height = win->Height;
 
     /* a minimum of 4 is said to avoid off-by-one errors and be required by mga_vid */
-    win->SizeHint.flags     |= PMinSize;
-    win->SizeHint.min_width  = 4;
-    win->SizeHint.min_height = 4;
+    size.flags     |= PMinSize;
+    size.min_width  = 4;
+    size.min_height = 4;
 
     if (win->Property & wsMinSize) {
-        win->SizeHint.min_width  = win->Width;
-        win->SizeHint.min_height = win->Height;
+        size.min_width  = win->Width;
+        size.min_height = win->Height;
     }
 
     if (win->Property & wsMaxSize) {
-        win->SizeHint.flags     |= PMaxSize;
-        win->SizeHint.max_width  = win->Width;
-        win->SizeHint.max_height = win->Height;
+        size.flags     |= PMaxSize;
+        size.max_width  = win->Width;
+        size.max_height = win->Height;
     }
 
     if (vo_keepaspect && (win->Property & wsAspect)) {
-        win->SizeHint.flags |= PAspect;
-        win->SizeHint.min_aspect.x = win->Width;
-        win->SizeHint.min_aspect.y = win->Height;
-        win->SizeHint.max_aspect.x = win->Width;
-        win->SizeHint.max_aspect.y = win->Height;
+        size.flags |= PAspect;
+        size.min_aspect.x = win->Width;
+        size.min_aspect.y = win->Height;
+        size.max_aspect.x = win->Width;
+        size.max_aspect.y = win->Height;
     }
 
-    win->SizeHint.flags      |= PBaseSize;
-    win->SizeHint.base_width  = 0;
-    win->SizeHint.base_height = 0;
+    size.flags      |= PBaseSize;
+    size.base_width  = 0;
+    size.base_height = 0;
 
-    win->SizeHint.flags      |= PWinGravity;
-    win->SizeHint.win_gravity = StaticGravity;
+    size.flags      |= PWinGravity;
+    size.win_gravity = StaticGravity;
 
-    XSetWMNormalHints(wsDisplay, win->WindowID, &win->SizeHint);
+    XSetWMNormalHints(wsDisplay, win->WindowID, &size);
 }
 
 /**

Modified: trunk/gui/wm/ws.h
==============================================================================
--- trunk/gui/wm/ws.h	Tue Jan 15 19:27:22 2013	(r35753)
+++ trunk/gui/wm/ws.h	Tue Jan 15 19:51:30 2013	(r35754)
@@ -173,7 +173,6 @@ typedef struct {
     unsigned long WindowMask;
     XVisualInfo VisualInfo;
     XSetWindowAttributes WindowAttrib;
-    XSizeHints SizeHint;
     XWMHints WMHints;
 
     XFontStruct *Font;


More information about the MPlayer-cvslog mailing list