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
039603c7
Commit
039603c7
authored
Mar 24, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't maintain a client-side WND structure for the desktop window.
Made WIN_GetPtr return WND_DESKTOP in that case.
parent
bf0f6a22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
39 additions
and
47 deletions
+39
-47
wnd.c
dlls/ttydrv/wnd.c
+1
-0
menu.c
dlls/user/menu.c
+3
-2
message.c
dlls/user/message.c
+2
-2
msg16.c
dlls/user/msg16.c
+3
-4
painting.c
dlls/user/painting.c
+1
-1
scroll.c
dlls/user/scroll.c
+3
-3
desktop.c
dlls/x11drv/desktop.c
+0
-6
winpos.c
dlls/x11drv/winpos.c
+4
-1
win.h
include/win.h
+1
-0
class.c
windows/class.c
+4
-6
dce.c
windows/dce.c
+1
-1
defdlg.c
windows/defdlg.c
+1
-1
dialog.c
windows/dialog.c
+2
-1
mdi.c
windows/mdi.c
+1
-1
nonclient.c
windows/nonclient.c
+6
-14
win.c
windows/win.c
+0
-0
winpos.c
windows/winpos.c
+6
-4
No files found.
dlls/ttydrv/wnd.c
View file @
039603c7
...
...
@@ -109,6 +109,7 @@ static BOOL set_window_pos( HWND hwnd, HWND insert_after, const RECT *rectWindow
ret
=
!
wine_server_call
(
req
);
}
SERVER_END_REQ
;
if
(
win
==
WND_DESKTOP
)
return
ret
;
if
(
ret
)
{
win
->
rectWindow
=
*
rectWindow
;
...
...
dlls/user/menu.c
View file @
039603c7
...
...
@@ -319,7 +319,7 @@ static HMENU get_win_sys_menu( HWND hwnd )
{
HMENU
ret
=
0
;
WND
*
win
=
WIN_GetPtr
(
hwnd
);
if
(
win
&&
win
!=
WND_OTHER_PROCESS
)
if
(
win
&&
win
!=
WND_OTHER_PROCESS
&&
win
!=
WND_DESKTOP
)
{
ret
=
win
->
hSysMenu
;
WIN_ReleasePtr
(
win
);
...
...
@@ -3667,6 +3667,7 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
WND
*
wndPtr
=
WIN_GetPtr
(
hWnd
);
HMENU
retvalue
=
0
;
if
(
wndPtr
==
WND_DESKTOP
)
return
0
;
if
(
wndPtr
==
WND_OTHER_PROCESS
)
{
if
(
IsWindow
(
hWnd
))
FIXME
(
"not supported on other process window %p
\n
"
,
hWnd
);
...
...
@@ -3724,7 +3725,7 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
{
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
wndPtr
&&
wndPtr
!=
WND_OTHER_PROCESS
)
if
(
wndPtr
&&
wndPtr
!=
WND_OTHER_PROCESS
&&
wndPtr
!=
WND_DESKTOP
)
{
if
(
wndPtr
->
hSysMenu
)
DestroyMenu
(
wndPtr
->
hSysMenu
);
wndPtr
->
hSysMenu
=
MENU_GetSysMenu
(
hwnd
,
hMenu
);
...
...
dlls/user/message.c
View file @
039603c7
...
...
@@ -2867,7 +2867,7 @@ LONG WINAPI DispatchMessageA( const MSG* msg )
if
(
msg
->
hwnd
)
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
wndPtr
==
WND_OTHER_PROCESS
)
if
(
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
{
if
(
IsWindow
(
msg
->
hwnd
))
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
else
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
...
...
@@ -2942,7 +2942,7 @@ LONG WINAPI DispatchMessageW( const MSG* msg )
if
(
msg
->
hwnd
)
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
wndPtr
==
WND_OTHER_PROCESS
)
if
(
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
{
if
(
IsWindow
(
msg
->
hwnd
))
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
else
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
...
...
dlls/user/msg16.c
View file @
039603c7
...
...
@@ -363,11 +363,10 @@ LONG WINAPI DispatchMessage16( const MSG16* msg )
if
(
msg
->
hwnd
)
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
wndPtr
==
WND_OTHER_PROCESS
)
if
(
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
{
if
(
IsWindow
(
hwnd
))
ERR
(
"cannot dispatch msg to other process window %p
\n
"
,
hwnd
);
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
if
(
IsWindow
(
hwnd
))
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
else
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
winproc
=
(
WNDPROC16
)
wndPtr
->
winproc
;
...
...
dlls/user/painting.c
View file @
039603c7
...
...
@@ -188,7 +188,7 @@ static HRGN send_ncpaint( HWND hwnd, HWND *child, UINT *flags )
INT
type
;
WND
*
win
=
WIN_GetPtr
(
hwnd
);
if
(
!
win
||
win
==
WND_OTHER_PROCESS
)
if
(
!
win
||
win
==
WND_OTHER_PROCESS
||
win
==
WND_DESKTOP
)
{
DeleteObject
(
whole_rgn
);
return
0
;
...
...
dlls/user/scroll.c
View file @
039603c7
...
...
@@ -152,7 +152,7 @@ static SCROLLBAR_INFO *SCROLL_GetInternalInfo( HWND hwnd, INT nBar, BOOL alloc )
SCROLLBAR_INFO
*
infoPtr
=
NULL
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
NULL
;
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
NULL
;
switch
(
nBar
)
{
case
SB_HORZ
:
infoPtr
=
(
SCROLLBAR_INFO
*
)
wndPtr
->
pHScroll
;
break
;
...
...
@@ -201,7 +201,7 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
BOOL
vertical
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
FALSE
;
switch
(
nBar
)
{
...
...
@@ -1069,7 +1069,7 @@ void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt )
if
(
scrollbar
!=
SB_CTL
)
{
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
;
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
;
xoffset
=
wndPtr
->
rectClient
.
left
-
wndPtr
->
rectWindow
.
left
;
yoffset
=
wndPtr
->
rectClient
.
top
-
wndPtr
->
rectWindow
.
top
;
WIN_ReleasePtr
(
wndPtr
);
...
...
dlls/x11drv/desktop.c
View file @
039603c7
...
...
@@ -66,18 +66,12 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data )
Display
*
display
;
MSG
msg
;
HWND
hwnd
;
WND
*
win
;
Atom
atom
=
x11drv_atom
(
WM_DELETE_WINDOW
);
NtCurrentTeb
()
->
driver_data
=
driver_data
;
display
=
thread_display
();
hwnd
=
GetDesktopWindow
();
/* patch the desktop window queue to point to our queue */
win
=
WIN_GetPtr
(
hwnd
);
win
->
tid
=
GetCurrentThreadId
();
WIN_ReleasePtr
(
win
);
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
desktop_winproc
);
wine_tsx11_lock
();
XSaveContext
(
display
,
root_window
,
winContext
,
(
char
*
)
hwnd
);
...
...
dlls/x11drv/winpos.c
View file @
039603c7
...
...
@@ -724,7 +724,6 @@ BOOL X11DRV_set_window_pos( HWND hwnd, HWND insert_after, const RECT *rectWindow
if
(
IsWindow
(
hwnd
))
ERR
(
"cannot set rectangles of other process window %p
\n
"
,
hwnd
);
return
FALSE
;
}
old_style
=
win
->
dwStyle
;
SERVER_START_REQ
(
set_window_pos
)
{
req
->
handle
=
hwnd
;
...
...
@@ -749,6 +748,8 @@ BOOL X11DRV_set_window_pos( HWND hwnd, HWND insert_after, const RECT *rectWindow
}
SERVER_END_REQ
;
if
(
win
==
WND_DESKTOP
)
return
ret
;
if
(
ret
)
{
Display
*
display
=
thread_display
();
...
...
@@ -765,6 +766,7 @@ BOOL X11DRV_set_window_pos( HWND hwnd, HWND insert_after, const RECT *rectWindow
win
->
rectWindow
=
*
rectWindow
;
win
->
rectClient
=
*
rectClient
;
old_style
=
win
->
dwStyle
;
win
->
dwStyle
=
new_style
;
data
->
window_rect
=
*
rectWindow
;
...
...
@@ -1090,6 +1092,7 @@ BOOL X11DRV_ShowWindow( HWND hwnd, INT cmd )
RECT
newPos
=
{
0
,
0
,
0
,
0
};
UINT
swp
=
0
;
if
(
hwnd
==
GetDesktopWindow
())
return
FALSE
;
TRACE
(
"hwnd=%p, cmd=%d, wasVisible %d
\n
"
,
hwnd
,
cmd
,
wasVisible
);
...
...
include/win.h
View file @
039603c7
...
...
@@ -106,6 +106,7 @@ inline static void WIN_ReleasePtr( WND *ptr )
}
#define WND_OTHER_PROCESS ((WND *)1)
/* returned by WIN_GetPtr on unknown window handles */
#define WND_DESKTOP ((WND *)2)
/* returned by WIN_GetPtr on the desktop window */
extern
LRESULT
HOOK_CallHooks
(
INT
id
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
unicode
);
...
...
windows/class.c
View file @
039603c7
...
...
@@ -65,7 +65,6 @@ typedef struct tagCLASS
}
CLASS
;
static
struct
list
class_list
=
LIST_INIT
(
class_list
);
static
CLASS
*
desktop_class
;
#define CLASS_OTHER_PROCESS ((CLASS *)1)
...
...
@@ -78,8 +77,9 @@ static CLASS *get_class_ptr( HWND hwnd, BOOL write_access )
if
(
ptr
)
{
if
(
ptr
!=
WND_OTHER_PROCESS
)
return
ptr
->
class
;
if
(
write_access
&&
IsWindow
(
hwnd
))
/* check other processes */
if
(
ptr
!=
WND_OTHER_PROCESS
&&
ptr
!=
WND_DESKTOP
)
return
ptr
->
class
;
if
(
write_access
&&
(
ptr
==
WND_DESKTOP
||
IsWindow
(
hwnd
)))
/* check other processes */
{
/* modifying classes in other processes is not allowed */
SetLastError
(
ERROR_ACCESS_DENIED
);
...
...
@@ -476,7 +476,7 @@ void CLASS_RegisterBuiltinClasses(void)
extern
const
struct
builtin_class_descr
SCROLL_builtin_class
;
extern
const
struct
builtin_class_descr
STATIC_builtin_class
;
desktop_class
=
register_builtin
(
&
DESKTOP_builtin_class
);
register_builtin
(
&
DESKTOP_builtin_class
);
register_builtin
(
&
BUTTON_builtin_class
);
register_builtin
(
&
COMBO_builtin_class
);
register_builtin
(
&
COMBOLBOX_builtin_class
);
...
...
@@ -499,8 +499,6 @@ void CLASS_RegisterBuiltinClasses(void)
*/
void
CLASS_AddWindow
(
CLASS
*
class
,
WND
*
win
,
WINDOWPROCTYPE
type
)
{
if
(
!
class
)
class
=
desktop_class
;
if
(
type
==
WIN_PROC_32W
)
{
if
(
!
(
win
->
winproc
=
class
->
winprocW
))
win
->
winproc
=
class
->
winprocA
;
...
...
windows/dce.c
View file @
039603c7
...
...
@@ -349,7 +349,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
else
hwnd
=
WIN_GetFullHandle
(
hwnd
);
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
)))
return
0
;
if
(
wndPtr
==
WND_OTHER_PROCESS
)
if
(
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
{
wndPtr
=
NULL
;
USER_Lock
();
...
...
windows/defdlg.c
View file @
039603c7
...
...
@@ -359,7 +359,7 @@ DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create )
dlgInfo
->
flags
=
0
;
dlgInfo
->
hDialogHeap
=
0
;
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
wndPtr
&&
wndPtr
!=
WND_OTHER_PROCESS
)
if
(
wndPtr
&&
wndPtr
!=
WND_OTHER_PROCESS
&&
wndPtr
!=
WND_DESKTOP
)
{
wndPtr
->
flags
|=
WIN_ISDIALOG
;
WIN_ReleasePtr
(
wndPtr
);
...
...
windows/dialog.c
View file @
039603c7
...
...
@@ -997,7 +997,7 @@ static HWND DIALOG_FindMsgDestination( HWND hwndDlg )
if
(
!
hParent
)
break
;
pParent
=
WIN_GetPtr
(
hParent
);
if
(
!
pParent
||
pParent
==
WND_OTHER_PROCESS
)
break
;
if
(
!
pParent
||
pParent
==
WND_OTHER_PROCESS
||
pParent
==
WND_DESKTOP
)
break
;
if
(
!
(
pParent
->
flags
&
WIN_ISDIALOG
))
{
...
...
@@ -1086,6 +1086,7 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg )
if
(
CallMsgFilterW
(
msg
,
MSGF_DIALOGBOX
))
return
TRUE
;
hwndDlg
=
WIN_GetFullHandle
(
hwndDlg
);
if
(
hwndDlg
==
GetDesktopWindow
())
return
FALSE
;
if
((
hwndDlg
!=
msg
->
hwnd
)
&&
!
IsChild
(
hwndDlg
,
msg
->
hwnd
))
return
FALSE
;
hwndDlg
=
DIALOG_FindMsgDestination
(
hwndDlg
);
...
...
windows/mdi.c
View file @
039603c7
...
...
@@ -191,7 +191,7 @@ static MDICLIENTINFO *get_client_info( HWND client )
{
if
(
win
==
WND_OTHER_PROCESS
)
{
ERR
(
"client %p belongs to other process
\n
"
,
client
);
if
(
IsWindow
(
client
))
ERR
(
"client %p belongs to other process
\n
"
,
client
);
return
NULL
;
}
if
(
win
->
cbWndExtra
<
sizeof
(
MDICLIENTINFO
))
WARN
(
"%p is not an MDI client
\n
"
,
client
);
...
...
windows/nonclient.c
View file @
039603c7
...
...
@@ -182,7 +182,7 @@ static HICON NC_IconForWindow( HWND hwnd )
HICON
hIcon
=
0
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
wndPtr
&&
wndPtr
!=
WND_OTHER_PROCESS
)
if
(
wndPtr
&&
wndPtr
!=
WND_OTHER_PROCESS
&&
wndPtr
!=
WND_DESKTOP
)
{
hIcon
=
wndPtr
->
hIconSmall
;
if
(
!
hIcon
)
hIcon
=
wndPtr
->
hIcon
;
...
...
@@ -441,7 +441,7 @@ static void NC_GetInsideRect( HWND hwnd, RECT *rect )
{
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
;
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
;
rect
->
top
=
rect
->
left
=
0
;
rect
->
right
=
wndPtr
->
rectWindow
.
right
-
wndPtr
->
rectWindow
.
left
;
...
...
@@ -642,7 +642,7 @@ LONG NC_HandleNCHitTest (HWND hwnd , POINT pt)
LONG
retvalue
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
HTERROR
;
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
HTERROR
;
retvalue
=
NC_DoNCHitTest
(
wndPtr
,
pt
);
WIN_ReleasePtr
(
wndPtr
);
...
...
@@ -933,18 +933,10 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, DWORD style,
/******************************************************************************
*
* NC_DoNCPaint
*
* Paint the non-client area for windows. The clip region is
* currently ignored.
*
* Bugs
* grep -E -A10 -B5 \(95\)\|\(Bugs\)\|\(FIXME\) windows/nonclient.c \
* misc/tweak.c controls/menu.c # :-)
*
*****************************************************************************/
* Paint the non-client area for windows.
*/
static
void
NC_DoNCPaint
(
HWND
hwnd
,
HRGN
clip
,
BOOL
suppress_menupaint
)
{
HDC
hdc
;
...
...
@@ -1185,7 +1177,7 @@ void NC_GetSysPopupPos( HWND hwnd, RECT* rect )
else
{
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
;
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
;
NC_GetInsideRect
(
hwnd
,
rect
);
OffsetRect
(
rect
,
wndPtr
->
rectWindow
.
left
,
wndPtr
->
rectWindow
.
top
);
...
...
windows/win.c
View file @
039603c7
This diff is collapsed.
Click to expand it.
windows/winpos.c
View file @
039603c7
...
...
@@ -477,7 +477,7 @@ static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset )
{
HWND
hwnd
=
hwndFrom
;
while
(
hwnd
&&
hwnd
!=
GetDesktopWindow
()
)
while
(
hwnd
)
{
if
(
hwnd
==
hwndTo
)
return
;
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
)))
...
...
@@ -485,6 +485,7 @@ static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset )
ERR
(
"bad hwndFrom = %p
\n
"
,
hwnd
);
return
;
}
if
(
wndPtr
==
WND_DESKTOP
)
break
;
if
(
wndPtr
==
WND_OTHER_PROCESS
)
goto
other_process
;
offset
->
x
+=
wndPtr
->
rectClient
.
left
;
offset
->
y
+=
wndPtr
->
rectClient
.
top
;
...
...
@@ -498,13 +499,14 @@ static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset )
{
HWND
hwnd
=
hwndTo
;
while
(
hwnd
&&
hwnd
!=
GetDesktopWindow
()
)
while
(
hwnd
)
{
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
)))
{
ERR
(
"bad hwndTo = %p
\n
"
,
hwnd
);
return
;
}
if
(
wndPtr
==
WND_DESKTOP
)
break
;
if
(
wndPtr
==
WND_OTHER_PROCESS
)
goto
other_process
;
offset
->
x
-=
wndPtr
->
rectClient
.
left
;
offset
->
y
-=
wndPtr
->
rectClient
.
top
;
...
...
@@ -893,7 +895,7 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
WND
*
pWnd
=
WIN_GetPtr
(
hwnd
);
LPINTERNALPOS
lpPos
;
if
(
!
pWnd
)
return
FALSE
;
if
(
!
pWnd
||
pWnd
==
WND_DESKTOP
)
return
FALSE
;
if
(
pWnd
==
WND_OTHER_PROCESS
)
{
if
(
IsWindow
(
hwnd
))
FIXME
(
"not supported on other process window %p
\n
"
,
hwnd
);
...
...
@@ -932,7 +934,7 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f
DWORD
style
;
WND
*
pWnd
=
WIN_GetPtr
(
hwnd
);
if
(
!
pWnd
||
pWnd
==
WND_OTHER_PROCESS
)
return
FALSE
;
if
(
!
pWnd
||
pWnd
==
WND_OTHER_PROCESS
||
pWnd
==
WND_DESKTOP
)
return
FALSE
;
lpPos
=
WINPOS_InitInternalPos
(
pWnd
);
if
(
flags
&
PLACE_MIN
)
...
...
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