mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
Force a redraw so we know we'll get a refreshed border after reconfig
This commit is contained in:
parent
d1951f73ec
commit
73cd8eb0bb
3 changed files with 10 additions and 2 deletions
|
|
@ -5,7 +5,6 @@
|
||||||
#include "common/macros.h"
|
#include "common/macros.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
|
||||||
|
|
||||||
struct borderset * getBorders(uint32_t id, int size, enum border_type type, int bevelSize) {
|
struct borderset * getBorders(uint32_t id, int size, enum border_type type, int bevelSize) {
|
||||||
struct borderset * current = borderCache;
|
struct borderset * current = borderCache;
|
||||||
struct borderset * last;
|
struct borderset * last;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
LAB_NODE_TITLEBAR, view, /*data*/ NULL);
|
LAB_NODE_TITLEBAR, view, /*data*/ NULL);
|
||||||
|
|
||||||
enum ssd_active_state active;
|
enum ssd_active_state active;
|
||||||
|
bool shouldForceUpdate = FALSE;
|
||||||
FOR_EACH_ACTIVE_STATE(active) {
|
FOR_EACH_ACTIVE_STATE(active) {
|
||||||
struct ssd_titlebar_subtree *subtree = &ssd->titlebar.subtrees[active];
|
struct ssd_titlebar_subtree *subtree = &ssd->titlebar.subtrees[active];
|
||||||
subtree->tree = lab_wlr_scene_tree_create(ssd->titlebar.tree);
|
subtree->tree = lab_wlr_scene_tree_create(ssd->titlebar.tree);
|
||||||
|
|
@ -53,7 +54,6 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
|
|
||||||
/* Background */
|
/* Background */
|
||||||
subtree->bar = lab_wlr_scene_buffer_create(parent, titlebar_fill);
|
subtree->bar = lab_wlr_scene_buffer_create(parent, titlebar_fill);
|
||||||
|
|
||||||
if (theme->window[active].title_bg.border_type) {
|
if (theme->window[active].title_bg.border_type) {
|
||||||
/* Beveled Titlebar */
|
/* Beveled Titlebar */
|
||||||
float *color = theme->window[active].title_bg.color;
|
float *color = theme->window[active].title_bg.color;
|
||||||
|
|
@ -65,6 +65,10 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
||||||
struct borderset * renderedborders = getBorders(colour32, theme->window[active].title_bg.border_width, theme->window[active].title_bg.border_type, theme->window[active].title_bg.bevel_width);
|
struct borderset * renderedborders = getBorders(colour32, theme->window[active].title_bg.border_width, theme->window[active].title_bg.border_type, theme->window[active].title_bg.bevel_width);
|
||||||
subtree->texturedBorders = generateBufferset(subtree->tree, renderedborders, theme->window[active].title_bg.border_width);
|
subtree->texturedBorders = generateBufferset(subtree->tree, renderedborders, theme->window[active].title_bg.border_width);
|
||||||
|
|
||||||
|
// If we have the beveled borders, we actually have to run ssd_titlebar_update() to make sure we render the updated
|
||||||
|
// borders. Otherwise they disappear on reconfigure
|
||||||
|
shouldForceUpdate = true;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Work around the wlroots/pixman bug that widened 1px buffer
|
* Work around the wlroots/pixman bug that widened 1px buffer
|
||||||
|
|
@ -152,6 +156,10 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
if (view->visible_on_all_workspaces) {
|
if (view->visible_on_all_workspaces) {
|
||||||
set_alt_button_icon(ssd, LAB_NODE_BUTTON_OMNIPRESENT, true);
|
set_alt_button_icon(ssd, LAB_NODE_BUTTON_OMNIPRESENT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldForceUpdate) {
|
||||||
|
ssd_titlebar_update(ssd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ ssd_create(struct view *view, bool active)
|
||||||
ssd_enable_keybind_inhibit_indicator(ssd, view->inhibits_keybinds);
|
ssd_enable_keybind_inhibit_indicator(ssd, view->inhibits_keybinds);
|
||||||
ssd->state.geometry = view->current;
|
ssd->state.geometry = view->current;
|
||||||
|
|
||||||
|
ssd_titlebar_update(ssd);
|
||||||
return ssd;
|
return ssd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue