wayland: 'focused' widgets should also have key events sent
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
fcca66d1e4
commit
3c1bd9956f
2 changed files with 12 additions and 2 deletions
|
|
@ -537,6 +537,7 @@ struct _MwLLWayland {
|
||||||
MwU32 ww, wh; /* Window position */
|
MwU32 ww, wh; /* Window position */
|
||||||
MwPoint cur_mouse_pos; /* Currently known mouse position */
|
MwPoint cur_mouse_pos; /* Currently known mouse position */
|
||||||
MwLL currentlyHeldWidget;
|
MwLL currentlyHeldWidget;
|
||||||
|
MwLL focusedWidget;
|
||||||
|
|
||||||
int resizing;
|
int resizing;
|
||||||
int setting_wh;
|
int setting_wh;
|
||||||
|
|
|
||||||
|
|
@ -600,6 +600,9 @@ static void pointer_button(void* data, struct wl_pointer* wl_pointer, MwU32 seri
|
||||||
|
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case WL_POINTER_BUTTON_STATE_PRESSED:
|
case WL_POINTER_BUTTON_STATE_PRESSED:
|
||||||
|
if(button == BTN_LEFT) {
|
||||||
|
topmost_parent->wayland.focusedWidget = self;
|
||||||
|
}
|
||||||
MwLLDispatch(self, down, &p);
|
MwLLDispatch(self, down, &p);
|
||||||
topmost_parent->wayland.currentlyHeldWidget = self;
|
topmost_parent->wayland.currentlyHeldWidget = self;
|
||||||
|
|
||||||
|
|
@ -718,13 +721,16 @@ static void keyboard_key(void* data,
|
||||||
MwU32 time,
|
MwU32 time,
|
||||||
MwU32 key,
|
MwU32 key,
|
||||||
MwU32 state) {
|
MwU32 state) {
|
||||||
MwLL self = data;
|
MwLL self = data;
|
||||||
MwBool inArea = 0;
|
MwBool inArea = 0;
|
||||||
|
MwLL topmost_parent = self;
|
||||||
|
|
||||||
(void)wl_keyboard;
|
(void)wl_keyboard;
|
||||||
(void)serial;
|
(void)serial;
|
||||||
(void)time;
|
(void)time;
|
||||||
|
|
||||||
|
while(topmost_parent->wayland.parent) topmost_parent = topmost_parent->wayland.parent;
|
||||||
|
|
||||||
WAYLAND_EVENT_OP_START(self);
|
WAYLAND_EVENT_OP_START(self);
|
||||||
|
|
||||||
if(self->wayland.framebuffer.surface) {
|
if(self->wayland.framebuffer.surface) {
|
||||||
|
|
@ -734,6 +740,9 @@ static void keyboard_key(void* data,
|
||||||
if(self->wayland.backbuffer.surface) {
|
if(self->wayland.backbuffer.surface) {
|
||||||
inArea |= self->wayland.backbuffer.surface == curSurface;
|
inArea |= self->wayland.backbuffer.surface == curSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inArea |= (self == topmost_parent->wayland.focusedWidget);
|
||||||
|
|
||||||
if(inArea) {
|
if(inArea) {
|
||||||
xkb_layout_index_t layout;
|
xkb_layout_index_t layout;
|
||||||
MwU32 levels;
|
MwU32 levels;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue