mirror of
https://github.com/kolunmi/dwlb.git
synced 2026-02-20 11:13:12 +00:00
Merge 40f13f8e8e22b1f0b57a78ee7030ea525cf72092 into 48dbe00bdb98a1ae6a0e60558ce14503616aa759
This commit is contained in:
commit
04d80c52d1
17
dwlb.c
17
dwlb.c
@ -161,6 +161,7 @@ typedef struct {
|
|||||||
CustomText title, status;
|
CustomText title, status;
|
||||||
|
|
||||||
bool hidden, bottom;
|
bool hidden, bottom;
|
||||||
|
bool floating;
|
||||||
bool redraw;
|
bool redraw;
|
||||||
|
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
@ -469,7 +470,14 @@ draw_frame(Bar *bar)
|
|||||||
});
|
});
|
||||||
x = nx;
|
x = nx;
|
||||||
|
|
||||||
x = draw_text(custom_title ? bar->title.text : bar->window_title,
|
char *title_text = custom_title ? bar->title.text : bar->window_title;
|
||||||
|
char floating_title[TEXT_MAX];
|
||||||
|
if (bar->floating) {
|
||||||
|
snprintf(floating_title, sizeof(floating_title), "** %s **", title_text);
|
||||||
|
title_text = floating_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
x = draw_text(title_text,
|
||||||
x, y, foreground, foreground_mask, background,
|
x, y, foreground, foreground_mask, background,
|
||||||
(bar->sel && active_color_title) ? &active_fg_color : &inactive_fg_color,
|
(bar->sel && active_color_title) ? &active_fg_color : &inactive_fg_color,
|
||||||
(bar->sel && active_color_title) ? &active_bg_color : &inactive_bg_color,
|
(bar->sel && active_color_title) ? &active_bg_color : &inactive_bg_color,
|
||||||
@ -985,6 +993,12 @@ static void
|
|||||||
dwl_wm_output_floating(void *data, struct zdwl_ipc_output_v2 *dwl_wm_output,
|
dwl_wm_output_floating(void *data, struct zdwl_ipc_output_v2 *dwl_wm_output,
|
||||||
uint32_t is_floating)
|
uint32_t is_floating)
|
||||||
{
|
{
|
||||||
|
Bar *bar = (Bar *)data;
|
||||||
|
|
||||||
|
if ((is_floating != 0) != bar->floating) {
|
||||||
|
bar->floating = (is_floating != 0);
|
||||||
|
bar->redraw = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct zdwl_ipc_output_v2_listener dwl_wm_output_listener = {
|
static const struct zdwl_ipc_output_v2_listener dwl_wm_output_listener = {
|
||||||
@ -1007,6 +1021,7 @@ setup_bar(Bar *bar)
|
|||||||
bar->textpadding = textpadding;
|
bar->textpadding = textpadding;
|
||||||
bar->bottom = bottom;
|
bar->bottom = bottom;
|
||||||
bar->hidden = hidden;
|
bar->hidden = hidden;
|
||||||
|
bar->floating = false;
|
||||||
|
|
||||||
bar->xdg_output = zxdg_output_manager_v1_get_xdg_output(output_manager, bar->wl_output);
|
bar->xdg_output = zxdg_output_manager_v1_get_xdg_output(output_manager, bar->wl_output);
|
||||||
if (!bar->xdg_output)
|
if (!bar->xdg_output)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user