mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Adds show cursor on mouse move + hide after 200ms.
This commit is contained in:
parent
5b765f02bd
commit
2ffcb874bb
@ -1,6 +1,7 @@
|
|||||||
User johns
|
User johns
|
||||||
Date:
|
Date:
|
||||||
|
|
||||||
|
Adds show cursor on pointer move and hide after 200ms.
|
||||||
Adds Hot-key support for auto-crop enable/disable/toggle.
|
Adds Hot-key support for auto-crop enable/disable/toggle.
|
||||||
Adds detached start mode.
|
Adds detached start mode.
|
||||||
Fix bug: VDPAU looses preemption callback.
|
Fix bug: VDPAU looses preemption callback.
|
||||||
|
20
video.c
20
video.c
@ -284,6 +284,7 @@ static Display *XlibDisplay; ///< Xlib X11 display
|
|||||||
static xcb_connection_t *Connection; ///< xcb connection
|
static xcb_connection_t *Connection; ///< xcb connection
|
||||||
static xcb_colormap_t VideoColormap; ///< video colormap
|
static xcb_colormap_t VideoColormap; ///< video colormap
|
||||||
static xcb_window_t VideoWindow; ///< video window
|
static xcb_window_t VideoWindow; ///< video window
|
||||||
|
static uint32_t VideoBlankTick; ///< blank cursor timer
|
||||||
static xcb_cursor_t VideoBlankCursor; ///< empty invisible cursor
|
static xcb_cursor_t VideoBlankCursor; ///< empty invisible cursor
|
||||||
|
|
||||||
static int VideoWindowX; ///< video output window x coordinate
|
static int VideoWindowX; ///< video output window x coordinate
|
||||||
@ -8692,6 +8693,7 @@ static void VideoEvent(void)
|
|||||||
XEvent event;
|
XEvent event;
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
uint32_t values[1];
|
||||||
|
|
||||||
XNextEvent(XlibDisplay, &event);
|
XNextEvent(XlibDisplay, &event);
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
@ -8708,6 +8710,7 @@ static void VideoEvent(void)
|
|||||||
// µwm workaround
|
// µwm workaround
|
||||||
xcb_change_window_attributes(Connection, VideoWindow,
|
xcb_change_window_attributes(Connection, VideoWindow,
|
||||||
XCB_CW_CURSOR, &VideoBlankCursor);
|
XCB_CW_CURSOR, &VideoBlankCursor);
|
||||||
|
VideoBlankTick = 0;
|
||||||
break;
|
break;
|
||||||
case Expose:
|
case Expose:
|
||||||
//Debug(3, "video/event: Expose\n");
|
//Debug(3, "video/event: Expose\n");
|
||||||
@ -8734,6 +8737,12 @@ static void VideoEvent(void)
|
|||||||
break;
|
break;
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
break;
|
break;
|
||||||
|
case MotionNotify:
|
||||||
|
values[0] = XCB_NONE;
|
||||||
|
xcb_change_window_attributes(Connection, VideoWindow,
|
||||||
|
XCB_CW_CURSOR, values);
|
||||||
|
VideoBlankTick = GetMsTicks();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
#if 0
|
#if 0
|
||||||
if (XShmGetEventBase(XlibDisplay) + ShmCompletion == event.type) {
|
if (XShmGetEventBase(XlibDisplay) + ShmCompletion == event.type) {
|
||||||
@ -8750,6 +8759,13 @@ static void VideoEvent(void)
|
|||||||
///
|
///
|
||||||
void VideoPollEvent(void)
|
void VideoPollEvent(void)
|
||||||
{
|
{
|
||||||
|
// hide cursor, after xx ms
|
||||||
|
if (VideoBlankTick && VideoWindow != XCB_NONE
|
||||||
|
&& VideoBlankTick + 200 < GetMsTicks()) {
|
||||||
|
xcb_change_window_attributes(Connection, VideoWindow, XCB_CW_CURSOR,
|
||||||
|
&VideoBlankCursor);
|
||||||
|
VideoBlankTick = 0;
|
||||||
|
}
|
||||||
while (XlibDisplay && XPending(XlibDisplay)) {
|
while (XlibDisplay && XPending(XlibDisplay)) {
|
||||||
VideoEvent();
|
VideoEvent();
|
||||||
}
|
}
|
||||||
@ -9400,7 +9416,8 @@ static void VideoCreateWindow(xcb_window_t parent, xcb_visualid_t visual,
|
|||||||
values[2] =
|
values[2] =
|
||||||
XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
|
XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE |
|
||||||
XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE |
|
XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE |
|
||||||
XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY;
|
XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE |
|
||||||
|
XCB_EVENT_MASK_STRUCTURE_NOTIFY;
|
||||||
values[3] = VideoColormap;
|
values[3] = VideoColormap;
|
||||||
VideoWindow = xcb_generate_id(Connection);
|
VideoWindow = xcb_generate_id(Connection);
|
||||||
xcb_create_window(Connection, depth, VideoWindow, parent, VideoWindowX,
|
xcb_create_window(Connection, depth, VideoWindow, parent, VideoWindowX,
|
||||||
@ -9482,6 +9499,7 @@ static void VideoCreateWindow(xcb_window_t parent, xcb_visualid_t visual,
|
|||||||
xcb_change_window_attributes(Connection, VideoWindow, XCB_CW_CURSOR,
|
xcb_change_window_attributes(Connection, VideoWindow, XCB_CW_CURSOR,
|
||||||
values);
|
values);
|
||||||
VideoBlankCursor = cursor;
|
VideoBlankCursor = cursor;
|
||||||
|
VideoBlankTick = 0;
|
||||||
// FIXME: free cursor/pixmap needed?
|
// FIXME: free cursor/pixmap needed?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user