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
886ae4c3
Commit
886ae4c3
authored
Apr 04, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Always forward SetCursor to the driver, and limit the frequency of…
winex11: Always forward SetCursor to the driver, and limit the frequency of updates on the driver side.
parent
4d358bfe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
14 deletions
+24
-14
cursoricon.c
dlls/user32/cursoricon.c
+1
-3
mouse.c
dlls/winex11.drv/mouse.c
+17
-9
window.c
dlls/winex11.drv/window.c
+5
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-1
No files found.
dlls/user32/cursoricon.c
View file @
886ae4c3
...
...
@@ -1651,9 +1651,7 @@ HCURSOR WINAPI DECLSPEC_HOTPATCH SetCursor( HCURSOR hCursor /* [in] Handle of cu
SERVER_END_REQ
;
if
(
!
ret
)
return
0
;
/* Change the cursor shape only if it is visible */
if
(
show_count
>=
0
&&
hOldCursor
!=
hCursor
)
USER_Driver
->
pSetCursor
(
hCursor
);
USER_Driver
->
pSetCursor
(
show_count
>=
0
?
hCursor
:
0
);
if
(
!
(
obj
=
get_icon_ptr
(
hOldCursor
)))
return
0
;
release_icon_ptr
(
hOldCursor
,
obj
);
...
...
dlls/winex11.drv/mouse.c
View file @
886ae4c3
...
...
@@ -93,7 +93,8 @@ static const UINT button_up_flags[NB_BUTTONS] =
};
static
HWND
cursor_window
;
static
DWORD
last_time_modified
;
static
HCURSOR
last_cursor
;
static
DWORD
last_cursor_change
;
static
XContext
cursor_context
;
static
RECT
clip_rect
;
static
Cursor
create_cursor
(
HANDLE
handle
);
...
...
@@ -157,7 +158,7 @@ static Cursor get_empty_cursor(void)
/***********************************************************************
* set_window_cursor
*/
void
set_window_cursor
(
struct
x11drv_win_data
*
data
,
HCURSOR
handle
)
void
set_window_cursor
(
Window
window
,
HCURSOR
handle
)
{
Cursor
cursor
,
prev
;
...
...
@@ -184,10 +185,9 @@ void set_window_cursor( struct x11drv_win_data *data, HCURSOR handle )
}
}
XDefineCursor
(
gdi_display
,
data
->
whole_
window
,
cursor
);
XDefineCursor
(
gdi_display
,
window
,
cursor
);
/* make the change take effect immediately */
XFlush
(
gdi_display
);
data
->
cursor
=
handle
;
wine_tsx11_unlock
();
}
...
...
@@ -206,7 +206,11 @@ void sync_window_cursor( struct x11drv_win_data *data )
}
SERVER_END_REQ
;
if
(
data
->
cursor
!=
cursor
)
set_window_cursor
(
data
,
cursor
);
if
(
data
->
cursor
!=
cursor
)
{
data
->
cursor
=
cursor
;
set_window_cursor
(
data
->
whole_window
,
cursor
);
}
}
/***********************************************************************
...
...
@@ -247,12 +251,11 @@ static void send_mouse_input( HWND hwnd, UINT flags, Window window, int x, int y
MapWindowPoints
(
hwnd
,
0
,
&
pt
,
1
);
if
(
InterlockedExchangePointer
(
(
void
**
)
&
cursor_window
,
hwnd
)
!=
hwnd
||
GetTickCount
()
-
last_
time_modified
>
100
)
GetTickCount
()
-
last_
cursor_change
>
100
)
{
cursor_window
=
hwnd
;
sync_window_cursor
(
data
);
last_cursor_change
=
GetTickCount
();
}
last_time_modified
=
GetTickCount
();
if
(
hwnd
!=
GetDesktopWindow
())
hwnd
=
GetAncestor
(
hwnd
,
GA_ROOT
);
...
...
@@ -877,7 +880,12 @@ void CDECL X11DRV_DestroyCursorIcon( HCURSOR handle )
*/
void
CDECL
X11DRV_SetCursor
(
HCURSOR
handle
)
{
if
(
cursor_window
)
SendNotifyMessageW
(
cursor_window
,
WM_X11DRV_SET_CURSOR
,
0
,
(
LPARAM
)
handle
);
if
(
InterlockedExchangePointer
(
(
void
**
)
&
last_cursor
,
handle
)
!=
handle
||
GetTickCount
()
-
last_cursor_change
>
100
)
{
last_cursor_change
=
GetTickCount
();
if
(
cursor_window
)
SendNotifyMessageW
(
cursor_window
,
WM_X11DRV_SET_CURSOR
,
0
,
(
LPARAM
)
handle
);
}
}
/***********************************************************************
...
...
dlls/winex11.drv/window.c
View file @
886ae4c3
...
...
@@ -2699,7 +2699,11 @@ LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
X11DRV_resize_desktop
(
LOWORD
(
lp
),
HIWORD
(
lp
)
);
return
0
;
case
WM_X11DRV_SET_CURSOR
:
if
((
data
=
X11DRV_get_win_data
(
hwnd
)))
set_window_cursor
(
data
,
(
HCURSOR
)
lp
);
if
((
data
=
X11DRV_get_win_data
(
hwnd
))
&&
data
->
whole_window
)
{
data
->
cursor
=
(
HCURSOR
)
lp
;
set_window_cursor
(
data
->
whole_window
,
data
->
cursor
);
}
return
0
;
default:
FIXME
(
"got window msg %x hwnd %p wp %lx lp %lx
\n
"
,
msg
,
hwnd
,
wp
,
lp
);
...
...
dlls/winex11.drv/x11drv.h
View file @
886ae4c3
...
...
@@ -820,7 +820,7 @@ extern int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow);
extern
void
X11DRV_Clipboard_Cleanup
(
void
);
extern
void
X11DRV_ResetSelectionOwner
(
void
);
extern
void
CDECL
X11DRV_SetFocus
(
HWND
hwnd
);
extern
void
set_window_cursor
(
struct
x11drv_win_data
*
data
,
HCURSOR
handle
);
extern
void
set_window_cursor
(
Window
window
,
HCURSOR
handle
);
extern
void
sync_window_cursor
(
struct
x11drv_win_data
*
data
);
extern
BOOL
CDECL
X11DRV_ClipCursor
(
LPCRECT
clip
);
extern
void
X11DRV_InitKeyboard
(
Display
*
display
);
...
...
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