Merge branch 'fixsize' into 'master'

size: Hardcode size to work around screen rotation

See merge request Librem5/squeekboard!361
This commit is contained in:
Dorota Czaplejewicz
2020-07-16 15:56:57 +00:00
2 changed files with 36 additions and 1 deletions

View File

@ -70,6 +70,24 @@ build_deb:amber:
- debuild -i -us -uc -b
- cp ../*.deb .
build_deb:buster:
image: "debian:buster"
tags:
- librem5
stage: build
artifacts:
paths:
- "*.deb"
script:
- echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list
- apt-get -y update
- rm -f ../*.deb
- apt-get -y build-dep .
- apt-get -y install devscripts
- debuild -i -us -uc -b
- cp ../*.deb .
build_deb:arm64:
tags:
- librem5:arm64

View File

@ -87,6 +87,18 @@ on_notify_unmap (GObject *object,
g_object_set (context, "visible", FALSE, NULL);
}
static uint32_t
calculate_height(int32_t width)
{
uint32_t height = 180;
if (width < 360 && width > 0) {
height = ((unsigned)width * 7 / 12); // to match 360×210
} else if (width < 540) {
height = 180 + (540 - (unsigned)width) * 30 / 180; // smooth transition
}
return height;
}
static void
on_surface_configure(PhoshLayerSurface *surface, ServerContextService *context)
{
@ -97,7 +109,12 @@ on_surface_configure(PhoshLayerSurface *surface, ServerContextService *context)
"configured-height", &height,
NULL);
guint desired_height = squeek_uiman_get_perceptual_height(context->manager);
// When the geometry event comes after surface.configure,
// this entire height calculation does nothing.
// guint desired_height = squeek_uiman_get_perceptual_height(context->manager);
// Temporarily use old method, until the size manager is complete.
guint desired_height = calculate_height(width);
guint configured_height = (guint)height;
// if height was already requested once but a different one was given
// (for the same set of surrounding properties),