Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Münchhalfen
wine
Commits
720af28e
Commit
720af28e
authored
21 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Always ignore BadMatch errors resulting from XSetInputFocus so that we
don't need to wait for the reply.
parent
3f6cb0cc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/x11drv/event.c
+3
-16
3 additions, 16 deletions
dlls/x11drv/event.c
dlls/x11drv/x11drv_main.c
+32
-1
32 additions, 1 deletion
dlls/x11drv/x11drv_main.c
with
35 additions
and
17 deletions
dlls/x11drv/event.c
+
3
−
16
View file @
720af28e
...
...
@@ -381,17 +381,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
*/
...
...
@@ -409,12 +398,10 @@ static void set_focus( HWND hwnd, Time time )
if
(
win
)
{
Display
*
display
=
thread_display
();
TRACE
(
"setting focus to %p (%lx) time=%ld
\n
"
,
focus
,
win
,
time
);
X11DRV_expect_error
(
display
,
set_focus_error_handler
,
NULL
);
XSetInputFocus
(
display
,
win
,
RevertToParent
,
time
);
XSync
(
display
,
False
);
if
(
X11DRV_check_error
())
TRACE
(
"got BadMatch, ignoring
\n
"
);
wine_tsx11_lock
();
XSetInputFocus
(
thread_display
(),
win
,
RevertToParent
,
time
);
wine_tsx11_unlock
();
}
}
...
...
This diff is collapsed.
Click to expand it.
dlls/x11drv/x11drv_main.c
+
32
−
1
View file @
720af28e
...
...
@@ -38,6 +38,18 @@
#include
<X11/XKBlib.h>
#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
"winbase.h"
#include
"wine/winbase16.h"
...
...
@@ -99,6 +111,18 @@ static int (*old_error_handler)( Display *, XErrorEvent * );
#define IS_OPTION_FALSE(ch) \
((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
*
...
...
@@ -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
)))
{
TRACE
(
"got expected error
\n
"
);
TRACE
(
"got expected error %d req %d
\n
"
,
error_evt
->
error_code
,
error_evt
->
request_code
);
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 */
old_error_handler
(
display
,
error_evt
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment