mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-25 13:14:13 -04:00
fix: clip error when cross monitor
This commit is contained in:
parent
1f9dbe7c3c
commit
1ae4858336
1 changed files with 36 additions and 18 deletions
|
|
@ -311,22 +311,27 @@ void client_draw_title(Client *c) {
|
|||
int32_t bottom_over =
|
||||
tab_y + config.group_bar_height - c->mon->m.y - c->mon->m.height;
|
||||
|
||||
if (c != grabc &&
|
||||
(ISSCROLLTILED(c) || c->animation.tagining || c->animation.tagouting)) {
|
||||
if (top_over > 0) {
|
||||
tab_y = c->mon->m.y;
|
||||
th = config.group_bar_height - top_over;
|
||||
}
|
||||
if (bottom_over > 0) {
|
||||
th = th - bottom_over;
|
||||
}
|
||||
if (right_over > 0) {
|
||||
tw = tw - right_over;
|
||||
}
|
||||
if (left_over > 0) {
|
||||
tab_x = c->mon->m.x;
|
||||
tw = tw - left_over;
|
||||
}
|
||||
if (c == grabc || (!ISSCROLLTILED(c) && !c->animation.tagining &&
|
||||
!c->animation.tagouting)) {
|
||||
top_over = 0;
|
||||
bottom_over = 0;
|
||||
left_over = 0;
|
||||
right_over = 0;
|
||||
}
|
||||
|
||||
if (top_over > 0) {
|
||||
tab_y = c->mon->m.y;
|
||||
th = config.group_bar_height - top_over;
|
||||
}
|
||||
if (bottom_over > 0) {
|
||||
th = th - bottom_over;
|
||||
}
|
||||
if (right_over > 0) {
|
||||
tw = tw - right_over;
|
||||
}
|
||||
if (left_over > 0) {
|
||||
tab_x = c->mon->m.x;
|
||||
tw = tw - left_over;
|
||||
}
|
||||
|
||||
if (tw <= 0 || th <= 0) {
|
||||
|
|
@ -356,6 +361,19 @@ void client_draw_title(Client *c) {
|
|||
}
|
||||
|
||||
void apply_shield(Client *c, struct wlr_box clip_box) {
|
||||
|
||||
if (clip_box.width <= 0 || clip_box.height <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (c == grabc || (!ISSCROLLTILED(c) && !c->animation.tagining &&
|
||||
!c->animation.tagouting)) {
|
||||
clip_box.x = 0;
|
||||
clip_box.y = 0;
|
||||
clip_box.width = c->animation.current.width - 2 * (int32_t)c->bw;
|
||||
clip_box.height = c->animation.current.height - 2 * (int32_t)c->bw;
|
||||
}
|
||||
|
||||
if (active_capture_count > 0 && c->shield_when_capture) {
|
||||
wlr_scene_node_raise_to_top(&c->shield->node);
|
||||
wlr_scene_node_set_position(&c->shield->node, clip_box.x, clip_box.y);
|
||||
|
|
@ -518,8 +536,8 @@ void apply_border(Client *c) {
|
|||
|
||||
int32_t right_offset, bottom_offset, left_offset, top_offset;
|
||||
|
||||
if (c == grabc ||
|
||||
(!ISTILED(c) && !c->animation.tagining && !c->animation.tagouting)) {
|
||||
if (c == grabc || (!ISSCROLLTILED(c) && !c->animation.tagining &&
|
||||
!c->animation.tagouting)) {
|
||||
right_offset = 0;
|
||||
bottom_offset = 0;
|
||||
left_offset = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue