Date: Fri, 17 Aug 2007 01:12:31 +0200
From: Couriersud Subject: fix for audio dsp exit crash / various dfb issues improved cursor handling fixes some mouse and event related bugs --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402621
This commit is contained in:
parent
8acf15bdaa
commit
8f8c80446d
4 changed files with 33 additions and 33 deletions
|
@ -64,7 +64,7 @@ DirectFB_PumpEventsWindow(_THIS)
|
|||
DirectFB_TranslateButton(evt.button));
|
||||
break;
|
||||
case DWET_MOTION:
|
||||
SDL_SendMouseMotion(devdata->mouse, 0, evt.x, evt.y);
|
||||
SDL_SendMouseMotion(devdata->mouse, 0, evt.cx, evt.cy);
|
||||
break;
|
||||
case DWET_KEYDOWN:
|
||||
DirectFB_TranslateKey(evt.key_id, evt.key_symbol,
|
||||
|
@ -79,14 +79,14 @@ DirectFB_PumpEventsWindow(_THIS)
|
|||
keysym.scancode, keysym.sym);
|
||||
break;
|
||||
case DWET_POSITION_SIZE:
|
||||
SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_MOVED, evt.cx,
|
||||
evt.cy);
|
||||
SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_MOVED, evt.x,
|
||||
evt.y);
|
||||
SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_RESIZED, evt.w,
|
||||
evt.h);
|
||||
break;
|
||||
case DWET_POSITION:
|
||||
SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_MOVED, evt.cx,
|
||||
evt.cy);
|
||||
SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_MOVED, evt.x,
|
||||
evt.y);
|
||||
break;
|
||||
case DWET_SIZE:
|
||||
SDL_SendWindowEvent(p->id, SDL_WINDOWEVENT_RESIZED, evt.w,
|
||||
|
|
|
@ -112,6 +112,7 @@ DirectFB_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
|
|||
static int
|
||||
DirectFB_ShowCursor(SDL_Cursor * cursor)
|
||||
{
|
||||
//FIXME check for null cursor here
|
||||
SDL_DFB_CURSORDATA(cursor);
|
||||
SDL_VideoDevice *dev = SDL_GetVideoDevice();
|
||||
SDL_DFB_DEVICEDATA(dev);
|
||||
|
@ -130,32 +131,22 @@ DirectFB_ShowCursor(SDL_Cursor * cursor)
|
|||
SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
|
||||
DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
|
||||
DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
|
||||
SDL_DFB_CHECKERR(windata->window->
|
||||
SetCursorShape(windata->window, curdata->surf,
|
||||
curdata->hotx, curdata->hoty));
|
||||
|
||||
if (cursor)
|
||||
SDL_DFB_CHECKERR(windata->window->
|
||||
SetCursorShape(windata->window, curdata->surf,
|
||||
curdata->hotx, curdata->hoty));
|
||||
//FIXME: This is somehow a directfb issue
|
||||
//TODO: Check administrative
|
||||
SDL_DFB_CHECKERR(dispdata->layer->
|
||||
SetCooperativeLevel(dispdata->layer,
|
||||
DLSCL_ADMINISTRATIVE));
|
||||
SDL_DFB_CHECKERR(dispdata->layer->
|
||||
SetCursorOpacity(dispdata->layer, 0xC0));
|
||||
SetCursorOpacity(dispdata->layer,
|
||||
cursor ? 0xC0 : 0x00));
|
||||
SDL_DFB_CHECKERR(dispdata->layer->
|
||||
SetCooperativeLevel(dispdata->layer, DLSCL_SHARED));
|
||||
}
|
||||
#if 0
|
||||
//TODO: Check administrative
|
||||
SDL_DFB_CHECKERR(dispdata->layer->
|
||||
SetCooperativeLevel(dispdata->layer,
|
||||
DLSCL_ADMINISTRATIVE));
|
||||
SDL_DFB_CHECKERR(dispdata->layer->
|
||||
SetCursorShape(dispdata->layer, curdata->surf,
|
||||
curdata->hotx, curdata->hoty));
|
||||
SDL_DFB_CHECKERR(dispdata->layer->
|
||||
SetCursorOpacity(dispdata->layer, 0xC0));
|
||||
SDL_DFB_CHECKERR(dispdata->layer->
|
||||
SetCooperativeLevel(dispdata->layer, DLSCL_SHARED));
|
||||
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
error:
|
||||
|
|
|
@ -33,7 +33,7 @@ struct _DFB_CursorData
|
|||
int hoty;
|
||||
};
|
||||
|
||||
#define SDL_DFB_CURSORDATA(curs) DFB_CursorData *curdata = (DFB_CursorData *) ((curs)->driverdata)
|
||||
#define SDL_DFB_CURSORDATA(curs) DFB_CursorData *curdata = (DFB_CursorData *) ((curs) ? (curs)->driverdata : NULL)
|
||||
|
||||
extern void DirectFB_InitMouse(_THIS);
|
||||
extern void DirectFB_QuitMouse(_THIS);
|
||||
|
|
|
@ -674,17 +674,25 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window)
|
|||
} else {
|
||||
y = window->y;
|
||||
}
|
||||
if (window->flags & SDL_WINDOW_FULLSCREEN) {
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
desc.flags =
|
||||
DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS | DWDESC_PIXELFORMAT;
|
||||
desc.flags |= DWDESC_POSX | DWDESC_POSY | DWDESC_SURFACE_CAPS;
|
||||
desc.posx = x;
|
||||
desc.posy = y;
|
||||
DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS | DWDESC_PIXELFORMAT |
|
||||
DWDESC_SURFACE_CAPS;
|
||||
if (!(window->flags & SDL_WINDOW_FULLSCREEN)
|
||||
&& window->x != SDL_WINDOWPOS_UNDEFINED
|
||||
&& window->y != SDL_WINDOWPOS_UNDEFINED) {
|
||||
desc.flags |= DWDESC_POSX | DWDESC_POSY;
|
||||
desc.posx = x;
|
||||
desc.posy = y;
|
||||
}
|
||||
|
||||
desc.width = window->w;
|
||||
desc.height = window->h;
|
||||
|
||||
desc.pixelformat = dispdata->pixelformat;
|
||||
|
||||
desc.caps = 0; //DWCAPS_DOUBLEBUFFER;
|
||||
desc.surface_caps = DSCAPS_DOUBLE | DSCAPS_TRIPLE; //| DSCAPS_PREMULTIPLIED;
|
||||
|
||||
|
@ -783,7 +791,8 @@ DirectFB_SetWindowPosition(_THIS, SDL_Window * window)
|
|||
SDL_DFB_WINDOWDATA(window);
|
||||
SDL_DFB_DISPLAYDATA(_this, window);
|
||||
|
||||
windata->window->MoveTo(windata->window, window->x, window->y);
|
||||
if (!(window->flags & SDL_WINDOW_FULLSCREEN))
|
||||
windata->window->MoveTo(windata->window, window->x, window->y);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -793,8 +802,8 @@ DirectFB_SetWindowSize(_THIS, SDL_Window * window)
|
|||
SDL_DFB_WINDOWDATA(window);
|
||||
SDL_DFB_DISPLAYDATA(_this, window);
|
||||
|
||||
windata->window->Resize(windata->window, window->w, window->h);
|
||||
|
||||
if (!(window->flags & SDL_WINDOW_FULLSCREEN))
|
||||
windata->window->Resize(windata->window, window->w, window->h);
|
||||
}
|
||||
static void
|
||||
DirectFB_ShowWindow(_THIS, SDL_Window * window)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue