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
1d9ea46c
Commit
1d9ea46c
authored
Dec 14, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Dec 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: ClipCursor should use virtual screen resolution for empty/invalid rects.
parent
fe70c54a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
8 deletions
+39
-8
cursoricon.c
dlls/user32/cursoricon.c
+11
-8
monitor.c
dlls/user32/tests/monitor.c
+27
-0
winpos.c
dlls/winex11.drv/winpos.c
+1
-0
No files found.
dlls/user32/cursoricon.c
View file @
1d9ea46c
...
...
@@ -1558,8 +1558,16 @@ HCURSOR WINAPI GetCursor(void)
*/
BOOL
WINAPI
ClipCursor
(
const
RECT
*
rect
)
{
if
(
!
rect
)
SetRectEmpty
(
&
CURSOR_ClipRect
);
else
CopyRect
(
&
CURSOR_ClipRect
,
rect
);
RECT
virt
;
SetRect
(
&
virt
,
0
,
0
,
GetSystemMetrics
(
SM_CXVIRTUALSCREEN
),
GetSystemMetrics
(
SM_CYVIRTUALSCREEN
)
);
OffsetRect
(
&
virt
,
GetSystemMetrics
(
SM_XVIRTUALSCREEN
),
GetSystemMetrics
(
SM_YVIRTUALSCREEN
)
);
if
(
!
IntersectRect
(
&
CURSOR_ClipRect
,
&
virt
,
rect
))
CURSOR_ClipRect
=
virt
;
return
TRUE
;
}
...
...
@@ -1569,12 +1577,7 @@ BOOL WINAPI ClipCursor( const RECT *rect )
*/
BOOL
WINAPI
GetClipCursor
(
RECT
*
rect
)
{
if
(
rect
)
{
CopyRect
(
rect
,
&
CURSOR_ClipRect
);
return
TRUE
;
}
return
FALSE
;
return
CopyRect
(
rect
,
&
CURSOR_ClipRect
);
}
...
...
dlls/user32/tests/monitor.c
View file @
1d9ea46c
...
...
@@ -141,6 +141,33 @@ static void test_ChangeDisplaySettingsEx(void)
dm
.
dmFields
=
vid_modes_test
[
i
].
fields
;
res
=
ChangeDisplaySettingsEx
(
NULL
,
&
dm
,
NULL
,
CDS_FULLSCREEN
,
NULL
);
ok
(
res
==
vid_modes_test
[
i
].
res
,
"Failed to change resolution[%d]: %d
\n
"
,
i
,
res
);
if
(
res
==
DISP_CHANGE_SUCCESSFUL
)
{
RECT
r
,
r1
,
virt
;
SetRect
(
&
virt
,
0
,
0
,
GetSystemMetrics
(
SM_CXVIRTUALSCREEN
),
GetSystemMetrics
(
SM_CYVIRTUALSCREEN
));
OffsetRect
(
&
virt
,
GetSystemMetrics
(
SM_XVIRTUALSCREEN
),
GetSystemMetrics
(
SM_YVIRTUALSCREEN
));
/* Resolution change resets clip rect */
ok
(
GetClipCursor
(
&
r
),
"GetClipCursor() failed
\n
"
);
ok
(
EqualRect
(
&
r
,
&
virt
),
"Invalid clip rect: (%d %d) x (%d %d)
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
ok
(
ClipCursor
(
NULL
),
"ClipCursor() failed
\n
"
);
ok
(
GetClipCursor
(
&
r
),
"GetClipCursor() failed
\n
"
);
ok
(
EqualRect
(
&
r
,
&
virt
),
"Invalid clip rect: (%d %d) x (%d %d)
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
/* This should always work. Primary monitor is at (0,0) */
SetRect
(
&
r1
,
10
,
10
,
20
,
20
);
ok
(
ClipCursor
(
&
r1
),
"ClipCursor() failed
\n
"
);
ok
(
GetClipCursor
(
&
r
),
"GetClipCursor() failed
\n
"
);
ok
(
EqualRect
(
&
r
,
&
r1
),
"Invalid clip rect: (%d %d) x (%d %d)
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
SetRect
(
&
r1
,
virt
.
left
-
10
,
virt
.
top
-
10
,
virt
.
right
+
20
,
virt
.
bottom
+
20
);
ok
(
ClipCursor
(
&
r1
),
"ClipCursor() failed
\n
"
);
ok
(
GetClipCursor
(
&
r
),
"GetClipCursor() failed
\n
"
);
ok
(
EqualRect
(
&
r
,
&
virt
),
"Invalid clip rect: (%d %d) x (%d %d)
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
}
}
res
=
ChangeDisplaySettingsEx
(
NULL
,
NULL
,
NULL
,
CDS_RESET
,
NULL
);
ok
(
res
==
DISP_CHANGE_SUCCESSFUL
,
"Failed to reset default resolution: %d
\n
"
,
res
);
...
...
dlls/winex11.drv/winpos.c
View file @
1d9ea46c
...
...
@@ -843,6 +843,7 @@ void X11DRV_handle_desktop_resize( unsigned int width, unsigned int height )
X11DRV_SetWindowPos
(
hwnd
,
0
,
&
virtual_screen_rect
,
&
virtual_screen_rect
,
SWP_NOZORDER
|
SWP_NOMOVE
,
NULL
);
data
->
lock_changes
--
;
ClipCursor
(
NULL
);
SendMessageTimeoutW
(
HWND_BROADCAST
,
WM_DISPLAYCHANGE
,
screen_depth
,
MAKELPARAM
(
width
,
height
),
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
...
...
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