From 8876751e9356f0852eb3bd397c22dee3f1b6611b Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Sun, 29 Dec 2013 21:33:30 -0600 Subject: [PATCH] winemac: Prevent disabled windows from being moved. This won't be enforced if AllowImmovableWindows=n is set in the registry. --- dlls/winemac.drv/cocoa_window.m | 3 +++ dlls/winemac.drv/macdrv_cocoa.h | 1 + dlls/winemac.drv/macdrv_main.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index bb2da55236d..c8c1e905ca4 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -642,6 +642,9 @@ - (void) adjustFeaturesForState [self setContentMaxSize:savedContentMaxSize]; [self setContentMinSize:savedContentMinSize]; } + + if (allow_immovable_windows) + [self setMovable:!disabled]; } - (void) adjustFullScreenBehavior:(NSWindowCollectionBehavior)behavior diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index 5073db81412..743757e686c 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -146,6 +146,7 @@ extern int capture_displays_for_fullscreen DECLSPEC_HIDDEN; extern int left_option_is_alt DECLSPEC_HIDDEN; extern int right_option_is_alt DECLSPEC_HIDDEN; +extern int allow_immovable_windows DECLSPEC_HIDDEN; extern int macdrv_start_cocoa_app(unsigned long long tickcount) DECLSPEC_HIDDEN; extern void macdrv_window_rejected_focus(const struct macdrv_event *event) DECLSPEC_HIDDEN; diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index 2c3ec23a680..1aab785b1fa 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -54,6 +54,7 @@ int left_option_is_alt = 0; int right_option_is_alt = 0; BOOL allow_software_rendering = FALSE; BOOL disable_window_decorations = FALSE; +int allow_immovable_windows = TRUE; HMODULE macdrv_module = 0; @@ -171,6 +172,9 @@ static void setup_options(void) if (!get_config_key(hkey, appkey, "Decorated", buffer, sizeof(buffer))) disable_window_decorations = !IS_OPTION_TRUE(buffer[0]); + if (!get_config_key(hkey, appkey, "AllowImmovableWindows", buffer, sizeof(buffer))) + allow_immovable_windows = IS_OPTION_TRUE(buffer[0]); + if (appkey) RegCloseKey(appkey); if (hkey) RegCloseKey(hkey); }