I've been playing the game Borderlands at less than my desktop resolution
due to a strange bug and finally decided to try and track it down. The
issue is that whenever the resolution of Borderlands is set to the same
resolution as the desktop then the game window does not appear in the upper
left hand corner and the size of the window is about 1/2 of the display size
for both the width and the height. After some exploration, this appears to
be two separate issues with the Wine's X11 driver.
1) sync_window_position() will not move an iconified managed window, so the
window is never repositioned to the upper left corner.
2) set_size_hints() checks to see if a window is the size of the display (or
larger) and does not resize the window if that is the case.
Another interesting point is that these issues only occur when using compiz,
when using metacity the following warnings are displayed:
---
Window manager warning: Window 0x4200005 (Borderland) sets an MWM hint
indicating it isn't resizable, but sets min size 1 x 1 and max size
2147483647 x 2147483647; this doesn't make much sense.
Window manager warning: Treating resize request of legacy application
0x4200005 (Borderland) as a fullscreen request
---
I've attached a patch that overcomes these issues, but I'm suspicious that
there are unintended consequences. I would appreciate it if someone could
take a look.
Erich Hoover
[email protected]
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 8cd3bf3..96f758e 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1003,6 +1003,18 @@ static void set_size_hints( Display *display, struct x11drv_win_data *data, DWOR
size_hints->min_height = size_hints->max_height;
size_hints->flags |= PMinSize | PMaxSize;
}
+
+ if (data->whole_rect.left == 0 && data->whole_rect.right == screen_width &&
+ data->whole_rect.top == 0 && data->whole_rect.bottom == screen_height)
+ {
+ size_hints->x = 0;
+ size_hints->y = 0;
+ size_hints->max_width = screen_width;
+ size_hints->max_height = screen_height;
+ size_hints->min_width = size_hints->max_width;
+ size_hints->min_height = size_hints->max_height;
+ size_hints->flags |= PPosition | PMinSize | PMaxSize;
+ }
}
XSetWMNormalHints( display, data->whole_window, size_hints );
XFree( size_hints );
@@ -1442,8 +1454,6 @@ static void sync_window_position( Display *display, struct x11drv_win_data *data
XWindowChanges changes;
unsigned int mask = 0;
- if (data->managed && data->iconic) return;
-
/* resizing a managed maximized window is not allowed */
if (!(style & WS_MAXIMIZE) || !data->managed)
{