mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-17 22:05:25 -05:00
opt: avoid double reset foreign toplevel handle
This commit is contained in:
parent
a4faf2c494
commit
2bda8e3bf1
1 changed files with 1 additions and 17 deletions
18
src/mango.c
18
src/mango.c
|
|
@ -969,7 +969,6 @@ static struct wlr_xwayland *xwayland;
|
|||
|
||||
void client_change_mon(Client *c, Monitor *m) {
|
||||
setmon(c, m, c->tags, true);
|
||||
reset_foreign_tolevel(c);
|
||||
if (c->isfloating) {
|
||||
c->float_geom = c->geom =
|
||||
setclient_coordinate_center(c, c->mon, c->geom, 0, 0);
|
||||
|
|
@ -2026,7 +2025,6 @@ buttonpress(struct wl_listener *listener, void *data) {
|
|||
selmon = xytomon(cursor->x, cursor->y);
|
||||
client_update_oldmonname_record(grabc, selmon);
|
||||
setmon(grabc, selmon, 0, true);
|
||||
reset_foreign_tolevel(grabc);
|
||||
selmon->prevsel = ISTILED(selmon->sel) ? selmon->sel : NULL;
|
||||
selmon->sel = grabc;
|
||||
tmpc = grabc;
|
||||
|
|
@ -5030,6 +5028,7 @@ void setmon(Client *c, Monitor *m, uint32_t newtags, bool focus) {
|
|||
arrange(oldmon, false, false);
|
||||
if (m) {
|
||||
/* Make sure window actually overlaps with the monitor */
|
||||
reset_foreign_tolevel(c);
|
||||
resize(c, c->geom, 0);
|
||||
c->tags =
|
||||
newtags ? newtags
|
||||
|
|
@ -5041,21 +5040,6 @@ void setmon(Client *c, Monitor *m, uint32_t newtags, bool focus) {
|
|||
if (focus && !client_is_x11_popup(c)) {
|
||||
focusclient(focustop(selmon), 1);
|
||||
}
|
||||
|
||||
if (m) {
|
||||
|
||||
if (c->foreign_toplevel) {
|
||||
remove_foreign_topleve(c);
|
||||
}
|
||||
|
||||
add_foreign_toplevel(c);
|
||||
if (m->sel && m->sel->foreign_toplevel)
|
||||
wlr_foreign_toplevel_handle_v1_set_activated(
|
||||
m->sel->foreign_toplevel, false);
|
||||
if (c->foreign_toplevel)
|
||||
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
void setpsel(struct wl_listener *listener, void *data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue