Module: wine
Branch: master
Commit: fff364274774fe51bdc8a0aee22369aac161dcb7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=fff364274774fe51bdc8a0ae…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Date: Tue May 19 15:18:48 2020 +0300
winex11.drv: Fix X11DRV_X_to_window_rect to handle windows smaller than the decoration.
A window can be resized to a smaller size than the decoration (title +
borders), such as when it is minimized. In such cases it is necessary
to recompute the minimum bounds, as it is done in the opposite function
X11DRV_window_to_X_rect, since the real information was lost.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48490
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/winex11.drv/window.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 595c54a7c0..a16b835424 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1209,12 +1209,16 @@ static void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect,
*/
void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect, int x, int y, int cx, int cy )
{
- x += data->window_rect.left - data->whole_rect.left;
- y += data->window_rect.top - data->whole_rect.top;
- cx += (data->window_rect.right - data->window_rect.left) -
- (data->whole_rect.right - data->whole_rect.left);
- cy += (data->window_rect.bottom - data->window_rect.top) -
- (data->whole_rect.bottom - data->whole_rect.top);
+ RECT rc;
+
+ get_decoration_rect( data, &rc, &data->window_rect, &data->client_rect );
+
+ x += min( data->window_rect.left - data->whole_rect.left, rc.left );
+ y += min( data->window_rect.top - data->whole_rect.top, rc.top );
+ cx += max( (data->window_rect.right - data->window_rect.left) -
+ (data->whole_rect.right - data->whole_rect.left), rc.right - rc.left );
+ cy += max( (data->window_rect.bottom - data->window_rect.top) -
+ (data->whole_rect.bottom - data->whole_rect.top), rc.bottom - rc.top );
SetRect( rect, x, y, x + cx, y + cy );
}
Module: wine
Branch: master
Commit: 55ba3648379d90642f174e74809b84130d6d1ddc
URL: https://source.winehq.org/git/wine.git/?a=commit;h=55ba3648379d90642f174e74…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com>
Date: Mon May 18 21:04:58 2020 +0200
libwine: Add support for mmap at fixed start addresses on FreeBSD.
The way to implement MAP_TRYFIXED on FreeBSD is call mmap()
with MAP_FIXED | MAP_EXCL, which will allocate the mapping
from the exact starting address if possible, and if that fails,
call mmap() again without them. This gets PE DLLs loading at
their correct base addresses, and fixes a FreeBSD-specific
problem with Cygwin's fork() caused by cygwin1.dll loading at
different base addresses in the parent and child.
Signed-off-by: Damjan Jovanovic <damjan.jov(a)gmail.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
libs/wine/mmap.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/libs/wine/mmap.c b/libs/wine/mmap.c
index f2b5adc1d2..0fbe2efea7 100644
--- a/libs/wine/mmap.c
+++ b/libs/wine/mmap.c
@@ -211,18 +211,21 @@ void *wine_anon_mmap( void *start, size_t size, int prot, int flags )
if (!(flags & MAP_FIXED))
{
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
- /* Even FreeBSD 5.3 does not properly support NULL here. */
- if( start == NULL ) start = (void *)0x110000;
-#endif
-
#ifdef MAP_TRYFIXED
/* If available, this will attempt a fixed mapping in-kernel */
flags |= MAP_TRYFIXED;
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ if ( start && mmap( start, size, prot, flags | MAP_FIXED | MAP_EXCL, get_fdzero(), 0 ) )
+ return start;
#elif defined(__svr4__) || defined(__NetBSD__) || defined(__APPLE__)
if ( try_mmap_fixed( start, size, prot, flags, get_fdzero(), 0 ) )
return start;
#endif
+
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+ /* Even FreeBSD 5.3 does not properly support NULL here. */
+ if( start == NULL ) start = (void *)0x110000;
+#endif
}
return mmap( start, size, prot, flags, get_fdzero(), 0 );
}
Module: wine
Branch: master
Commit: 5ab64243dafa23cd36ad02ec737fcad9a58a78e4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5ab64243dafa23cd36ad02ec…
Author: Jacek Caban <jacek(a)codeweavers.com>
Date: Wed May 20 17:54:21 2020 +0200
include: Add winapifamily.h file.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
include/Makefile.in | 1 +
include/winapifamily.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
include/winnt.h | 1 +
3 files changed, 64 insertions(+)
diff --git a/include/Makefile.in b/include/Makefile.in
index 6aff236a7c..2f2d94d574 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -715,6 +715,7 @@ SOURCES = \
wia_xp.idl \
wiadef.h \
wimgapi.h \
+ winapifamily.h \
winbase.h \
wincodec.idl \
wincodecsdk.idl \
diff --git a/include/winapifamily.h b/include/winapifamily.h
new file mode 100644
index 0000000000..c1df2e1627
--- /dev/null
+++ b/include/winapifamily.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2020 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _INC_WINAPIFAMILY
+#define _INC_WINAPIFAMILY
+
+#define WINAPI_FAMILY_PC_APP 2
+#define WINAPI_FAMILY_PHONE_APP 3
+#define WINAPI_FAMILY_SYSTEM 4
+#define WINAPI_FAMILY_SERVER 5
+#define WINAPI_FAMILY_DESKTOP_APP 100
+
+#define WINAPI_FAMILY_APP WINAPI_FAMILY_PC_APP
+
+#ifndef WINAPI_FAMILY
+#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
+#endif
+
+#ifndef WINAPI_PARTITION_DESKTOP
+#define WINAPI_PARTITION_DESKTOP (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_APP
+#define WINAPI_PARTITION_APP (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_PC_APP
+#define WINAPI_PARTITION_PC_APP (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PC_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_PHONE_APP
+#define WINAPI_PARTITION_PHONE_APP (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_SYSTEM
+#define WINAPI_PARTITION_SYSTEM (WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM || \
+ WINAPI_FAMILY == WINAPI_FAMILY_SERVER)
+#endif
+
+#define WINAPI_PARTITION_PHONE WINAPI_PARTITION_PHONE_APP
+
+#define WINAPI_FAMILY_PARTITION(x) x
+
+#endif /* _INC_WINAPIFAMILY */
diff --git a/include/winnt.h b/include/winnt.h
index 46e17c546a..99c3793346 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -23,6 +23,7 @@
#include <basetsd.h>
#include <guiddef.h>
+#include <winapifamily.h>
#ifndef RC_INVOKED
#include <ctype.h>