forked from pyrite-dev/milsko
wayland: min width/height of 50
This commit is contained in:
parent
a30d306da0
commit
d056d1b7fb
1 changed files with 14 additions and 7 deletions
|
|
@ -177,6 +177,9 @@ static void xdg_toplevel_configure(void* data,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(width < 50) width = 50;
|
||||||
|
if(height < 50) height = 50;
|
||||||
|
|
||||||
MwLLWaylandRegionInvalidate(self);
|
MwLLWaylandRegionInvalidate(self);
|
||||||
self->wayland.ww = width;
|
self->wayland.ww = width;
|
||||||
self->wayland.wh = height;
|
self->wayland.wh = height;
|
||||||
|
|
@ -451,6 +454,9 @@ static void popup_configure(void* data,
|
||||||
int32_t height) {
|
int32_t height) {
|
||||||
MwLL self = data;
|
MwLL self = data;
|
||||||
(void)xdg_popup;
|
(void)xdg_popup;
|
||||||
|
|
||||||
|
if(width < 50) width = 50;
|
||||||
|
if(height < 50) height = 50;
|
||||||
self->wayland.x = x;
|
self->wayland.x = x;
|
||||||
self->wayland.y = y;
|
self->wayland.y = y;
|
||||||
self->wayland.ww = width;
|
self->wayland.ww = width;
|
||||||
|
|
@ -600,6 +606,9 @@ static void layer_shell_configure(void* data,
|
||||||
MwLL self = data;
|
MwLL self = data;
|
||||||
zwlr_layer_surface_v1_ack_configure(surface, serial);
|
zwlr_layer_surface_v1_ack_configure(surface, serial);
|
||||||
|
|
||||||
|
if(width < 50) width = 50;
|
||||||
|
if(height < 50) height = 50;
|
||||||
|
|
||||||
self->wayland.ww = width;
|
self->wayland.ww = width;
|
||||||
self->wayland.wh = height;
|
self->wayland.wh = height;
|
||||||
|
|
||||||
|
|
@ -1106,13 +1115,11 @@ static void MwLLSetWHImpl(MwLL handle, int w, int h) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prevent an integer underflow when the w/h is too low */
|
/* Prevent an integer underflow when the w/h is too low */
|
||||||
if((w < 2 || h < 2)) {
|
if(w < 50) w = 50;
|
||||||
handle->wayland.ww = 2;
|
if(h < 50) h = 50;
|
||||||
handle->wayland.wh = 2;
|
|
||||||
} else {
|
|
||||||
handle->wayland.ww = w;
|
handle->wayland.ww = w;
|
||||||
handle->wayland.wh = h;
|
handle->wayland.wh = h;
|
||||||
}
|
|
||||||
|
|
||||||
if(!handle->wayland.setting_wh) {
|
if(!handle->wayland.setting_wh) {
|
||||||
handle->wayland.setting_wh = 1;
|
handle->wayland.setting_wh = 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue