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
77502e7e
Commit
77502e7e
authored
Jan 14, 2005
by
Jeremy White
Committed by
Alexandre Julliard
Jan 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix X11 event timing so that we correctly correlate X11 timing and
Wine timing and dynamically adjust it as we go.
parent
0de5671e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
22 deletions
+40
-22
event.c
dlls/x11drv/event.c
+34
-0
keyboard.c
dlls/x11drv/keyboard.c
+1
-1
mouse.c
dlls/x11drv/mouse.c
+1
-1
window.c
dlls/x11drv/window.c
+2
-1
wintab.c
dlls/x11drv/wintab.c
+1
-1
x11drv.h
dlls/x11drv/x11drv.h
+1
-2
x11drv_main.c
dlls/x11drv/x11drv_main.c
+0
-16
No files found.
dlls/x11drv/event.c
View file @
77502e7e
...
...
@@ -187,6 +187,40 @@ DWORD X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
return
ret
;
}
/***********************************************************************
* EVENT_x11_time_to_win32_time
*
* Make our timer and the X timer line up as best we can
* Pass 0 to retrieve the current adjustment value (times -1)
*/
DWORD
EVENT_x11_time_to_win32_time
(
Time
time
)
{
static
DWORD
adjust
=
0
;
DWORD
now
=
GetTickCount
();
DWORD
ret
;
if
(
!
adjust
&&
time
!=
0
)
{
ret
=
now
;
adjust
=
time
-
now
;
}
else
{
/* If we got an event in the 'future', then our clock is clearly wrong.
If we got it more than 10000 ms in the future, then it's most likely
that the clock has wrapped. */
ret
=
time
-
adjust
;
if
(
ret
>
now
&&
((
ret
-
now
)
<
10000
)
&&
time
!=
0
)
{
adjust
+=
ret
-
now
;
ret
-=
ret
-
now
;
}
}
return
ret
;
}
/***********************************************************************
* EVENT_ProcessEvent
...
...
dlls/x11drv/keyboard.c
View file @
77502e7e
...
...
@@ -1103,7 +1103,7 @@ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event )
DWORD
dwFlags
;
int
ascii_chars
;
XIC
xic
=
X11DRV_get_ic
(
hwnd
);
DWORD
event_time
=
event
->
time
-
X11DRV_server_startticks
;
DWORD
event_time
=
EVENT_x11_time_to_win32_time
(
event
->
time
)
;
Status
status
=
0
;
TRACE_
(
key
)(
"type %d, window %lx, state 0x%04x, keycode 0x%04x
\n
"
,
...
...
dlls/x11drv/mouse.c
View file @
77502e7e
...
...
@@ -141,7 +141,7 @@ static void send_mouse_event( HWND hwnd, DWORD flags, DWORD posX, DWORD posY,
input
.
u
.
mi
.
dy
=
posY
;
input
.
u
.
mi
.
mouseData
=
data
;
input
.
u
.
mi
.
dwFlags
=
flags
;
input
.
u
.
mi
.
time
=
time
-
X11DRV_server_startticks
;
input
.
u
.
mi
.
time
=
EVENT_x11_time_to_win32_time
(
time
)
;
input
.
u
.
mi
.
dwExtraInfo
=
(
ULONG_PTR
)
hwnd
;
SendInput
(
1
,
&
input
,
sizeof
(
input
)
);
}
...
...
dlls/x11drv/window.c
View file @
77502e7e
...
...
@@ -1317,7 +1317,8 @@ void X11DRV_SetFocus( HWND hwnd )
/* we must not use CurrentTime (ICCCM), so try to use last message time instead */
/* FIXME: this is not entirely correct */
XSetInputFocus
(
display
,
win
,
RevertToParent
,
/*CurrentTime*/
GetMessageTime
()
+
X11DRV_server_startticks
);
/* CurrentTime */
GetMessageTime
()
-
EVENT_x11_time_to_win32_time
(
0
));
if
(
X11DRV_PALETTE_PaletteFlags
&
X11DRV_PALETTE_PRIVATE
)
XInstallColormap
(
display
,
X11DRV_PALETTE_PaletteXColormap
);
}
...
...
dlls/x11drv/wintab.c
View file @
77502e7e
...
...
@@ -598,7 +598,7 @@ int X11DRV_ProcessTabletEvent(HWND hwnd, XEvent *event)
TRACE_
(
event
)(
"Received tablet motion event (%p)
\n
"
,
hwnd
);
TRACE
(
"Received tablet motion event (%p)
\n
"
,
hwnd
);
gMsgPacket
.
pkTime
=
motion
->
time
;
gMsgPacket
.
pkTime
=
EVENT_x11_time_to_win32_time
(
motion
->
time
)
;
gMsgPacket
.
pkSerialNumber
=
gSerial
++
;
gMsgPacket
.
pkCursor
=
motion
->
deviceid
;
gMsgPacket
.
pkX
=
motion
->
axis_data
[
0
];
...
...
dlls/x11drv/x11drv.h
View file @
77502e7e
...
...
@@ -110,8 +110,6 @@ extern Pixmap BITMAP_stock_pixmap; /* pixmap for the default stock bitmap */
#define BITMAP_GC(bmp) \
(((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
extern
unsigned
int
X11DRV_server_startticks
;
/* Wine driver X11 functions */
extern
BOOL
X11DRV_AlphaBlend
(
X11DRV_PDEVICE
*
physDevDst
,
INT
xDst
,
INT
yDst
,
...
...
@@ -504,6 +502,7 @@ extern INPUT_TYPE X11DRV_EVENT_SetInputMethod(INPUT_TYPE type);
void
X11DRV_EVENT_SetDGAStatus
(
HWND
hwnd
,
int
event_base
)
;
#endif
extern
DWORD
EVENT_x11_time_to_win32_time
(
Time
time
);
extern
int
X11DRV_ProcessTabletEvent
(
HWND
hwnd
,
XEvent
*
event
);
/* x11drv private window data */
...
...
dlls/x11drv/x11drv_main.c
View file @
77502e7e
...
...
@@ -98,8 +98,6 @@ int client_side_antialias_with_core = 1;
int
client_side_antialias_with_render
=
1
;
int
using_wine_desktop
=
0
;
unsigned
int
X11DRV_server_startticks
;
static
BOOL
synchronous
;
/* run in synchronous mode? */
static
BOOL
desktop_dbl_buf
=
TRUE
;
static
char
*
desktop_geometry
;
...
...
@@ -214,19 +212,6 @@ void wine_tsx11_unlock(void)
LeaveCriticalSection
(
&
X11DRV_CritSection
);
}
/***********************************************************************
* get_server_startup
*
* Get the server startup time
* Won't be exact, but should be sufficient
*/
static
void
get_server_startup
(
void
)
{
struct
timeval
t
;
gettimeofday
(
&
t
,
NULL
);
X11DRV_server_startticks
=
((
t
.
tv_sec
*
1000
)
+
(
t
.
tv_usec
/
1000
))
-
GetTickCount
();
}
/***********************************************************************
* get_config_key
...
...
@@ -341,7 +326,6 @@ static BOOL process_attach(void)
{
Display
*
display
;
get_server_startup
();
setup_options
();
/* Open 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