Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a8575a8b
Commit
a8575a8b
authored
Apr 12, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add infrastructure for managing the extra data of generic extension events.
parent
e5c3883c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
12 deletions
+59
-12
configure
configure
+12
-0
configure.ac
configure.ac
+1
-1
event.c
dlls/winex11.drv/event.c
+26
-6
x11drv.h
dlls/winex11.drv/x11drv.h
+3
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+13
-0
xrandr.c
dlls/winex11.drv/xrandr.c
+1
-3
xrender.c
dlls/winex11.drv/xrender.c
+0
-2
config.h.in
include/config.h.in
+3
-0
No files found.
configure
View file @
a8575a8b
...
@@ -8733,6 +8733,18 @@ _ACEOF
...
@@ -8733,6 +8733,18 @@ _ACEOF
fi
fi
ac_fn_c_check_member
"
$LINENO
"
"XEvent"
"xcookie"
"ac_cv_member_XEvent_xcookie"
"#ifdef HAVE_X11_XLIB_H
#include <X11/Xlib.h>
#endif
"
if
test
"x
$ac_cv_member_XEvent_xcookie
"
=
x
""
yes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_XEVENT_XCOOKIE 1
_ACEOF
fi
...
...
configure.ac
View file @
a8575a8b
...
@@ -1045,7 +1045,7 @@ then
...
@@ -1045,7 +1045,7 @@ then
[libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported.])
[libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported.])
dnl *** Check for XICCallback struct
dnl *** Check for XICCallback struct
AC_CHECK_MEMBERS([XICCallback.callback],,,
AC_CHECK_MEMBERS([XICCallback.callback
, XEvent.xcookie
],,,
[#ifdef HAVE_X11_XLIB_H
[#ifdef HAVE_X11_XLIB_H
#include <X11/Xlib.h>
#include <X11/Xlib.h>
#endif])
#endif])
...
...
dlls/winex11.drv/event.c
View file @
a8575a8b
...
@@ -86,6 +86,9 @@ extern BOOL ximInComposeMode;
...
@@ -86,6 +86,9 @@ extern BOOL ximInComposeMode;
#define XEMBED_UNREGISTER_ACCELERATOR 13
#define XEMBED_UNREGISTER_ACCELERATOR 13
#define XEMBED_ACTIVATE_ACCELERATOR 14
#define XEMBED_ACTIVATE_ACCELERATOR 14
Bool
(
*
pXGetEventData
)(
Display
*
display
,
XEvent
/*XGenericEventCookie*/
*
event
)
=
NULL
;
void
(
*
pXFreeEventData
)(
Display
*
display
,
XEvent
/*XGenericEventCookie*/
*
event
)
=
NULL
;
/* Event handlers */
/* Event handlers */
static
void
X11DRV_FocusIn
(
HWND
hwnd
,
XEvent
*
event
);
static
void
X11DRV_FocusIn
(
HWND
hwnd
,
XEvent
*
event
);
static
void
X11DRV_FocusOut
(
HWND
hwnd
,
XEvent
*
event
);
static
void
X11DRV_FocusOut
(
HWND
hwnd
,
XEvent
*
event
);
...
@@ -140,8 +143,6 @@ static x11drv_event_handler handlers[MAX_EVENT_HANDLERS] =
...
@@ -140,8 +143,6 @@ static x11drv_event_handler handlers[MAX_EVENT_HANDLERS] =
NULL
/* 35 GenericEvent */
NULL
/* 35 GenericEvent */
};
};
static
const
char
*
event_names
[
MAX_EVENT_HANDLERS
]
=
static
const
char
*
event_names
[
MAX_EVENT_HANDLERS
]
=
{
{
NULL
,
NULL
,
"KeyPress"
,
"KeyRelease"
,
"ButtonPress"
,
"ButtonRelease"
,
NULL
,
NULL
,
"KeyPress"
,
"KeyRelease"
,
"ButtonPress"
,
"ButtonRelease"
,
...
@@ -152,13 +153,29 @@ static const char * event_names[MAX_EVENT_HANDLERS] =
...
@@ -152,13 +153,29 @@ static const char * event_names[MAX_EVENT_HANDLERS] =
"CirculateNotify"
,
"CirculateRequest"
,
"PropertyNotify"
,
"SelectionClear"
,
"SelectionRequest"
,
"CirculateNotify"
,
"CirculateRequest"
,
"PropertyNotify"
,
"SelectionClear"
,
"SelectionRequest"
,
"SelectionNotify"
,
"ColormapNotify"
,
"ClientMessage"
,
"MappingNotify"
,
"GenericEvent"
"SelectionNotify"
,
"ColormapNotify"
,
"ClientMessage"
,
"MappingNotify"
,
"GenericEvent"
};
};
/* return the name of an X event */
/* return the name of an X event */
static
const
char
*
dbgstr_event
(
int
type
)
static
const
char
*
dbgstr_event
(
int
type
)
{
{
if
(
type
<
MAX_EVENT_HANDLERS
&&
event_names
[
type
])
return
event_names
[
type
-
KeyPress
];
if
(
type
<
MAX_EVENT_HANDLERS
&&
event_names
[
type
])
return
event_names
[
type
];
return
wine_dbg_sprintf
(
"Unknown event %d"
,
type
);
return
wine_dbg_sprintf
(
"Unknown event %d"
,
type
);
}
}
static
inline
void
get_event_data
(
XEvent
*
event
)
{
#if defined(GenericEvent) && defined(HAVE_XEVENT_XCOOKIE)
if
(
event
->
xany
.
type
!=
GenericEvent
)
return
;
if
(
!
pXGetEventData
||
!
pXGetEventData
(
event
->
xany
.
display
,
event
))
event
->
xcookie
.
data
=
NULL
;
#endif
}
static
inline
void
free_event_data
(
XEvent
*
event
)
{
#if defined(GenericEvent) && defined(HAVE_XEVENT_XCOOKIE)
if
(
event
->
xany
.
type
!=
GenericEvent
)
return
;
if
(
event
->
xcookie
.
data
)
pXFreeEventData
(
event
->
xany
.
display
,
event
);
#endif
}
/***********************************************************************
/***********************************************************************
* X11DRV_register_event_handler
* X11DRV_register_event_handler
...
@@ -333,22 +350,25 @@ static int process_events( Display *display, Bool (*filter)(Display*, XEvent*,XP
...
@@ -333,22 +350,25 @@ static int process_events( Display *display, Bool (*filter)(Display*, XEvent*,XP
else
else
continue
;
/* filtered, ignore it */
continue
;
/* filtered, ignore it */
}
}
get_event_data
(
&
event
);
if
(
prev_event
.
type
)
action
=
merge_events
(
&
prev_event
,
&
event
);
if
(
prev_event
.
type
)
action
=
merge_events
(
&
prev_event
,
&
event
);
switch
(
action
)
switch
(
action
)
{
{
case
MERGE_DISCARD
:
/* discard prev, keep new */
prev_event
=
event
;
break
;
case
MERGE_HANDLE
:
/* handle prev, keep new */
case
MERGE_HANDLE
:
/* handle prev, keep new */
call_event_handler
(
display
,
&
prev_event
);
call_event_handler
(
display
,
&
prev_event
);
/* fall through */
case
MERGE_DISCARD
:
/* discard prev, keep new */
free_event_data
(
&
prev_event
);
prev_event
=
event
;
prev_event
=
event
;
break
;
break
;
case
MERGE_KEEP
:
/* handle new, keep prev for future merging */
case
MERGE_KEEP
:
/* handle new, keep prev for future merging */
call_event_handler
(
display
,
&
event
);
call_event_handler
(
display
,
&
event
);
free_event_data
(
&
event
);
break
;
break
;
}
}
}
}
if
(
prev_event
.
type
)
call_event_handler
(
display
,
&
prev_event
);
if
(
prev_event
.
type
)
call_event_handler
(
display
,
&
prev_event
);
free_event_data
(
&
prev_event
);
XFlush
(
gdi_display
);
XFlush
(
gdi_display
);
wine_tsx11_unlock
();
wine_tsx11_unlock
();
if
(
count
)
TRACE
(
"processed %d events
\n
"
,
count
);
if
(
count
)
TRACE
(
"processed %d events
\n
"
,
count
);
...
...
dlls/winex11.drv/x11drv.h
View file @
a8575a8b
...
@@ -729,6 +729,9 @@ extern void X11DRV_SelectionRequest( HWND hWnd, XEvent *event );
...
@@ -729,6 +729,9 @@ extern void X11DRV_SelectionRequest( HWND hWnd, XEvent *event );
extern
void
X11DRV_SelectionClear
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_SelectionClear
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_MappingNotify
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_MappingNotify
(
HWND
hWnd
,
XEvent
*
event
);
extern
Bool
(
*
pXGetEventData
)(
Display
*
display
,
XEvent
/*XGenericEventCookie*/
*
event
);
extern
void
(
*
pXFreeEventData
)(
Display
*
display
,
XEvent
/*XGenericEventCookie*/
*
event
);
extern
DWORD
EVENT_x11_time_to_win32_time
(
Time
time
);
extern
DWORD
EVENT_x11_time_to_win32_time
(
Time
time
);
/* X11 driver private messages, must be in the range 0x80001000..0x80001fff */
/* X11 driver private messages, must be in the range 0x80001000..0x80001fff */
...
...
dlls/winex11.drv/x11drv_main.c
View file @
a8575a8b
...
@@ -529,7 +529,20 @@ sym_not_found:
...
@@ -529,7 +529,20 @@ sym_not_found:
*/
*/
static
BOOL
process_attach
(
void
)
static
BOOL
process_attach
(
void
)
{
{
char
error
[
1024
];
Display
*
display
;
Display
*
display
;
void
*
libx11
=
wine_dlopen
(
SONAME_LIBX11
,
RTLD_NOW
|
RTLD_GLOBAL
,
error
,
sizeof
(
error
)
);
if
(
!
libx11
)
{
ERR
(
"failed to load %s: %s
\n
"
,
SONAME_LIBX11
,
error
);
return
FALSE
;
}
pXGetEventData
=
wine_dlsym
(
libx11
,
"XGetEventData"
,
NULL
,
0
);
pXFreeEventData
=
wine_dlsym
(
libx11
,
"XFreeEventData"
,
NULL
,
0
);
#ifdef SONAME_LIBXEXT
wine_dlopen
(
SONAME_LIBXEXT
,
RTLD_NOW
|
RTLD_GLOBAL
,
NULL
,
0
);
#endif
setup_options
();
setup_options
();
...
...
dlls/winex11.drv/xrandr.c
View file @
a8575a8b
...
@@ -71,9 +71,7 @@ static int load_xrandr(void)
...
@@ -71,9 +71,7 @@ static int load_xrandr(void)
{
{
int
r
=
0
;
int
r
=
0
;
if
(
wine_dlopen
(
SONAME_LIBX11
,
RTLD_NOW
|
RTLD_GLOBAL
,
NULL
,
0
)
&&
if
(
wine_dlopen
(
SONAME_LIBXRENDER
,
RTLD_NOW
|
RTLD_GLOBAL
,
NULL
,
0
)
&&
wine_dlopen
(
SONAME_LIBXEXT
,
RTLD_NOW
|
RTLD_GLOBAL
,
NULL
,
0
)
&&
wine_dlopen
(
SONAME_LIBXRENDER
,
RTLD_NOW
|
RTLD_GLOBAL
,
NULL
,
0
)
&&
(
xrandr_handle
=
wine_dlopen
(
SONAME_LIBXRANDR
,
RTLD_NOW
,
NULL
,
0
)))
(
xrandr_handle
=
wine_dlopen
(
SONAME_LIBXRANDR
,
RTLD_NOW
,
NULL
,
0
)))
{
{
...
...
dlls/winex11.drv/xrender.c
View file @
a8575a8b
...
@@ -346,8 +346,6 @@ void X11DRV_XRender_Init(void)
...
@@ -346,8 +346,6 @@ void X11DRV_XRender_Init(void)
int
event_base
,
i
;
int
event_base
,
i
;
if
(
client_side_with_render
&&
if
(
client_side_with_render
&&
wine_dlopen
(
SONAME_LIBX11
,
RTLD_NOW
|
RTLD_GLOBAL
,
NULL
,
0
)
&&
wine_dlopen
(
SONAME_LIBXEXT
,
RTLD_NOW
|
RTLD_GLOBAL
,
NULL
,
0
)
&&
(
xrender_handle
=
wine_dlopen
(
SONAME_LIBXRENDER
,
RTLD_NOW
,
NULL
,
0
)))
(
xrender_handle
=
wine_dlopen
(
SONAME_LIBXRENDER
,
RTLD_NOW
,
NULL
,
0
)))
{
{
...
...
include/config.h.in
View file @
a8575a8b
...
@@ -1118,6 +1118,9 @@
...
@@ -1118,6 +1118,9 @@
/* Define to 1 if you have the <X11/Xutil.h> header file. */
/* Define to 1 if you have the <X11/Xutil.h> header file. */
#undef HAVE_X11_XUTIL_H
#undef HAVE_X11_XUTIL_H
/* Define to 1 if `xcookie' is a member of `XEvent'. */
#undef HAVE_XEVENT_XCOOKIE
/* Define to 1 if `callback' is a member of `XICCallback'. */
/* Define to 1 if `callback' is a member of `XICCallback'. */
#undef HAVE_XICCALLBACK_CALLBACK
#undef HAVE_XICCALLBACK_CALLBACK
...
...
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