diff --git a/include/Mw/Core.h b/include/Mw/Core.h index cd7cabd1..e714a32e 100644 --- a/include/Mw/Core.h +++ b/include/Mw/Core.h @@ -354,11 +354,6 @@ MWDECL void MwGetCursorCoord(MwWidget handle, MwPoint* point); */ MWDECL void MwGetScreenSize(MwWidget handle, MwRect* rect); -/*! - * @brief Reports whether a widget reports global or local coordinates upon GetXY/SetXY. Anything with a parent reports local, and most backends report global coordinates being supported for top level windows, but some (Wayland) do not. - */ -MWDECL int MwGetCoordinateType(MwWidget handle); - #ifdef __cplusplus } #endif diff --git a/include/Mw/LowLevel.h b/include/Mw/LowLevel.h index c748bf93..3c8bdf7b 100644 --- a/include/Mw/LowLevel.h +++ b/include/Mw/LowLevel.h @@ -33,7 +33,6 @@ struct _MwLLCommon { void* user; int copy_buffer; int type; - int coordinate_type; MwLLHandler handler; }; diff --git a/include/Mw/TypeDefs.h b/include/Mw/TypeDefs.h index 6434f523..caf38879 100644 --- a/include/Mw/TypeDefs.h +++ b/include/Mw/TypeDefs.h @@ -219,10 +219,4 @@ struct _MwClass { void* reserved4; }; -/* Whether or not GetXY/SetXY works with global or local coordinates */ -enum MwCoordinateType { - MwCoordinatesGlobal = 0, - MwCoordinatesLocal, -}; - #endif diff --git a/src/backend/wayland.c b/src/backend/wayland.c index 9169a10b..f6532fa4 100644 --- a/src/backend/wayland.c +++ b/src/backend/wayland.c @@ -1299,6 +1299,7 @@ static void setup_popup(MwLL r, int x, int y) { xdg_positioner_set_anchor(r->wayland.popup->xdg_positioner, XDG_POSITIONER_ANCHOR_NONE); xdg_positioner_set_anchor_rect( r->wayland.popup->xdg_positioner, 0, 0, 1, 1); + printf("%d, %d\n", x, y); xdg_positioner_set_offset(r->wayland.popup->xdg_positioner, x, y); xdg_surface = topmost_parent->wayland.toplevel->xdg_surface; @@ -1343,10 +1344,6 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) { memset(r, 0, sizeof(*r)); MwLLCreateCommon(r); - /* Wayland does not report global coordinates ever. Compositors are not even expected to have knowledge of this. - */ - r->common.coordinate_type = MwCoordinatesLocal; - r->common.type = MwLLBackendWayland; if(width < 2) width = 2; diff --git a/src/core.c b/src/core.c index d47e3b8a..3d41a360 100644 --- a/src/core.c +++ b/src/core.c @@ -797,11 +797,3 @@ void MwGetCursorCoord(MwWidget handle, MwPoint* point) { void MwGetScreenSize(MwWidget handle, MwRect* rect) { MwLLGetScreenSize(handle->lowlevel, rect); } - -int MwGetCoordinateType(MwWidget handle) { - if(handle->parent == NULL) { - return handle->lowlevel->common.coordinate_type; - } else { - return MwCoordinatesLocal; - } -}; diff --git a/src/widget/submenu.c b/src/widget/submenu.c index 82815501..54ee8ea8 100644 --- a/src/widget/submenu.c +++ b/src/widget/submenu.c @@ -183,12 +183,10 @@ static void mwSubMenuAppearImpl(MwWidget handle, MwMenu menu, MwPoint* point, in MwLLMakeToolWindow(handle->lowlevel); MwLLDetach(handle->lowlevel, &p); - if(handle->lowlevel->common.coordinate_type == MwCoordinatesGlobal) { - if(MwGetInteger(handle, MwNy) + sz.height > rc.height) { - MwVaApply(handle, - MwNy, rc.height - sz.height, - NULL); - } + if(MwGetInteger(handle, MwNy) + sz.height > rc.height) { + MwVaApply(handle, + MwNy, rc.height - sz.height, + NULL); } MwLLEndStateChange(handle->lowlevel);