Ken Thomases : winemac: Prevent disabled windows from being moved.
Alexandre Julliard
julliard at winehq.org
Mon Dec 30 13:06:00 CST 2013
Module: wine
Branch: master
Commit: 8876751e9356f0852eb3bd397c22dee3f1b6611b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8876751e9356f0852eb3bd397c22dee3f1b6611b
Author: Ken Thomases <ken at codeweavers.com>
Date: Sun Dec 29 21:33:30 2013 -0600
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(+), 0 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index bb2da55..c8c1e90 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -642,6 +642,9 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
[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 5073db8..743757e 100644
--- a/dlls/winemac.drv/macdrv_cocoa.h
+++ b/dlls/winemac.drv/macdrv_cocoa.h
@@ -146,6 +146,7 @@ extern int topmost_float_inactive DECLSPEC_HIDDEN;
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 2c3ec23..1aab785 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);
}
More information about the wine-cvs
mailing list