Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d1f55471
Commit
d1f55471
authored
Apr 23, 2014
by
Ken Thomases
Committed by
Alexandre Julliard
Apr 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Send WM_SIZING messages during resizing to let app alter the proposed size.
parent
b52c89fc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
1 deletion
+103
-1
cocoa_window.h
dlls/winemac.drv/cocoa_window.h
+2
-0
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+50
-1
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
+6
-0
window.c
dlls/winemac.drv/window.c
+40
-0
No files found.
dlls/winemac.drv/cocoa_window.h
View file @
d1f55471
...
...
@@ -54,6 +54,8 @@
NSUInteger
lastModifierFlags
;
NSTimer
*
liveResizeDisplayTimer
;
NSRect
frameAtResizeStart
;
BOOL
resizingFromLeft
,
resizingFromTop
;
void
*
imeData
;
BOOL
commandDone
;
...
...
dlls/winemac.drv/cocoa_window.m
View file @
d1f55471
...
...
@@ -1809,7 +1809,17 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
-
(
void
)
windowDidResize
:
(
NSNotification
*
)
notification
{
macdrv_event
*
event
;
NSRect
frame
=
[
self
contentRectForFrameRect
:[
self
frame
]];
NSRect
frame
=
[
self
frame
];
if
([
self
inLiveResize
])
{
if
(
NSMinX
(
frame
)
!=
NSMinX
(
frameAtResizeStart
))
resizingFromLeft
=
TRUE
;
if
(
NSMaxY
(
frame
)
!=
NSMaxY
(
frameAtResizeStart
))
resizingFromTop
=
TRUE
;
}
frame
=
[
self
contentRectForFrameRect
:
frame
];
if
(
ignore_windowResize
||
exitingFullScreen
)
return
;
...
...
@@ -1899,6 +1909,42 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
[
self
becameIneligibleParentOrChild
];
}
-
(
NSSize
)
windowWillResize
:
(
NSWindow
*
)
sender
toSize
:
(
NSSize
)
frameSize
{
if
([
self
inLiveResize
])
{
NSRect
rect
;
macdrv_query
*
query
;
rect
=
[
self
frame
];
if
(
resizingFromLeft
)
rect
.
origin
.
x
=
NSMaxX
(
rect
)
-
frameSize
.
width
;
if
(
!
resizingFromTop
)
rect
.
origin
.
y
=
NSMaxY
(
rect
)
-
frameSize
.
height
;
rect
.
size
=
frameSize
;
rect
=
[
self
contentRectForFrameRect
:
rect
];
[[
WineApplicationController
sharedController
]
flipRect
:
&
rect
];
query
=
macdrv_create_query
();
query
->
type
=
QUERY_RESIZE_SIZE
;
query
->
window
=
(
macdrv_window
)[
self
retain
];
query
->
resize_size
.
rect
=
NSRectToCGRect
(
rect
);
query
->
resize_size
.
from_left
=
resizingFromLeft
;
query
->
resize_size
.
from_top
=
resizingFromTop
;
if
([
self
.
queue
query
:
query
timeout
:
0
.
1
])
{
rect
=
NSRectFromCGRect
(
query
->
resize_size
.
rect
);
rect
=
[
self
frameRectForContentRect
:
rect
];
frameSize
=
rect
.
size
;
}
macdrv_release_query
(
query
);
}
return
frameSize
;
}
-
(
void
)
windowWillStartLiveResize
:
(
NSNotification
*
)
notification
{
macdrv_query
*
query
=
macdrv_create_query
();
...
...
@@ -1908,6 +1954,9 @@ static inline NSUInteger adjusted_modifiers_for_option_behavior(NSUInteger modif
[
self
.
queue
query
:
query
timeout
:
0
.
3
];
macdrv_release_query
(
query
);
frameAtResizeStart
=
[
self
frame
];
resizingFromLeft
=
resizingFromTop
=
FALSE
;
// There's a strange restriction in window redrawing during Cocoa-
// managed window resizing. Only calls to -[NSView setNeedsDisplay...]
// that happen synchronously when Cocoa tells us that our window size
...
...
dlls/winemac.drv/event.c
View file @
d1f55471
...
...
@@ -162,6 +162,10 @@ static void macdrv_query_event(HWND hwnd, const macdrv_event *event)
TRACE
(
"QUERY_PASTEBOARD_DATA
\n
"
);
success
=
query_pasteboard_data
(
hwnd
,
query
->
pasteboard_data
.
type
);
break
;
case
QUERY_RESIZE_SIZE
:
TRACE
(
"QUERY_RESIZE_SIZE
\n
"
);
success
=
query_resize_size
(
hwnd
,
query
);
break
;
case
QUERY_RESIZE_START
:
TRACE
(
"QUERY_RESIZE_START
\n
"
);
success
=
query_resize_start
(
hwnd
);
...
...
dlls/winemac.drv/macdrv.h
View file @
d1f55471
...
...
@@ -173,6 +173,7 @@ extern void macdrv_window_resize_ended(HWND hwnd) DECLSPEC_HIDDEN;
extern
void
macdrv_window_restore_requested
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_window_drag_begin
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_window_drag_end
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_resize_size
(
HWND
hwnd
,
macdrv_query
*
query
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_resize_start
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_min_max_info
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/macdrv_cocoa.h
View file @
d1f55471
...
...
@@ -298,6 +298,7 @@ enum {
QUERY_DRAG_OPERATION
,
QUERY_IME_CHAR_RECT
,
QUERY_PASTEBOARD_DATA
,
QUERY_RESIZE_SIZE
,
QUERY_RESIZE_START
,
QUERY_MIN_MAX_INFO
,
NUM_QUERY_TYPES
...
...
@@ -331,6 +332,11 @@ typedef struct macdrv_query {
struct
{
CFStringRef
type
;
}
pasteboard_data
;
struct
{
CGRect
rect
;
unsigned
int
from_left
:
1
;
unsigned
int
from_top
:
1
;
}
resize_size
;
};
}
macdrv_query
;
...
...
dlls/winemac.drv/window.c
View file @
d1f55471
...
...
@@ -2400,6 +2400,46 @@ fail:
/***********************************************************************
* query_resize_size
*
* Handler for QUERY_RESIZE_SIZE query.
*/
BOOL
query_resize_size
(
HWND
hwnd
,
macdrv_query
*
query
)
{
struct
macdrv_win_data
*
data
=
get_win_data
(
hwnd
);
RECT
rect
=
rect_from_cgrect
(
query
->
resize_size
.
rect
);
int
corner
;
BOOL
ret
=
FALSE
;
if
(
!
data
)
return
FALSE
;
macdrv_mac_to_window_rect
(
data
,
&
rect
);
if
(
query
->
resize_size
.
from_left
)
{
if
(
query
->
resize_size
.
from_top
)
corner
=
WMSZ_TOPLEFT
;
else
corner
=
WMSZ_BOTTOMLEFT
;
}
else
if
(
query
->
resize_size
.
from_top
)
corner
=
WMSZ_TOPRIGHT
;
else
corner
=
WMSZ_BOTTOMRIGHT
;
if
(
SendMessageW
(
hwnd
,
WM_SIZING
,
corner
,
(
LPARAM
)
&
rect
))
{
macdrv_window_to_mac_rect
(
data
,
GetWindowLongW
(
hwnd
,
GWL_STYLE
),
&
rect
);
query
->
resize_size
.
rect
=
cgrect_from_rect
(
rect
);
ret
=
TRUE
;
}
release_win_data
(
data
);
return
ret
;
}
/***********************************************************************
* query_resize_start
*
* Handler for QUERY_RESIZE_START query.
...
...
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