wayland: fix GetCursorCoordImpl somewhat
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
1c8e301e15
commit
37fae993b9
2 changed files with 28 additions and 10 deletions
|
|
@ -495,6 +495,7 @@ static void pointer_motion(void* data, struct wl_pointer* wl_pointer, MwU32 time
|
||||||
MwLL topmost_parent = self;
|
MwLL topmost_parent = self;
|
||||||
MwMouse p;
|
MwMouse p;
|
||||||
MwBool inArea = MwFALSE;
|
MwBool inArea = MwFALSE;
|
||||||
|
MwBool h = MwFALSE;
|
||||||
MwLL currentlyHeldWidget = NULL;
|
MwLL currentlyHeldWidget = NULL;
|
||||||
|
|
||||||
(void)time;
|
(void)time;
|
||||||
|
|
@ -505,11 +506,12 @@ static void pointer_motion(void* data, struct wl_pointer* wl_pointer, MwU32 time
|
||||||
|
|
||||||
currentlyHeldWidget = topmost_parent->wayland.currentlyHeldWidget;
|
currentlyHeldWidget = topmost_parent->wayland.currentlyHeldWidget;
|
||||||
|
|
||||||
if(currentlyHeldWidget == self) {
|
if(currentlyHeldWidget) {
|
||||||
self->wayland.cur_mouse_pos.x = wl_fixed_to_int(surface_x);
|
currentlyHeldWidget->wayland.cur_mouse_pos.x = wl_fixed_to_int(surface_x);
|
||||||
self->wayland.cur_mouse_pos.y = wl_fixed_to_int(surface_y);
|
currentlyHeldWidget->wayland.cur_mouse_pos.y = wl_fixed_to_int(surface_y);
|
||||||
p.point = self->wayland.cur_mouse_pos;
|
p.point = currentlyHeldWidget->wayland.cur_mouse_pos;
|
||||||
MwLLDispatch(self, move, &p);
|
MwLLDispatch(currentlyHeldWidget, move, &p);
|
||||||
|
h = MwTRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(self->wayland.framebuffer.surface) {
|
if(self->wayland.framebuffer.surface) {
|
||||||
|
|
@ -520,10 +522,12 @@ static void pointer_motion(void* data, struct wl_pointer* wl_pointer, MwU32 time
|
||||||
inArea |= self->wayland.backbuffer.surface == curSurface;
|
inArea |= self->wayland.backbuffer.surface == curSurface;
|
||||||
}
|
}
|
||||||
if(inArea) {
|
if(inArea) {
|
||||||
self->wayland.cur_mouse_pos.x = wl_fixed_to_int(surface_x);
|
if(h) {
|
||||||
self->wayland.cur_mouse_pos.y = wl_fixed_to_int(surface_y);
|
self->wayland.cur_mouse_pos.x = wl_fixed_to_int(surface_x);
|
||||||
p.point = self->wayland.cur_mouse_pos;
|
self->wayland.cur_mouse_pos.y = wl_fixed_to_int(surface_y);
|
||||||
MwLLDispatch(self, move, &p);
|
p.point = self->wayland.cur_mouse_pos;
|
||||||
|
MwLLDispatch(self, move, &p);
|
||||||
|
}
|
||||||
wl_pointer_set_cursor(self->wayland.pointer, self->wayland.pointer_serial, self->wayland.cursor.surface, 0, 0);
|
wl_pointer_set_cursor(self->wayland.pointer, self->wayland.pointer_serial, self->wayland.cursor.surface, 0, 0);
|
||||||
}
|
}
|
||||||
WAYLAND_EVENT_OP_END(self);
|
WAYLAND_EVENT_OP_END(self);
|
||||||
|
|
|
||||||
|
|
@ -1472,7 +1472,7 @@ static void MwLLGetCursorCoordImpl(MwLL handle, MwPoint* point) {
|
||||||
WIDGET_CHECK(handle);
|
WIDGET_CHECK(handle);
|
||||||
while(topmost_parent->wayland.parent) topmost_parent = topmost_parent->wayland.parent;
|
while(topmost_parent->wayland.parent) topmost_parent = topmost_parent->wayland.parent;
|
||||||
|
|
||||||
*point = handle->wayland.cur_mouse_pos;
|
*point = topmost_parent->wayland.cur_mouse_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLGetScreenSizeImpl(MwLL handle, MwRect* rect) {
|
static void MwLLGetScreenSizeImpl(MwLL handle, MwRect* rect) {
|
||||||
|
|
@ -1558,6 +1558,20 @@ static void MwLLSetDarkThemeImpl(MwLL handle, int toggle) {
|
||||||
|
|
||||||
static void MwLLRaiseImpl(MwLL handle) {
|
static void MwLLRaiseImpl(MwLL handle) {
|
||||||
(void)handle;
|
(void)handle;
|
||||||
|
/* WIDGET_CHECK(handle);
|
||||||
|
|
||||||
|
if(handle->wayland.type == MwLL_WAYLAND_SUBLEVEL) {
|
||||||
|
MwLL topmost_parent = handle;
|
||||||
|
int children_num;
|
||||||
|
while(topmost_parent->wayland.parent) topmost_parent = topmost_parent->wayland.parent;
|
||||||
|
children_num = arrlen(((MwWidget)topmost_parent->common.user)->children);
|
||||||
|
|
||||||
|
if(children_num > 1) {
|
||||||
|
printf("%d\n", children_num);
|
||||||
|
MwWidget last_child = ((MwWidget)topmost_parent->common.user)->children[children_num - 1];
|
||||||
|
wl_subsurface_place_above(handle->wayland.sublevel->subsurface, last_child->lowlevel->wayland.framebuffer.surface);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MwLLWaylandCallInitImpl(void) {
|
static int MwLLWaylandCallInitImpl(void) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue