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
720af28e
Commit
720af28e
authored
Nov 21, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always ignore BadMatch errors resulting from XSetInputFocus so that we
don't need to wait for the reply.
parent
3f6cb0cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
17 deletions
+35
-17
event.c
dlls/x11drv/event.c
+3
-16
x11drv_main.c
dlls/x11drv/x11drv_main.c
+32
-1
No files found.
dlls/x11drv/event.c
View file @
720af28e
...
@@ -382,17 +382,6 @@ inline static BOOL can_activate_window( HWND hwnd )
...
@@ -382,17 +382,6 @@ inline static BOOL can_activate_window( HWND hwnd )
/**********************************************************************
/**********************************************************************
* set_focus_error_handler
*
* Handler for X errors happening during XSetInputFocus call.
*/
static
int
set_focus_error_handler
(
Display
*
display
,
XErrorEvent
*
event
,
void
*
arg
)
{
return
(
event
->
error_code
==
BadMatch
);
}
/**********************************************************************
* set_focus
* set_focus
*/
*/
static
void
set_focus
(
HWND
hwnd
,
Time
time
)
static
void
set_focus
(
HWND
hwnd
,
Time
time
)
...
@@ -409,12 +398,10 @@ static void set_focus( HWND hwnd, Time time )
...
@@ -409,12 +398,10 @@ static void set_focus( HWND hwnd, Time time )
if
(
win
)
if
(
win
)
{
{
Display
*
display
=
thread_display
();
TRACE
(
"setting focus to %p (%lx) time=%ld
\n
"
,
focus
,
win
,
time
);
TRACE
(
"setting focus to %p (%lx) time=%ld
\n
"
,
focus
,
win
,
time
);
X11DRV_expect_error
(
display
,
set_focus_error_handler
,
NULL
);
wine_tsx11_lock
();
XSetInputFocus
(
display
,
win
,
RevertToParent
,
time
);
XSetInputFocus
(
thread_display
(),
win
,
RevertToParent
,
time
);
XSync
(
display
,
False
);
wine_tsx11_unlock
();
if
(
X11DRV_check_error
())
TRACE
(
"got BadMatch, ignoring
\n
"
);
}
}
}
}
...
...
dlls/x11drv/x11drv_main.c
View file @
720af28e
...
@@ -38,6 +38,18 @@
...
@@ -38,6 +38,18 @@
#include <X11/XKBlib.h>
#include <X11/XKBlib.h>
#endif
#endif
#define BOOL X_BOOL
#define BYTE X_BYTE
#define INT8 X_INT8
#define INT16 X_INT16
#define INT32 X_INT32
#include <X11/Xproto.h>
#undef BOOL
#undef BYTE
#undef INT8
#undef INT16
#undef INT32
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "wine/winbase16.h"
#include "wine/winbase16.h"
...
@@ -100,6 +112,18 @@ static int (*old_error_handler)( Display *, XErrorEvent * );
...
@@ -100,6 +112,18 @@ static int (*old_error_handler)( Display *, XErrorEvent * );
((ch) == 'n' || (ch) == 'N' || (ch) == 'f' || (ch) == 'F' || (ch) == '0')
((ch) == 'n' || (ch) == 'N' || (ch) == 'f' || (ch) == 'F' || (ch) == '0')
/***********************************************************************
/***********************************************************************
* ignore_error
*
* Check if the X error is one we can ignore.
*/
static
inline
BOOL
ignore_error
(
Display
*
display
,
XErrorEvent
*
event
)
{
if
(
event
->
request_code
==
X_SetInputFocus
&&
event
->
error_code
==
BadMatch
)
return
TRUE
;
return
FALSE
;
}
/***********************************************************************
* X11DRV_expect_error
* X11DRV_expect_error
*
*
* Setup a callback function that will be called on an X error. The
* Setup a callback function that will be called on an X error. The
...
@@ -145,10 +169,17 @@ static int error_handler( Display *display, XErrorEvent *error_evt )
...
@@ -145,10 +169,17 @@ static int error_handler( Display *display, XErrorEvent *error_evt )
{
{
if
((
err_callback_result
=
err_callback
(
display
,
error_evt
,
err_callback_arg
)))
if
((
err_callback_result
=
err_callback
(
display
,
error_evt
,
err_callback_arg
)))
{
{
TRACE
(
"got expected error
\n
"
);
TRACE
(
"got expected error %d req %d
\n
"
,
error_evt
->
error_code
,
error_evt
->
request_code
);
return
0
;
return
0
;
}
}
}
}
if
(
ignore_error
(
display
,
error_evt
))
{
TRACE
(
"got ignored error %d req %d
\n
"
,
error_evt
->
error_code
,
error_evt
->
request_code
);
return
0
;
}
if
(
synchronous
)
DebugBreak
();
/* force an entry in the debugger */
if
(
synchronous
)
DebugBreak
();
/* force an entry in the debugger */
old_error_handler
(
display
,
error_evt
);
old_error_handler
(
display
,
error_evt
);
return
0
;
return
0
;
...
...
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