Removed unneccesary code lines. Fixed mousename bug. Added lacking code in mousebutton
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403168
This commit is contained in:
parent
f3a0aca8ff
commit
96e1657806
3 changed files with 47 additions and 10 deletions
|
@ -116,8 +116,8 @@ SDL_AddMouse(const SDL_Mouse * mouse, int index, char *name, int pressure_max,
|
|||
/* we're setting the mouse properties */
|
||||
length = 0;
|
||||
length = SDL_strlen(name);
|
||||
SDL_mice[index]->name = SDL_malloc((length + 1) * sizeof(char));
|
||||
SDL_strlcpy(SDL_mice[index]->name, name, length);
|
||||
SDL_mice[index]->name = SDL_malloc((length + 2) * sizeof(char));
|
||||
SDL_strlcpy(SDL_mice[index]->name, name, length+1);
|
||||
SDL_mice[index]->pressure_max = pressure_max;
|
||||
SDL_mice[index]->pressure_min = pressure_min;
|
||||
SDL_mice[index]->cursor_shown = SDL_TRUE;
|
||||
|
@ -512,6 +512,10 @@ SDL_SendMouseButton(int id, Uint8 state, Uint8 button)
|
|||
mouse->buttonstate |= SDL_BUTTON(button);
|
||||
break;
|
||||
case SDL_RELEASED:
|
||||
if(!(mouse->buttonstate & SDL_BUTTON(button))) {
|
||||
/* Ignore this event, no state change */
|
||||
return 0;
|
||||
}
|
||||
type = SDL_MOUSEBUTTONUP;
|
||||
mouse->buttonstate &= ~SDL_BUTTON(button);
|
||||
break;
|
||||
|
|
|
@ -483,7 +483,6 @@ X11_CreateWindow(_THIS, SDL_Window * window)
|
|||
Uint32 fevent = 0;
|
||||
pXGetICValues(((SDL_WindowData *) window->driverdata)->ic,
|
||||
XNFilterEvents, &fevent, NULL);
|
||||
XMapWindow(data->display, w);
|
||||
XSelectInput(data->display, w,
|
||||
(FocusChangeMask | EnterWindowMask | LeaveWindowMask |
|
||||
ExposureMask | ButtonPressMask | ButtonReleaseMask |
|
||||
|
@ -492,13 +491,14 @@ X11_CreateWindow(_THIS, SDL_Window * window)
|
|||
KeymapStateMask | fevent));
|
||||
}
|
||||
#else
|
||||
XMapWindow(data->display, w);
|
||||
XSelectInput(data->display, w,
|
||||
{
|
||||
XSelectInput(data->display, w,
|
||||
(FocusChangeMask | EnterWindowMask | LeaveWindowMask |
|
||||
ExposureMask | ButtonPressMask | ButtonReleaseMask |
|
||||
PointerMotionMask | KeyPressMask | KeyReleaseMask |
|
||||
PropertyChangeMask | StructureNotifyMask |
|
||||
KeymapStateMask));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* we're informing the display what extension events we want to receive from it */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue