Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4d9340eb
Commit
4d9340eb
authored
Oct 08, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Oct 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Update the window min/max size info and enforce it when zooming.
parent
bdcb8138
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
0 deletions
+60
-0
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+41
-0
event.c
dlls/winemac.drv/event.c
+4
-0
macdrv.h
dlls/winemac.drv/macdrv.h
+1
-0
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+1
-0
window.c
dlls/winemac.drv/window.c
+13
-0
No files found.
dlls/winemac.drv/cocoa_window.m
View file @
4d9340eb
...
...
@@ -1616,6 +1616,47 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
forMode
:
NSRunLoopCommonModes
];
}
-
(
NSRect
)
windowWillUseStandardFrame
:
(
NSWindow
*
)
window
defaultFrame
:
(
NSRect
)
proposedFrame
{
macdrv_query
*
query
;
NSRect
currentContentRect
,
proposedContentRect
,
newContentRect
,
screenRect
;
NSSize
maxSize
;
query
=
macdrv_create_query
();
query
->
type
=
QUERY_MIN_MAX_INFO
;
query
->
window
=
(
macdrv_window
)[
self
retain
];
[
self
.
queue
query
:
query
timeout
:
0
.
5
];
macdrv_release_query
(
query
);
currentContentRect
=
[
self
contentRectForFrameRect
:[
self
frame
]];
proposedContentRect
=
[
self
contentRectForFrameRect
:
proposedFrame
];
maxSize
=
[
self
contentMaxSize
];
newContentRect
.
size
.
width
=
MIN
(
NSWidth
(
proposedContentRect
),
maxSize
.
width
);
newContentRect
.
size
.
height
=
MIN
(
NSHeight
(
proposedContentRect
),
maxSize
.
height
);
// Try to keep the top-left corner where it is.
newContentRect
.
origin
.
x
=
NSMinX
(
currentContentRect
);
newContentRect
.
origin
.
y
=
NSMaxY
(
currentContentRect
)
-
NSHeight
(
newContentRect
);
// If that pushes the bottom or right off the screen, pull it up and to the left.
screenRect
=
[
self
contentRectForFrameRect
:[[
self
screen
]
visibleFrame
]];
if
(
NSMaxX
(
newContentRect
)
>
NSMaxX
(
screenRect
))
newContentRect
.
origin
.
x
=
NSMaxX
(
screenRect
)
-
NSWidth
(
newContentRect
);
if
(
NSMinY
(
newContentRect
)
<
NSMinY
(
screenRect
))
newContentRect
.
origin
.
y
=
NSMinY
(
screenRect
);
// If that pushes the top or left off the screen, push it down and the right
// again. Do this last because the top-left corner is more important than the
// bottom-right.
if
(
NSMinX
(
newContentRect
)
<
NSMinX
(
screenRect
))
newContentRect
.
origin
.
x
=
NSMinX
(
screenRect
);
if
(
NSMaxY
(
newContentRect
)
>
NSMaxY
(
screenRect
))
newContentRect
.
origin
.
y
=
NSMaxY
(
screenRect
)
-
NSHeight
(
newContentRect
);
return
[
self
frameRectForContentRect
:
newContentRect
];
}
/*
* ---------- NSPasteboardOwner methods ----------
...
...
dlls/winemac.drv/event.c
View file @
4d9340eb
...
...
@@ -158,6 +158,10 @@ static void macdrv_query_event(HWND hwnd, const macdrv_event *event)
TRACE
(
"QUERY_RESIZE_START
\n
"
);
success
=
query_resize_start
(
hwnd
);
break
;
case
QUERY_MIN_MAX_INFO
:
TRACE
(
"QUERY_MIN_MAX_INFO
\n
"
);
success
=
query_min_max_info
(
hwnd
);
break
;
default:
FIXME
(
"unrecognized query type %d
\n
"
,
query
->
type
);
break
;
...
...
dlls/winemac.drv/macdrv.h
View file @
4d9340eb
...
...
@@ -164,6 +164,7 @@ extern void macdrv_window_minimize_requested(HWND hwnd) DECLSPEC_HIDDEN;
extern
void
macdrv_window_did_unminimize
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_resize_end
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_resize_start
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_min_max_info
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_mouse_button
(
HWND
hwnd
,
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_mouse_moved
(
HWND
hwnd
,
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/macdrv_cocoa.h
View file @
4d9340eb
...
...
@@ -287,6 +287,7 @@ enum {
QUERY_PASTEBOARD_DATA
,
QUERY_RESIZE_END
,
QUERY_RESIZE_START
,
QUERY_MIN_MAX_INFO
,
NUM_QUERY_TYPES
};
...
...
dlls/winemac.drv/window.c
View file @
4d9340eb
...
...
@@ -2048,3 +2048,16 @@ BOOL query_resize_end(HWND hwnd)
SendMessageW
(
hwnd
,
WM_EXITSIZEMOVE
,
0
,
0
);
return
TRUE
;
}
/***********************************************************************
* query_min_max_info
*
* Handler for QUERY_MIN_MAX_INFO query.
*/
BOOL
query_min_max_info
(
HWND
hwnd
)
{
TRACE
(
"hwnd %p
\n
"
,
hwnd
);
sync_window_min_max_info
(
hwnd
);
return
TRUE
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment