]> git.sesse.net Git - vlc/commitdiff
Fix crash when vout window is resized to 0 width
authorClément Stenac <zorglub@videolan.org>
Mon, 19 Apr 2004 15:49:25 +0000 (15:49 +0000)
committerClément Stenac <zorglub@videolan.org>
Mon, 19 Apr 2004 15:49:25 +0000 (15:49 +0000)
modules/video_output/x11/xcommon.c

index a110a0fecff165756a0f5880fa78089d3fde91ca..3529e76754932abc74f8ce027cd223e88aaf47d2 100644 (file)
@@ -901,6 +901,10 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
     p_win->wm_delete_window =
              XInternAtom( p_vout->p_sys->p_display, "WM_DELETE_WINDOW", True );
 
+    /* Never have a 0-pixel-wide window */
+    xsize_hints.min_width = 2;
+    xsize_hints.min_height = 1;
+
     /* Prepare window attributes */
     xwindow_attributes.backing_store = Always;       /* save the hidden part */
     xwindow_attributes.background_pixel = BlackPixel(p_vout->p_sys->p_display,
@@ -915,7 +919,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
 
         xsize_hints.base_width  = xsize_hints.width = p_win->i_width;
         xsize_hints.base_height = xsize_hints.height = p_win->i_height;
-        xsize_hints.flags       = PSize;
+        xsize_hints.flags       = PSize | PMinSize;
 
         if( p_win->i_x >=0 || p_win->i_y >= 0 )
         {