mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
ssd: don't update ssd if view width is too small
Clients can ignore the requsted geometry and negative widths could be passed to `wlr_scene_rect_set_size()` in `ssd_titlebar_update()` or in `ssd_border_update()`.
This commit is contained in:
parent
c224e1e05a
commit
2603dbf396
1 changed files with 10 additions and 0 deletions
|
|
@ -229,6 +229,16 @@ ssd_update_geometry(struct ssd *ssd)
|
||||||
int eff_width = current.width;
|
int eff_width = current.width;
|
||||||
int eff_height = view_effective_height(ssd->view, /* use_pending */ false);
|
int eff_height = view_effective_height(ssd->view, /* use_pending */ false);
|
||||||
|
|
||||||
|
if (eff_width > 0 && eff_width < LAB_MIN_VIEW_WIDTH) {
|
||||||
|
/*
|
||||||
|
* Prevent negative values in calculations like
|
||||||
|
* `width - SSD_BUTTON_WIDTH * SSD_BUTTON_COUNT`
|
||||||
|
*/
|
||||||
|
wlr_log(WLR_ERROR,
|
||||||
|
"view width is smaller than its minimal value");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (eff_width == cached.width && eff_height == cached.height) {
|
if (eff_width == cached.width && eff_height == cached.height) {
|
||||||
if (current.x != cached.x || current.y != cached.y) {
|
if (current.x != cached.x || current.y != cached.y) {
|
||||||
/* Dynamically resize extents based on position and usable_area */
|
/* Dynamically resize extents based on position and usable_area */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue