forked from pyrite-dev/milsko
coords
This commit is contained in:
parent
d784770ca9
commit
54cdd85015
6 changed files with 36 additions and 4 deletions
|
|
@ -1344,6 +1344,10 @@ 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;
|
||||
|
|
|
|||
|
|
@ -797,3 +797,11 @@ 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;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -183,10 +183,18 @@ static void mwSubMenuAppearImpl(MwWidget handle, MwMenu menu, MwPoint* point, in
|
|||
MwLLMakeToolWindow(handle->lowlevel);
|
||||
MwLLDetach(handle->lowlevel, &p);
|
||||
|
||||
if(MwGetInteger(handle, MwNy) + sz.height > rc.height) {
|
||||
MwVaApply(handle,
|
||||
MwNy, rc.height - sz.height,
|
||||
NULL);
|
||||
if(handle->lowlevel->common.coordinate_type == MwCoordinatesGlobal) {
|
||||
if(MwGetInteger(handle, MwNy) + sz.height > rc.height) {
|
||||
MwVaApply(handle,
|
||||
MwNy, rc.height - sz.height,
|
||||
NULL);
|
||||
}
|
||||
} else {
|
||||
if(MwGetInteger(handle, MwNy) > sz.height) {
|
||||
MwVaApply(handle,
|
||||
MwNy, sz.height,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
MwLLEndStateChange(handle->lowlevel);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue