fix expanding window across the screen
test case included
This commit is contained in:
parent
631c2f722f
commit
c2a5b526e2
@ -148,6 +148,12 @@ function geometry {
|
|||||||
../dunstify -a "dunst tester" -u c "-300x1-20-20"
|
../dunstify -a "dunst tester" -u c "-300x1-20-20"
|
||||||
basic_notifications
|
basic_notifications
|
||||||
keypress
|
keypress
|
||||||
|
|
||||||
|
killall dunst
|
||||||
|
../dunst -config dunstrc.default -geom "x1" &
|
||||||
|
../dunstify -a "dunst tester" -u c "x1-20-20" "across the screen"
|
||||||
|
basic_notifications
|
||||||
|
keypress
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
|
8
x.c
8
x.c
@ -204,7 +204,7 @@ static colored_layout *r_init_shared(cairo_t *c, notification *n)
|
|||||||
cl->bg = x_string_to_color_t(n->color_strings[ColBG]);
|
cl->bg = x_string_to_color_t(n->color_strings[ColBG]);
|
||||||
|
|
||||||
int width = calculate_width();
|
int width = calculate_width();
|
||||||
if (xctx.geometry.w > 0) {
|
if (width) {
|
||||||
width -= 2 * settings.h_padding;
|
width -= 2 * settings.h_padding;
|
||||||
width -= 2 * settings.frame_width;
|
width -= 2 * settings.frame_width;
|
||||||
r_setup_pango_layout(cl->l, width);
|
r_setup_pango_layout(cl->l, width);
|
||||||
@ -309,10 +309,8 @@ void x_win_draw(void)
|
|||||||
text_width = MAX(w, text_width);
|
text_width = MAX(w, text_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
int width;
|
int width = calculate_width();
|
||||||
if (xctx.geometry.w > 0)
|
if (width <= 0) {
|
||||||
width = xctx.geometry.w;
|
|
||||||
else {
|
|
||||||
width = text_width + 2 * settings.h_padding;
|
width = text_width + 2 * settings.h_padding;
|
||||||
width += 2 * settings.frame_width;
|
width += 2 * settings.frame_width;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user