mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
X11: Handle keyboard layout changing during app's run on Ubuntu 12.04 (etc).
Fixes Bugzilla #3050 (in addition to Jason Wyatt's patch, prior to this).
This commit is contained in:
parent
0d8c3a0b76
commit
8145760314
@ -1135,7 +1135,14 @@ X11_DispatchEvent(_THIS)
|
|||||||
SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
|
SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (xevent.xproperty.atom == videodata->XKLAVIER_STATE) {
|
||||||
|
/* Hack for Ubuntu 12.04 (etc) that doesn't send MappingNotify
|
||||||
|
events when the keyboard layout changes (for example,
|
||||||
|
changing from English to French on the menubar's keyboard
|
||||||
|
icon). Since it changes the XKLAVIER_STATE property, we
|
||||||
|
notice and reinit our keymap here. This might not be the
|
||||||
|
right approach, but it seems to work. */
|
||||||
|
X11_UpdateKeymap(_this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -408,6 +408,7 @@ X11_VideoInit(_THIS)
|
|||||||
GET_ATOM(XdndDrop);
|
GET_ATOM(XdndDrop);
|
||||||
GET_ATOM(XdndFinished);
|
GET_ATOM(XdndFinished);
|
||||||
GET_ATOM(XdndSelection);
|
GET_ATOM(XdndSelection);
|
||||||
|
GET_ATOM(XKLAVIER_STATE);
|
||||||
|
|
||||||
/* Detect the window manager */
|
/* Detect the window manager */
|
||||||
X11_CheckWindowManager(_this);
|
X11_CheckWindowManager(_this);
|
||||||
|
@ -111,6 +111,7 @@ typedef struct SDL_VideoData
|
|||||||
Atom XdndDrop;
|
Atom XdndDrop;
|
||||||
Atom XdndFinished;
|
Atom XdndFinished;
|
||||||
Atom XdndSelection;
|
Atom XdndSelection;
|
||||||
|
Atom XKLAVIER_STATE;
|
||||||
|
|
||||||
SDL_Scancode key_layout[256];
|
SDL_Scancode key_layout[256];
|
||||||
SDL_bool selection_waiting;
|
SDL_bool selection_waiting;
|
||||||
|
Loading…
Reference in New Issue
Block a user