I've been periodically revisiting a patch I've been using to fix a bug
with running Borderlands under Wine at the same resolution as the
desktop ( original message:
http://www.winehq.org/pipermail/wine-devel/2010-May/083339.html ).
Attached is an iteration that appears to resolve the issue without
impacting the other applications I normally run.  It appears that the
problem arises since Borderlands goes straight from being iconified to
being exactly the desktop resolution, as a result Wine never turns off
the "iconic" flag - so the application window is not sized or
positioned properly.  I would appreciate it if I could get some
feedback on this patch, it doesn't seem to break anything but it would
be nice to have an expert opinion.

Erich Hoover
ehoo...@mines.edu
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 8957a44..168180f 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -2381,13 +2381,14 @@ void CDECL X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags
         if (!data->mapped || (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)))
             set_wm_hints( display, data );
 
+        /* Note: It is important to properly track the iconic state whether the state is fresh or changing. */
+        data->iconic = (new_style & WS_MINIMIZE) != 0;
         if (!data->mapped)
         {
             map_window( display, data, new_style );
         }
         else if ((swp_flags & SWP_STATECHANGED) && (!data->iconic != !(new_style & WS_MINIMIZE)))
         {
-            data->iconic = (new_style & WS_MINIMIZE) != 0;
             TRACE( "changing win %p iconic state to %u\n", data->hwnd, data->iconic );
             wine_tsx11_lock();
             if (data->iconic)


Reply via email to