Module: wine
Branch: master
Commit: 0137b07973d86d288265a25a1f55956c6b0cbe3f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0137b07973d86d288265a25a1…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Sun Dec 29 21:33:36 2013 -0600
winemac: Allow programmatic changes of the window frame even if a window is disabled (prevented from resizing).
---
dlls/winemac.drv/cocoa_window.m | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index c8c1e90..f051934 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -1231,6 +1231,16 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
BOOL equalSizes = NSEqualSizes(frame.size, oldFrame.size);
BOOL needEnableScreenUpdates = FALSE;
+ if (disabled)
+ {
+ // Allow the following calls to -setFrame:display: to work even
+ // if they would violate the content size constraints. This
+ // shouldn't be necessary since the content size constraints are
+ // documented to not constrain that method, but it seems to be.
+ [self setContentMinSize:NSZeroSize];
+ [self setContentMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)];
+ }
+
if (equalSizes && [[self childWindows] count])
{
// If we change the window frame such that the origin moves
@@ -1249,6 +1259,11 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
}
[self setFrame:frame display:YES];
+ if (disabled)
+ {
+ [self setContentMinSize:contentRect.size];
+ [self setContentMaxSize:contentRect.size];
+ }
if (needEnableScreenUpdates)
NSEnableScreenUpdates();
Module: wine
Branch: master
Commit: 2c6ad1829d4fe77278dc6f8cc2f496a59fb62849
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2c6ad1829d4fe77278dc6f8cc…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Sun Dec 29 21:33:07 2013 -0600
winemac: Don't check the state of the SC_MINIMIZE item of the window menu when asked to minimize.
The window menu items are not updated as the window state changes; they only
update when the menu is shown. So the item state is not a reliable indicator
of whether minimization is allowed.
---
dlls/winemac.drv/window.c | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index a4e730d..91a1d4d 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -2037,7 +2037,6 @@ void macdrv_app_deactivated(void)
void macdrv_window_minimize_requested(HWND hwnd)
{
DWORD style;
- HMENU hSysMenu;
style = GetWindowLongW(hwnd, GWL_STYLE);
if (!(style & WS_MINIMIZEBOX) || (style & (WS_DISABLED | WS_MINIMIZE)))
@@ -2046,17 +2045,6 @@ void macdrv_window_minimize_requested(HWND hwnd)
return;
}
- hSysMenu = GetSystemMenu(hwnd, FALSE);
- if (hSysMenu)
- {
- UINT state = GetMenuState(hSysMenu, SC_MINIMIZE, MF_BYCOMMAND);
- if (state == 0xFFFFFFFF || (state & (MF_DISABLED | MF_GRAYED)))
- {
- TRACE("not minimizing win %p menu state 0x%08x\n", hwnd, state);
- return;
- }
- }
-
if (GetActiveWindow() != hwnd)
{
LRESULT ma = SendMessageW(hwnd, WM_MOUSEACTIVATE, (WPARAM)GetAncestor(hwnd, GA_ROOT),