@@ -509,23 +509,24 @@ static void render_titlebar(struct render_context *ctx, struct sway_container *c
509
509
texture_box .y = round ((bg_y - output_y ) * output_scale ) +
510
510
ob_padding_above ;
511
511
512
- if (ob_inner_width < texture_box .width ) {
513
- texture_box .width = ob_inner_width ;
512
+ struct wlr_box clip_box = texture_box ;
513
+ if (ob_inner_width < clip_box .width ) {
514
+ clip_box .width = ob_inner_width ;
514
515
}
515
516
render_texture (ctx , marks_texture ,
516
- NULL , & texture_box , NULL , WL_OUTPUT_TRANSFORM_NORMAL , con -> alpha );
517
+ NULL , & texture_box , & clip_box , WL_OUTPUT_TRANSFORM_NORMAL , con -> alpha );
517
518
518
519
// Padding above
519
520
memcpy (& color , colors -> background , sizeof (float ) * 4 );
520
521
premultiply_alpha (color , con -> alpha );
521
- box .x = texture_box .x + round (output_x * output_scale );
522
+ box .x = clip_box .x + round (output_x * output_scale );
522
523
box .y = roundf ((y + titlebar_border_thickness ) * output_scale );
523
- box .width = texture_box .width ;
524
+ box .width = clip_box .width ;
524
525
box .height = ob_padding_above ;
525
526
render_rect (ctx , & box , color );
526
527
527
528
// Padding below
528
- box .y += ob_padding_above + texture_box .height ;
529
+ box .y += ob_padding_above + clip_box .height ;
529
530
box .height = ob_padding_below ;
530
531
render_rect (ctx , & box , color );
531
532
}
@@ -579,24 +580,25 @@ static void render_titlebar(struct render_context *ctx, struct sway_container *c
579
580
texture_box .y =
580
581
round ((bg_y - output_y ) * output_scale ) + ob_padding_above ;
581
582
582
- if (ob_inner_width - ob_marks_width < texture_box .width ) {
583
- texture_box .width = ob_inner_width - ob_marks_width ;
583
+ struct wlr_box clip_box = texture_box ;
584
+ if (ob_inner_width - ob_marks_width < clip_box .width ) {
585
+ clip_box .width = ob_inner_width - ob_marks_width ;
584
586
}
585
587
586
588
render_texture (ctx , title_texture ,
587
- NULL , & texture_box , NULL , WL_OUTPUT_TRANSFORM_NORMAL , con -> alpha );
589
+ NULL , & texture_box , & clip_box , WL_OUTPUT_TRANSFORM_NORMAL , con -> alpha );
588
590
589
591
// Padding above
590
592
memcpy (& color , colors -> background , sizeof (float ) * 4 );
591
593
premultiply_alpha (color , con -> alpha );
592
- box .x = texture_box .x + round (output_x * output_scale );
594
+ box .x = clip_box .x + round (output_x * output_scale );
593
595
box .y = roundf ((y + titlebar_border_thickness ) * output_scale );
594
- box .width = texture_box .width ;
596
+ box .width = clip_box .width ;
595
597
box .height = ob_padding_above ;
596
598
render_rect (ctx , & box , color );
597
599
598
600
// Padding below
599
- box .y += ob_padding_above + texture_box .height ;
601
+ box .y += ob_padding_above + clip_box .height ;
600
602
box .height = ob_padding_below ;
601
603
render_rect (ctx , & box , color );
602
604
}
0 commit comments