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
6551553f
Commit
6551553f
authored
Apr 28, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Make the cursor window global instead of per-thread, and send it a…
winex11: Make the cursor window global instead of per-thread, and send it a message when the cursor changes.
parent
ce3c1dfc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
28 deletions
+37
-28
cursoricon.c
dlls/user32/tests/cursoricon.c
+6
-9
mouse.c
dlls/winex11.drv/mouse.c
+25
-17
window.c
dlls/winex11.drv/window.c
+3
-0
x11drv.h
dlls/winex11.drv/x11drv.h
+3
-2
No files found.
dlls/user32/tests/cursoricon.c
View file @
6551553f
...
...
@@ -1639,13 +1639,12 @@ static void test_DestroyCursor(void)
* ERROR_INVALID_CURSOR_HANDLE. This happens because we called
* DestroyCursor() 2+ times after calling SetCursor(). The calls to
* GetCursor() and SetCursor(NULL) in between make no difference. */
SetLastError
(
0xdeadbeef
);
ret
=
DestroyCursor
(
cursor
);
todo_wine
{
ok
(
!
ret
,
"DestroyCursor succeeded.
\n
"
);
error
=
GetLastError
();
ok
(
error
==
ERROR_INVALID_CURSOR_HANDLE
||
error
==
0xdeadbeef
,
/* vista */
"Last error: 0x%08x
\n
"
,
error
);
}
todo_wine
ok
(
!
ret
,
"DestroyCursor succeeded.
\n
"
);
error
=
GetLastError
();
ok
(
error
==
ERROR_INVALID_CURSOR_HANDLE
||
error
==
0xdeadbeef
,
/* vista */
"Last error: 0x%08x
\n
"
,
error
);
}
DeleteObject
(
cursorInfo
.
hbmMask
);
...
...
@@ -1664,9 +1663,7 @@ static void test_DestroyCursor(void)
SetLastError
(
0xdeadbeef
);
SetCursor
(
cursor
);
error
=
GetLastError
();
todo_wine
{
ok
(
error
==
0xdeadbeef
,
"Last error: 0x%08x
\n
"
,
error
);
}
ok
(
error
==
0xdeadbeef
,
"Last error: 0x%08x
\n
"
,
error
);
/* Check if LoadCursor() returns the same handle with the same icon. */
cursor2
=
LoadCursor
(
NULL
,
IDC_ARROW
);
...
...
dlls/winex11.drv/mouse.c
View file @
6551553f
...
...
@@ -86,6 +86,7 @@ static const UINT button_up_flags[NB_BUTTONS] =
};
POINT
cursor_pos
;
static
HWND
cursor_window
;
static
DWORD
last_time_modified
;
static
RECT
cursor_clip
;
/* Cursor clipping rect */
static
XContext
cursor_context
;
...
...
@@ -206,6 +207,28 @@ Cursor get_x11_cursor( HCURSOR handle )
}
/***********************************************************************
* set_window_cursor
*/
void
set_window_cursor
(
HWND
hwnd
,
HCURSOR
handle
)
{
struct
x11drv_win_data
*
data
;
Cursor
cursor
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
;
wine_tsx11_lock
();
if
((
cursor
=
get_x11_cursor
(
handle
)))
{
TRACE
(
"%p xid %lx
\n
"
,
handle
,
cursor
);
XDefineCursor
(
gdi_display
,
data
->
whole_window
,
cursor
);
/* Make the change take effect immediately */
XFlush
(
gdi_display
);
data
->
cursor
=
handle
;
}
wine_tsx11_unlock
();
}
/***********************************************************************
* update_mouse_state
*
* Update the various window states on a mouse event.
...
...
@@ -216,7 +239,7 @@ static void update_mouse_state( HWND hwnd, Window window, int x, int y, unsigned
get_coords
(
hwnd
,
window
,
x
,
y
,
pt
);
data
->
cursor_window
=
hwnd
;
cursor_window
=
hwnd
;
/* update the wine server Z-order */
...
...
@@ -1012,22 +1035,7 @@ void CDECL X11DRV_DestroyCursorIcon( HCURSOR handle )
*/
void
CDECL
X11DRV_SetCursor
(
HCURSOR
handle
)
{
struct
x11drv_thread_data
*
thread_data
=
x11drv_init_thread_data
();
struct
x11drv_win_data
*
data
;
Cursor
cursor
;
if
(
!
(
data
=
X11DRV_get_win_data
(
thread_data
->
cursor_window
)))
return
;
wine_tsx11_lock
();
if
((
cursor
=
get_x11_cursor
(
handle
)))
{
TRACE
(
"%p xid %lx
\n
"
,
handle
,
cursor
);
XDefineCursor
(
gdi_display
,
data
->
whole_window
,
cursor
);
/* Make the change take effect immediately */
XFlush
(
gdi_display
);
data
->
cursor
=
handle
;
}
wine_tsx11_unlock
();
if
(
cursor_window
)
SendNotifyMessageW
(
cursor_window
,
WM_X11DRV_SET_CURSOR
,
0
,
(
LPARAM
)
handle
);
}
/***********************************************************************
...
...
dlls/winex11.drv/window.c
View file @
6551553f
...
...
@@ -2493,6 +2493,9 @@ LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
case
WM_X11DRV_RESIZE_DESKTOP
:
X11DRV_resize_desktop
(
LOWORD
(
lp
),
HIWORD
(
lp
)
);
return
0
;
case
WM_X11DRV_SET_CURSOR
:
set_window_cursor
(
hwnd
,
(
HCURSOR
)
lp
);
return
0
;
default:
FIXME
(
"got window msg %x hwnd %p wp %lx lp %lx
\n
"
,
msg
,
hwnd
,
wp
,
lp
);
return
0
;
...
...
dlls/winex11.drv/x11drv.h
View file @
6551553f
...
...
@@ -546,7 +546,6 @@ struct x11drv_thread_data
{
Display
*
display
;
XEvent
*
current_event
;
/* event currently being processed */
HWND
cursor_window
;
/* current window that contains the cursor */
Window
grab_window
;
/* window that currently grabs the mouse */
HWND
last_focus
;
/* last window that had focus */
XIM
xim
;
/* input method */
...
...
@@ -714,7 +713,8 @@ enum x11drv_window_messages
WM_X11DRV_ACQUIRE_SELECTION
=
0x80001000
,
WM_X11DRV_SET_WIN_FORMAT
,
WM_X11DRV_SET_WIN_REGION
,
WM_X11DRV_RESIZE_DESKTOP
WM_X11DRV_RESIZE_DESKTOP
,
WM_X11DRV_SET_CURSOR
};
/* _NET_WM_STATE properties that we keep track of */
...
...
@@ -782,6 +782,7 @@ extern void X11DRV_Clipboard_Cleanup(void);
extern
void
X11DRV_ResetSelectionOwner
(
void
);
extern
void
CDECL
X11DRV_SetFocus
(
HWND
hwnd
);
extern
Cursor
get_x11_cursor
(
HCURSOR
handle
);
extern
void
set_window_cursor
(
HWND
hwnd
,
HCURSOR
handle
);
extern
BOOL
CDECL
X11DRV_ClipCursor
(
LPCRECT
clip
);
extern
void
X11DRV_InitKeyboard
(
Display
*
display
);
extern
void
X11DRV_send_keyboard_input
(
WORD
wVk
,
WORD
wScan
,
DWORD
dwFlags
,
DWORD
time
,
...
...
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