#include "fbdev.h"
+#define PFX "fbdev: "
+
struct vout_fbdev {
int fd;
void *mem;
int fb_size;
int buffer_count;
int top_border, bottom_border;
+ void *mem_saved;
+ size_t mem_saved_size;
};
void *vout_fbdev_flip(struct vout_fbdev *fbdev)
{
if (fbdev->fbvar_new.bits_per_pixel != bpp ||
w != fbdev->fbvar_new.xres || h != fbdev->fbvar_new.yres)
- printf(" switching to %dx%d@%d\n", w, h, bpp);
+ printf(PFX "switching to %dx%d@%d\n", w, h, bpp);
fbdev->fbvar_new.xres = w;
fbdev->fbvar_new.yres = h;
fbdev->fbvar_new.yres_virtual = h_total;
ret = ioctl(fbdev->fd, FBIOPUT_VSCREENINFO, &fbdev->fbvar_new);
if (ret == -1) {
- perror("FBIOPUT_VSCREENINFO ioctl");
+ perror(PFX "FBIOPUT_VSCREENINFO ioctl");
return NULL;
}
fbdev->buffer_count = 1;
fbdev->buffer_write = 0;
- fprintf(stderr, "Warning: failed to increase virtual resolution, "
+ fprintf(stderr, PFX "Warning: failed to increase virtual resolution, "
"multibuffering disabled\n");
}
fbdev->mem = mmap(0, mem_size, PROT_WRITE|PROT_READ, MAP_SHARED, fbdev->fd, 0);
if (fbdev->mem == MAP_FAILED && fbdev->buffer_count > 1) {
- fprintf(stderr, "Warning: can't map %zd bytes, doublebuffering disabled\n", mem_size);
+ fprintf(stderr, PFX "Warning: can't map %zd bytes, doublebuffering disabled\n", mem_size);
fbdev->buffer_count = 1;
fbdev->buffer_write = 0;
mem_size = fbdev->fb_size;
if (fbdev->mem == MAP_FAILED) {
fbdev->mem = NULL;
fbdev->mem_size = 0;
- perror("mmap framebuffer");
+ perror(PFX "mmap framebuffer");
return NULL;
}
fbdev->fd = open(fbdev_name, O_RDWR);
if (fbdev->fd == -1) {
- fprintf(stderr, "%s: ", fbdev_name);
+ fprintf(stderr, PFX "%s: ", fbdev_name);
perror("open");
goto fail_open;
}
ret = ioctl(fbdev->fd, FBIOGET_VSCREENINFO, &fbdev->fbvar_old);
if (ret == -1) {
- perror("FBIOGET_VSCREENINFO ioctl");
+ perror(PFX "FBIOGET_VSCREENINFO ioctl");
goto fail;
}
if (pret == NULL)
goto fail;
- printf("%s: %ix%i@%d\n", fbdev_name, fbdev->fbvar_new.xres, fbdev->fbvar_new.yres,
- fbdev->fbvar_new.bits_per_pixel);
+ printf(PFX "%s: %ix%i@%d\n", fbdev_name, fbdev->fbvar_new.xres,
+ fbdev->fbvar_new.yres, fbdev->fbvar_new.bits_per_pixel);
*w = fbdev->fbvar_new.xres;
*h = fbdev->fbvar_new.yres;
ret = 0;
ret = ioctl(fbdev->fd, FBIO_WAITFORVSYNC, &ret);
if (ret != 0)
- fprintf(stderr, "Warning: vsync doesn't seem to be supported\n");
+ fprintf(stderr, PFX "Warning: vsync doesn't seem to be supported\n");
if (fbdev->buffer_count > 1) {
fbdev->buffer_write = 0;
ret = ioctl(fbdev->fd, FBIOPAN_DISPLAY, &fbdev->fbvar_new);
if (ret != 0) {
fbdev->buffer_count = 1;
- fprintf(stderr, "Warning: can't pan display, doublebuffering disabled\n");
+ fprintf(stderr, PFX "Warning: can't pan display, doublebuffering disabled\n");
}
}
return NULL;
}
-void vout_fbdev_finish(struct vout_fbdev *fbdev)
+static void vout_fbdev_release(struct vout_fbdev *fbdev)
{
ioctl(fbdev->fd, FBIOPUT_VSCREENINFO, &fbdev->fbvar_old);
if (fbdev->mem != MAP_FAILED)
munmap(fbdev->mem, fbdev->mem_size);
+ fbdev->mem = NULL;
+}
+
+int vout_fbdev_save(struct vout_fbdev *fbdev)
+{
+ void *tmp;
+
+ if (fbdev == NULL || fbdev->mem == NULL || fbdev->mem == MAP_FAILED) {
+ fprintf(stderr, PFX "bad args for save\n");
+ return -1;
+ }
+
+ if (fbdev->mem_saved_size < fbdev->mem_size) {
+ tmp = realloc(fbdev->mem_saved, fbdev->mem_size);
+ if (tmp == NULL)
+ return -1;
+ fbdev->mem_saved = tmp;
+ }
+ memcpy(fbdev->mem_saved, fbdev->mem, fbdev->mem_size);
+ fbdev->mem_saved_size = fbdev->mem_size;
+
+ vout_fbdev_release(fbdev);
+ return 0;
+}
+
+int vout_fbdev_restore(struct vout_fbdev *fbdev)
+{
+ int ret;
+
+ if (fbdev == NULL || fbdev->mem != NULL) {
+ fprintf(stderr, PFX "bad args/state for restore\n");
+ return -1;
+ }
+
+ fbdev->mem = mmap(0, fbdev->mem_size, PROT_WRITE|PROT_READ, MAP_SHARED, fbdev->fd, 0);
+ if (fbdev->mem == MAP_FAILED) {
+ perror(PFX "restore: memory restore failed");
+ return -1;
+ }
+ memcpy(fbdev->mem, fbdev->mem_saved, fbdev->mem_size);
+
+ ret = ioctl(fbdev->fd, FBIOPUT_VSCREENINFO, &fbdev->fbvar_new);
+ if (ret == -1) {
+ perror(PFX "restore: FBIOPUT_VSCREENINFO");
+ return -1;
+ }
+
+ return 0;
+}
+
+void vout_fbdev_finish(struct vout_fbdev *fbdev)
+{
+ vout_fbdev_release(fbdev);
if (fbdev->fd >= 0)
close(fbdev->fd);
- fbdev->mem = NULL;
fbdev->fd = -1;
free(fbdev);
}
void vout_fbdev_clear(struct vout_fbdev *fbdev);
void vout_fbdev_clear_lines(struct vout_fbdev *fbdev, int y, int count);
int vout_fbdev_get_fd(struct vout_fbdev *fbdev);
+int vout_fbdev_save(struct vout_fbdev *fbdev);
+int vout_fbdev_restore(struct vout_fbdev *fbdev);
void vout_fbdev_finish(struct vout_fbdev *fbdev);
#include <termios.h>
#include <linux/kd.h>
+#include "xenv.h"
+
#define PFX "xenv: "
#define FPTR(f) typeof(f) * p##f
struct xstuff {
Display *display;
+ Window window;
FPTR(XCreateBitmapFromData);
FPTR(XCreatePixmapCursor);
FPTR(XFreePixmap);
FPTR(XMapWindow);
FPTR(XNextEvent);
FPTR(XCheckTypedEvent);
- FPTR(XUnmapWindow);
+ FPTR(XWithdrawWindow);
FPTR(XGrabKeyboard);
FPTR(XPending);
FPTR(XLookupKeysym);
FPTR(XkbSetDetectableAutoRepeat);
+ FPTR(XStoreName);
+ FPTR(XIconifyWindow);
+ FPTR(XMoveResizeWindow);
+ FPTR(XInternAtom);
+ FPTR(XSetWMHints);
+ FPTR(XSync);
};
static struct xstuff g_xstuff;
return cursor;
}
-static int x11h_init(void)
+static int x11h_init(int *xenv_flags, const char *window_title)
{
unsigned int display_width, display_height;
Display *display;
XSetWindowAttributes attributes;
Window win;
Visual *visual;
+ long evt_mask;
void *x11lib;
int screen;
FPTR_LINK(g_xstuff, x11lib, XMapWindow);
FPTR_LINK(g_xstuff, x11lib, XNextEvent);
FPTR_LINK(g_xstuff, x11lib, XCheckTypedEvent);
- FPTR_LINK(g_xstuff, x11lib, XUnmapWindow);
+ FPTR_LINK(g_xstuff, x11lib, XWithdrawWindow);
FPTR_LINK(g_xstuff, x11lib, XGrabKeyboard);
FPTR_LINK(g_xstuff, x11lib, XPending);
FPTR_LINK(g_xstuff, x11lib, XLookupKeysym);
FPTR_LINK(g_xstuff, x11lib, XkbSetDetectableAutoRepeat);
+ FPTR_LINK(g_xstuff, x11lib, XStoreName);
+ FPTR_LINK(g_xstuff, x11lib, XIconifyWindow);
+ FPTR_LINK(g_xstuff, x11lib, XMoveResizeWindow);
+ FPTR_LINK(g_xstuff, x11lib, XInternAtom);
+ FPTR_LINK(g_xstuff, x11lib, XSetWMHints);
+ FPTR_LINK(g_xstuff, x11lib, XSync);
//XInitThreads();
display_height = DisplayHeight(display, screen);
printf(PFX "display is %dx%d\n", display_width, display_height);
- win = g_xstuff.pXCreateSimpleWindow(display,
- RootWindow(display, screen),
- 0, 0, display_width, display_height, 0,
- BlackPixel(display, screen),
- BlackPixel(display, screen));
+ g_xstuff.window = win = g_xstuff.pXCreateSimpleWindow(display,
+ RootWindow(display, screen), 0, 0, display_width, display_height,
+ 0, BlackPixel(display, screen), BlackPixel(display, screen));
attributes.override_redirect = True;
attributes.cursor = transparent_cursor(&g_xstuff, display, win);
g_xstuff.pXChangeWindowAttributes(display, win, CWOverrideRedirect | CWCursor, &attributes);
- g_xstuff.pXSelectInput(display, win, ExposureMask | FocusChangeMask | KeyPressMask
- | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask);
+ if (window_title != NULL)
+ g_xstuff.pXStoreName(display, win, window_title);
+ evt_mask = ExposureMask | FocusChangeMask | PropertyChangeMask;
+ if (xenv_flags && (*xenv_flags & XENV_CAP_KEYS))
+ evt_mask |= KeyPressMask | KeyReleaseMask;
+ if (xenv_flags && (*xenv_flags & XENV_CAP_MOUSE))
+ evt_mask |= ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
+ g_xstuff.pXSelectInput(display, win, evt_mask);
g_xstuff.pXMapWindow(display, win);
g_xstuff.pXGrabKeyboard(display, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
g_xstuff.pXkbSetDetectableAutoRepeat(display, 1, NULL);
// XSetIOErrorHandler
+ // we don't know when event dispatch will be called, so sync now
+ g_xstuff.pXSync(display, False);
+
return 0;
fail2:
dlclose(x11lib);
}
}
+static void x11h_wait_vmstate(void)
+{
+ Atom wm_state = g_xstuff.pXInternAtom(g_xstuff.display, "WM_STATE", False);
+ XEvent evt;
+ int i;
+
+ usleep(20000);
+
+ for (i = 0; i < 20; i++) {
+ while (g_xstuff.pXPending(g_xstuff.display)) {
+ g_xstuff.pXNextEvent(g_xstuff.display, &evt);
+ // printf("w event %d\n", evt.type);
+ if (evt.type == PropertyNotify && evt.xproperty.atom == wm_state)
+ return;
+ }
+ usleep(200000);
+ }
+
+ fprintf(stderr, PFX "timeout waiting for wm_state change\n");
+}
+
+static int x11h_minimize(void)
+{
+ XSetWindowAttributes attributes;
+ Display *display = g_xstuff.display;
+ Window window = g_xstuff.window;
+ int screen = DefaultScreen(g_xstuff.display);
+ int display_width, display_height;
+ XWMHints wm_hints;
+ XEvent evt;
+
+ g_xstuff.pXWithdrawWindow(display, window, screen);
+
+ attributes.override_redirect = False;
+ g_xstuff.pXChangeWindowAttributes(display, window,
+ CWOverrideRedirect, &attributes);
+
+ wm_hints.flags = StateHint;
+ wm_hints.initial_state = IconicState;
+ g_xstuff.pXSetWMHints(display, window, &wm_hints);
+
+ g_xstuff.pXMapWindow(display, window);
+
+ while (g_xstuff.pXNextEvent(display, &evt) == 0)
+ {
+ // printf("m event %d\n", evt.type);
+ switch (evt.type)
+ {
+ case FocusIn:
+ goto out;
+ default:
+ break;
+ }
+ }
+
+out:
+ g_xstuff.pXWithdrawWindow(display, window, screen);
+
+ // must wait for some magic vmstate property change before setting override_redirect
+ x11h_wait_vmstate();
+
+ attributes.override_redirect = True;
+ g_xstuff.pXChangeWindowAttributes(display, window,
+ CWOverrideRedirect, &attributes);
+
+ // fixup window after resize on override_redirect loss
+ display_width = DisplayWidth(display, screen);
+ display_height = DisplayHeight(display, screen);
+ g_xstuff.pXMoveResizeWindow(display, window, 0, 0, display_width, display_height);
+
+ g_xstuff.pXMapWindow(display, window);
+ g_xstuff.pXGrabKeyboard(display, window, False, GrabModeAsync, GrabModeAsync, CurrentTime);
+ g_xstuff.pXkbSetDetectableAutoRepeat(display, 1, NULL);
+
+ // we don't know when event dispatch will be called, so sync now
+ g_xstuff.pXSync(display, False);
+
+ return 0;
+}
+
static struct termios g_kbd_termios_saved;
static int g_kbdfd = -1;
g_kbdfd = -1;
}
-int xenv_init(int *have_mouse_events)
+int xenv_init(int *xenv_flags, const char *window_title)
{
- int have_mouse = 0;
int ret;
- ret = x11h_init();
- if (ret == 0) {
- have_mouse = 1;
+ ret = x11h_init(xenv_flags, window_title);
+ if (ret == 0)
goto out;
- }
+ if (xenv_flags != NULL)
+ *xenv_flags &= ~(XENV_CAP_KEYS | XENV_CAP_MOUSE); /* TODO? */
ret = tty_init();
if (ret == 0)
goto out;
fprintf(stderr, PFX "error: both x11h_init and tty_init failed\n");
ret = -1;
out:
- if (have_mouse_events != NULL)
- *have_mouse_events = have_mouse;
return ret;
}
return -1;
}
+/* blocking minimize until user maximizes again */
+int xenv_minimize(void)
+{
+ int ret;
+
+ if (g_xstuff.display) {
+ xenv_update(NULL, NULL, NULL, NULL);
+ ret = x11h_minimize();
+ xenv_update(NULL, NULL, NULL, NULL);
+ return ret;
+ }
+
+ return -1;
+}
+
void xenv_finish(void)
{
// TODO: cleanup X?
tty_end();
}
+
+#if 0
+int main()
+{
+ int i, r, d;
+
+ xenv_init("just a test");
+
+ for (i = 0; i < 5; i++) {
+ while ((r = xenv_update(&d)) > 0)
+ printf("%d %x %d\n", d, r, r);
+ sleep(1);
+
+ if (i == 1)
+ xenv_minimize();
+ printf("ll %d\n", i);
+ }
+
+ printf("xenv_finish..\n");
+ xenv_finish();
+
+ return 0;
+}
+#endif
-int xenv_init(int *have_mouse_events);
+#define XENV_CAP_KEYS (1<<0)
+#define XENV_CAP_MOUSE (1<<1)
+
+/* xenv_flags specify if we need keys and mouse,
+ * on return, flag is removed if input is not available */
+int xenv_init(int *xenv_flags, const char *window_title);
/* read events from X, calling key_cb for key, mouseb_cb for mouse button
* and mousem_cb for mouse motion events */
int (*mousem_cb)(void *cb_arg, int x, int y),
void *cb_arg);
+int xenv_minimize(void);
void xenv_finish(void);
void *osdl_video_set_mode(struct SDL_PrivateVideoData *pdata,
int border_l, int border_r, int border_t, int border_b,
- int width, int height, int bpp, int *doublebuf);
+ int width, int height, int bpp, int *doublebuf,
+ const char *wm_title);
void *osdl_video_flip(struct SDL_PrivateVideoData *pdata);
int osdl_video_detect_screen(struct SDL_PrivateVideoData *pdata);
+int osdl_video_pause(struct SDL_PrivateVideoData *pdata, int is_pause);
void osdl_video_finish(struct SDL_PrivateVideoData *pdata);
void omapsdl_input_init(void);
break;
}
- if (ev.type != EV_KEY)
- continue; /* not key event */
+ if (ev.type != EV_KEY || key_cb == NULL)
+ continue; /* not key event or not needed */
if ((unsigned int)ev.value > 1)
continue; /* not key up/down */
if ((unsigned int)ev.code >= ARRAY_SIZE(osdl_evdev_map))
#include "linux/fbdev.h"
#include "linux/xenv.h"
-struct omapfb_saved_layer {
+struct omapfb_state {
struct omapfb_plane_info pi;
struct omapfb_mem_info mi;
+ struct omapfb_plane_info pi_old;
+ struct omapfb_mem_info mi_old;
};
static const char *get_fb_device(void)
return fbname;
}
-static int osdl_setup_omapfb(int fd, int enabled, int x, int y, int w, int h,
- int mem, int *buffer_count)
+static int osdl_setup_omapfb(struct omapfb_state *ostate, int fd, int enabled,
+ int x, int y, int w, int h, int mem, int *buffer_count)
{
struct omapfb_plane_info pi;
struct omapfb_mem_info mi;
return -1;
}
+ ostate->pi = pi;
+ ostate->mi = mi;
return 0;
}
/* FIXME: assuming layer doesn't change here */
if (pdata->saved_layer == NULL) {
- struct omapfb_saved_layer *slayer;
+ struct omapfb_state *slayer;
slayer = calloc(1, sizeof(*slayer));
if (slayer == NULL)
goto out;
- ret = ioctl(fd, OMAPFB_QUERY_PLANE, &slayer->pi);
+ ret = ioctl(fd, OMAPFB_QUERY_PLANE, &slayer->pi_old);
if (ret != 0) {
err_perror("QUERY_PLANE");
goto out;
}
- ret = ioctl(fd, OMAPFB_QUERY_MEM, &slayer->mi);
+ ret = ioctl(fd, OMAPFB_QUERY_MEM, &slayer->mi_old);
if (ret != 0) {
err_perror("QUERY_MEM");
goto out;
x = screen_w / 2 - w / 2;
y = screen_h / 2 - h / 2;
- ret = osdl_setup_omapfb(fd, 1, x, y, w, h,
+ ret = osdl_setup_omapfb(pdata->saved_layer, fd, 1, x, y, w, h,
width * height * ((bpp + 7) / 8), buffer_count);
if (ret == 0) {
pdata->layer_x = x;
void *osdl_video_set_mode(struct SDL_PrivateVideoData *pdata,
int border_l, int border_r, int border_t, int border_b,
- int width, int height, int bpp, int *doublebuf)
+ int width, int height, int bpp, int *doublebuf,
+ const char *wm_title)
{
int buffers_try, buffers_set;
const char *fbname;
goto fail;
if (!pdata->xenv_up) {
- int xenv_mouse = 0;
- ret = xenv_init(&xenv_mouse);
+ int xenv_flags = XENV_CAP_KEYS | XENV_CAP_MOUSE;
+ ret = xenv_init(&xenv_flags, wm_title);
if (ret == 0) {
pdata->xenv_up = 1;
- pdata->xenv_mouse = xenv_mouse;
+ pdata->xenv_mouse = (xenv_flags & XENV_CAP_MOUSE) ? 1 : 0;
}
}
return ret;
}
+int osdl_video_pause(struct SDL_PrivateVideoData *pdata, int is_pause)
+{
+ struct omapfb_state *state = pdata->saved_layer;
+ struct omapfb_plane_info pi;
+ struct omapfb_mem_info mi;
+ int enabled;
+ int fd = -1;
+ int ret;
+
+ if (pdata->fbdev != NULL)
+ fd = vout_fbdev_get_fd(pdata->fbdev);
+ if (fd == -1) {
+ err("bad fd %d", fd);
+ return -1;
+ }
+ if (state == NULL) {
+ err("missing layer state\n");
+ return -1;
+ }
+
+ if (is_pause) {
+ ret = vout_fbdev_save(pdata->fbdev);
+ if (ret != 0)
+ return ret;
+ pi = state->pi_old;
+ mi = state->mi_old;
+ enabled = pi.enabled;
+ } else {
+ pi = state->pi;
+ mi = state->mi;
+ enabled = 1;
+ }
+ pi.enabled = 0;
+ ret = ioctl(fd, OMAPFB_SETUP_PLANE, &pi);
+ if (ret != 0) {
+ err_perror("SETUP_PLANE");
+ return -1;
+ }
+
+ ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi);
+ if (ret != 0)
+ err_perror("SETUP_MEM");
+
+ if (!is_pause) {
+ ret = vout_fbdev_restore(pdata->fbdev);
+ if (ret != 0) {
+ err("fbdev_restore failed\n");
+ return ret;
+ }
+ }
+
+ if (enabled) {
+ pi.enabled = 1;
+ ret = ioctl(fd, OMAPFB_SETUP_PLANE, &pi);
+ if (ret != 0) {
+ err_perror("SETUP_PLANE");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
void osdl_video_finish(struct SDL_PrivateVideoData *pdata)
{
static const char *fbname;
/* restore the OMAP layer */
if (pdata->saved_layer != NULL) {
- struct omapfb_saved_layer *slayer = pdata->saved_layer;
+ struct omapfb_state *slayer = pdata->saved_layer;
int fd;
fd = open(fbname, O_RDWR);
if (fd != -1) {
- int enabled = slayer->pi.enabled;
+ int enabled = slayer->pi_old.enabled;
/* be sure to disable while setting up */
- slayer->pi.enabled = 0;
- ioctl(fd, OMAPFB_SETUP_PLANE, &slayer->pi);
- ioctl(fd, OMAPFB_SETUP_MEM, &slayer->mi);
+ slayer->pi_old.enabled = 0;
+ ioctl(fd, OMAPFB_SETUP_PLANE, &slayer->pi_old);
+ ioctl(fd, OMAPFB_SETUP_MEM, &slayer->mi_old);
if (enabled) {
- slayer->pi.enabled = enabled;
- ioctl(fd, OMAPFB_SETUP_PLANE, &slayer->pi);
+ slayer->pi_old.enabled = enabled;
+ ioctl(fd, OMAPFB_SETUP_PLANE, &slayer->pi_old);
}
close(fd);
}
#include <stdio.h>
#include <stdlib.h>
+#include <X11/XF86keysym.h>
#include "../SDL_sysvideo.h"
#include "../SDL_pixels_c.h"
doublebuf = (flags & SDL_DOUBLEBUF) ? 1 : 0;
fbmem = osdl_video_set_mode(pdata,
pdata->border_l, pdata->border_r, pdata->border_t, pdata->border_b,
- width, height, bpp, &doublebuf);
+ width, height, bpp, &doublebuf, this->wm_title);
if (fbmem == NULL) {
err("failing on mode %dx%d@%d, doublebuf %s, border %d,%d,%d,%d",
width, height, bpp, (flags & SDL_DOUBLEBUF) ? "on" : "off",
SDL_PrivateMouseMotion(0, 0, x, y);
}
-static int mouseb_event_cb(void *cb_arg, int x, int y, int button, int is_pressed)
+static int xmouseb_event_cb(void *cb_arg, int x, int y, int button, int is_pressed)
{
SDL_VideoDevice *this = cb_arg;
struct SDL_PrivateVideoData *pdata = this->hidden;
SDL_PrivateMouseButton(is_pressed ? SDL_PRESSED : SDL_RELEASED, button, x, y);
}
-static int mousem_event_cb(void *cb_arg, int x, int y)
+static int xmousem_event_cb(void *cb_arg, int x, int y)
{
SDL_VideoDevice *this = cb_arg;
struct SDL_PrivateVideoData *pdata = this->hidden;
SDL_PrivateMouseMotion(0, 0, x, y);
}
+static int xkey_cb(void *cb_arg, int kc, int is_pressed)
+{
+ SDL_VideoDevice *this = cb_arg;
+ struct SDL_PrivateVideoData *pdata = this->hidden;
+ int ret;
+
+ if (kc == XF86XK_MenuKB && is_pressed) {
+ ret = osdl_video_pause(pdata, 1);
+ if (ret == 0) {
+ xenv_minimize();
+ osdl_video_pause(pdata, 0);
+ omapsdl_input_get_events(0, NULL, NULL, NULL);
+ }
+ }
+}
+
static void omap_PumpEvents(SDL_VideoDevice *this)
{
struct SDL_PrivateVideoData *pdata = this->hidden;
if (pdata->xenv_up) {
if (!pdata->cfg_ts_force_tslib) {
- xenv_update(NULL, mouseb_event_cb, mousem_event_cb, this);
+ xenv_update(xkey_cb, xmouseb_event_cb, xmousem_event_cb, this);
if (pdata->xenv_mouse)
read_tslib = 0;
}