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
b6544d19
Commit
b6544d19
authored
Jan 11, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Jan 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Implement support for owned windows.
parent
429732ce
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
3 deletions
+58
-3
cocoa_window.h
dlls/winemac.drv/cocoa_window.h
+1
-0
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+50
-3
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+1
-0
window.c
dlls/winemac.drv/window.c
+6
-0
No files found.
dlls/winemac.drv/cocoa_window.h
View file @
b6544d19
...
...
@@ -27,6 +27,7 @@
BOOL
disabled
;
BOOL
noActivate
;
BOOL
floating
;
WineWindow
*
latentParentWindow
;
}
@end
dlls/winemac.drv/cocoa_window.m
View file @
b6544d19
...
...
@@ -63,6 +63,7 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
@property
(
nonatomic
)
BOOL
disabled
;
@property
(
nonatomic
)
BOOL
noActivate
;
@property
(
nonatomic
)
BOOL
floating
;
@property
(
retain
,
nonatomic
)
NSWindow
*
latentParentWindow
;
+
(
void
)
flipRect
:(
NSRect
*
)
rect
;
...
...
@@ -81,7 +82,7 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
@implementation
WineWindow
@synthesize
disabled
,
noActivate
,
floating
;
@synthesize
disabled
,
noActivate
,
floating
,
latentParentWindow
;
+
(
WineWindow
*
)
createWindowWithFeatures
:(
const
struct
macdrv_window_features
*
)
wf
windowFrame
:(
NSRect
)
window_frame
...
...
@@ -119,6 +120,12 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
return
window
;
}
-
(
void
)
dealloc
{
[
latentParentWindow
release
];
[
super
dealloc
];
}
+
(
void
)
flipRect
:
(
NSRect
*
)
rect
{
rect
->
origin
.
y
=
NSMaxY
([[[
NSScreen
screens
]
objectAtIndex
:
0
]
frame
])
-
NSMaxY
(
*
rect
);
...
...
@@ -172,11 +179,23 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
[
self
orderWindow
:
NSWindowBelow
relativeTo
:[
prev
windowNumber
]];
else
[
self
orderWindow
:
NSWindowAbove
relativeTo
:[
next
windowNumber
]];
if
(
latentParentWindow
)
{
[
latentParentWindow
addChildWindow
:
self
ordered
:
NSWindowAbove
];
self
.
latentParentWindow
=
nil
;
}
}
return
on_screen
;
}
-
(
void
)
doOrderOut
{
self
.
latentParentWindow
=
[
self
parentWindow
];
[
latentParentWindow
removeChildWindow
:
self
];
[
self
orderOut
:
nil
];
}
-
(
BOOL
)
setFrameIfOnScreen
:
(
NSRect
)
contentRect
{
NSArray
*
screens
=
[
NSScreen
screens
];
...
...
@@ -193,7 +212,7 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
{
on_screen
=
frame_intersects_screens
(
contentRect
,
screens
);
if
(
!
on_screen
)
[
self
orderOut
:
nil
];
[
self
doOrderOut
];
}
oldFrame
=
[
self
frame
];
...
...
@@ -209,6 +228,19 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
return
on_screen
;
}
-
(
void
)
setMacDrvParentWindow
:
(
WineWindow
*
)
parent
{
if
([
self
parentWindow
]
!=
parent
)
{
[[
self
parentWindow
]
removeChildWindow
:
self
];
self
.
latentParentWindow
=
nil
;
if
([
self
isVisible
]
&&
parent
)
[
parent
addChildWindow
:
self
ordered
:
NSWindowAbove
];
else
self
.
latentParentWindow
=
parent
;
}
}
-
(
void
)
setDisabled
:
(
BOOL
)
newValue
{
if
(
disabled
!=
newValue
)
...
...
@@ -368,7 +400,7 @@ void macdrv_hide_cocoa_window(macdrv_window w)
WineWindow
*
window
=
(
WineWindow
*
)
w
;
OnMainThread
(
^
{
[
window
orderOut
:
nil
];
[
window
doOrderOut
];
});
}
...
...
@@ -392,3 +424,18 @@ int macdrv_set_cocoa_window_frame(macdrv_window w, const CGRect* new_frame)
return
on_screen
;
}
/***********************************************************************
* macdrv_set_cocoa_parent_window
*
* Sets the parent window for a Cocoa window. If parent is NULL, clears
* the parent window.
*/
void
macdrv_set_cocoa_parent_window
(
macdrv_window
w
,
macdrv_window
parent
)
{
WineWindow
*
window
=
(
WineWindow
*
)
w
;
OnMainThread
(
^
{
[
window
setMacDrvParentWindow
:(
WineWindow
*
)
parent
];
});
}
dlls/winemac.drv/macdrv_cocoa.h
View file @
b6544d19
...
...
@@ -144,5 +144,6 @@ extern int macdrv_order_cocoa_window(macdrv_window w, macdrv_window prev,
macdrv_window
next
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_hide_cocoa_window
(
macdrv_window
w
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_set_cocoa_window_frame
(
macdrv_window
w
,
const
CGRect
*
new_frame
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_set_cocoa_parent_window
(
macdrv_window
w
,
macdrv_window
parent
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_MACDRV_COCOA_H */
dlls/winemac.drv/window.c
View file @
b6544d19
...
...
@@ -301,12 +301,18 @@ static macdrv_window macdrv_get_cocoa_window(HWND hwnd)
static
void
set_cocoa_window_properties
(
struct
macdrv_win_data
*
data
)
{
DWORD
style
,
ex_style
;
HWND
owner
;
macdrv_window
owner_win
;
struct
macdrv_window_features
wf
;
struct
macdrv_window_state
state
;
style
=
GetWindowLongW
(
data
->
hwnd
,
GWL_STYLE
);
ex_style
=
GetWindowLongW
(
data
->
hwnd
,
GWL_EXSTYLE
);
owner
=
GetWindow
(
data
->
hwnd
,
GW_OWNER
);
owner_win
=
macdrv_get_cocoa_window
(
owner
);
macdrv_set_cocoa_parent_window
(
data
->
cocoa_window
,
owner_win
);
get_cocoa_window_features
(
data
,
style
,
ex_style
,
&
wf
);
macdrv_set_cocoa_window_features
(
data
->
cocoa_window
,
&
wf
);
...
...
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